Issues when saving DMN files / Work with collections

Hi all, can anybody tell me why the Decision Table sometimes produces DMN files with values with double quotes and sometimes don’t?

With quotes:

   <inputEntry id="inputEntry_inputExpression_inputExpression_InputExpression1126659821_3">
      <extensionElements>
        <flowable:operator xmlns:flowable="http://flowable.org/dmn">!=</flowable:operator>
        <flowable:expression xmlns:flowable="http://flowable.org/dmn">"BUSINESS_REASON"</flowable:expression>
      </extensionElements>
      <text><![CDATA[!= "BUSINESS_REASON"]]></text>
    </inputEntry>

Without quotes:

    <inputEntry id="inputEntry_inputExpression_inputExpression_inputExpression_InputExpression1126659821_2">
      <extensionElements>
        <flowable:operator xmlns:flowable="http://flowable.org/dmn">!=</flowable:operator>
        <flowable:expression xmlns:flowable="http://flowable.org/dmn">BUSINESS_REASON</flowable:expression>
      </extensionElements>
      <text><![CDATA[!= BUSINESS_REASON]]></text>
    </inputEntry>

This one gives an error when evaluating the no quotes version.

Another one that cause no issues but seems odd are this two below, why sometimes the “==” comparator is wrapped on a extensionElements and sometimes does not?

    <inputEntry id="inputEntry_inputExpression_inputExpression_InputExpression1126659821_4">
      <extensionElements>
        <flowable:operator xmlns:flowable="http://flowable.org/dmn">==</flowable:operator>
        <flowable:expression xmlns:flowable="http://flowable.org/dmn">"PROBLEM"</flowable:expression>
      </extensionElements>
      <text><![CDATA[== "PROBLEM"]]></text>
    </inputEntry>

    <inputEntry id="inputEntry_inputExpression_inputExpression_inputExpression_InputExpression360068646_3">
      <text><![CDATA[== "PROBLEM"]]></text>
    </inputEntry>

The first issue is far more problematic than the second, what I did was, having a big dmn file, I loaded it in the Decision Tables, deleted some rules and saved that file with a different name, loaded the initial one, delete other rules and saved it as a yet a different name, so basically I split a file in two.

Thank you all.

Hi,

thanks for reporting it.
Regarding the first issue. This is of course not correct.
Can you elaborate a bit more on how to reproduce it?
Is it possible to share the model files (.json) related to these different variations (with and without quotes)?

Yvo

Hi, thanks for your quick reply.

Unfortunately I can’t elaborate or share much more, however (and pardon my ignorance) I don’t even know what are the model files (.json), I’m only aware of the XML DMN files produced based on the Decision Tables.

Today this happened as I described, I loaded a DMN file into a Decision Table on the Flowable UI, deleted some rows (rules), save the table and exported as DMN. I did this twice and in both newly created DMN files this happened.

I can try to get a reproducible example if I have the time.

Cheers.

Hi again, I think I found out the issue, and it is on me… To cut a long story short we had a column of type string that later changed to a collection, and while I changed some of the values to be multi-value like “value1”, “value2”, the other ones stayed the same, like value (no quotes at all). I think that’s what caused them being save without being quoted.

HOWEVER this uncovered a more severe issue when using collection and java Enums, and even when converting those enums to Strings, the ==, AnyOf and AllOf simply dosen’t work…

I can elaborate more on this since I debugged down to the CollectionUtil and BooleanOperations and did a all bunch of tests, but not today… And anyway it’s better do it on it’s own post…

Cheers.

Here’s some more thoughts, can I ask if if they are wrong or right?

  1. I can’t use Enums with collection (but with string is fine)
  2. setting a variable as a Array doesn’t work
  3. I can’t create a collection of only one element
  4. == is useless on collections

1 and 2 would be easy to implement in Flowable (half-dozen lines of code should do it) and it would be nice to us simple developers not to have to do conversions that aren’t really related to the work in hand…

The rest of my issues seem to be working fine now, but there’s still much test to do…

Thanks all.

Here’s another one, this is a number output as it appears on flowable UI

Half of the lines have the content 0.12 and the other half 0.000035 and in the UI everything appears as 0.

The real output for those values is 0.12 and {Double@11138} 3.5E-5!!!

Isn’t there a way to input this kind of numbers in the output and get them both correctly?

Cheers.

Hi all, can I get some help with this issues? I have to do a demo tomorrow and I didn’t want to look bad…

Many many thanks…

Hi @amsmota

First of all. Thanks for pointing out these issues. I’ve looked at a few of them and you definitely have a point with these. This does not work as expected and will be fixed.
When, if and in what order will depend on the time we as a team have available.
May I remind you that this is an open source project and the issues will be fixed on the basis of best effort. Especially with the UI applications.

This is different with the commercial Flowable offerings; like Flowable Work and Flowable Design; but this is not the place to discuss this.

That is why we are reluctant to give estimations on when issues will be fixed.
I hope you understand.

The issues you mention are, as far I can see now, valid and are on my radar to be fixed. I suggest that you create GitHub issues so that you can track the progress.

Regards,

Yvo

Hi, thanks for the reply.

Note that my main purpose is not that you fix issues over night, what I really want is:

  • is this really an issue or am I doing something wrong?
  • if it is an issue is there any known workaround?
  • if I’m doing something wrong, what would be the correct way?
  • that’s not possible to do

All the issues I reported I did solve them with some workarounds, so even if I welcome any fix youse make that is not my main problem. Is it really those points above.

Anyway, I’m working with the docker version and the Java DmnEngine in my code, I actually don’t know if the company to whom I’m making this work have a commercial Flowable version, they may very well have, but how that would help in those issues?

