Setting and Overriding Target Connector Properties at Runtime
PeopleSoft Integration Broker enables you to dynamically override target connector properties at runtime that have previously been set at the node, connector and transaction levels. To set or override target connectors at runtime, use the PeopleCode IBInfo object, the Connector Info object and implement the OnRequestSend method.
Note:
Properties set at the PeopleCode level take precedence over those set at the node, connector and routing level.
| Field or Control | Description |
|---|---|
|
IBInfo object |
An IBInfo object is instantiated from a message object. You can use this object in publishing or synchronous request PeopleCode. You can also use it in your implementation of the OnRequestSend method. |
|
ConnectorInfo object |
A ConnectorInfo object is instantiated from an IBInfo object. Use this object for reading and writing connector name/value pair information to and from the IBRequest. You can use this object in publishing or synchronous request PeopleCode. You can also use it in your implementation of the OnRequestSend method. |
|
OnRequestSend Method |
The OnRequestSend method is included in the ISend application class. Use your implementation of this method to override target connector properties at runtime for a subscribing node transaction. This event associated with the service operation executes before any transformations are processed. You can use this event for asynchronous and synchronous messages. |
Since data is always carried with the message, you can use the IBInfo object, ConnectorInfo object and your implementation of the OnRequestSend method to populate connector information in the publishing PeopleCode and then override it for a specific node.
Setting and Overriding Target Connector Properties Using the OnRequestSend Method
You can use implement the OnRequestSend method to override IBInfo and connector properties at runtime for a subscribing node transaction.
Any content data that is changed on the message or XMLDoc is sent to the subscribing node or used within a transformation.
To override the properties of a target connector, you must set the following statement to true:
&MSG.IBInfo.ConnectorOverride=true
If a publication contract fails as a result of using an implementation of the OnRequestSend method to override connector properties at runtime, correct the PeopleCode in your implementation and resubmit the message.
Example: Setting Target Connector Properties Using the OnRequestSend Method
The following example shows loading all connectors that exist for the node and adding one additional property, FileName.
import PS_PT:Integration:ISend;
class SendHandler implements PS_PT:Integration:ISend
method SendHandler();
method OnRequestSend(&Msg As Message) Returns Message;
end-class;
/* constructor */
method SendHandler
end-method;
method OnRequestSend
/+ &MSG as Message +/
/+ Returns Message +/
/+ Extends/implements PS_PT:Integration:ISend.OnRequestSend +/
/* Variable Declaration */
Local Any &Bo;
Local Message &Msg;
&Bo = &MSG.IBInfo.LoadConnectorPropFromNode("nodename");
&Bo = &MSG.IBInfo.IBConnectorInfo.AddConnectorProperties
("FileName", "temp", %Property);
&MSG.IBInfo.ConnectorOverride = True;
Return (&Msg);
end-method;
Example: Overriding Connector Properties Using the OnRequestSend Method
The following example demonstrates overriding target connector properties using an implementation of the OnRequestSend method for a rowset-based asynchronous message.
import PS_PT:Integration:ISend;
class SendHandler implements PS_PT:Integration:ISend
method SendHandler();
method OnRequestSend(&Msg As Message) Returns Message;
end-class;
/* constructor */
method SendHandler
end-method;
method OnRequestSend
/+ &MSG as Message +/
/+ Returns Message +/
/+ Extends/implements PS_PT:Integration:ISend.OnRequestSend +/
/* Variable Declaration */
Local Boolean &bRet;
&bRet= &MSG.IBInfo.LoadConnectorProp("FILEOUTPUT");
&MSG.IBInfo.ConnectorOverride = True;
&bRet= &MSG.IBInfo.IBConnectorInfo.AddConnectorProperties
("sendUncompressed", "Y", %Header);
&bRet= &MSG.IBInfo.IBConnectorInfo.AddConnectorProperties
("FilePath", "c:\temp", %Property);
Return (&Msg);
End-Method;
The following example demonstrates overriding target connector properties using an implementation of the OnRequestSend method for a nonrowset-based asynchronous message.
import PS_PT:Integration:ISend;
class SendHandler implements PS_PT:Integration:ISend
method SendHandler();
method OnRequestSend(&Msg As Message) Returns Message;
end-class;
/* constructor */
method SendHandler
end-method;
method OnRequestSend
/+ &MSG as Message +/
/+ Returns Message +/
/+ Extends/implements PS_PT:Integration:ISend.OnRequestSend +/
/* Variable Declaration */
Local XmlDoc &xmldoc;
Local Boolean &bRet;
// if you have to access the content data for content based
// decisions, do this
&xmldoc = &MSG.GetXmlDoc();
&bRet= &MSG.IBInfo.LoadConnectorProp("FILEOUTPUT");
&MSG.IBInfo.ConnectorOverride = True;
&bRet= &MSG.IBInfo.IBConnectorInfo.AddConnectorProperties
("sendUncompressed", "Y", %Header);
&bRet= &MSG.IBInfo.IBConnectorInfo.AddConnectorProperties
("FilePath", "c:\temp", %Property);
Return (&MSG);
End-Method;