0 votes
1.5k views
in Interview Questions by

1 Answer

+2 votes
by
edited by anonymous
 
Best answer

From IBM BPM v8.5, the Assignment options which were there before such as "Last User in the lane", "Routing Policy",  "List Of Users" and "Custom" were deprecated an can no longer be used for the Task Assignments.

The Earlier Concept of Participant Groups has been replaced with Teams, a Team can have static members or static LDAP groups, also it can be linked to a "Team Retrieval Service" which can in any way (most commonly used DB lookup) retrieve a group of users and create a team with the members added to it. The result of this lookup can be cached as is the case with any other service.

‚ÄčIn Task Assignments you can assign a Team defined by the above process directly and the task will get assigned to the resulting team from the invocation of the "Team Retrieval Service". Additionally on top of that it is sometimes required to create a dynamic filtered team based on certain inputs e.g. You want to exclude certain people from the team or include only some people and exclude all others in this case "Team Filter Services" come handy, Team filter service takes a team and optional inputs and based on the incoming team and input parameters does some  filteration of users and returns the filtered team back to the Task Assignment call.

There is a common problem/bug with this approach, the filtered team is a temporary team which gets assigned when the task is created, if you add some new members to the Team, the team gets updated with the new members because it is dynamically tied to the Team Retrieval, but the filtered teams are temporary teams and do not get updated when new users are added to the team.

we have solved this issue by creating a small dashboard which does a search for the desired tasks, retrieves the filter inputs and then reruns the team retrieval and filter service using jsapi and assigns the team to the task with jsapi commands.

by (100 points)
Can you please share this approach screenshots or code for reference & help to implement the same. Need your earliest response. Thank you.
by (11.2k points)
This is pseudo code and directions rather than actual working code

Search for all tasks you are interested in using TWSearch and get business data containing the input to the tasks team filter service

You can execute the Team Retrieval Service to get the base team to filter or get it directly from Business Data if available. (Approach will be same as below to call the Team Filter Service using Execute Service by name)

create a map of the inputValues to the team filter service

var tw.local.inputValues= new tw.object.Map();

map.put("input1", tw.local.input1); // This is the team filter custom input be sure to change the name to actual name

map.put("originalTeam", tw.local.OriginalTeam);

var resultsMap = tw.system.executeServiceByName("Your Team Filter Service Name Here", tw.local.inputValues);

if(resultsMap){

    tw.local.newTeam = resultsMap.get("filteredTeam");

}

tw.system.findTaskByID("1234").reassignTo(tw.local.newTeam);

Related questions

0 votes
1 answer 403 views
0 votes
1 answer 258 views
0 votes
1 answer 692 views
0 votes
0 answers 70 views
0 votes
0 answers 132 views
+1 vote
1 answer 570 views
0 votes
1 answer 599 views
+1 vote
1 answer 918 views
0 votes
0 answers 33 views
...