+1 vote
in BPD by

2 Answers

+4 votes
by (16.1k points)

In a BPD(Business Process Diagram), you can make any activity/javascript be a simple loop or a multi-instance loop implementation e.g. System Service, Human Services and Linked Process or Sub-Process and even scripts, A simple loop means that the connected service/process/task/script will run in sequence for the defined number of times with a single token, whereas a multi instance loop means it may run in parallel or sequence(as chosen) for the defined number of times with individual separate tokens for each instance.

You generally use a list variable to supply the input data to each instance, each instance gets a member of the list variable to work upon, additionally you can supply common data also to the instances.

The index of the list which will match the current step/instance (the counter for the instances) is retrieved using

tw.system.step.counter, so the index of the current item for the list will be tw.system.step.counter - 1 since list indexes start with 0

A simple use case is lets say a person chooses how many approvers will be for a given task, we will have to generate as many tasks as the number of approvers added.

You can have a scenario where all approvers will need to approve before we can move forward, or a scenario where any approver approving moves the flow forward, this is done by conditional wait till a certain condition is true and cancelling remaining instances, you may have a scenario that when a certain condition is met come out of the loop but let the remaining instances run, when the additional instances exit they will introduce additional token and you will have multiple tokens in you process.

The most complex scenario i have seen for a multi-instance loop is where in a user chooses approvers we generate tasks for each approver, but any one of the approver can add additonal approvers and we have to add as many additional approvers to the task list but the approval task is essentially same.

The solution used was a self joining multi instance linked process, it is'nt easy to implement especially in the conditional exit area and keeping in mind pass by reference. the exit condition was if any approver rejects cancel all remaining tasks and exit to main process or wait for all approvals adhoc and main ones to come in.

I am attaching a skeleton of the implementation, its not a fully executing one. later I will try to post a fully working version also.


0 votes
by (16.1k points)

Related questions

0 votes
1 answer 631 views
0 votes
1 answer 113 views
+1 vote
2 answers 1.4k views
0 votes
1 answer 323 views
0 votes
0 answers 133 views
0 votes
0 answers 175 views
0 votes
1 answer 605 views
0 votes
1 answer 616 views
0 votes
1 answer 296 views
asked May 19, 2016 in BPD by anonymous
0 votes
0 answers 94 views
0 votes
1 answer 388 views
0 votes
0 answers 96 views
0 votes
1 answer 252 views

591 questions

485 answers


1.8k users

Dosvak IBM BPM /BAW Products, Download Evaluation
Process & Performance Tools Process & Performance Tools
Code Analyzer Code Analyzer
UI Toolkit UI Toolkit
Integration Monitoring Integration Monitoring
Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel