Complex reusable condition


#1

Hi,
In many places along the BPMN flow we need to check the complex condition, that works as following:
Is all required fields in place.
Required field are :
field1, field2, field3, field4, field5 …

If it’s a cat, dog - check also field6
If it’s a cat, dog, bird - check also field7

check meaning required fields .

I thought of using DMN. not sure what is the best way.

This needs to be reusable - possibly checked a few times during the flow…

Many thanks,
Chani


#2

@Chani_Green are you checking this as a Task or as a gateway/sequence flow condition?


#3

yes this is used by gateway. along the flow every event this will be checked.


#4

If you came up with a DMN for your logic (not sure what it would look like based on your example), you could use scripting to call the DMN and return the values. Would need some additional boiler plate code to support it as well.

Can you provide a BPMN image of your process? There may be a better way to build your flow that does not create the current issue you are describing.


#5

thanks !!


#6

How are you using the engine? Shared engine with Scripting? Java Delegates? …?


#7

Yes. Althogh we want to make this handy to be configurable via the modeler.
That potential no need to compile


#8

Okay but how are you using the engine? are you using java delegates or scripting?

Here is two options that come to mind:


#9

we are investigating what is the best way to use Camunda.
planning on using all three. by finding the right and the most user friendly solution.
not clear to me where is the check for required fields - is it a script ?


#10

The check is down in the “Has Required Data?” box. You can call this sub-process as required. You pass your variables into the sub process and let it do its check, and then you return a True/False back to the parent process.


#11

Can this be an expression that doesn’t need compilation ?


#12

you could do all of this as a expression or as a script using javascript or groovy