Raising the Priority of a Work Item
Both the Process Monitor and Claim Breakdown dashboards demonstrate a simple way of raising the priority of selected work items. This provides an example of how you can both monitor BPM data, and then react to and update that data, in real-time (often referred to as "closing the loop").
The user interface to raise a work item's priority is provided as part of the Offered Work report on the Process Monitor dashboard. When the user clicks the Raise Priority arrow for a specific activity, a Priority has been raised message is displayed, and the work item's priority is raised by 10.
To provide this functionality:
- In the Jaspersoft Studio AMX-BPM Statistics Reports project, in the Work report, the Raise Priority column of the report table contains the arrow_up.png graphic. This graphic is configured as a RemoteAnchor hyperlink.
- When the user clicks the arrow for a particular activity (work item), the click event in the getTeamUnallocatedReport function (in jaspershowcase.js) is invoked. This event calls the setPriority function in Jaspershowcase.java, passing the WorkItemId of the selected activity as a parameter.
function getTeamUnallocatedReport(v) { unallocated = v.report( { resource : pathRoot + "Work", container : "#unallocated", linkOptions : { events : { "click" : function(ev, link) { if (link.type == "RemoteAnchor") { setPriority(link.parameters.WorkItemId); } } } } } ) }
- setPriority invokes the BPM Web Client API PrioritiseWorkItem method to increase the work item's priority by 10.
/** * This method is called by any dashboard which wishes to modify the work * item priority of an item. Within the demonstration it is used by * Jaspersoft page hyperlinks */ public static void setPriority(String workItemId) { Set<ManagedId> items = new HashSet<ManagedId>(); items.add(new ManagedId(Long.parseLong(workItemId), -1)); BPMWebClientService.getInstance().execute( new PrioritiseWorkItem(items, 10, false), new AsyncCallback<VoidResult>() { @Override public void onFailure(Throwable caught) { Window.alert("Failed to change Work Item Priority. Original error message: "+caught.getMessage()); } @Override public void onSuccess(VoidResult result) { Window.alert("Priority has been raised"); } }); }
Authorization
To be able to execute the PrioritiseWorkItem method the calling user - in this case, the user who is logged in to the Openspace session - must have permission to use the changeAnyWorkItemPriority or changeAllocatedWorkItemPriority system action. Access to this functionality should be restricted to the team leaders, Leon Court and Richard Cresswell.
This is configured in TIBCO Business Studio, in the CompanyOrganizationModel project:
- A privilege, Privilege1, is defined.
- Privilege1 is associated with the Change Any Work Item Priority system action.
- Privilege1 is assigned to the TeamManagers group.
At runtime, Leon Court and Richard Cresswell inherit Privilege1 as a result of their membership of the TeamManagers group.
They are therefore authorized to execute the PrioritiseWorkItem method when they click the Raise Priority arrow for a specific activity in the Offered Work report.