Support Article
"Queue" activity method throws NullPointerException
SA-39269
Summary
Calling an activity through the "Queue" method in another activity results in a NullPointerException.
The same activity runs without issue when called through a "Call" method.
Error Messages
2017-06-07 15:25:48,285 [ PegaRULES-Batch-43] [ STANDARD] [ ] [ App:01.01.01] (ernal.async.BatchRequestorTask) ERROR user - Batch activity "ORG-DSM-Work.CallRealTimeAccInfo" threw:
com.pega.pegarules.pub.PRRuntimeError: PRRuntimeError
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:712)
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivities(ThreadRunner.java:572)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivities(PRThreadImpl.java:458)
at com.pega.pegarules.session.internal.async.agent.QueueProcessor.executeBatchTask(QueueProcessor.java:257)
at com.pega.pegarules.session.internal.async.agent.QueueProcessor.execute(QueueProcessor.java:321)
at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:967)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1266)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1015)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:908)
at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:684)
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:745)
Caused by: java.lang.NullPointerException
at com.pegarules.generated.activity.ra_action_getrealtimeacctinfo_test_1654d8b6b5dd9f7208ffa8a213738624.step6_circum0(ra_action_getrealtimeacctinfo_test_1654d8b6b5dd9f7208ffa8a213738624.java:601)
at com.pegarules.generated.activity.ra_action_getrealtimeacctinfo_test_1654d8b6b5dd9f7208ffa8a213738624.perform(ra_action_getrealtimeacctinfo_test_1654d8b6b5dd9f7208ffa8a213738624.java:154)
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3510)
at com.pega.pegarules.session.internal.mgmt.Executable.invokeActivity(Executable.java:10587)
at com.pegarules.generated.activity.ra_action_callrealtimeaccinfo_91b35ff302c60b417c8ffc1e444db0aa.step2_circum0(ra_action_callrealtimeaccinfo_91b35ff302c60b417c8ffc1e444db0aa.java:267)
at com.pegarules.generated.activity.ra_action_callrealtimeaccinfo_91b35ff302c60b417c8ffc1e444db0aa.perform(ra_action_callrealtimeaccinfo_91b35ff302c60b417c8ffc1e444db0aa.java:86)
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3510)
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:646)
... 12 more
Steps to Reproduce
Use Queue method to fire another activity.
Root Cause
An issue in the custom application code or rules
The queued activity makes use of the Primary page, for example, there is a reference in it to Primary.foo), and the Help for the Queue command states:
The activity does not receive a step page or a primary page.
Resolution
Perform the following local-change:
Instead of referencing Primary.Foo in the called activity, put the value of Foo into a parameter call PFoo, and pass PFoo to the queued activity.
Published August 16, 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.