Expression
Expression
The Expression operation is used to set and adjust the values of User Counters and Buffers.
The supported functions are:
- Set Number
- Set Counter
- Increment Counter
Each function corresponds to a rule that can be included in the operation’s rule set.
Config Parameters
The Expression operation config attributes are as follows.
| Parameter | Type | Description |
|---|---|---|
rules
|
Array of Object |
[Required] The rules Array must contain one or more Objects.
|
Config Rules
The attributes for each Expression operation rules Object are as follows.
| Parameter | Type | Used By | Description |
|---|---|---|---|
type
|
String | (all rules) |
[Required]
Describes the function of the rule. Valid values are: set, set_loop_counter, and adjust_loop_counter.
|
loop_counter
|
User Counter |
set_loop_counter, adjust_loop_counter
|
Required when setting or adjusting the value of a User Counter. This is the identifier of a User Counter configured in the platform configuration (e.g. Loop Counter 1).
The value of the User Counter will be set or adjusted using value.
|
target_buffer
|
User Buffer |
set
|
Required when setting the value of a User Buffer. This is the identifier of a writeable User Buffer configured in the platform configuration (e.g. User Buffer).
The value of this User Buffer will be set to value.
|
value
|
Any | (all rules) |
[Required]
For type set_loop_counter or adjust_loop_counter: an integer to use to set or adjust the value of the User Counter specified by loop_counter.For type set: a string to use to set the value of the User Buffer specified by target_buffer.
|
Example Operation
Here is an example Expression operation in JSON representation.
{
"id": "1",
"type": "Expression",
"config": {
"rules": [
{
"type": "set",
"target_buffer": "Postcode",
"value": "1234"
},
{
"type": "set_loop_counter",
"loop_counter": "Loop Counter 1",
"value": 1
},
{
"type": "adjust_loop_counter",
"loop_counter": "Loop Counter 2",
"value": -2
}
],
},
"exits": [
2
]
}
In this example:
- The first rule sets the value of the
PostcodeUser Buffer to1234. - The second rule sets the value of the
Loop Counter 1User Counter to1. - The third rule decrements the value of the
Loop Counter 2User Counter by2.
After applying these changes, processing will continue via exit index 0 to the operation with ID 2.
Exits
The only exit is the “Continue” exit.
| Exit Index | Name | Description |
|---|---|---|
0
|
Continue | [Required] This exit is always followed after the processing for each rule has been completed. |