This topic shows how to list activities currently assigned to an end user by using the Case_GetActivities service action from the CaseServices_API module.
The concept of activity internal state is important to filter the kind of activity the user is looking for. There are 3 types of activities, according to their internal state (which takes into account both the bpt status of the activity and the assignment/ownership of the activity):
- The activity has been assigned to a group or a group and a user. The activity is in the ready status (BPT state).
- The activity has been assigned to a user or a user and a group. The activity is in the open status (BPT state).
- The activity is finished (closed state).
List activities assigned to an end user
As an example, let's look at the particular case of “obtaining all the activities, which haven't yet been opened, assigned to the user who is accessing the screen”:
Before following the steps, make sure you have created the UI module of your app, named <app-name>_UI.
To get a list of the activities assigned to an end user, follow these steps:
In <app-name>_UI, open Manage Dependencies, and add the following dependencies:
- Case_GetActivities entity from the CaseServices_API producer.
- ActivityFilterCriteria static entity from CM_ProcessServices_BL producer.
- UserAssigneeCriteria static entity from CM_ProcessServices_BL producer.
In the screen where you want to display the list of activities, add a Data Action.
In the data action flow, add a Case_GetActivities action.
Set the Data Type of the Output Parameter as CaseActivity_View List.
To filter the activities by the logged in end user, expand the FilterResults action input, and set UserAssigneeCriteriaId as
You can use the suggestion AssignedToMe.
After these steps, display the results to end users by using the output parameter as the source of a Table, List, or Table Records.