Hi @dred,
I am happy to take a closer look on your use-case!
Generally speaking, DMN can be used for a variety of different use-cases. In the end is usually simplifies the BPMN diagram a lot.
To answer you questions I wonder how stable the rules are you want to capture. If they change frequently and are driven by business users this would be a perfect scenario for a DMN table or even a decision requirements diagram featuring multiple of these .
I am not sure whether I completely understand why you want to use it together with a relational database though. Maybe you can elaborate a bit more on that topic.
P.s.: No need to externalise Camunda 8’s DMN engine…
To answer the question about Zeebe gRPC endpoints for the DMN engine.
According to the documentation I do not find any way to trigger a standalone decision.
You would always need to embed it in a process model.
DMN to simplify BPMN flows and allow more responsive changes looks great, yet need to see what the constraints to its usage are too.
Taking our reusability requirement
I gather that reusability in the DMN world can mean:
reusing the DMN file (and its entire DRD contents) or
reusing values, variables or functions (within a given DRD only)
The challenge is how to reference a rule defined in one DMN file, in another… I don’t think this is possible in Camunda or other vendors out-of-the-box…
If so, perhaps we can solve by extracting data from the DMN file (UID, annotations, even values) and storing in CSV or JSON for example. Then in a modified GUI, reference any given rule, copying in values on demand before saving the new DMN file.
This would not interfere with rule execution per se (as it’s still DMN), but allow for even more responsive business rule management …
Reuse a DMN table, literal expression (which is part of a bigger DRD)
Reuse the complete DRD
You cannot reuse a single rule which is part on one DMN table in another.
At this point I would ask why you want to achieve something like this. If you want to have the same type of rule in two separate tables, these can be merged into one.
Having done so, you can always reference to another DMN table based on the output in the larger DRD. Just to align on wether we are talking about the same thing I have added a screenshot below.
Now let’s quickly check out the plan you have mentioned:
Generally speaking, DMN is serialised in XML. Before deploying a DMN table to the engine you could run a script extracting data from the file and modifying the DMN tables as needed.
each can share 1+ rules with other tenants, at their discretion only
if shared, take the reference of the rule and insert into the other tenant’s table / formula or DRD (ideally refresh values if the master reference changes)
Had considered the proposed DRD structure when there is a default / fallback / final decision to take, but this would still not solve 2. & 3 unfortunately (the need for a rule created by a particular tenant to be inserted into another’s table or DRD safely, with appropriate viewing and editing restrictions).
In theory could achieve with a modified GUI, parsing the XML and a single DRD. This would not easily solve the next requirement.
Secondly key :
If above ETL capability was there the files would still be stored as DMN hence executable by the engine and there’d also be a mirror reference data source.
It’d allow performant searches per se if stored in an appropriate DB like Mongo or Redis. Do doubt how performant traversing dmn folders and parsing the xml documents within would be for this second purpose (e.g. “find all rules with input or output values in range of XYZ” across XX tenants and YY services, loading each dmn into memory each time).
That is … unless the rules loaded into the DMN Engine were exposed via an API with similar performance to db queries.
====
These are two must have requirements. Was quite keen on DMN, but unfortunately can only have it for these use-cases if it can be supplemented in this or a similar way