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 Idc6 - 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
docs.appian.com/.../recipe-refresh-until-asynchronous-action-completes.html
Thank you Stefan for the response.
We are also stopping the refresh based on the variable returned from the process report but wondering why it's refreshing the process report even refresh interval is null.
Is that refresh then still in an interval, or on user interaction? Are you aware that the parameter refreshOnReferencedVarChange is set to true by default?
Hi Sneha,
What I see is that your value for the IF() inside the local!processReportData value is always true(), the you will always query the process report.
What I would do is:
1.Refresh is Interval
2. No UI local variables are references in the a!refreshVariable and referenced ri will not get refresh in the UI
Thank you for the response.
Yes "IF" condition is true and I assumed process report data will not refresh as the refresh interval condition is false.
Let me try this approach. Thank You