Displaying Process Status (Statistical Data) for a Particular Claim (Case Data)
The Claim Breakdown dashboard demonstrates how you can access information about a particular case (in this example, a claim) from the case data store in one report, and then use that information in another report to extract and display statistical data about the case (in this example, about the current process instance and work item) from the BPM database.
In the Claims Breakdown dashboard, if the user clicks Details to display the Claims Hot List, then clicks View Audit for one of the Top 5 Highest Claims, a Claim Status report for that claim is displayed. This report:
- displays statistical data (from the BPM database) about the current process instance and work item associated with the selected claim ID.
- allows the user to raise the priority of that work item.
To provide this functionality:
-
In the Jaspersoft Studio ClaimsModelReports project, in the DisplayTopClaims report, the View Audit column of the report table contains the audit.png graphic. This graphic is configured as a ReportExecution hyperlink.
-
When the user clicks the audit button for a particular Claim Id, the click event in the doTopClaimsReport function (in claimdashboard.js) is invoked.
function doTopClaimsReport(v) { topclaims = v.report({ resource: pathRoot+"DisplayTopClaims", container: "#claimtop5", params: context, linkOptions: { events: { "click": function (ev, link) { callLookupCaseRef(link.parameters.CLAIM_ID, function reloadClaimStatus(caseRef) { removeClassFromElement (document.getElementById("claim_status"),'hide'); $('#claim_status_text').text ("Claim Status for: "+link.parameters.CLAIM_ID); claimstatus.params({ "CASE_REFERENCE": [caseRef] }).run(); } ); } } }, error: handleError } ); }
This event:
- calls callLookupCaseRef (in osApi.js). That function uses the BPM REST API
findbyid operation to get the case reference associated with this claim Id.
openspaceClientApi.prototype.lookupCaseRef = function (id, onSuccess) { var baseUrl = this.host + "/bpm/rest/globaldata/model/com.example.claimmodel.Claim/2.0.0/findbyid"; var callback = function (data) { data = JSON.parse(data); onSuccess(data.caseReference); }; var payload = "<xml-fragment><casePayload><![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?><claimmodel:ClaimElement xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:claimmodel=\"http://example.com/claimmodel\" xsi:type=\"claimmodel:Claim\"><claimID>"+id+"</claimID> </claimmodel:ClaimElement>]]></casePayload></xml-fragment>"; call(baseUrl, callback,"POST",payload);
- passes that case reference as a parameter to the reloadClaimStatus function, which loads the Claim Status report.
- calls callLookupCaseRef (in osApi.js). That function uses the BPM REST API
findbyid operation to get the case reference associated with this claim Id.
- The Claim Status report:
- queries the BPM database (the ec_proc_template table) and displays the details of the current work item associated with that case reference.
- provides the ability to
raise the work item priority when a user clicks the
Raise Priority arrow. (The report calls the setPriority function in Jaspershowcase.java, passing the WorkItemId of the selected activity as a parameter, in the same way as the Offered Work report on the Process Monitor dashboard.)
function doClaimStatusReport(v) { claimstatus = v.report( { resource: pathRoot+"ClaimStatus", container: "#claimstatusdiv", linkOptions: { events: { "click": function (ev, link) { setPriority(link.parameters.WorkItemId); } } }, error: handleError, } ); }