The deployment of the API Proxy is failing with the error “Both the operands for EQUALS expression should be data expressions”.
What is the cause for this error ?
The deployment of the API Proxy is failing with the error “Both the operands for EQUALS expression should be data expressions”.
What is the cause for this error ?
Looked into the Message Processor logs and found the following stack trace corresponding to this error:
2018-06-01 13:55:17,796 org:myorg env:dev Apigee-Main-246 ERROR STARTUP_RUNTIME_ERROR - Application.sync() : sync error for ErrorResponseLogging and revision 1
2018-06-01 13:55:17,797 org:myorg env:dev Apigee-Main-246 ERROR STARTUP_RUNTIME_ERROR - Application.sync() : Actual Error
com.apigee.expressions.parser.ParseException: Both the operands for EQUALS expression should be data expressions
at com.apigee.expressions.parser.ExpressionParser.buildExpressionTree(ExpressionParser.java:337) ~[expressions-1.0.0.jar:na]
at com.apigee.expressions.parser.ExpressionParser.parse(ExpressionParser.java:24) ~[expressions-1.0.0.jar:na]
at com.apigee.expressions.parser.ExpressionParser.parseLogicExpression(ExpressionParser.java:28) ~[expressions-1.0.0.jar:na]
at com.apigee.messaging.runtime.Step.getExpression(Step.java:67) ~[message-processor-1.0.0.jar:na]
at com.apigee.messaging.runtime.Step.handleAdd(Step.java:58) ~[message-processor-1.0.0.jar:na]
at com.apigee.messaging.runtime.SharedFlowRuntime.addStep(SharedFlowRuntime.java:81) ~[message-processor-1.0.0.jar:na]
… <snipped>
The error message in the ParseException - “Both the operands for EQUALS expression should be data expressions” indicated that a condition involving equal to (=), not equal to (!=) or Stats with (=|) operator must be having some issue.
So I checked all the Conditional Expressions used and found the problem in the following line:
<Condition>(error.state != null) and (productId === 'PayApp')</Condition>
The error was thrown because “===” was used instead of “==”
Modified this line as follows:
<Condition>(error.state != null) and (productId == 'PayApp')</Condition>
Saved the changes and deployed the API Proxy again.
With this change, the deployment went through successfully.