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:
Select File, Open in PeopleSoft Application Designer.
Select Record in the Definition drop-down menu.
Open the EO_BUSUNT_EOC record.
Save the record as YOUR_TABLE_EOC.
Remove the BUSINESS_UNIT field.
Insert the custom chunking fields at the bottom of the record.
Select File, Save.
Build the SQL table.
To create a view for the component search record:
Select File, Open in PeopleSoft Application Designer.
Select Record in the Definition drop-down menu.
Open the EO_CHUNKBU_VW record.
Save the record as YOUR_TABLE_VW.
Select the Record Type tab.
Open the SQL editor.
Modify the Where clause.
Change WHERE RECNAME_CHUNK=EO_BUSUNT_EOC to WHERE RECNAME_CHUNK=YOUR_TABLE_EOC.
Select File, Save.
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](img/i-1de106ban-7eed.png)
To create maintenance pages:
Select File, Open in PeopleSoft Application Designer.
Select Page in the Definition drop-down menu.
Open the EO_CHUNKBU page.
Save the page as YOUR_PAGE.
Select the Order tab.
In the Type column, double-click Grid to open the Grid Properties dialog box.
Change the value in the Main Record and Page Field Name fields to YOUR_TABLE_EOC.
Click OK.
Delete the business unit and description columns.
Add chunking fields from YOUR_TABLE_EOC.
Select File, Save.
To create a component:
Select File, New in PeopleSoft Application Designer.
Select Component in the New Definition box.
Select Insert, Page Into Component.
Enter YOUR_PAGE.
Click Close.
Select File, Definition Properties
Select the Use tab to edit component properties:
In the Search record field, enter YOUR_TABLE_VW.
Select the Update/Display, Update/Display All, and Correction check boxes.
Click OK.
Select File, Save As, and save the page group as YOUR_COMPONENT.
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;