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

In the model API, a business rule task can reference a DMN decision #8060

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

In the model API, a business rule task can reference a DMN decision #8060

saig0 opened this issue Oct 26, 2021 · 0 comments · Fixed by #8243
Assignees
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 version:1.3.0 Marks an issue as being completely or in parts released in 1.3.0

Comments

@saig0
Copy link
Member

saig0 commented Oct 26, 2021

Description

In the BPMN model API, a business rule task should be able to reference a DMN decision.

  • a business rule task can have an extension element calledDecision with
    • an attribute decisionId that references the id of the decision to evaluate
      • has either a static value or an expression
      • must not be empty
    • an attribute resultVariable that defines the variable name to store the decision result in
      • has a static value
      • must not be empty
  • a business rule task must have either an extension element calledDecision or taskDefinition but not both

Sample XML with static decisionId:

    <bpmn:businessRuleTask id="chooseDish" name="Choose Dish">
      <bpmn:extensionElements>
        <zeebe:calledDecision decisionId="dish" resultVariable="dish" />
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0ixwjoa</bpmn:incoming>
    </bpmn:businessRuleTask>

Sample XML with decisionId expression:

    <bpmn:businessRuleTask id="chooseDish" name="Choose Dish">
      <bpmn:extensionElements>
        <zeebe:calledDecision decisionId="= decisionId" resultVariable="dish" />
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0ixwjoa</bpmn:incoming>
    </bpmn:businessRuleTask>
@saig0 saig0 added kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. scope/broker Marks an issue or PR to appear in the broker section of the changelog labels Oct 26, 2021
@saig0 saig0 added this to the Evaluate DMN decisions milestone Oct 26, 2021
@saig0 saig0 added this to Planned in Zeebe Oct 26, 2021
@saig0 saig0 added kind/feature Categorizes an issue or PR as a feature, i.e. new behavior and removed kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. labels Oct 26, 2021
@npepinpe npepinpe moved this from Planned to Ready in Zeebe Oct 26, 2021
@saig0 saig0 self-assigned this Nov 18, 2021
@saig0 saig0 moved this from Ready to In progress in Zeebe Nov 18, 2021
@ghost ghost closed this as completed in 2a9beeb Nov 22, 2021
Zeebe automation moved this from In progress to Done Nov 22, 2021
@korthout korthout added the version:1.3.0 Marks an issue as being completely or in parts released in 1.3.0 label Jan 4, 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 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>
@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 version:1.3.0 Marks an issue as being completely or in parts released in 1.3.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants