Support Article
RuleNotFoundException when unit testing flow
SA-29470
Summary
A Fail error message is thrown when playing back a recorded flow test case.
Error Messages
Caused by: com.pega.pegarules.pub.generator.RuleNotFoundException: Failed to find a 'RULE-OBJ-ACTIVITY' with the name 'WORK-.NEWCOVERED' that applies to 'ORG-Work'; no rules with this name were found in the rulebase.
at com.pega.pegarules.generation.internal.vtable.ruleres.VirtualTableResolver.checkCandidateList(VirtualTableResolver.java:698)
at com.pega.pegarules.generation.internal.vtable.ruleres.VirtualTableResolver.resolveRule(VirtualTableResolver.java:151)
at com.pega.pegarules.generation.internal.vtable.VirtualTableImpl.resolveRule(VirtualTableImpl.java:309)
at com.pega.pegarules.generation.internal.PRGenProviderImpl.get(PRGenProviderImpl.java:474)
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3493)
at com.pegarules.generated.callActivity_071017_xvj4o_pyNDBZ4Gy293rekg.callActivity07_10_17(callActivity_071017_xvj4o_pyNDBZ4Gy293rekg.java:122)
at com.pegarules.generated.callActivity_071017_xvj4o_pyNDBZ4Gy293rekg.invoke(callActivity_071017_xvj4o_pyNDBZ4Gy293rekg.java:82)
at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:133)
at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:110)
at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:9017)
at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflection(LibrarySupport.java:181)
at com.pegarules.generated.pega_rules_utilities.callActivity(pega_rules_utilities.java:1784)
at com.pegarules.generated.activity.ra_action_flowplaybackstep_1bd35655623c29fb19b1c100eba1517a.step4_circum0(ra_action_flowplaybackstep_1bd35655623c29fb19b1c100eba1517a.java:483)
at com.pegarules.generated.activity.ra_action_flowplaybackstep_1bd35655623c29fb19b1c100eba1517a.perform(ra_action_flowplaybackstep_1bd35655623c29fb19b1c100eba1517a.java:134)
Steps to Reproduce
Replay the recorded test case.
Root Cause
A defect in Pegasystems’ code or rules. The pega_rule_utilities.callActivity function assumes the parameter pyActivity contains a simple activity name. If the original execution of the command being replayed actually used the valid reference to <classname>-.<activityName>, the function does not know to strip off the leading class name and instead looks for a function with name <classname>-.<activityName>.
Resolution
Apply HFix-30011. The hot fix strips off any leading class name from the input parameter.
Published October 27, 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.