Map variables allows each input and output to be explicitly mapped between process variables and the values or variables within another model.
If Map variables is selected as the Mapping type, there are three ways of mapping variables that can be chosen by selecting the edit icon next to any input or output parameters:
- Process Variables are regular process variables that must match the type of the source or target parameter. For example an input parameter of type string cannot map to a process variable of type file.
- Expressions can be entered using a JSON editor to create more complex mappings such as mapping JSON process variables to input and output parameters. For example, using ${temperature.celsius} will use the value for the object celsius.
In the following example this would result in a value of 16:
{ "day": "Monday", "temperature": { "celsius": 16, "fahrenheit": 66 } }
- Static Values can be entered rather than using process variables.
An example of using the Map variables option is a decision table that contains the input Price and the output Decision and the process contains the process variables Total and customerResponse. At runtime, the value for the process variable Total will be sent as the input to the decision table when that point in the process instance is reached. Once the decision table has evaluated the input, the value of the output Decision will be sent back to the process variable customerResponse which can then be used later in the process, such as in sending an email to a customer.