Variables can be used directly in expressions, for example :
{
"Id": "NxOvbRR0iSwpj3i",
"ClassId": "NxOvbRR0iSwpj3i",
"Author": "",
"Version": 0,
"CreatedAt": "2021-02-28T18:54:49.008973141+01:00",
"UpdatedAt": "2021-02-28T18:54:49.008973141+01:00",
"Name": "Transform-calc-demo",
"Group": "test",
"Nodes": [
{
"Id": "1",
"Type": "trigger",
"Label": "Button",
"SuccessTransition": "2",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:zigbee/ad:1/sv:scene_ctrl/ad:9_1",
"Service": "scene_ctrl",
"ServiceInterface": "evt.scene.report",
"Config": {
"Timeout": 0,
"ConnectorID": "",
"ValueFilter": {
"Value": null,
"ValueType": "string"
},
"PropFilterName": "",
"PropFilterValue": "",
"ValueJPath": "",
"ValueJPathResultType": "",
"InputVariableType": "",
"IsValueFilterEnabled": false,
"RegisterAsVirtualService": false,
"LookupServiceNameAndLocation": false,
"VirtualServiceGroup": "",
"VirtualServiceProps": null
},
"Ui": {
"x": 319,
"y": 213,
"nodeType": ""
},
"TypeAlias": "Trigger",
"LastValue": "toggle"
},
{
"Id": "2",
"Type": "set_variable",
"Label": "Set counter1",
"Address": "",
"Service": "",
"ServiceInterface": "",
"SuccessTransition": "3",
"ErrorTransition": "",
"Config": {
"Name": "counter1",
"UpdateGlobal": false,
"UpdateInputMsg": false,
"DefaultValue": {
"Value": "5",
"ValueType": "int"
}
},
"Ui": {
"x": 295,
"y": 423,
"nodeType": ""
},
"TypeAlias": "Set variable"
},
{
"Id": "3",
"Type": "set_variable",
"Label": "Set counter2",
"Address": "",
"Service": "",
"ServiceInterface": "",
"SuccessTransition": "4",
"ErrorTransition": "",
"Config": {
"Name": "counter2",
"UpdateGlobal": false,
"UpdateInputMsg": false,
"DefaultValue": {
"Value": 10,
"ValueType": "int"
}
},
"Ui": {
"x": 277,
"y": 606,
"nodeType": ""
},
"TypeAlias": "Set variable"
},
{
"Id": "4",
"Type": "transform",
"Label": "Set result",
"Address": "",
"Service": "",
"ServiceInterface": "",
"SuccessTransition": "5",
"ErrorTransition": "",
"Config": {
"TargetVariableName": "compResult",
"TargetVariableType": "bool",
"IsTargetVariableGlobal": false,
"TransformType": "calc",
"Rtype": "var",
"IsRVariableGlobal": false,
"IsLVariableGlobal": false,
"Expression": "counter1<counter2",
"RValue": {
"ValueType": "int",
"Value": 0
},
"RVariableName": "",
"LVariableName": "",
"ValueMapping": [],
"XPathMapping": [],
"Template": ""
},
"Ui": {
"x": 269,
"y": 840,
"nodeType": ""
},
"TypeAlias": "Transform"
},
{
"Id": "5",
"Type": "log_action",
"Label": "Log result",
"Address": "",
"Service": "",
"ServiceInterface": "",
"SuccessTransition": "",
"ErrorTransition": "",
"Config": {
"VariableName": "compResult",
"IsVariableGlobal": false,
"LogLevel": "info",
"Text": ""
},
"Ui": {
"x": 256,
"y": 1048,
"nodeType": ""
},
"TypeAlias": "Log action"
}
],
"Settings": null,
"IsDisabled": false,
"IsDefault": false,
"ParallelExecution": ""
}