Question

Check Agents status by Agent

We try to use the Agent Management functionality in Pega 7.2.2 by an Agent to check the status of Agents. Running by a user works fine, but when executed by an Agent we got the following error:

2019-10-06 22:42:49,162 [.PRPCWorkManager : 1] (ernal.async.BatchRequestorTask) ERROR - Batch activity "Data-SystemOperations-AgentManagement-AgentInfo.PSCCheckAgentsInNode" threw:

java.lang.NullPointerException

at com.pegarules.generated.activity.ra_action_psccheckagentsinnode_03252bf5df8baf974ee3c6ca2fde0f80.step5_circum0(ra_action_psccheckagentsinnode_03252bf5df8baf974ee3c6ca2fde0f80.java:727)

at com.pegarules.generated.activity.ra_action_psccheckagentsinnode_03252bf5df8baf974ee3c6ca2fde0f80.perform(ra_action_psccheckagentsinnode_03252bf5df8baf974ee3c6ca2fde0f80.java:159)

at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3553)

at com.pega.pegarules.session.internal.async.agent.QueueProcessor.runActivity(QueueProcessor.java:749)

at com.pega.pegarules.session.internal.async.agent.QueueProcessor.execute(QueueProcessor.java:618)

at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:1000)

at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1286)

at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1034)

at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:916)

at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:707)

at com.pega.pegarules.session.internal.async.Agent.queueBatchActivityForAgent(Agent.java:1532)

at com.pega.pegarules.session.internal.async.Agent.queueBatchActivityForAgent(Agent.java:1303)

at com.pega.pegarules.session.internal.async.AgentQueue.run(AgentQueue.java:917)

at com.pega.pegarules.session.internal.async.Agent.runAgentTask(Agent.java:947)

at com.pega.pegarules.session.internal.engineinterface.etier.impl.AsyncServant.processAsyncTask(AsyncServant.java:222)

at com.pega.pegarules.session.internal.engineinterface.etier.impl.AsyncServant.invoke(AsyncServant.java:168)

at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl._invokeEngine_privact(EngineImpl.java:331)

at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:274)

at com.pega.pegarules.session.internal.engineinterface.etier.ejb.EngineBean.invokeEngine(EngineBean.java:225)

at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)

at java.lang.reflect.Method.invoke(Method.java:508)

at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:370)

at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingThrowable(PRBootstrap.java:411)

at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingThrowable(AppServerBridgeToPega.java:224)

at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingException(AppServerBridgeToPega.java:246)

at com.pega.pegarules.internal.etier.ejb.EngineBeanBoot.invokeEngine(EngineBeanBoot.java:168)

at com.pega.pegarules.internal.etier.interfaces.EJSLocalStatelessEngineBMT_f2439d86.invokeEngine(Unknown Source)

at com.pega.pegarules.session.internal.engineinterface.etier.mdb.PRAsync.processRequest(PRAsync.java:155)

at com.pega.pegarules.session.internal.engineinterface.etier.asynchbeans.AsyncTask.run(AsyncTask.java:64)

at com.pega.pegarules.session.internal.engineinterface.etier.asynchbeans.RunnableWrapper.run(RunnableWrapper.java:71)

at com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:271)

at java.security.AccessController.doPrivileged(AccessController.java:647)

at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:797)

at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:222)

at com.ibm.ws.asynchbeans.ABWorkItemImpl.run(ABWorkItemImpl.java:206)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)

Step 5 contains the following java (as in Agent Mangement):

String nodeId = tools.getParamValue("nodeId");
String agentDetailsInJSONFormat = pega.getSystemOperationsProvider().getAgentManagementAPI().getAllAgentsInfoForNode(nodeId);

try{
tools.getPrimaryPage().adoptJSONArray(agentDetailsInJSONFormat,"pxResults");
}catch(InvalidStreamError e){
oLog.error("error while adopting agents list to clipboard"+e);
e.printStackTrace();
}

Anyone clue why the Agent will not run by an agent?

Comments

Keep up to date on this post and subscribe to comments

October 7, 2019 - 3:09am

Hello, 

Looks like your custom activity called "psccheckagentsinnode" is failing on step5. Do you what step5 is supposed to do?

October 7, 2019 - 3:23am

Hello,

like mentioned:

String nodeId = tools.getParamValue("nodeId");
String agentDetailsInJSONFormat = pega.getSystemOperationsProvider().getAgentManagementAPI().getAllAgentsInfoForNode(nodeId);

try{
tools.getPrimaryPage().adoptJSONArray(agentDetailsInJSONFormat,"pxResults");
}catch(InvalidStreamError e){
oLog.error("error while adopting agents list to clipboard"+e);
e.printStackTrace();
}

By this a list of all Agents will be collected. But like said before, when running as an interactive requestor (my own user) it works fine. When running in Batch (by an Agent) is fails.

October 10, 2019 - 11:58pm

we are facing similar issue with SendEmailNotification activity, when directly execute from designer studio using admin id, it works fine. through agent call same activity fails. pega version 8.2.2

October 17, 2019 - 2:49am

Anyone?