Mock Process Variable
Simulates a process variable.
Command availability: IBM RPA SaaS and IBM RPA on premises
Description
Simulates a process variable started by the Mock Process command.
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.
mockProcessVariable --name(String) --type(WdgDatabaseTypesComboBox) [--value(String)]
Dependencies
- You must use the Mock Process (
mockProcess
) command to simulate an orchestration process.
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Name | name |
Required |
Text |
Name of the variable created for the simulated orchestration process. |
Type | type |
Required |
WdgDatabaseTypesComboBox |
Type of variable to be simulated. See type parameter options. |
Value | value |
Optional |
Text |
Value assigned to the variable. |
type
parameter options
The following table displays the options available for the type
input parameter. The table shows the options available when working in Script mode and the equivalent label in the Designer mode.
Designer mode label | Script mode name | Description |
---|---|---|
Boolean | boolean |
Boolean type of variable. Can only be True or False . |
Date and Time | datetime |
Date and Time type of variable. Only accepts date formats. |
Number | number |
Number type of variable. Accepts both integers and floating point numbers. |
Text | text |
Text type of variable. Accepts chains of strings. |
Example
The Mock Process (mockProcess
) command creates a simulated orchestration process, and this command then creates a variable to be used in this simulated environment.
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\nGet current message success: ${successGet}\r\nMapped variable content: ${variableContent}\r\n" --type "Info"
// Result:
// Queue name obtained: Simulated queue name
// Queue structure obtained: Simulated queue structure
// Get current message success: True
// Mapped variable content: IBM Robotic Process Automation Simulate Orchestrator
Limitations
This command is only used to simulate orchestrated processes, and must not be used in production.