Example 3: Using the PeopleSoft 8.1 Connectors

The examples provided in this section demonstrate sending a rowset-based asynchronous message between a PeopleSoft 8.55 node and a PeopleSoft 8.1 node.

When sending a message from a PeopleSoft 8.55 system to a PeopleSoft 8.1 system, you will use the PeopleSoft 8.1 target connector. You will also use PeopleCode, as well as the example page and work record that you created using the information in the setup section at the beginning of this topic.

When sending a message from a PeopleSoft 8.1 system to a PeopleSoft 8.4 system, you will use the PeopleSoft 8.1 listening connector. You will also use the test message functionality in PeopleSoft Application Designer.

This section describes setting up data for using the PeopleSoft 8.1 connector examples.

Setting Up Data on the PeopleSoft 8.55 System

To set up data on the PeopleSoft 8.55 system:

  1. In PeopleSoft Application Designer, create a new field called EXAMPLE_CHAR. This should be a mixed-case character field of size 20.

  2. Create a new record.

    1. Name the record EXAMPLE_REC.

    2. Add the EXAMPLE_CHAR field to this record, set it as the key, and save the definition.

    3. Build the physical table for this record.

  3. In the PeopleSoft Pure Internet Architecture, create a new message called EXAMPLE_PSFT_MSG with the version set to VERSION_1.

    1. Select the message type to be Rowset— Based.

    2. Add the EXAMPLE_REC record as the root record of this message.

  4. Add a new node, using the node name of the PeopleSoft 8.1 system. Verify that the Active Node box is checked, and save the record.

  5. Open the EXAMPLE_PAGE page and add an EditBox to the page, setting the following properties:

    Property

    Value

    Record name

    EXAMPLE_REC

    Field name

    EXAMPLE_CHAR

  6. Create a new service called PSFT81_SERVICE.

  7. Create a new service operation.

    1. Add a service operation of type asynchronous-one way to the PSFT81_SERVICE and name it PSFT81_SERVICE_OPR.

    2. Add EXAMPLE_PSFT_MSG as the message.

    3. Add EXAMPLE_QUEUE as the queue.

    4. Configure the service operation security for this service operation.

  8. Add an inbound routing for the PSFT81_SERVICE_OPR service operation with the source node being the 8.1 system and the destination being the 8.55 system.

  9. Add an outbound routing for the PSFT81_SERVICE_OPR service operation with the source node being the 8.55 system and the destination being 8.1 system.

  10. Open the EXAMPLE_WORKREC record. Add the following PeopleCode to the FieldChange event for the TEST field:

    &message = CreateMessage(Operation.PSFT81_SERVICE_OPR);
    
    /* get the buffer data */
    &rowset = GetLevel0();
    
    /* copy buffer data to the message */
    &message.CopyRowset(&rowset);
    
    /* send the message */
    &message.Publish();
    
  11. Go to the connector information for the new node. Set the Connector ID to PSFT81TARGET. Set the URL property to the address of the gateway servlet on the PeopleSoft 8.1 system. For example:

    http://<theServerNameAndPort>/servlets/gateway

Setting Up Data on the PeopleSoft 8.1 System

To set up data on the PeopleSoft 8.1 system:

  1. In PeopleSoft Application Designer, create a new field called EXAMPLE_CHAR. This should be a mixed-case character field of size 20.

  2. Create a new record.

    1. Name the record EXAMPLE_REC.

    2. Add the EXAMPLE_CHAR field to this record, set it as the key, and save the definition.

    3. Build the physical table for this record.

  3. Create a new message channel called EXAMPLE_CHANNEL. On the properties dialog box, set the Status to Run. Configure the security for the message monitor so that the channel can be displayed.

  4. Create a new message.

    1. Open the properties and select the Active box for the Status.

    2. Set the Message Channel to EXAMPLE_CHANNEL.

    3. Add the EXAMPLE_REC record to VERSION_1 of this message.

    4. Save the message as EXAMPLE_PSFT_MSG.

  5. Add the subscription ExampleSubscription to the EXAMPLE_PSFT_MSG. Use the following PeopleCode in the subscription body:

    /* get the incoming message */
    &msg = GetMessage();
    &msgXML = &msg.GenXMLString();
    
    /* and write it to a file */
    &file = GetFile("PSFT81msg.txt", "w");
    &file.writeString(&msgXML);
    &file.close(); 
    
  6. Create a new message node, using the name of the PeopleSoft 8.55 node. Add a Location to this node with the following format:

    http://<serverName:port>/PSIGW/PS81ListeningConnector 

    The serverName and port you specify must correspond to the integration gateway address of the PeopleSoft 8.55 system.

  7. Open the EXAMPLE_CHANNEL. Add a new routing rule to the channel, where the direction is Both and the message node name is that of the PeopleSoft 8.55 node.

  8. In the Message Monitor, invoke the Gateway Administration servlet and add the PeopleSoft 8.1 node to the PeopleSoft handler.

  9. Open the Message Monitor and verify that the EXAMPLE_CHANNEL is running.

In the example presented in this section, you will use the PeopleSoft 8.1 target connector to send a message from a PeopleSoft 8.55 system to a PeopleSoft 8.1 system.

To send a message from a PeopleSoft 8.55 system to a PeopleSoft 8.1 system:

  1. In the PeopleSoft Pure Internet Architecture on the PeopleSoft 8.55 system, open the EXAMPLE_PAGE. Enter text into the edit box, and press the Test button. Wait for a minute or two to allow the systems to process the message.

  2. On the PeopleSoft 8.55 system, open the Service Operations Monitor to view the details of the outbound message.

  3. On the PeopleSoft 8.1 system, open up the Message Monitor to view the details of the received message. Open the PSFT81msg.txt file created by the subscription PeopleCode to see the body of the message.

In the example presented in this section, you will use the PeopleSoft 8.1 listening connector to send a message from a PeopleSoft 8.1 system to a PeopleSoft 8.55 system.

To send a message from a PeopleSoft 8.1 system to a PeopleSoft 8.55 system:

  1. On the PeopleSoft 8.1 system, open PeopleSoft Application Designer and open the EXAMPLE_PSFT_MSG message. Right-click VERSION_1 and select Create test message. The Create Test Message window appears.

  2. Expand Transaction in the tester window. Set the value for EXAMPLE_CHAR. Open the PSCAMA section and set the AUDIT_ACTN to A and click OK. A message is published. Wait a minute or two before proceeding to allow the message to be processed by both nodes.

  3. On the PeopleSoft 8.1 system, open the Message Monitor to view the details of the outbound message.

  4. On the PeopleSoft 8.55 system, open the Service Operations Monitor to view the details of the received message.