'IS IN' and equals comparison for data types in Decision Table

Hi,
What is the significance of having ‘IS IN’ when evaluating business rules for data type ‘number’?
For example: I have a workflow, where I’m submitting amount variable when starting a process instance.


On following the evaluation of decision table, I can see that this comparison ended up in allOf() of org.flowable.dmn.engine.impl.el.util.CollectionUtil.java, which is doing a normal .contains check against the value given in decision table.

I have the same query for other data types as well.
For example: == for Collection data type and ‘Date’ data type to evaluate a business rule.
For collection if we have below configuration in table


I passed the same values in countryCode variable when starting the process instance. However, it gave me false with equals comparison.

Hi

It seems your doing it the other way around.
When a non collection input variable and using the IS IN operator and you have define a collection in the expression.
For example checking if the input1 number is in the collection containing the numbers 1,2 and 3;

When the input variable is a collection you have other operators to check against an other collection.

For example check if the elements in input1 collection are all in the collection contains the numbers 1,2 and 3;

PS.

The ‘Collection*’ unit tests perhaps provide some additional info;

Hope this helps,

Regards,

Yvo

1 Like

Hi @yvo ,

I’m using flowable version 6.4.2.
For the number and date data types, when I try to give multiple values, the row gets filled with a red background indicating some sort of validation error
Although when I tried executing below decision table for number data type,

It executed perfectly i.e. when input1 value was 23, the rule was evaluated to true and assignee output variable was set to ‘JOHN’. But while configuring it shows some sort of invalid input in the column.

Also, how can we configure multiple date values for date data type, I tried doing it this way,


but got this error while executing the above decision.
Below is the error
Error while evaluating expression: ${collection:allOf('2021-01-20,2021-01-21', dueDate)}

Hi,

not sure if this was a validation bug in the editor in 6.4.2. But it’s working correct during runtime?
Is there a reason you’re not on the latest version; 6.6.0?

Regarding the date collection check. The date strings should be between quotes; "2021-02-16", "2021-02-21".
But; while checking this I noticed an issue. When using a date as in input variable type and a collection related operated; it tries to do some (unneeded) transformation on the date variable. Which can result in issues. This is a bug. I’ve created an issue for this so you can track the progress.

This issue does not occur when using a collection containing dates as an input variable. This can be used as a temporary workaround.

Regards,

Yvo

1 Like

Thanks, @yvo .
Yes, even after the validation bug for number data type, it’s working correctly during runtime in version 6.4.2.
My project is using 6.4.2, that’s why I’m not on the latest version.

As with all software out there, it’s always a good idea to be on the latest version (bugfixes and improvements get added all the time)