zeebe-io / zeebe-modeler

Desktop Application for modeling Zeebe Workflows with BPMN
MIT License
220 stars 48 forks source link

New Zeebe attribute "propagateAllChildVariables" for call activities #252

Closed saig0 closed 3 years ago

saig0 commented 4 years ago

Is your feature request related to a problem? Please describe.

Zeebe supports a new (boolean) attribute "propagateAllChildVariables" for call activities. It can be set to true or false.

If it is set to true then all variables are propagated (i.e. copied) from the child instance to the parent instance. Otherwise, no variables are copied.

If an output mapping is defined on the call activity then the output mapping is applied and only the defined variables are propagated.

The Zeebe modeler should support the new attribute.

The related issue in Zeebe: https://github.com/zeebe-io/zeebe/issues/4860#issuecomment-682519598

Describe the solution you'd like

In the Zeebe modeler, I can set the attribute "propagateAllChildVariables" for call activities. For example, by enabling or disabling a flag on the details section of the activity next to the process id.

By default, the attribute should be set to false. This avoids that variables are overridden accidentally in a parallel flow (e.g. multi-instance parallel call activity). If the attribute is not present then Zeebe interprets it as true to be backward-compatible. So, new BPMN workflows should serialize the attribute. But existing workflows should not serialize the attribute (or with value true) if the attribute is not changed/disabled to avoid changing in the behavior of the workflow.

The user should be notified (e.g. a warning or failure message) if the attribute is set to true and output mappings are defined. If output mappings are defined then it propagates only the variables that are defined in the mapping.

Decided design and tasks as of kickoff 20th October 2020

Also see https://github.com/zeebe-io/zeebe-modeler/issues/252#issuecomment-712833797

Describe alternatives you've considered

No.

Additional context

BPMN XML of a call activity:

  <bpmn:callActivity id="Activity_1h7j9o6" name="A">
      <bpmn:extensionElements>
        <zeebe:calledElement processId="demo-process" propagateAllChildVariables="false" />
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1t0ia8l</bpmn:incoming>
      <bpmn:outgoing>Flow_0ypungt</bpmn:outgoing>
    </bpmn:callActivity>
MaxTru commented 4 years ago

Depends on https://github.com/zeebe-io/zeebe-bpmn-moddle/issues/1

MaxTru commented 4 years ago

Hi there,

The user should be notified (e.g. a warning or failure message) if the attribute is set to true and output mappings are defined.

Would a validation of the respective checkbox be okay?

saig0 commented 4 years ago

@MaxTru a validation would be an option :heavy_check_mark:
It is to avoid a misconfiguration. You can deploy such a workflow to Zeebe but it might not work as the user expect.

MaxTru commented 4 years ago

Affected/blocked by: https://github.com/bpmn-io/bpmn-js-properties-panel/issues/359

MaxTru commented 4 years ago

Assigning it to @volkergersabeck to do PM evaluation of this issue before implementation.

saig0 commented 3 years ago

@volkergersabeck when do you plan to implement this feature?

This issue would solve a major issue in Zeebe. It is easy for users to run into this bug because the current (default) behavior is not intuitive.

MaxTru commented 3 years ago

@saig0 I scheduled a quick sync to clarify some conceptual questions (see your calendar), afterwards we can implement this rather quickly IMO. Hope this helps, please feel free to reach out in case of questions.

pinussilvestrus commented 3 years ago

This will probably need some API updates if we need to update the bpmn-js-properties-panel dependency, cf. https://github.com/zeebe-io/zeebe-modeler/issues/261

MaxTru commented 3 years ago

Kickoff performed on 20.October together with @saig0, @andreasgeier, @volkergersabeck and myself.

Key decisions:

I will treat this issue as the epic and create child issues for the respective tasks.

pinussilvestrus commented 3 years ago

Closed via https://github.com/zeebe-io/zeebe-modeler/pull/271