Set
The Set action sets a value in the State.
If a value exists at the location, the new value overrides the existing value.
The following table shows the parameters for the Set action.
| Name | Data type | Required | Notes |
|---|---|---|---|
| path | JPath | Yes | The location to store the value. |
| value | String/Number | Yes | The value to set. |
| dataType | String | No | The data type of the value provided must be either integer or float. Note: The
dataType parameter is only supported in V2_1 and later.
|
XML Example:
This action adds the value that is returned by the time() function to the State at location /current_time. If a value exists at that location, it is overwritten.
<Set path="/current_time" value="${time()}" />
This action adds the value as an integer in the State at the location /count.
<Set path="/count" value="20" dataType="integer" />
This action adds the value as an float in the State at the location /point.
<Set path="/point" value="12" dataType="float" />