AnsweredAssumed Answered

Property in JUEL Expression

Question asked by stroobat on Mar 2, 2011
Latest reply on Mar 3, 2011 by ronald.van.kuijk
I'm creating a subprocess that accepts some parameters. One of the first steps in my subprocess is to check the presense of the paremeters.
If they are not present I'm ending the subprocess (the parent process will take over).

Here is the xml:

   
   <process id="resubmitOrder">

        <exclusiveGateway id="checkParameters" name="checkParameters"/>

        <sequenceFlow id="resubmitFlow_1" sourceRef="startResubmitOrder" targetRef="checkParameters"/>
        <sequenceFlow id="resubmitFlow_2" sourceRef="checkParameters" targetRef="endResubmitOrder">
            <conditionExpression xsi:type="tFormalExpression">${orderId==null or subOrderId==null}</conditionExpression>
        </sequenceFlow>
        <sequenceFlow id="resubmitFlow_3" sourceRef="checkParameters" targetRef="correctOrder">
            <conditionExpression xsi:type="tFormalExpression">${orderId != null and subOrderId != null}</conditionExpression>
        </sequenceFlow>
        <sequenceFlow id="resubmitFlow_4" sourceRef="correctOrder" targetRef="endResubmitOrder"/>

        <endEvent id="endResubmitOrder" name="endResubmitOrder" />

   </process>

When running this code in a unit test, I get the exception

org.activiti.engine.ActivitiException: Unknown property used in expression
   at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:46)
   at org.activiti.engine.impl.el.UelExpressionCondition.evaluate(UelExpressionCondition.java:36)
   at org.activiti.engine.impl.bpmn.ExclusiveGatewayActivityBehavior.leave(ExclusiveGatewayActivityBehavior.java:62)

Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'orderId'

I could also use a servicetask to check on the parameters … But then I have to put the code in a Java class. Just wanted to configure it in xml.
Is that possible ?

I could do this justing JSTL (which is nullpointer friendly).

Tom.

Outcomes