Functions Editor
Use the Functions Editor to develop Java methods that can be called from rule actions and conditions.
Each function contains the same fields:
Function Name—A name for the function.
Description—A brief description of the function.
Implementation—Either Java or Groovy.
Example
This function is used to compare dates. It would be configured as follows:
Name: compareDates Description: This function is required to compare dates. Implementation: import java.util.Date; import java.text.SimpleDateFormat; function int _GRS_compareDate(String a, String b) { // Compare two dates and returns: // -99 : invalid/bogus input // -1 : if a < b // 0 : if a = b // 1 : if a > b SimpleDateFormat dtFormat = new SimpleDateFormat(“dd-MMM-yyyy”); try { Date dt1= dtFormat.parse(a); Date dt2= dtFormat.parse(b); return dt1.compareTo(dt2); } catch (Exception e) { return -99; } }
For user-supplied classes, the .jar file must be in the CLASSPATH for both GRAT and the GRE.
This page was last edited on August 30, 2019, at 20:05.
Comments or questions about this documentation? Contact us for support!