camunda:inputVariable should be always used in conjunction with inputExpression?

When the input expression is evaluated then the return value is stored in a variable. The name of the variable can be specified by the camunda:inputVariable on the input element. The variable can be used in an expression of an InputEntry.

<input id="input_1" label="Order Type" camunda:inputVariable="orderType">
	<inputExpression id="inputExpression_1" typeRef="string" expressionLanguage="groovy">
	  <text>
		field1.toLowercase() + "00Z" + field2.toLowercase() + field3.subString(0, 2);
	  </text>
    </inputExpression>
</input>

Is it possible to refer process variables directly in camunda:inputVariable without inputExpression? Similar like below:

<input id="input_1" label="Order Type" camunda:inputVariable="orderType">
    <inputExpression id="inputExpression_1" typeRef="string"></inputExpression>
</input>

Or camunda:inputVariable should be always used in conjunction with inputExpression?

camunda:inputVariable can directly refer process variables?

Hi @aravindhrs,

the input variable can be used to change the name of the variable that holds the result of the input expression. This variable can be used in an input entry. So, it is only useful if you have an input expression.

Process variables can be accessed in input expressions and input entries.

Does this help you?

Best regards,
Philipp

@Philipp_Ossler so process variables can’t be accessed in the camunda:inputVariable ? Input variables is used only for changing the variable name of the result of the input expression and can be further accessed in the input entry?

Correct.

See also https://docs.camunda.org/manual/7.12/reference/dmn11/decision-table/input/#input-variable-name

@Philipp_Ossler, Great :blush:. Last one question for this topic.

  • Even if I have inputExpression, it’s not mandatory to use camunda:inputVariable right? Can we leave that field blank?

  • Or camunda:inputVariable field is mandatorily need to use whenever I use inputExpression?

Yes! It’s an optional field. It is only needed it for some use cases.

@Philipp_Ossler Thanks for helping on this and for your time and effort. It was a great conversation and I got better understanding on dmn.

1 Like