If we need to write java code and it has potential to be reused then we should write that java code as function.

Let’s take an example where application is expected to display the Pega date value which usually in mmddyyy format into a more readable format like mm-dd-yyyy.

Let’s call this function as “FormatDate”. This function will take date as the input parameter and will return formatted string.


Parameters Tab

Input parameters defined in Parameters tab can be used as it is in java code written in Java tab as shown below.

Java Tab

This is the place where actual java code is written.