BPM, Workflow, and Case

 View Only
Expand all | Collapse all

Team retrieval service after task assignment

  • 1.  Team retrieval service after task assignment

    Posted Thu May 05, 2022 10:50 AM
    Hi,

    we use team retrieval service.

    After the tasks assignment (and before claiming the tasks), if the team retrieval service produce a different member list, the tasks don't seem to refresh the potential task owner list. Is it possible to refresh the team for ready tasks ? We tried to use an scheduled UCA to automatically refresh the dynamic teams (see document Teams_im_BPM_8.5_part3.pdf)

    Note : we use the "user-tasks" REST API to check the team details on ready tasks.

    Thanks for help



    ------------------------------
    Yannick Martin
    ------------------------------


  • 2.  RE: Team retrieval service after task assignment

    Posted Fri May 06, 2022 11:55 AM
    Edited by Don Williams Fri May 06, 2022 11:57 AM
    If possible, you might consider assigning the tasks to an internal group/role (those configured under User Management -> Group Management in the ProcessAdmin console) as changes in the role membership would be reflected immediately.  This may require the creation of many roles depending on your use case, but using a convention for the role names such as (ProcessApp)_(BusinessIdentifier)_(RoleName) has been an effective pattern for many projects I've worked on over the years.  For example:

    • ABCPROC_USA_Requestor
    • ABCPROC_FRA_Requestor
    • ABCPROC_GER_Requestor
    • ABCPROC_USA_Approver
    • ABCPROC_FRA_Approver
    • ABCPROC_GER_Approver

    If the number of roles required is simply too many to manage - i.e. more than 50, for example - then using a Team Retrieval Service or Team Filter Service to dynamically build your team is probably your best bet.  In this case, you could implement a scheduled UCA which executes a service on an interval of your choosing that runs code similar to the following:

    var teams = tw.system.org.getAllTeams();
    for(var i=0; i<teams.length; i++) {
        teams[i].refresh();
    }
    ​
    You could also add an IF statement in the loop to ensure only certain teams are refreshed, if desired.

    ------------------------------
    Don Williams
    ------------------------------



  • 3.  RE: Team retrieval service after task assignment

    Posted Fri May 13, 2022 11:25 AM
    Hi Don,

    I expect that the ready task list reflect the team membership when I retrieve user tasks thri REST API but it isn't the case.
    First I had to read the sentence saying that the UCA scheduled service (to refresh the team) cannot be scheduled on development environment.
    It has to be started manually.

    My team refresh service is : 
    var team = tw.system.org.findTeamByName("Team1");
    if (team != null) {
    team.refresh();
    }
    team = tw.system.org.findTeamByName("Team2");
    if (team != null) {
    team.refresh();
    }

    But the task list keeps to be the same. In REST API the list of potentiel owners is always the same and the workdashboard for one user which is in and out the team membership doesn't change.

    What am I doing wrong ?

    Thank for help


    ------------------------------
    Yannick Martin
    ------------------------------



  • 4.  RE: Team retrieval service after task assignment

    Posted Mon May 16, 2022 05:27 AM
    Hi,

    I'm responding to myself.
    My mistake was that, the direct team membership don't updates the tasks potential users, this is what I've tested.
    I have to create an internal role added as member on team to achieve the actual dynamic team membership on tasks.

    Best regards

    ------------------------------
    Yannick Martin
    ------------------------------



  • 5.  RE: Team retrieval service after task assignment

    Posted Fri May 27, 2022 03:26 AM

    Hi,

    I've tested the team build as follow :
    "Team1" is a team retrieval service, this service use or create an internal group "customRole1". This internal group contains 2 users "test1" and "test2".

    If I start a new process with one task assigned to team "Team1", thru REST API I see an task with potential owners "test1" and "test2".
    Now I add the user "test3" to the internal group (thru process admin console) .
    The user "test3" don't appear as potential user in the task instance.
    And in the Process Portal Work list the task also don't appear for the user "test3".

    If I start a the process with one task assigned to team "Team1", I see the user "test3" in potential user list.

    In the REST API "getUserTasks", I see that there's a "potential owners" section with an new id (p.e. 2075.2081 instead of 2075.2080 for the previous assigned task) and the model.id is the same.
    If a new member joins the team, all tasks assigned to the team before the new member arrival will not be visible to him ?

    Is there a option to refresh the team that will affect all tasks ? 

    Thanks for help



    ------------------------------
    Yannick Martin
    ------------------------------



  • 6.  RE: Team retrieval service after task assignment

    IBM Champion
    Posted Fri May 27, 2022 05:19 AM
    Edited by Atanu Roy Fri May 27, 2022 05:21 AM
    Are these BAW file based users or LDAP users? In case of file based user, the task should be visible to the newly added user. But I think, incase of LDAP users, even if you add the user to the internal group/role, the task won't be visible to the newly added user. There is no official API available for refreshing this, I believe. 

    You can design your solution to handle this kind of situation, there would be two steps - 

    1. Find out the tasks impacted
    2. Attach an IME (interrupt activity) on the activity and route that back to the same activity, so that once triggered, a new task id is created of the same activity. When a new task is created that would take the latest role membership.
    3. Trigger the IMEs for applicable tasks

    I have implemented similar solution before and that served the purpose.

    Thanks!


    ------------------------------
    Atanu Roy
    Solution Architect
    Salient Process
    ------------------------------



  • 7.  RE: Team retrieval service after task assignment

    Posted Fri May 27, 2022 07:37 AM
    Hi Atanu,

    thanks for your quick answer.

    The users are LDAP-ones, and all human tasks are impacted because the group membership system isn't the LDAP system but a centralized database.

    I will test your workaround but I cannot deduce its drawback except the addition of IME at design step. Is there more drawbacks ?

    Best regards

    ------------------------------
    Yannick Martin
    ------------------------------



  • 8.  RE: Team retrieval service after task assignment

    IBM Champion
    Posted Fri May 27, 2022 08:42 AM
    Hi Yannick,

    The design is simple but critical part is performance, depending on the number of impacted tasks (equals to number of UCA invocations), user add/remove frequency, time of change(in case change is happening in business hour) etc. It would be recommended to perform performance testing in a prod like environment before pushing this solution to prod. I had also encountered performance issues with this approach. If you are going with this approach, I would suggest you not to fire all the UCAs at a time and process in batches.

    Thanks!


    ------------------------------
    Atanu Roy
    Solution Architect
    Salient Process
    ------------------------------



  • 9.  RE: Team retrieval service after task assignment

    Posted Mon May 30, 2022 01:32 AM
    Hi Yannick,

    I think what you describe should work if your Team Retrieval Service returns the group as a team member.
    Your behavior sounds as if the service returns the list of group members as team members. Consequently, the task is assigned to these users, not to the group.

    ------------------------------
    Jens Engelke
    ------------------------------



  • 10.  RE: Team retrieval service after task assignment

    Posted Mon May 30, 2022 02:59 AM
    Hi Jens,

    your comment is very interesting and I hope you're right but see below the retrieval script, the internal group is returned as member.
    I'm in a lab environment, I cannot now debug the team operations. I will ask for logs.

    For a human task a new team id is produced when the internal group is modified or when team refresh occurs.

    -----------------------------------------
    var roleName = "customRole_" + tw.local.businessRoleId;
    var roleDisplayName = roleName;
    var roleDescription = "Internal BPM group that represents EDS manager role " + tw.local.businessRoleId;;

    var internalCaseGroup = tw.system.org.findRoleByName(roleName);
    if (internalCaseGroup == null ) {
    log.info("Custom TRS create internal BPM group " + roleName + "for team " + tw.local.name);
    internalCaseGroup = tw.system.org.createRole(roleName , roleDisplayName , roleDescription , false);
    if (internalCaseGroup == null) {
    internalCaseGroup = tw.system.org.findRoleByName(roleName);
    }
    }

    tw.local.team = new tw.object.Team();
    tw.local.team.members = new tw.object.listOf.String();
    tw.local.team.members[0] = internalCaseGroup.name;
    tw.local.team.managerTeam = tw.local.name + " Managers";
    ------------------------------------------------------


    Thanks for help.

    ------------------------------
    Yannick Martin
    ------------------------------



  • 11.  RE: Team retrieval service after task assignment

    Posted Mon May 30, 2022 04:58 AM
    A very similar pattern is used to synchronize a case role into a BPM team.

    ------------------------------
    Jens Engelke
    ------------------------------



  • 12.  RE: Team retrieval service after task assignment

    Posted Mon May 30, 2022 05:37 AM
    Edited by Yannick Martin Mon May 30, 2022 05:45 AM
    Right Jens, it is a bad way to retrieve an internal group ?
    My references were documents eries "Teams_in_BPM_8.5_part_X.pdf".

    ------------------------------
    Yannick Martin
    ------------------------------



  • 13.  RE: Team retrieval service after task assignment

    Posted Mon May 30, 2022 06:55 AM
    No Yannick,
    what I am saying is that we have product code that does almost the same:


    ------------------------------
    Jens Engelke
    ------------------------------



  • 14.  RE: Team retrieval service after task assignment

    Posted Mon May 30, 2022 09:06 AM
    Yes I took this as sample to create the role thru JS API, the rest is also in "Teams_in_BPM_8.5_part_X.pdf" series.

    ------------------------------
    Yannick Martin
    ------------------------------



  • 15.  RE: Team retrieval service after task assignment

    Posted Tue June 07, 2022 04:56 AM
    Hi Jens,

    as I'm not sure that the team filtering service interfoeres with the team retrieval service, I have disabled the team filtering but the result is always the same.

    Hereunder the REST API gives the users list and in Process portal there's no change in tasl assignment when I change the internal group membership :
    { "user_task_instances": [ { "id": "2078.754", "name": "Tâche 104 - Chargé de clientèle", "model": "Demande 104", "state": "ready", "assignments": { "potential_owners": { "team": { "id": "2075.2067", "name": "Chargé de clientèle", "members": [ "test3" ], "model_id": "24.2ec3d8c0-17b7-47c9-bf22-d28ba2612d4b" }, "manager_team": { "id": "2075.2074", "name": "Chargé de clientèle Managers", "members": [] } } }, "priority": "30", "display_name": "Step: Tâche 104 - Chargé de clientèle", "process_id": "2072.604", "process_name": "Demande 104:604 - ETA1, STR1", "due_date": "2022-06-07T09:23:30.379Z", "start_time": "2022-06-07T08:23:30.380Z", "at_risk_time": "2022-06-07T09:19:39.975Z" },

    You confirm that the internal group must appear in task team details ? 
    I don't know where to further investiguate.

    Best regards

    ------------------------------
    Yannick Martin
    ------------------------------



  • 16.  RE: Team retrieval service after task assignment

    Posted Tue June 07, 2022 05:14 AM
    Hi Jens,

    I was focused on REST API, but in the process portal the tasks assignments are correctly updated after 2 minutes.
    I will enable the team filtering to check if the behavior stays the same.

    Best regards

    ------------------------------
    Yannick Martin
    ------------------------------