Get Current Message from Queue
Obtains the current message from the desired queue.
Command availability: IBM RPA SaaS and IBM RPA on premises
Description
Obtains the current queue message from a queue configured in the IBM RPA Control Center.
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
currentQueueMessage (String)=queuename (String)=body (Numeric)=priority (DateTime)=enqueuedtime (Boolean)=success
Dependencies
- You must have an orchestration context.
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Queue Name | queuename |
Text |
Returns the name of the queue associated with the orchestration context in the IBM RPA Control Center. |
Message Structure | body |
Text |
Returns the content of the message running on the queue. |
Message Priority | priority |
Number |
Returns the priority of the message running on the queue. |
Enqueued Message Date | enqueuedtime |
Date Time |
Returns the date for queuing the message running on the queue. |
Success | success |
Boolean |
Returns "True", if the current message from the queue in the orchestration context was obtained successfully, or "False", otherwise. |
Example
The Mock Process (mockProcess
) command simulates a process in an orchestration context. Then, a variable is created by the Mock Process Variable (mockProcessVariable
) command in this fictional context. After that, the End Mock Process (endMockProcess
) command ends the simulation of an Orchestrator. The current
message from the queue is obtained, the variable created is mapped and, in the end, Log Message (logMessage
) records the values obtained from the simulated process.
defVar --name queueName --type String --value "Simulated queue name"
defVar --name queueStructure --type String --value "Simulated queue structure"
defVar --name variableContent --type String --value "IBM Robotic Process Automation Simulate Orchestrator"
defVar --name variableReceives --type String
defVar --name successGet --type Boolean
mockProcess --queuename "${queueName}" --body "${queueStructure}Simulated queue message structure."
mockProcessVariable --name variableName --type "Text" --value "${variableContent}"
endMockProcess
currentQueueMessage queueName=queuename queueStructure=body successGet=success
mapProcessVariables --mappings "variableName=${variableReceives}"
logMessage --message "Queue name obtained: ${queueName}\r\nQueue structure obtained: ${queueStructure}\r\nSuccess get current message: ${successGet}\r\nMapped variable content: ${variableContent}\r\n" --type "Info"
// Result:
// Queue name obtained: Simulated queue name
// Queue structure obtained: Simulated queue structure
// Success get current message: True
// Mapped variable content: IBM Robotic Process Automation Simulate Orchestrator
Limitations
- The command only obtains queue messages from an orchestration context.