cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti Explorer - Compare decimal values

texano1
Champ in-the-making
Champ in-the-making
Hey,

In my business process i need to compare decimal numbers.

Example:

if 500,35€ >= 500 then go there
if 1000€ < 500,34 then go there
if 30,5(%) > 90 (%) then go there
if 50(%) > 10,3 (%) then go there
*the € and % are irelevant ofc.

What type should i define the input field? Long doesn't work because when i input, for example, 9993,35 i get and error: "Value must be a long", witch make sense. String type does not work aswell because if i input 9993,35 the formula, for example, if 9993,35 >= 500 then go there can't be validated.


Thanks.


Regard,
Tiago
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Tiago,

The process definition snapshot from activiti jUnit tests

    <exclusiveGateway id="exclusiveGw" name="Exclusive Gateway" />
   
    <sequenceFlow id="flow2" sourceRef="exclusiveGw" targetRef="basicService">
      <conditionExpression xsi:type="tFormalExpression">
        <![CDATA[${orders[1].price <= 100}]]>
      </conditionExpression>
    </sequenceFlow>

Basically you have to create Integer (Long, Double, … ) process variable and compare it in the condition.

Regards
Martin