ReturnToServer
Mon 01 January 2018Syntax
ReturnToServer({True | False | &NODE_ARRAY, | &Message})
Description
Use the ReturnToServer function to return a value from a PeopleCode messaging program to the publication or subscription server.
Note: ReturnToServer is a special case of a built-in function that's no longer supported. The deprecated handler for OnRequest subscriptions cannot be upgraded. ReturnToServer can only be used in an OnRequest event fired using the deprecated handler. This means that ReturnToServer no longer works and is not valid in any case other than when the code has already been written and used in a deprecated handler.
You would use this in either your publication or subscription routing code, to either return an array of nodes that the message should be published to, or to do error processing (return False if entire message wasnât received.)
What is returned depends on where the PeopleCode program is called from.
From OnRoute Publication:
-
True: All nodes the message was published to are returned.
-
False: No nodes are returned (generally used with error checking).
-
&NODE_ARRAY: The nodes specified in the array are returned.
-
&Message: Return a response message. This must be an already instantiated message object.
Note: You can return XmlDoc objects as responses. Only homogeneous type transactions are supported, that is, you can only return an XmlDoc object as a response if and only if an XmlDoc object was used in the request. Similarly, you can only return a Message object if and only if a Message object was used in the request.
From OnRoute Subscription:
-
True: The subscription node is returned.
-
False: No node is returned. This is generally used with error checking.
Parameters
Field or Control |
Definition |
---|---|
True | False | &NODE_ARRAY | &Message |
Specify True if you want publication nodes or the subscription node returned. Specify False if you do not want any nodes returned, and nothing written to the database. This is generally used with error checking. Specify an object reference to an array of node names if you want to return a list of nodes to be published to. Specify a reference to a response message if you want to return a message. |
Returns
None.