queryProcessAnalytics with Refresh Interval

Certified Senior Developer

Hello All,

We need to show the generated docs in the interface, and if there is any error in the document generation need to show an error to the user.

Document creation takes time so we created the PM to generate the document and used the process report for the generate document process model.

We are using queryProcessAnalytics in the interface with a refresh variable to check the "generate document" process status.

We need to stop re-querying the queryProcessAnalytics if any error is received from the process report, used the below code to achieve this.

local!processReportData:

a!refreshVariable(

value: if(

true(), /*Some conditions*/
a!queryProcessAnalytics(
report: <<process report>>,
contextProcessModels: <<process model to be checked>>
query: a!query(
/*
c1 - processStatus (1=Completed)
c3 - process Id
c6 - errorMessage
*/
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: a!queryFilter(
field: "c3",
operator: "=",
value: ri!reportProcessId
)
),
pagingInfo: a!pagingInfo(1, 1)
)
).data,
null
),
refreshInterval: if(
or(
isnull(fv!value),
tointeger(tostring(index(fv!value, "c1", 0))) = 1,
not(
rule!Empty(tostring(index(fv!value, "c6", null)))
)
),
null,
0.5
)
)

all the refresh interval conditions are true and it should not execute the queryProcessAnalytics but it is not happening and local!processReportData is getting refreshed.

Please let me know if anyone tried to stop refreshing the queryProcessAnalytics with a refresh interval.

Thank You,

Sneha.

  Discussion posts and replies are publicly visible