Support Article
Activity is failing to find function after import
SA-30587
Summary
On some nodes, an imported activity rule is inoperative with Pega 7.1.7.
Error Messages
During compilation of the activity, this error is seen:
The method functionName(String, String, String, String) is undefined for the type rulesetName_libraryName
During attempt to use the activity, this one is seen:
java.lang.NoSuchMethodError: com/pegarules/generated/rulesetName_libraryName.functionName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
at com.pegarules.generated.activity.ra_action_activityName_a6ee1b7a4f61c2f6bd35dda5fb28aaec.step10_circum0(ra_action_activityName_a6ee1b7a4f61c2f6bd35dda5fb28aaec.java:865)
The method functionName(String, String, String, String) is undefined for the type rulesetName_libraryName
Steps to Reproduce
- Include an earlier version of an activity already exist that does not refer to a private function.
- Import a newer version of the activity that does refer to a new function that's also being imported.
- During the import, have an asynchronous process, for example an agent, attempt to use the activity.
Root Cause
The import process compiles the function library, but if the asynchronous process refers to the activity before the function compilation is complete, the activity compilation fails because the function isn't available in the library yet.
Furthermore, after the activity compilation fails, since the error message is stored in the activity compilation log file, the activity will be inoperative until the activity is resaved to cause a fresh compilation.
Resolution
For future imports, either guarantee that the rules being imported won't be referenced during the import process, or divide the import into several zip files, so that the function is imported in one zip, and when that import is complete, import the zip that contains the activity.
For the currently inoperative activity, resave the activity with the revalidate-and-save tool, in order to clear the error message.
Published November 24, 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.