Question
Activity Queue method rulesetstack problem
Hi
We have a service package and it calls an activity which name is resumeDigitalApprove. Current definition of activity is below. It works fine but we have some performance issues. Respone times are not good enough for client expectations.
For kind of these reasons we need to change this activity and tried to use Queue method. Our new design is below. The goal is return an immediately response to client and doing activities job in background.
At second step Queue method calls resumeDigitalApproveG(newly created but copy of first one)
Both activities security tabs are configured to "Allow direct invocation from the client or a service Checked"
So when we execute that activity from service package and it throws an exception. The log result of this operation is below. Our access groups ruleset stack is missing. Error message demonstrates only default ruleset stack.
So we think that if we able to set our requestor context properly, we can call the second activity. We need your suggestions.
Service package -> resumeDigitalApprove ->Queue resumeDigitalApproveG
2020-12-18 09:48:30,901 [ WebContainer : 2] [ STANDARD] [ CLoanFW:01.01.27] (nk_FW_CLoanFW_Int_Loan_.Action) INFO kaopewasd3|10.215.13.49|SOAP|HTKOperations|Services|ResumeDigitalApprove|AC625BDBBCA64667A24EF4381A073BA37 - TESTTEST3 2020-12-18 09:48:30,961 [.PRPCWorkManager : 2] [ STANDARD] [ PegaRULES:07.10] (ernal.async.BatchRequestorTask) ERROR - Batch activity "IsBank-FW-CLoanFW-Int-Loan-.ResumeDigitalApproveG" 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) at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivities(PRThreadImpl.java:427) at com.pega.pegarules.session.internal.async.agent.QueueProcessor.executeBatchTask(QueueProcessor.java:256) at com.pega.pegarules.session.internal.async.agent.QueueProcessor.execute(QueueProcessor.java:319) at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:917) at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1177) at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:926) at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:825) at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:650) at com.pega.pegarules.session.internal.async.Agent.runBatchTask(Agent.java:816) at com.pega.pegarules.session.internal.engineinterface.etier.impl.AsyncServant.processAsyncTask(AsyncServant.java:229) at com.pega.pegarules.session.internal.engineinterface.etier.impl.AsyncServant.invoke(AsyncServant.java:166) at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl._invokeEngine_privact(EngineImpl.java:315) at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:263) at com.pega.pegarules.session.internal.engineinterface.etier.ejb.EngineBean.invokeEngine(EngineBean.java:225) at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:338) at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingThrowable(PRBootstrap.java:379) at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingThrowable(AppServerBridgeToPega.java:216) at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingException(AppServerBridgeToPega.java:238) 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:269) at java.security.AccessController.doPrivileged(AccessController.java:273) at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:795) 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:1862) Caused by: com.pega.pegarules.pub.generator.RuleNotFoundException: Failed to find a 'RULE-OBJ-ACTIVITY' with the name 'RESUMEDIGITALAPPROVEG' that applies to 'IsBank-FW-CLoanFW-Int-Loan-'. There were 1 rules with this name in the rulebase, but none matched this request. The 1 rules named 'RESUMEDIGITALAPPROVEG' defined in the rulebase are: 1 related to applies-to class 'IsBank-FW-CLoanFW-Int-Loan-', but were defined in rulesets which are not in your rulesetlist: 'CLoanFWInt:01-01-17'.
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.ruleres.VirtualTableResolver.throwDetailedRuleNotFoundException(VirtualTableResolver.java:711) at com.pega.pegarules.generation.internal.vtable.ruleres.VirtualTableResolver.resolveToContainer(VirtualTableResolver.java:390) at com.pega.pegarules.generation.internal.vtable.ruleres.VirtualTableResolver.resolveRule(VirtualTableResolver.java:154) at com.pega.pegarules.generation.internal.vtable.VirtualTableImpl.resolveRule(VirtualTableImpl.java:254) at com.pega.pegarules.generation.internal.PRGenProviderImpl.get(PRGenProviderImpl.java:474) at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3358) at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:641) ... 33 more
you can try below refactoring ways.
1. you can merge step 1 and 2 with a single step for obj-open by handle with when
2.you can call a DT for prop sets in 3,4 and 5
3.remove commented steps
4. you can keep exit activity on jump rather than a separate step
as this refactoring reduce the number of steps in current activity the final out come will give less no of lines of java and may execute faster than the current version of the rule.