Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

How to access PublicAPI through the Rule-Utility-Function

Updated on September 13, 2021

Summary

Function rules (Rule-Utility-Function rule type) extend the power of Process Commander expressions. An expression can contain calls to built-in, standard, and custom functions.

Use a function rule to define a Java function that is accessed through rule resolution. Function rules can be referenced in expressions and directly in Java.

This PublicAPI is the supported public interface to the rules engine.

The keyword tools identifies the PublicAPI interface in Java calls. The PublicAPI includes the following classes:

com.pega.pegarules.pub.*; // Classes common to most public interfaces.
com.pega.pegarules.pub.clipboard.*; //Clipboard, Page, and Property
com.pega.pegarules.pub.context.*; // Requestor, Thread, and Node
com.pega.pegarules.pub.database.*; // Relational database access
com.pega.pegarules.pub.dictionary.*; // Dictionary validation interface
com.pega.pegarules.pub.generator.*; // Java generation
com.pega.pegarules.pub.pal.*; // Reports statistics about a Thread
com.pega.pegarules.pub.runtime.*; //Activities, Models, Whens, Streams
com.pega.pegarules.pub.util.*; // Miscellaneous utilities

For performance reasons, you may not want to pass PublicAPI through an activity. Instead, you can access the PublicAPI through function rules.

 

Suggested Approach

You can access PublicAPI facilities by Including the following Java code to a function rule::

PublicAPI api = (PublicAPI) ThreadContainer.get().getPublicAPI();

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us