You are here: Reference > Rule types > Edit Inputs > Edit Input form - Completing the Java tab

Edit Input form - Completing the Java tab

  1. About
  2. New
  3. Java
  4. History
  5. More...

Enter the Java code for the edit input rule in this tab. Write the body of a Java class that has two inputs:

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 Edit Input 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 theValue to the desired form, and stores the result in the same variable, theValue.

Your Java source extends the Java class EditInput.

Type your Java directly into the Java Source text box.

Use the String.equals() Java method, not the == or != operators, to compare the value of a property to a literal string or to the value of another property.

You can use the normal Pega Platform 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")

In releases before Version 4.2SP6, a different fully qualified syntax was employed to call function rules; it still executes correctly but is deprecated.