Hello team,

in a few of the functions, we see that there are many other data types to be passed as input apart from String, boolean, etc.
Can someone help explain whats the use, how do they work and what do we need to pass.
e.g.
Function -> ApplyModel. Param Name -> ThisActivity, Java Type -> Activity
Function -> Obtain Values Param Name -> tools, myStepPage, Java Type -> PublicAPI and Clipboard Page

I am aware that we can pass tools keyword when we are unsure of the param πŸ˜‰ but how does it work?

Thanks in advance..

@ospteam

    Hi Mahi, I too had this question when I started to work with functions. πŸ˜…

    Here are my observations on this:

    In Java,  We have two different data types - Primitives and Non Primitives.
    Primitive  - byte, short, int, long, float, double, boolean and char.
    Non-primitive -  String, Arrays, and Classes  - User- defined datatypes

    Some functions require to pass primitive data types and some OOTB function requires passing nonprimitive data types such as objects of custom classes based on the operation that function performs.

    Some of the Non-primitive params in Pega functions :

    The most common one is PublicAPI. This expects the object with the below class definition.

    But For this param, we will usual using tools keyword. But Why? : I have answered that below part.

    Other common non-primitive params in Pega are :
    ClipboardPage - Pega Page
    Clipboard Property - Pega Property
    Object - Any Class Object

    mahi I am aware that we can pass tools keyword when we are unsure of the param πŸ˜‰ but how does it work?

    We know that Pega generates Java for each rule. When we inspect the generated Java code for a rule, we can see a class is created with the unique key similar to pzInskey of the rule and It has a constructor that initializes tools with the object of datatype PegaAPI.

    Current Thread information, methods, and other important values are defined in the object.

    To pass current rule context Information or other context information to that function, we used to send tools keyword to that function. This object will be passed to the assembler at runtime.

    I hope it helps you a bit!

    P.S : Anyone, Correct me if I am wrong anywhere ! πŸ˜ƒ

    a month later
    Write a Reply...

    -An Initiative Of OneStopPega- Love our work? Support UsπŸ–€