02-06-2017 09:47 AM
In the above process, I want the tasks within the Red box to be part of a Sub process- this has to be performed as many times as I select Actor Groups in the "Update Notice Task".
For Example I may choose a HR group and a Finance Group as Actors, then the above review Tasks needs to create 2 sub processes(each subprocess would have different data depending on the type of Group).
The subsequent Master process( inthe above example "Compliance SignOff")tasks need to wait till both these subprocesses end and then proceed execution.
Please guide....
Regards
02-08-2017 11:34 AM
Actually loop cardinality isnt the right approach on this occasion.
Assume you have a dynamic list of users you want to assign tasks to.
ArrayList idList = new ArrayList();
Long tenantId = currentUser.getTenantId();List<User> users = userService.getAllUsers(0,999,tenantId);
for (User u : users) {
idList.add(u.getId());
}execution.setVariable('assigneeList', idList);
Now, setup the Multi Instance properties as follows:
Collection (Multi Instance) = assigneeList
Multi Instance Type = parallel (or serial, doesnt matter)
Completion Condition = No Value
Cardinality = No Value (not used in this case)
Element Variable - assignee (this takes each element from the list and creates a named variable in the sub process)
Assignment = ${assignee) - if this is a complex type and includes other data, point to the user id element.
Now you will have a dynamic number of instances with dynamic assignment and dynamic data elements based on the ArrayList used to trigger the multi instance.
This is really super powerful stuff, and the Completion Condition can be used to model what are typically complex scenarios such as two eye approval etc.
Cheers,
Greg
02-06-2017 12:38 PM
02-07-2017 04:18 PM
Hi Greg,
Thank you for your response....
I have used your inputs and re-designed my process and now it looks like this:
The red marked task is the Call Activity Task, which calls my sub process which I have designed as a separate process.
I have again currently made it work for only one instance of subprocess. i.e.: The sub process is called only once from the master process.
From your comment, I understand that I can store the number of Called Activity instances and mapped data in an Array and use it.
My query is:
How do I call multiple instances of the Call Activity(subprocesses)? Can I configure the Multi Instance property in the Call Activity Task? or Use some Activiti API?
Appreciate your help.... Thank you...
Regards.
02-08-2017 02:19 AM
Hi Paiyyavj13 _,
you can set the loopCardinality with a variable you pass to the process. The loopCardinality says how much instances of the call activity will be created.
<callActivity id="callDeptReviewCallActivity" calledElement="callDeptReview">
<multiInstanceLoopCharacteristics isSequential="false|true">
<loopCardinality>${variable}</loopCardinality>
</multiInstanceLoopCharacteristics>
</callActivity>
For more information take a look in the user Activiti User Guide at Chapter 8.5.14.
Niklas
02-08-2017 11:34 AM
Actually loop cardinality isnt the right approach on this occasion.
Assume you have a dynamic list of users you want to assign tasks to.
ArrayList idList = new ArrayList();
Long tenantId = currentUser.getTenantId();List<User> users = userService.getAllUsers(0,999,tenantId);
for (User u : users) {
idList.add(u.getId());
}execution.setVariable('assigneeList', idList);
Now, setup the Multi Instance properties as follows:
Collection (Multi Instance) = assigneeList
Multi Instance Type = parallel (or serial, doesnt matter)
Completion Condition = No Value
Cardinality = No Value (not used in this case)
Element Variable - assignee (this takes each element from the list and creates a named variable in the sub process)
Assignment = ${assignee) - if this is a complex type and includes other data, point to the user id element.
Now you will have a dynamic number of instances with dynamic assignment and dynamic data elements based on the ArrayList used to trigger the multi instance.
This is really super powerful stuff, and the Completion Condition can be used to model what are typically complex scenarios such as two eye approval etc.
Cheers,
Greg
02-10-2017 09:57 AM
Thank you Greg for your post.... It really helped a lot...I had to do some minor changes for group assignment...
Regards.
02-10-2017 10:05 AM
02-14-2017 10:28 AM
Hi Greg,
I have a quick question and I did not want to create a separate thread for this query:
I am trying to send some additional process information from the Master process into my Call Activity subprocess and wanted to check below queries.
Earlier I was using below configurations for only sending the assignee Groups information from Master to Sub process:
This works fine for sending assignee group information alone to my sub process. But now I need to send some additional information into my subprocess.
Depending on the type of group selected I choose a set of subtasks, I store the group and subtasks into a Java Map variable.
I am having trouble trying to pass and refer this additional information in my sub process.
My configurations change as below,
Queries:
Appreciate your assistance.... Thank you again ....
02-17-2017 07:49 AM
Explore our Alfresco products with the links below. Use labels to filter content by product module.