Condition expression returns non-Boolean

Hello everyone I’m getting this error:
“condition expression returns non-Boolean: isSomething==0 (java.lang.String)”

My bpmn is like this:

<process id="process" name="Process" isExecutable="true">
  <dataObject id="isSomething" name="Something" itemSubjectRef="xsd:int"/>
  <serviceTask id="serviceTask" name="Service Task" flowable:delegateExpression="${jd_myBean}"/>
  <sequenceFlow id="flow0" sourceRef="serviceTask" targetRef="gw4">
  <exclusiveGateway id="gw4"/>  
  <sequenceFlow id="flow1" sourceRef="gw4" targetRef="endGood">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${isSomething==0}]]> 
   </conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="gw4" targetRef="endBad">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${isSomething==1}]]> 
     </conditionExpression>
      <endEventid id ="endGood" />
      <endEventid id ="endBad" />
   </sequenceFlow>
 </process>

On my bean I’m doing only this:

  if(exists){
            execution.setVariable("isSomething",0);
        }else{
            execution.setVariable("isSomething",1);
        }

I can’t understand why I’m getting this error . and when debugging I have this
image

Can anyone help me.

Thanks

Hi,

Are you sure that you pasted proper bpmn ?
I can’t see start element so you I expect FlowableException: No start element found for process … exception rather than yours.
Which version of the Flowable do you use?
Try to debug your process execution. Set breakpoint in UelExpressionCondition class.

bpmn is just an example.

I’m using Flowable 6.3.1

Try to debug your process execution. Set breakpoint in UelExpressionCondition class.

I will try that.

Ok :slight_smile:

So if it is only example I think that you have typo in you target process.
It looks like you forgot about ${} and it’s the reason that you’re getting:
condition expression returns non-Boolean: isSomething==0 (java.lang.String)
Check your sequence flow conditions.

I verified and I have the ${} on my sequence flows like in example.

The problem was in a sub process that use the same variable and doesn’t has the ${}. Thank you rgorzkowski for your time.

Hi hugomar,

actually i also facing the same issue in some process and i am providing a typo ${} then also i am getting

org.flowable.common.engine.api.FlowableException: condition expression returns non-Boolean (sequenceFlowId: SequenceFlow_1tstpxv): false (java.lang.String) at org.flowable.engine.impl.el.UelExpressionCondition.evaluate(UelExpressionCondition.java:43) ~[flowable-engine-6.4.1.jar:6.4.1] at
this error
if some solution you found please share with me.

thanks in advance,

Hello @tiru.sadul

did you verify if in all of your condition you have ${xptoVar} or xptoVar is a boolean expession?

hi @hugomar

yes i verified and that xptoVar is boolean

But some process are not throwing this exception some are throwing the non-boolean exception

whichever process is throwing an exception i have cross checked is there any change i did but it is same only

so can you guide me to remove that exception

thanks
@tiru.sadul