When i try to use this function inside rule event it will throw an below error,"(ERROR:EVAL:@reason=index)"and process status is changed to "Paused By Exception"How do i resolve this?P.S. :- Value of pv!ppid_int is set to tp!id (also tried with ri! and pp!id)
Discussion posts and replies are publicly visible
Firstly, when you are indexing a particular field from queryProcessAnalytics().data, that field will contain an array of elements. So, your if condition will return a list of true and false. Means it will return a list of boolean elements.
Store your queryProcessAnalytics().data in a local variable, say local!data. Then use the local variable inside your if condition as, if( index(local!data,"c31","") =1, true, false ) put the entire code inside a load().
I tried this way also but getting same error and process paused by exception.Thanks!!
Don't put your load and a!queryProcessAnalytics().data inside if condition. What I meant was: load( local!data:a!queryProcessAnalytics().data,
then start your if conditions and everything else.......
if(/*your condition*/,
false,
if(/*Your Condition*/,
true,
false
)
) ) Your entire code should be inside load. That means your code should start with load()
I have tried this way still facing same issue
Hi Shubham Aware (shubhama),
Could you try using this code:
if( rule!RCOS_PFM_nullCheck( ri!ppid_int ), {}, index( index( a!queryProcessAnalytics( report: cons!RCOS_PFM_CUSTODIAN_TASK_REPORT, contextProcessModels: cons!RCOS_PFM_CUSTODIAN_PROCESS_MODEL, query: a!query( pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 1, sort: a!sortInfo( field: "c32", ascending: false ) ), filter: a!queryFilter( field: "c28", operator: "=", value: ri!ppid_int ) ) ).data, "c31", "" ), 1, {} ) = "1" )
If you still get the same issue, first test the result executing the queryprocessanalytics rule, to see if it's ok, then with the first and then the last one, like debugging your results.