Creating Custom Chunking Tables

This section discusses how to:

  • Create a custom chunking table.

  • Create a view for the component search record.

  • Create maintenance pages.

  • Create a component.

  • Create routing PeopleCode.

To create a custom chunking table:

  1. Select File, Open in PeopleSoft Application Designer.

  2. Select Record in the Definition drop-down menu.

  3. Open the EO_BUSUNT_EOC record.

  4. Save the record as YOUR_TABLE_EOC.

  5. Remove the BUSINESS_UNIT field.

  6. Insert the custom chunking fields at the bottom of the record.

  7. Select File, Save.

  8. Build the SQL table.

To create a view for the component search record:

  1. Select File, Open in PeopleSoft Application Designer.

  2. Select Record in the Definition drop-down menu.

  3. Open the EO_CHUNKBU_VW record.

  4. Save the record as YOUR_TABLE_VW.

  5. Select the Record Type tab.

  6. Open the SQL editor.

  7. Modify the Where clause.

    Change WHERE RECNAME_CHUNK=EO_BUSUNT_EOC to WHERE RECNAME_CHUNK=YOUR_TABLE_EOC.

  8. Select File, Save.

  9. Build the SQL view.

You can also create maintenance pages.

Image: Grid Properties dialog box

This example illustrates the fields and controls on the Grid Properties dialog box. You can find definitions for the fields and controls later on this page.

Grid Properties dialog box

To create maintenance pages:

  1. Select File, Open in PeopleSoft Application Designer.

  2. Select Page in the Definition drop-down menu.

  3. Open the EO_CHUNKBU page.

  4. Save the page as YOUR_PAGE.

  5. Select the Order tab.

  6. In the Type column, double-click Grid to open the Grid Properties dialog box.

  7. Change the value in the Main Record and Page Field Name fields to YOUR_TABLE_EOC.

  8. Click OK.

  9. Delete the business unit and description columns.

  10. Add chunking fields from YOUR_TABLE_EOC.

  11. Select File, Save.

To create a component:

  1. Select File, New in PeopleSoft Application Designer.

  2. Select Component in the New Definition box.

  3. Select Insert, Page Into Component.

  4. Enter YOUR_PAGE.

  5. Click Close.

  6. Select File, Definition Properties

  7. Select the Use tab to edit component properties:

    1. In the Search record field, enter YOUR_TABLE_VW.

    2. Select the Update/Display, Update/Display All, and Correction check boxes.

  8. Click OK.

  9. Select File, Save As, and save the page group as YOUR_COMPONENT.

  10. Add YOUR_PAGE_GROUP to YOUR_MENU that is used by your application.

OnRouteSend (and OnRouteReceive) are PeopleCode methods that are tied to the message for routing, based on the message contents. If you want the contents of the message (such as a message chunking field value) to determine the subscribing nodes that should receive the message, OnRouteReceive PeopleCode must contain the logic to examine the message and return a list of subscribing nodes.

The OnRouteSend and OnRouteReceive methods are contained in the IRouter application class. The IRouter application class is located in PeopleSoft Application Designer in the Integration subpackage of the PS_PT application package.

PeopleCode functions provided by common components, GetNodes and RtnNodes, work with any message and chunking rule. For a given message, these nodes select the chunking rule for the publish rule that is assigned to the message.

The functions:

  • Build SQL based on the chunking fields as defined in the chunking table.

  • Extract chunking field values from the message.

  • Run the associated SQL.

  • Compare the array of nodes returned to the application server against the list of nodes for the message channel.

  • Create a publish contract for nodes in both arrays.

    You can override the publish rule from the message, specifying an optional parameter when calling the functions.

  • Return an array of nodes that is based on the nodes that are assigned to the message channel if the publish rule is invalid or does not contain a chunking rule.

    Returning an array of nodes enables the functions to work regardless of whether chunking is set up for the publish rule.

To route any message that uses chunking, use generic PeopleCode functions.

These functions are called from routing PeopleCode:

Field or Control

Definition

GetNodes

Returns an array of nodes to the application server.

Use this function for integrations on PeopleTools 8.47 and earlier releases.

RtnNodes

Returns an array of nodes to the calling PeopleCode.

Use this function for integrations on PeopleTools 8.47 and earlier releases.

RtnMsgNodes

Returns an array of nodes of datatype Any to the calling PeopleCode.

Use this function for integrations on PeopleTools 8.48 and higher releases.

These functions are internal functions:

Field or Control

Definition

FndNodes

Builds an array of nodes for the message.

GetPubRule

Selects the chunking rule for the publish rule.

GetChunkInfo

Selects the chunk table for the chunking rule.

BuildSQL

Builds SQL to select nodes from the chunking table for specific chunking field values from the message.

GetValue

Gets the chunking field values from the message.

HasNodes

Determines whether a chunking field is mapped to any nodes for a particular chunking rule.

The following code example shows the logic that you can add to SavePostChange PeopleCode for the Customer_General component to verify that the setID can publish the message by calling the HasNodes() function:

Declare Function HasNodes PeopleCode FUNCLIB_EOEIP.PUBLISH_ROUTE_PC 
FieldFormula;
Local Message &MSG;
Local Rowset &RS0;
Local string &PublishRule;
&MSG = CreateMessage(MESSAGE.CUSTOMER_MSG);
/* Check if message is active */
If &MSG.IsActive Then
     &RS0 = GetLevel0();
     &PublishRule = "CUSTOMER_SYNC";
     /* Call function passing publish rule and rowset, which returns 
     true if this setID can publish the message */
     If (HasNodes(&PublishRule, &RSO)) Then
          &RS0 = GetLevel0();
          &MSG.CopyRowsetDelta(&RS0);
          &MSG.Publish();
     End-If;
End-If;

The following code example shows the logic that you can add to service operation APC handler PeopleCode to chunk the message by nodes as defined in the chunking rules by calling the RtnMsgNodes function:


import PS_PT:Integration:IRouter;

class ChunkSetidByNode implements PS_PT:Integration:IRouter
   method RoutingHandler();
   property array of any destinationNodes;
   method OnRouteSend(&_MSG As Message) Returns integer;
   method OnError(&_MSG As Message);
end-class;

Declare Function RtnMsgNodes PeopleCode FUNCLIB_EOEIP.PUBLISH_ROUTE_PC 
FieldFormula;

/* constructor */
method RoutingHandler
end-method;

method OnRouteSend
   /+ &_MSG as Message +/
   /+ Returns Integer +/
   /+ Extends/implements PS_PT:Integration:IRouter.OnRouteSend +/
   /* Variable Declaration */
   Local string &PublishRule;
   
   %This.destinationNodes = RtnMsgNodes(&PublishRule, &_MSG);
   
   If %This.destinationNodes.Len > 0 Then
      Return (%IntBroker_ROUTE_SOME);
   Else
      Return (%IntBroker_ROUTE_ALL);
   End-If;
   
end-method;

/** If an error occurs the OnError method if implemented will be automatically invoked. The type of exception can be viewed by using the Message object to retrieve the Exception object (&Message.IBException)
  * @param   MSG Message object containing the operation instance where the error occured while being routed
  */
method OnError
   /+ &_MSG as Message +/
   /+ Extends/implements PS_PT:Integration:IRouter.OnError +/
end-method;