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
Solved! Go to Solution.
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
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.
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
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
Thank you Greg for your post.... It really helped a lot...I had to do some minor changes for group assignment...
Regards.
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 ....
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.