PeopleSoft - PeopleTools Configurations Records or Meta Tables

PeopleSoft - PeopleTools Configurations Records or Meta Tables PeopleSoft records/metadata tables, often referred to as "meta tables," store information about various PeopleSoft objects and configurations.  1. Object Definition Tables: PSRECDEFN : Contains definitions of records (tables) used in the application, including details like record type and description. PSDBFIELD : Stores field definitions, detailing the attributes of each field such as data type and length. PSPNLGROUP : Holds information about components, which are collections of pages that function together. PSPNLDEFN : Contains definitions of pages (interfaces) within the application. PSMENUDEFN : Stores menu definitions, organizing how components are presented to users. 2. Security Tables: PSOPRDEFN : Maintains user profile information, including user IDs and associated roles. PSROLEDEFN : Defines roles that group together permissions for easier security management. PSCLASSDEFN : Holds permission li...

Peoplesoft Application Package, Application Class and Application Method Implementation

Application Classes in PeopleSoft

Defining and Importing packages or classes in PeopleCode

<Pacakge name>:<Subpacakge name>:<…>:<Class name or wild card>

Class Extensions represents the “is-a” relationship.

 When a class extends another class, it’s called a subclass of that class.

No Multiple inheritances or Concept of interface in Application classes.

Instance variables in the class are accessible in all the objects of that class.

Application programs generally pass parameters by value, which is not the same as for existing functions.

Parameter passing with object data types is by reference.

When the objects are passed to method and it reassign the object with new object it will not reflected in the calling method.

Application Programs use the out specifier to pass a parameter by reference.

Method increment (&Value as number out); rem passed by reference.

 

Create is the key word used to create the class object.

            Local MyObjectClass &o1 = Create MyobjectClass (‘A’);

            Local MyObjectClass &o1 = Create Test: Examples: MyobjectClass (‘A’);

If parameter in a method is having out specifier then parameter should be a variable and cannot be constant.

A class that extends another class must have constructor, and in the constructor it must initialize its super class.

 To initialize a superobject, an instance of the superclass is assigned to the keyword %Super in the constructor for the subclass.

 

Class Example extends ExampleBase

    Method Example ();

           End-class;

           Method Example        

              %Super = create ExampleBase ();

              &BaseStrin = &currentBaseString;

             &Slashstring = &BaseString;               

          End-Method;

 

Before the constructor runs, the instance variables for the class are set by default takes on their declared types.

An application class doesn’t have destructors, that is, a method called just before an object is destroyed. The People code runtime environment generally cleans up any held resources.

When application class properties and instance variables are used as the argument to functions or methods, they are always passed by value, never by reference.

%This is can be used to self reference. This is to refer the same object.

%Super = %This – this should never be done it will go to an infinite loop.

Import Fruit:* - imports all the classes in the application package.

Import statements are validated when you save the Peoplecode.

Peoplesoft recommends that you use read-write or ready only properties instead of creating methods name GetXxx and SetXxx.

Getter and Setter syntax

Get Propertyname

 ---

End-get;

 

External Functions Declarations are allowed in application classes, in the global and component variable declarations, after the class declaration (after the end-class) and before the method definition.

%Super is only required to access superclass members that are hidden by overriding members in the current time.

Downcasting is the process of determining if an object is of a particular subclass type. If the object has that subtype (either the object is of that subtype, or is a subtype of it), a reference to the subject is returned, otherwise Null is returned. In either case, the type of the resulting value is compatible with the name subclass type.

Class Fruit

          Property number fruitcount;

End-class;           

 Class Banana extends Fruit

              Property number BananaCount;

 End-Class;

 

    Local Banana &MyBanana = Create Banana ();

    Local Fruit &MyFruit = &MyBanana;   /* Okay, Banana is a subtype of Fruit */

    Local number &num = & MyBanana.BananaCount;

         &MyBanana = &MyFruit as Banana;   /* &MyFruit is currently a Banana at runtime */

        &Num = (&MyFruit as Banana).BananaCount; /* same as &MyBanana.BananaCount */

        &MyFruit = Create Fruit ();

   &MyBanana = &MyFruit as Banana; /* Assigns Null - &Myfruit isn’t a Banana */

/* */ and /**  */ comments are allowed. Comments enclosed in  /** -- */ are potentially be used to generate API documentation.

 

Example

Import PWWPack: ExampleBase

Class Example extends ExampleBase

   Method Example ();                                     /*Constructor*/

   Method NumToStr (&Num As number) Returns string ();

   Method AppendSlash ();

   Property number SlashCount get;                   /*Get properties */

   Property number ImportantDayofWeek get set; /*Get and set properties */

   Property string Slashstring readonly;   /* values can be assigned in constructor */

   Property date ImporantDate;

  Private

   Method NextDayofWeek (&Dow As number) returns date;

   Constant &Sunday = 1;              /*Constants */

   Instance string &Basestring;      /* Instance variables are like static variable */

end-class;                                                                                                           

 

Declare function getusername Peoplecode FUNCLIB_PP.STRING_FUNCTIONS FieldFormula;

/**

* Method header comments example

* @param Dow is a number parameter

* @exception it throws Invalid day exception if the number is negative.

* @return   it is returns the date as of that week.

*/

Method NextDayofWeek  (&Dow)

      ---------    ---------

End-method;


/* get block */

Get SlashCount

  Return (Slashcount);

End-get;

 

Thank You for visiting my blog, do share to you friends.

Keep Sharing, Keep Learning.


Popular posts from this blog

PeopleSoft Meta Tables

Peoplesoft Application Package - Application Class/Application Package peoplecode and Calling them anywhere