DMN input array question

918 views
Skip to first unread message

webcyberrob

unread,
Nov 20, 2015, 12:37:06 AM11/20/15
to camunda BPM users
Hi all,

I have a potential use case for DMN. My use case is an identity check where a person presents enough documents until they accumulate 100 points of id.

Hence the kinds of rules are;
  • Classify document into class 1, 2, 3, 4... eg a passport is class 1, a drivers licence is class 2, a utility bill is class 3
  • A class 1 document is worth 70 points as long as it is not older than two years past expiry, a class 2 document is worth 25 points, a class 3 15 points etc.
  • If the individual is under 18, then a class 1 document is worth 100 points.
  • In accumulating 100 points, no more than one class 1 document can be used.

Thus I anticipate a decision table which can classify documents and possibly one which can rate the documents for points. Ideally Id like to pass in an array of documents as input and use an 'accumulate'  ruleset to add up the sum of points. However, I cant see a way to pass in a set of facts as opposed to an atomic fact. An alternate is I use a column and thus input per document, but this would impose a fixed or maximum number of supporting documents.

Hence at the moment I am forced to perform a lot of iterations over the set of documents and call the dmn engine per document etc.

This forces me to implement some knowledge in code rather than DMN. For example to enforce the rule that only one class 1 document is used, I either have to filter items from the set of presented documents, or I add an additional attrribute indicating the sequence number within a classification and modify the points rating rule to - if classification 1 and sequence 1, then 70 pints, else 0 points etc.


Thus, any advice or feedback on how to best deal with patterns such as this?

In addition - where can I get access to the latest DMN modeller build?

regards

Rob

Sebastian Menski

unread,
Nov 20, 2015, 11:08:34 AM11/20/15
to camunda BPM users
Hi Rob,

let me answer your last question first. You can find the latest version of the
DMN table editor online [1] or in the nightly build of the new Camunda desktop
modeler [2].

Regarding your main questions I would model 2 decisions tables.
1. Classification of a document by type and issue date
2. Score document by classification and customer properties like  age

Both of these decisions should be invoked with a single document. I do not
think you can and should express some kind of iteration in a decision table.

I think your use case requires to have a composite decision logic which does
this steps:

1. Iterate over input documents and classifies them (Decision Table 1)
2. Filters them, for example only one class 1 document allowed
3. Iterates over filtered classified documents and scores them (Decision Table 2)
4. Sum up the document scores

With Camunda 7.4.0 you can either model these decision logic in a BPMN process
witch uses Business Rule Tasks to invoke the Decision Tables. Or if you don't
want to expose this logic in your process you can implement your decision logic
in a Java Delegate which uses the Decision Service to invoke the Decision
Tables.

Additionally if you really want to, you could also implement the filtering in
step 3 with a Decision Table. You would again iterate over the classified
documents and decided based on the document and the already filtered list of
documents if you want to include the document.

Cheers,
Sebastian


webcyberrob

unread,
Nov 21, 2015, 5:49:18 AM11/21/15
to camunda BPM users
Thanks Sebastion,

Im usimg the separate decision tables and some iteration over the documents in code. I managed to get the DMN task running in 7.4-alpha3, works really well!

regards

Rob
Reply all
Reply to author
Forward
0 new messages