AnsweredAssumed Answered

Expression to detect if property not set yet.

Question asked by mhanrahan on Oct 17, 2014
Latest reply on Oct 17, 2014 by mhanrahan
Hi,

In a process I have, I have a loop.  The loop depends on a process variable called "provisioningStatus".  The first time this loop is run (before provisioningStatus has been set, I want to take a different path.

I have tried this using conditional logic on a line rule, however every time I try to access the property to see if it has been set yet, I get the exeption:

<blockcode>
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'provisioningStatus'
        at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.juel.AstUnary$SimpleOperator.eval(AstUnary.java:28)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.juel.AstUnary.eval(AstUnary.java:60)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:33)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)[172:org.activiti.engine:5.16.3]
        at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:48)[172:org.activiti.engine:5.16.3]
</blockcode>

I have tried the expressions:
${provisioningStatus == null}
${empty(provisioningStatus}
${empty provisioningStatus}

Is there another way to find out in JUEL whether a property is not set?

Outcomes