Calling Function rule inside a Custom function

Hi,

i have created a Function rule called “A”.

i need to use one of the Pega functions ex: contains or Replaceall inside my custom function rule “A”.

Can some one help how to acheive this?

Thanks,

Raghavender.

Hi @RaghavenderReddyL

All Function rules can be invoked as static Java methods according to the convention:

[library-ruleset-name]_[library-name].[function-name]

… where:

  • Any not-Java-safe characters are replaced with an underscore;
  • The Java classname is all lower-case; and
  • The capitalization of the Function name is preserved as the method name.

So, to call the following OTB function:

  • Ruleset: Pega-RULES
  • Library: DateTime
  • Function: CompareDates(String, String)
  • Returning: Boolean

… you can use the following code in your custom Function:

boolean localResult = pega_rules_datetime.CompareDates("...", "...");

Thanks!! Braam for the solution.