Enter the Java code for the edit input rule in this tab. Write the body of a Java class that has two inputs:
Java.lang.String
variable named theValue
itsType
.The value of itsType
corresponds to the Type of the property. It matches one of nine predefined Java constants:TYPE_TEXT
, TYPE_IDENTIFIER
, TYPE_PASSWORD
, TYPE_DATETIME
,TYPE_DATE
, TYPE_TIMEOFDAY
, TYPE_TRUEFALSE
, TYPE_NUMBER
or TYPE_DECIMAL
.
In the Java code, convert the initial value to a desired resulting format. If the input value of theValue
is already in the correct format, your Java code can return it unchanged.
After you save the Edit Input form, the system appends the statement:
return theValue;
to your source code, and also adds the appropriate class wrapper declarations.
See More about Function rules for additional guidance on Java code that you can use here.
Field |
Description |
Java Source |
Enter Java source that converts the value of the string Your Java source extends the Java class Type your Java directly into the text box, or click () to start your workstation Java editor or Notepad. Enter your Java using the editor, then exit completely from the editor to return the edited file to Pega 7. See open authoring for instructions on setting up a Java editor. Note: Use the You can use the normal Pega 7 syntax to call a function rule: ruleset_library.FunctionName(arg1, arg2, arg3) where the ruleset and library name are in lowercase but the function name is in exact case. For example: double d_result = pegarules_math.Sqrt("4") Note: In releases before Version 4.2SP6, a different fully qualified syntax was employed to call function rules; it still executes correctly but is deprecated. |