Support Article
Declare trigger is giving runtime error
SA-38594
Summary
Users observe that Declare triggers configured to run in the background are causing a runtime error.
Error Messages
2017-05-18 06:32:04,543 [ PegaRULES-Batch-5] [ STANDARD] [ ] [ PegaRULES:07.10] (ernal.async.BatchRequestorTask) ERROR - Batch activity "WorkClass.DeclareTriggerName" threw:
com.pega.pegarules.pub.PRRuntimeError: PRRuntimeError
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:707)
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivities(ThreadRunner.java:568)
Steps to Reproduce
- Create a Declare Trigger which applies to a class associated to a work object.
- On a work object resolution or cancellation (when flow end) invoke the trigger on commit.
- Configure trigger execution mode to run in back ground.
- Review the Pega logs.
Root Cause
The root cause of this problem is a defect in Pegasystems’ code/rules.
The declare trigger takes in the ruleset stack of the access group for the batch requestor instead of the operator that creates the work object.
Resolution
This issue is resolved through the following local-change:
1. Go to the activity that the declare trigger calls.
2. Add a parameter pzUseCurrentAccessGroupForChild. An example here, the activity name is PrintToLog:
2) Go to the declare trigger and set the parameter to true.
Published July 10, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.