Thanks again for your reply.

Most of the issues / problems you mention are related to the Decision Table editor. This is part of the Flowable Modeler component (in Flowable UI).
The commercial counterpart of Flowable Modeler is Flowable Design. Although the Decision Table editor in Flowable Design originated from the same source code (as the open source version) thy aren’t the same anymore.
So code wise they are different. And if they have a support contract that can also influence the prioritisation of possible fixes (or providing support in general).

I’ll try to find out if they have that.

Cheers.

Hi @amsmota,

There is a flowable-dmn-engine module in flowable-source-code, it contains different test cases that can clarify many basic things. You can import and give it a try

This is the link for above module

Hi again, here’s yet another issue working with Collections… If I pass to the variable a List of values it works OK but if for that same variable I pass a Array it always return false…

I debugged down to the Array code itself when it’s called from your CollectionUtil class, I can see what’s happening, so i can elaborate a little if youse want – and if I have the time to do it too…

Cheers.

Hi,

Could you provide a unit test that shows some unexpected behaviour?

Yvo

Hi Yvo, unfortunately I don’t have any time to do it. And to make things worse I got into another situation, I was browsing thru the CollectionUtil looking for a operation such as:

[apples] NOP [oranges]    ---> true
[apples, oranges] NOP [oranges]  ---> true
[oranges] NOP [oranges]  ---> false

So that would translate to

  • at least one of the values in collection is not in values

At first I thought that notAllOf would do the trick but I mistaken values with collection in the description

  • one of the values of value must not be in collection

So now it seems what I need is something like a NOT allOf? Is that possible to do with the current implementation? If not what can I do? Write myself a function delegate?

In an unrelated question, we are still having much pain with the Decision Table Editor every time we need to load a DMN file into it (see the issues I reported above). You mentioned a paid version, so can I assume that a paid version will NOT have all those issues? And can a Decision Table Editor be bought on its own or is it part of a bigger product only? Please note that I’m not a decider or an influencer on this project, but it is a information that I can pass along.

Thank you.

Hi,

Regarding the function delegates.
The collection function delegates / helper classes are provided as a default implementation. We have made some implementation choices regarding logic / method naming.
We have made the function delegate mechanisme extendable and pluggable so that you override or provide your own logic that can be used in (custom) expressions; if you need that flexibility.

In specific; the notAllOf question.
The logic you’re looking for seems to be in the delegate; FlowableNotContainsAnyFunctionDelegate.
This currently not mapped via a convenience 'drop down operator.
You can use it in a custom expression. Have a look at this unit test (and referenced DMN files).

If you need help with that; please let me know.

Regarding the decision table editor. I haven’t been able to verify your remarks against the commercial version. Have you’ve taken a look at the free trial that is available? Look here for more info; Download a free trial of Flowable's Intelligent Automation platform .

Yvo

Hi Yvo, thanks for your quick reply.

I looked at that code but AFAICS the notContainsAny is deprecated and actually being delegated to notAllOf, both of then in /org/flowable/dmn/engine/impl/el/util/CollectionUtil (
flowable-dmn-engine-6.6.0.jar). Anyway, I’ll test again to be sure I didn’t missed anything.

I’ll also try the free trial ASAP.

Thank you.

Oh, I forgot about another one… I noticed when there is a error evaluating a rule JUEL expression I see a FlowableException in the logs but there is no exception thrown at all. So I did that myself by checking the decisionExecutionAuditContainer.isFailed().

However, this is a very dangerous situation since without the exception being thrown the remaining rules are evaluated and the wrong output is sent back as if it is the correct. So even if I refactored my code to handle this situation in every place the rules are evaluated I can’t guarantee that people in the future will follow this path.

So the question is, is there any type of global configuration that forces Flowable to always throw an error when an error occurs?

Thanks again.

It would be really helpful if you would provide code examples or explain in more detail what you are doing because your comments / remarks can be interpreted in multiple ways.
(Please don’t say that you don’t have time to do that … )

Are you executing a decision table / service from a process / case instance? Because in that case the decisionExecutionAuditContainer is evaluated if the execution has failed.

The execution of a decision table is not halted when there is an error while evaluating a JUEL expression. I don’t agree that this is ‘very dangerous’. Perhaps it does not fit your use case. That is something else.
The audit container has all the needed data to implement the stuff you mention. Please let me know if I’m missing something.

Regards,

Yvo

I don’t have time to do that … :dizzy_face:

Seriously, I have little time to fully explain and I can’t disclose much info due to, well, reasons that I can’t control. And also I don’t know much of our entire business case or even about Flowable, so I’m on a “need to know” basis.

So, in relation to my last post, I’m creating a DmnEngine and loading a bunch of DMN files into it and then at some point use that DmnEngine::DmnDecisionService to evaluate a rule with executeWithAuditTrail and get a DecisionExecutionAuditContainer with the results.

Now suppose that a BA changes a DMN rule by loading the DMN in the Editor and then saving and exporting again. What was described as this expression

${collection:anyOf(Country, '"US", "UK"')}

will become (note the missing " in the beginning and end)

${collection:anyOf(Country, 'US", "UK')}

and that will produce an error when executing. So if it is not thrown it proceeds to the next rule giving final results different from it was supposed to do, without nobody noticing it… A little bit scary if you ask me.

And now to some more “complains” :slight_smile: I noticed that a Collection with only one element is not a Collection but a String. Is this intentionally? Because from my POV now that I’m writing a Function Delegate means much more coding than I would have to do.

And since I referred that, what is the rationale of having public methods in DMNParseUtil - that I can use in my function - and protected methods that I can’t use?

Thanks again for your support.

Cheers.