Use SAIL to display information about instances of a specific process model.
This design pattern is not recommended for offline interfaces because reflecting immediate changes in an interface based on user interaction requires a connection to the server.
This scenario demonstrates:
How to use a!queryProcessAnalytics() to query process data
How to display process report data in a grid
How to use the process report's configured formatting to customize display
How to us a!forEach() to dynamically create a grid's columns
For this recipe, you'll need a constant pointing to a process report and a process model that has been at least started a few times. If you don't have a process model, you can follow the Process Modeling Tutorial. Once you have some processes, you can follow these steps to create a process report with the default columns and associate it with a constant:
From your application, click New, and then click Process Report.
Select Create from scratch.
Name the report Processes for Process Model A.
Under Report Type, select Process.
Under Context Type, select Processes by process model.
Specify a folder to contain the report, and then click Create & Edit.
The process report opens in a new tab with the Choose Process Models dialog open.
In the Choose Process Models dialog, select the desired process model, and then click OK.
The main expression uses two supporting constants, so let's create them first.
UC_PROCESSES_FOR_PM_REPORT: Constant of type Document whose value is Processes for Process Model A.
UC_PROCESS_MODEL: Constant of type Process Model whose value is the process you created.
Test It Out
Sort and (if you have enough processes) page your grid
In another window or tab, complete a process and then refresh your interface to see the status change
Notable Implementation Details
This example shows how to specially handle one kind of formatting, but the same pattern can be applied to provide a SAIL interpretation of other process report configurations.
To display text or image columns, the expression uses the showWhen parameter. When looping through the process report data, the column associated with status will show up as an icon, while all other grids show up as a text column.