I’m trying to return an object in my OnSuccess action, but I keep getting this error:
Exception while executing OutputExpressionAction: Expression is missing an 'as' clause
Example JSON:
{
"WorkflowName": "Percent",
"Rules": [
{
"RuleName": "Percent",
"Expression": "true",
"RuleExpressionType": "LambdaExpression",
"Properties": { "DbFactor": 1.25 },
"Actions": {
"OnSuccess": {
"Name": "OutputExpression",
"Context": {
"Expression": "new { State = input.state, CalculatedValue = input.currentLimit * (input.lastYrPrem - 1) * Convert.ToDouble(Properties["DbFactor"]) } as Result",
"Output": "Result"
}
},
"OnFailure": {
"Name": "OutputExpression",
"Context": {
"Expression": "-1 as Result",
"Output": "Result"
}
}
}
}
]
}
Expected: Return an object with State and CalculatedValue
Actual: Engine throws the "missing 'as' clause" error.
Could you clarify the correct format for returning objects in OnSuccess?