How to Use Scripting in Expression Editor?
- Last UpdatedJun 10, 2024
- 1 minute read
In some scenarios, users want to execute a series of expressions together and return the value of the last statement. This can be achieved by separating the statements by semi colon (;).
The below example shows how one can execute multiple statements and return the value of the last statement.
If the user wants to execute one or more expressions in SOA Expression Editor, then the statements can be separated by using semicolon (;).
Example:
In the below example, there are three statements.
-
int a = 10;
-
Variable.varResult = a;
-
Employee.GetEmployeeName();
Here, the execution sequence takes place from the first statement.
Step Details:
-
Variable 'a' with integer type will be created with the value 10.
-
AVEVA Work Tasks Variable 'Variable.varResult' will be updated with the value of 'a' that is 10.
-
SOA Expression 'Employee.GetEmployeeName();' will be executed and value will be returned.
Note: By using this feature, there is no need to use the 'Update Variable' activity for simple data updation to any AVEVA Work Tasks Variables.
