Using Camunda DMN Engine

You can use the Camunda DMN engine integration to evaluate a DMN decision. You haveto specify the decision key to evaluate as the attribute. Additionally,the camunda:decisionRefBinding specifies which version of the decision should be evaluated.Valid values are:

  • deployment, which evaluates the decision version which was deployed with the processversion,
  • latest which will always evaluate the latest decision version,
  • version which allows you to specify a specific version to execute with the camunda:decisionRefVersion attribute, and
  • versionTag which allows you to specify a specific version tag to execute with the camunda:decisionRefVersionTag attribute.

The camunda:decisionRefBinding attribute defaults to latest.

  1. <businessRuleTask id="businessRuleTask"
  2. camunda:decisionRef="myDecision" />

The attributes camunda:decisionRef, camunda:decisionRefVersion, and camunda:decisionRefVersionTag can be specified asan expression which will be evaluated on execution of the task.

The output of the decision, also called decision result, is not saved as process variable automatically. It has to pass into a process variable by using a predefined or a mapping of the decision result.

  1. <businessRuleTask id="businessRuleTask"
  2. camunda:resultVariable="result" />

See the User Guide for details about the mapping.

The result variable should not have the name decisionResult, as the decision result itself is saved in a variable with this name. Otherwise, an exception is thrown while saving the result variable.

DecisionRef Tenant Id

When the Business Rule Task resolves the decision definition to be evaluated it must take multi tenancy into account.

By default, the tenant id of the calling process definition is used to evaluate the decision definition.That is, if the calling process definition has no tenant id, then the Business Rule Task evaluates a decision definition using the provided key, binding and without a tenant id (tenant id = null).If the calling process definition has a tenant id, a decision definition with the provided key and the same tenant id is evaluated.

Note that the tenant id of the calling process instance is not taken into account in the default behavior.

Explicit Tenant Resolution

The camunda:decisionRefTenantId attribute allows to explicitly specify a tenant id:

If the tenant id is not known at design time, an expression can be used as well:

  1. <businessRuleTask id="businessRuleTask" decisionRef="myDecision"
  2. camunda:decisionRefTenantId="${ myBean.calculateTenantId(variable) }">
  3. </businessRuleTask>

An expression also allows using the tenant id of the calling process instance instead of the calling process definition:

Using a Custom Rule Engine

You can integrate with other rule engines. To do so, you have to plug in yourimplementation of the rule task the same way as in a Service Task.

  1. <businessRuleTask id="businessRuleTask"
  2. camunda:delegateExpression="${MyRuleServiceDelegate}" />

Using Delegate Code

Alternatively, a Business Rule Task can be implemented using Java Delegation just as a Service Task. For moreinformation on this please see the documentation.

Implementing as an External Task

Camunda Extensions

Additional Resources