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

Deploy workflow with parallel multi-instance service task #2845

Closed
saig0 opened this issue Jul 16, 2019 · 1 comment · Fixed by #2878
Closed

Deploy workflow with parallel multi-instance service task #2845

saig0 opened this issue Jul 16, 2019 · 1 comment · Fixed by #2878
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

Comments

@saig0
Copy link
Member

saig0 commented Jul 16, 2019

Is your feature request related to a problem? Please describe.
I want to use parallel multi-instance on a service task to execute it for each element of a collection.

Describe the solution you'd like

  • I can mark a service task with the multi-instance marker and isSequential=false (default)
  • I can define the collection variable to iterate over it
  • I can define the variable name to store the element of the instance in
  • when the service task is entered, it creates one instance of each element in the collection
  • when all instances are completed, the service task is left

Describe alternatives you've considered

  • model a loop in the BPMN using gateways -> hard to understand
  • control the execution externally -> workflow is not self-contained

Additional context

The BPMN XML could look like:

    <bpmn:task id="Task_1f0s1iu" name="task">
      <bpmn:multiInstanceLoopCharacteristics 
        zeebe:inputCollection="items" 
        zeebe:inputElementVariable="item" />
    </bpmn:task>
@saig0 saig0 added the kind/feature Categorizes an issue or PR as a feature, i.e. new behavior label Jul 16, 2019
@saig0 saig0 added Status: Ready scope/broker Marks an issue or PR to appear in the broker section of the changelog labels Jul 16, 2019
@saig0
Copy link
Member Author

saig0 commented Jul 18, 2019

Following our current Zeebe model approach, it would look like:

    <serviceTask id="task" name="task">
      <extensionElements>
        <zeebe:taskDefinition type="test"/>
      </extensionElements>
      <incoming>...</incoming>
      <outgoing>...</outgoing>
      <multiInstanceLoopCharacteristics id="...">
        <extensionElements>
          <zeebe:loopCharacteristics inputCollection="items" inputElement="item"/>
        </extensionElements>
      </multiInstanceLoopCharacteristics>
    </serviceTask>

zeebe-bors bot added a commit that referenced this issue Jul 29, 2019
2878: feat(engine): support parallel multi-instance service task r=saig0 a=saig0

## Description

* add extension element `loopCharacteristics` with attributes `inputCollection` and `inputElement` for `multiInstanceLoopCharacteristics` element
* wrap activity with multi-instance loop characteristics into a multi-instance body when transforming it
* create one instance for each element of the input collection when activating the multi-instance body
* set the input element variable for each instance, if defined
* complete the multi-instance body when all instances are completed
* complete the multi-instance body immediately when the input collection is empty
* terminate all instances when multi-instance body is terminating
* raise incident if input collection variable is missing or not an array

## Related issues

closes #2845 

#

Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
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