Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A business rule task can evaluate a DMN decision #8080

Closed
Tracked by #8083
saig0 opened this issue Oct 27, 2021 · 0 comments · Fixed by #8755
Closed
Tracked by #8083

A business rule task can evaluate a DMN decision #8080

saig0 opened this issue Oct 27, 2021 · 0 comments · Fixed by #8755
Labels
kind/feature Categorizes an issue or PR as a feature, i.e. new behavior scope/broker Marks an issue or PR to appear in the broker section of the changelog

Comments

@saig0
Copy link
Member

saig0 commented Oct 27, 2021

Description

A business rule task can reference a DMN decision by its decision id. If a process instance activates such a business rule task then it evaluates the decision. It writes the result of the evaluation as a process variable under the name that is defined as the result variable. The value type of the variable depends on the DMN decision (i.e. single value, list, or context).

  • extend the executable representation of a business rule task
    • add a property for the decision id
    • add a property for the result variable
  • evaluate the decision when processing the activate command
    • after the input mappings are applied
    • load the decision from the state
    • use the DMN module to evaluate the decision
  • write the decision result as process variable
    • the decision result is returned by the DMN module
    • the name of the variable is defined as resultVariable
    • propagate the variable if no output mappings are defined
    • set the variable in the local scope if output mappings are defined (e.g. to extract or transform the decision result)
    • use the process event to pass the decision result to the output mapping

blocked by #8060
blocked by #8067
blocked by #8069
blocked by #8082

@saig0 saig0 added kind/feature Categorizes an issue or PR as a feature, i.e. new behavior scope/broker Marks an issue or PR to appear in the broker section of the changelog labels Oct 27, 2021
@saig0 saig0 added this to the Evaluate DMN decisions milestone Oct 27, 2021
@saig0 saig0 added this to Planned in Zeebe Oct 27, 2021
@saig0 saig0 moved this from Planned to Ready in Zeebe Jan 31, 2022
@korthout korthout moved this from Ready to In progress in Zeebe Feb 3, 2022
@npepinpe npepinpe moved this from In progress to Review in progress in Zeebe Feb 11, 2022
ghost pushed a commit that referenced this issue Feb 14, 2022
8755: Business rule task can evaluate a DMN decision r=korthout a=korthout

## Description

This adds the ability to process business rule tasks that refer to a called decision (see #8060). Business rule tasks that refer to a [task definition](https://docs.camunda.io/docs/components/modeler/bpmn/business-rule-tasks/business-rule-tasks/#defining-a-task) instead of a called decision work like they did before, i.e. by creating a job for job workers.

On activation of a business rule task with called decision, the decision specified by `decisionId` is retrieved from the deployed decisions state. If present, the engine uses the `dmn` module to evaluate the decision. If that is successful, the decision result's output is stored in a result variable (defined by `resultVariable`).

The result variable stores the decision result's output according to the following rules:
- if the business rule task defines no output mappings, the result variable is [propagated](https://docs.camunda.io/docs/components/concepts/variables/#variable-propagation)
- if there are [output mappings](https://docs.camunda.io/docs/components/concepts/variables/#output-mappings) defined on the business rule task, the result variable is set as a [local variable](https://docs.camunda.io/docs/components/concepts/variables/#local-variables) of the business rule task

If any of this fails, Zeebe raises an incident on the business rule task. For example, if the decision was not deployed yet, then an incident is raised. This allows you to:
1. deploy the decision to fix the problem
2. retry activating the business rule task by resolving the incident

## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #8080



Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
ghost pushed a commit that referenced this issue Feb 14, 2022
8755: Business rule task can evaluate a DMN decision r=korthout a=korthout

## Description

This adds the ability to process business rule tasks that refer to a called decision (see #8060). Business rule tasks that refer to a [task definition](https://docs.camunda.io/docs/components/modeler/bpmn/business-rule-tasks/business-rule-tasks/#defining-a-task) instead of a called decision work like they did before, i.e. by creating a job for job workers.

On activation of a business rule task with called decision, the decision specified by `decisionId` is retrieved from the deployed decisions state. If present, the engine uses the `dmn` module to evaluate the decision. If that is successful, the decision result's output is stored in a result variable (defined by `resultVariable`).

The result variable stores the decision result's output according to the following rules:
- if the business rule task defines no output mappings, the result variable is [propagated](https://docs.camunda.io/docs/components/concepts/variables/#variable-propagation)
- if there are [output mappings](https://docs.camunda.io/docs/components/concepts/variables/#output-mappings) defined on the business rule task, the result variable is set as a [local variable](https://docs.camunda.io/docs/components/concepts/variables/#local-variables) of the business rule task

If any of this fails, Zeebe raises an incident on the business rule task. For example, if the decision was not deployed yet, then an incident is raised. This allows you to:
1. deploy the decision to fix the problem
2. retry activating the business rule task by resolving the incident

## Related issues

<!-- Which issues are closed by this PR or are related -->

closes #8080



Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
@ghost ghost closed this as completed in 926d47e Feb 14, 2022
Zeebe automation moved this from Review in progress to Done Feb 14, 2022
@KerstinHebel KerstinHebel removed this from Done in Zeebe Mar 23, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes an issue or PR as a feature, i.e. new behavior scope/broker Marks an issue or PR to appear in the broker section of the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants