Support Article
Pega include directive is not working in HTML rule
SA-22603
Summary
Pega include directive is not working in HTML rule. It is looking for the stream rule in the @baseclass.
Error Messages
Could not find a rule when appending a stream com.pega.pegarules.pub.generator.RuleNotFoundException: Failed to find instance @baseclass.YYYY of type Rule-HTML-Section.
Steps to Reproduce
1. Create a HTML rule 'XXXX', which uses the pega include directive to include the 'YYYY' in the work class.
2. Create an activity and call Show-HTML to show the 'XXXX'.
3. Run the activity.
Root Cause
This is working as per design. The activity call with Show-HTML with include directive, will work for the stream rules in @baseclass only.
Resolution
Perform the following local-change:
1. Instead of the include directive, modify the html to include the below script:
<%
StringMap keys = new HashStringMap();
keys.putString("pxObjClass", "Rule-HTML-Section");
keys.putString("pyStreamName", "SectionName");
keys.putString("pyClassName", "ClassName");
String stream = tools.getStream(keys, null);
// Append the stream to
out.println(stream);
%>
StringMap keys = new HashStringMap();
keys.putString("pxObjClass", "Rule-HTML-Section");
keys.putString("pyStreamName", "SectionName");
keys.putString("pyClassName", "ClassName");
String stream = tools.getStream(keys, null);
// Append the stream to
out.println(stream);
%>
2. Create an Activity and call the Show-HTML, to call the above HTML rule, using the step page of the work class.
Published May 4, 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.