Is there a way to include variables within output of DMN's

I am trying to make a decision table based on user type what kind of email he should receives when he logs in for the first time.

The output contains the Onboarding Message which has to be sent to the user, Is there any better way to get the interpolated output, if so what format does it have in FEEL?
I tried something like “string ${variable}” but it throws a runtime error that DMN is not able to evaluate the given expression.


plans.dmn (5.8 KB)

Hi @vermauv,

it seems that the onboarding messing is always the same. In this case, it doesn’t need to be part of the decision table.

I would recommend to remove it from the decision table and build a small BPMN. First, it calls the DMN to calculate the plan cost and the number of devices. Then, you can generate the onboarding messing using a script task (e.g. using FreeMarker: https://docs.camunda.org/manual/7.11/user-guide/process-engine/templating).

Does this make sense for you?

Best regards,
Philipp

Hi @Philipp_Ossler,

That does make sense, but what if we have multiple types of onboarding messages, should it then be a BPMN with multiple gateways connected to different script tasks having different templates?

You could have the messages include the placeholders in the decision table and transform it afterwards in a script task. I guess that it is also possible to use FreeMarker in the output by setting the expression language to “freemarker”.