# Condition expression returns non-Boolean

**URL:** <https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409>\
**Category:** Flowable Engine\
**Created:** [August 17, 2018, 1:56pm UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409 "2018-08-17T13:56:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugomar](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hugomar](https://forum.flowable.org/u/hugomar)\
**Post date:** [August 17, 2018, 1:56pm UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/1 "2018-08-17T13:56:28Z")

</div>

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](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/1X/6065220343eb5b1d7b1403cd69f563b2e7ceb96b.png)

Can anyone help me.

Thanks

---

<div class="post-metadata">

**Author:** ![rgorzkowski](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/rgorzkowski/32/1365_2.png) [@rgorzkowski](https://forum.flowable.org/u/rgorzkowski)\
**Post date:** [August 17, 2018, 4:56pm UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/2 "2018-08-17T16:56:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hugomar](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hugomar](https://forum.flowable.org/u/hugomar)\
**Post date:** [August 17, 2018, 5:02pm UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/3 "2018-08-17T17:02:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rgorzkowski](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/rgorzkowski/32/1365_2.png) [@rgorzkowski](https://forum.flowable.org/u/rgorzkowski)\
**Post date:** [August 17, 2018, 5:12pm UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/4 "2018-08-17T17:12:40Z")

</div>

Ok 🙂

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.

---

<div class="post-metadata">

**Author:** ![hugomar](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hugomar](https://forum.flowable.org/u/hugomar)\
**Post date:** [August 20, 2018, 9:41am UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/5 "2018-08-20T09:41:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hugomar](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hugomar](https://forum.flowable.org/u/hugomar)\
**Post date:** [August 20, 2018, 10:46am UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/6 "2018-08-20T10:46:00Z")

</div>

The problem was in a sub process that use the same variable and doesn’t has the ${}. Thank you [rgorzkowski](https://forum.flowable.org/u/rgorzkowski) for your time.

---

<div class="post-metadata">

**Author:** ![tiru.sadul](https://avatars.discourse-cdn.com/v4/letter/t/e56c9b/32.png) [@tiru.sadul](https://forum.flowable.org/u/tiru.sadul)\
**Post date:** [July 5, 2019, 12:12pm UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/7 "2019-07-05T12:12:32Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![hugomar](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hugomar](https://forum.flowable.org/u/hugomar)\
**Post date:** [July 16, 2019, 1:23pm UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/8 "2019-07-16T13:23:24Z")

</div>

Hello @tiru.sadul

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

---

<div class="post-metadata">

**Author:** ![tiru.sadul](https://avatars.discourse-cdn.com/v4/letter/t/e56c9b/32.png) [@tiru.sadul](https://forum.flowable.org/u/tiru.sadul)\
**Post date:** [July 17, 2019, 9:35am UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/9 "2019-07-17T09:35:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![edonick](https://avatars.discourse-cdn.com/v4/letter/e/2acd7d/32.png) [@edonick](https://forum.flowable.org/u/edonick)\
**Post date:** [April 21, 2020, 3:42pm UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/10 "2020-04-21T15:42:39Z")

</div>

Hi,  
I have similar problem with condition ${loopVal} \> 0 causes  
Unhandled exception org.flowable.engine.common.api.FlowableException: condition expression returns non-Boolean: 2.0 \> 0 (java.lang.String)  
I have tried also Number() to get number but it causes condition expression returns non-Boolean: Number(2.0) \> 0 (java.lang.String)  
What can I do to avoid this problem?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![edonick](https://avatars.discourse-cdn.com/v4/letter/e/2acd7d/32.png) [@edonick](https://forum.flowable.org/u/edonick)\
**Post date:** [April 22, 2020, 11:55am UTC](https://forum.flowable.org/t/condition-expression-returns-non-boolean/2409/11 "2020-04-22T11:55:13Z")

</div>

Found that right expression is  
**{loopVal \> 0}\*\* not \*\*{loopVal}**
