Support Article
Declare trigger activity not found when used with standard agent
SA-5555
Summary
A declare trigger whose execute option is set to "In Background on Copy" is unable to find the execute activity rule. This only happens when the trigger was done by an agent (standard agent). When the trigger is done by an operator, the issue does not happen. An example scenario: a declare trigger is configured to execute an activity when a work object is saved and its status is updated. A work object is created and put in the queue. Then a standard agent runs, picks up the work object and update its status to Pending. The declare trigger will then say it is unable to find the activity.
Error Messages
2015-01-19 12:03:11,651 [ PegaRULES-Batch-2] [ STANDARD] [ ] [ PegaRULES:07.10] (ernal.async.BatchRequestorTask) ERROR - Batch activity "GCS-CDTestbed-Work-SR124669.PrintToLog" threw:
com.pega.pegarules.pub.PRRuntimeError: PRRuntimeError
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:706)
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivities(ThreadRunner.java:567)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivities(PRThreadImpl.java:425)
at com.pega.pegarules.session.internal.async.agent.QueueProcessor.executeBatchTask(QueueProcessor.java:259)
at com.pega.pegarules.session.internal.async.agent.QueueProcessor.execute(QueueProcessor.java:322)
at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:884)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1192)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:930)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:829)
at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:617)
at com.pega.jsr166backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:991)
at com.pega.jsr166backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:532)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.pega.pegarules.pub.generator.RuleNotFoundException: Failed to find a 'RULE-OBJ-ACTIVITY' with the name 'PRINTTOLOG' that applies to 'GCS-CDTestbed-Work-SR124669'. There were 1 rules with this name in the rulebase, but none matched this request. The 1 rules named 'PRINTTOLOG' defined in the rulebase are:
1 related to applies-to class 'GCS-CDTestbed-Work-SR124669', but were defined in rulesets which are not in your rulesetlist: 'SR124669:01-01-01'.
Current RulesetList:
Pega-ProcessCommander:07-10,
Pega-LP-ProcessAndRules:07-10,
Pega-LP-Integration:07-10,
Pega-LP-Reports:07-10,
Pega-LP-SystemSettings:07-10,
Pega-LP-UserInterface:07-10,
Pega-LP-OrgAndSecurity:07-10,
Pega-LP-DataModel:07-10,
Pega-LP-Application:07-10,
Pega-LP:07-10,
Pega-UpdateManager:07-10,
Pega-SecurityVA:07-10,
Pega-Feedback:07-10,
Pega-AutoTest:07-10,
Pega-AppDefinition:07-10,
Pega-ImportExport:07-10,
Pega-LocalizationTools:07-10,
Pega-RuleRefactoring:07-10,
Pega-ProcessArchitect:07-10,
Pega-Portlet:07-10,
Pega-Content:07-10,
Pega-IntegrationArchitect:07-10,
Pega-SystemArchitect:07-10,
Pega-Desktop:07-10,
Pega-EndUserUI:07-10,
Pega-Social:07-10,
Pega-EventProcessing:07-10,
Pega-Reporting:07-10,
Pega-UIDesign:07-10,
Pega-Gadgets:07-10,
Pega-UIEngine:07-10,
Pega-ProcessEngine:07-10,
Pega-SearchEngine:07-10,
Pega-IntegrationEngine:07-10,
Pega-RulesEngine:07-10,
Pega-Engine:07-10,
Pega-ProCom:07-10,
Pega-IntSvcs:07-10,
Pega-WB:07-10,
Pega-RULES:07-10
at com.pega.pegarules.generation.internal.vtable.VirtualRuleTableDispatchImpl.useRuleResolutionToSelectRule(VirtualRuleTableDispatchImpl.java:697)
at com.pega.pegarules.generation.internal.vtable.VirtualRuleTableDispatchImpl.resolveRule(VirtualRuleTableDispatchImpl.java:455)
at com.pega.pegarules.generation.internal.PRGenProviderImpl.get(PRGenProviderImpl.java:586)
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3261)
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:640)
... 12 more
Steps to Reproduce
1. Create a standard agent. The agent's activity does an update to a work object, for example changes a value of a property.
2. Create a trigger rule on save of the work object to run on background, this activity will be called once the work object is saved.
3. Create a work object and put it to the queue to be picked up the by the standard agent. This can be done using a flow action's post activity and set QueueForAgent.
Observe the declare trigger throw the error message in PegaRULES log
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. 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 January 31, 2016 - 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.