Tip: Interface patterns give you an opportunity to explore different interface designs. Be sure to check out How to Adapt a Pattern for Your Application.
Display the tasks for a user in a Read-Only Grid and allow them to click on a task to navigate to the task itself.
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:
a!queryProcessAnalytics()
to query task dataFor this recipe, you'll need a constant pointing to a task report. Follow these steps to create a task report with the default columns and associate it with a constant:
The main expression uses a supporting constant constant, so let's create them first.
UC_TASKS_FOR_USER_REPORT
: Constant of type Document whose value is Tasks for User A
Now that we've created the supporting rules, let's move on to the main expression.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
a!localVariables(
local!pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: -1
),
local!report: a!queryProcessAnalytics(
report: cons!UC_TASKS_FOR_USER_REPORT,
query: a!query(pagingInfo: local!pagingInfo)
),
a!gridField(
label: local!report.name,
instructions: local!report.description,
data: local!report.data,
columns:
a!forEach(
items: local!report.columnConfigs,
expression: a!gridColumn(
label: fv!item.label,
sortField: fv!item.field,
align: if(fv!item.configuredFormatting = "DATE_TIME", "END", "START"),
value: if(
fv!item.configuredFormatting = "TASK_STATUS",
index(
{
"Assigned",
"Accepted",
"Completed",
"Not Started",
"Cancelled",
"Paused",
"Unattended",
"Aborted",
"Cancelled By Exception",
"Submitted",
"Running",
"Error"
},
/* Task status ids start with 0, so add one to reach the first index */
tointeger(index(fv!row, tointeger(fv!item.field) + 1, -1 )),
"Other"
),
if(
fv!item.configuredDrilldown = "TASK_DETAILS",
a!linkField(
links: a!processTaskLink(
label: index(fv!row, fv!item.field, {}),
task: index(fv!row, fv!item.drilldownField, {})
)
),
index(fv!row, fv!item.field, {})
)
)
)
),
rowHeader: 1,
pageSize: 20
)
)
Display a User's Tasks in a Grid With Task Links