Hi Team,
Apologies if this question is asked earlier.
I have a requirement like I will get some inputs from the initiate form and using these form variables, I need to define some rules in DMN and the output of the DMN decides what is the next flow.
ie, there is a form field called ‘Country’ in the initiate form, and based on the country input, I need to decide (using rule task) if some validations are required and if yes, that should be routed to a flow. So I am very confused on how can I provide this country form field as input to DMN in the rule task.
Thanks in advance
Hi Pushkala,
There are a few things to consider here:
- We need to understand how form data is linked to process data. When you use Camunda forms, you can add a
key
to each input field. This key is the variable name. In the following example, we store the user input in the variable countryInput
:
This variable can be used in the process. You can read more about this in our documentation here and here.
- Next, we need to understand how these process variables can be accessed by DMN decision. Such a decision is called via a business rule task. When you define the input of a decision table, you can define an input variable, e.g., the input for column country is taken from the process variable
countryInput
:
Alternatively, you can use the expression field. Read more about it here.
1 Like
Hi @StephanHaarmann
Thank you very much for your quick response.
I have mapped variable key as Input Variable in DMN. I have listed a set of country values as well.
My need is to check a validation is required or not for these countries( a boolean field which indicates yes or no) and I am getting the following issue
I have mapped input variable here
These are my set of sample rules( eg, if country is Malaysia, autodocValidation=true)
I have added the rule task after start event. I am getting the error:
Can you kindly help me on what went wrong in my rule definition.
Hi @Pushkala,
In FEEL and DMN Decision Tables, strings must be sournded by qotation marks.
So instead of Malaysia
, Germany
, etc. write "Malaysia"
, "Germany"
…
1 Like
@StephanHaarmann Thank you very much. It worked 