BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

BPM REST - task query for already assigned task for expert users

  • 1.  BPM REST - task query for already assigned task for expert users

    Posted 09/16/20 12:38 PM
    Edited by Bernd Varga 09/28/20 05:44 AM
    Hi community,

    we should now integrate the expert/manager team functionality with the BPM REST API.

    To verify it, I created a user task and assigned it to a dynamic user group.

    tw.local.approvalTeam = tw.system.org.team.REMOTE_APPROVAL.asTeam();
    var candidates = tw.local.instance.approvalCandidates;
    for(var i=0; i < candidates.listLength; i++){
      tw.local.approvalTeam.name = tw.local.approvalTeam.name + " " + candidates[i].key;
      tw.local.approvalTeam.members[tw.local.approvalTeam.members.listLength] = candidates[i].key;
    }
    tw.local.approvalTeam.managerTeam = tw.system.org.team.TestExpertTeam.name;


    During runtime the manager team is set:

    GET /rest/bpm/wle/v1/process/4697 ...
    { "activationTime": "2020-09-16T12:19:30Z", "atRiskTime": "2020-09-16T13:18:48Z", "displayName": "Step: prompt for remote authorisation", "startTime": "2020-09-16T12:19:30Z", "state": "STATE_CLAIMED", "piid": "4697", "processInstanceName": "EndOfDay:4697", "priorityName": "Normal", "data": { }, "actions": null, "teamDisplayName": "REMOTE_APPROVAL TSTA01 TSTA05 TSTA04", "teamName": "fna/WrmV6Eg3ljTKD6Luy095wDDzQ8vb7oABtap4f6A= (1670)", "teamID": 1670, "managerTeamDisplayName": "TestExpertTeam", "managerTeamName": "TestExpertTeam_T_863481c4-32a3-46bf-99bd-ca7c513bcf4a.9e56a119-b677-4eee-b6a8-a6f567a98e6a", "managerTeamID": 1667, "tkiid": "51712", "name": "prompt for remote authorisation", "status": "Received", "owner": "TSTA05", "assignedTo": "TSTA05", "assignedToDisplayName": "TSTA05", "assignedToID": 1049, "assignedToType": "user", "dueTime": "2020-09-16T13:19:30Z" }


    And the dynamic team contains the members:

    GET /rest/bpm/wle/v1/group/1667
    { "status": "200", "data": { "groupID": 1667, "groupName": "TestExpertTeam_T_863481c4-32a3-46bf-99bd-ca7c513bcf4a.9e56a119-b677-4eee-b6a8-a6f567a98e6a", "displayName": "TestExpertTeam", "description": "TestExpertTeam", "deleted": false, "members": [ "TSTA01" ], "managerGroupName": null } }

    Current we use following query request to evaluate tasks for the current user:

    PUT /rest/bpm/wle/v1/tasks?filterByCurrentUser=false&calcStats=false
    { "name":"TasksForBusinesskeySearch", "interaction":"claimed_and_available", "fields":[ "taskDueDate", "taskId", "taskSubject", "taskStatus", "taskPriority", "taskIsAtRisk", "taskAtRiskTime", "taskClosedDate", "taskActivityName", "assignedToUser", "assignedToRoleDisplayName", "instanceName", "instanceId", "instanceStatus", "instanceProcessApp", "instanceSnapshot" ], "aliases": [ ], "sort":[ { "field":"taskDueDate", "order":"ASC" } ], "conditions":[ ], "organization":"byTask", "size":2000, "shared":true, "teams":[ ] }​


    If the user TSTA01 queries for tasks, this management task is not returned! But in the ProcessPortal displays the assigned task to TSTA05 for manager user TSTA01! And it the ProcessPortal it is possible to reassign the task.

    We should integrate similar functionality as in the ProcessPortal also on BPM REST API.
    Is there a possible to evaluate for manager/expert users assigned task from other user?

    Thanks, for any advice!

    BR



    ------------------------------
    Bernd Varga
    ------------------------------