Using Expressions
You can use two categories of data mapping expressions in TIBCO Cloud Integration - Flogo (PAYG).
Basic Expression
Refer to Supported Operators for details on the operators that can be used within a basic expression.
string.concat("Rest Invoke response status code:",$activity[InvokeRESTService].statusCode)
string.length($activity[InvokeRESTService].responseBody.data) >=7
$activity[InvokeRESTService].statusCode == 200 && $activity[InvokeRESTService].responseBody.data == "Success"
Ternary Expression
Ternary expressions are assembled as follows: expression ? boolean true : boolean false
$activity[InvokeRESTService].statusCode == 200 ? "Response successfully":"Response failed, status code not 200"
In the above example $activity[InvokeRESTService].statusCode == 200 is the expression to be evaluated. If the expression evaluates to true (meaning statusCode equals 200), it returns Response successfully. If the expression evaluates to false (meaning statusCode does not equal 200), it returns "Response failed, status code not 200".
$activity[InvokeRESTService].statusCode == 200 ? $activity[InvokeRESTService].responseBody.data == "Success" ? "Response with correct data" : "Status ok but data unexpected" : "Response failed, status code not 200"
The example above checks fist to see is statusCode equals 200. If the statusCode does not equal 200, it outputs Response failed, status code not 200. If the statusCode equals 200, only then it checks to see is the responseBody.data is equal to "Success". If the responseBody.data is equal to "Success", it outputs Response with correct data. If the responseBody.data is not equal to "Success", it outputs Status ok but data unexpected.