Message Class Properties

In this section, we discuss the Message class properties. The properties are discussed in alphabetical order.

Description

This property returns the name of the action associated with the message, as a string.

This property is read-only.

Description

This property returns the name of the alias associated with the message part executing the property.

This property is read-only.

Description

This property references the name of the channel associated with the message definition.

Note: This property has been deprecated and remains for backward compatibility only. Use the Message class QueueName property instead.

See QueueName.

This property is set when the message is created. The message instance keys are a subset of the publication and subscription contract keys. This property is one of the message instance keys: the others are PubID and PubNodeName for asynchronous messages, GUID and PubNodeName for synchronous messages.

This property is valid for both synchronous and asynchronous messages.

This property is read-only.

Example

&CHANNEL = &MSG.ChannelName

Description

This property returns or sets the cookies associated with a message.

Note: This property has been deprecated and remains for backward compatibility only. Use the IBInfo class Cookies property instead.

See Cookies.

You can accept a synchronous response message containing cookies, save those cookies in a global variable, and later return them to the target node in an outbound synchronous or asynchronous request message.

You can access this property only in an inbound synchronous response message or an outbound request message.

This property is read-write.

Example

The following is an example of receiving cookies:

Local Message &SalesRequest, &SalesResponse;
Local Rowset &SALES_ORDER;
Global string &SalesCookies;

&SALES_ORDER = GetLevel0();
&SalesRequest = CreateMessage(OPERATION.SALES_ORDER_SYNC);
&SalesRequest.CopyRowsetDelta(&SALES_ORDER);

/* send the synchronous request; the return value is */
/* the response message object */
&SalesResponse = &SalesRequest.SyncRequest();

/* Retrieve cookies from the response message */
&SalesCookies = &SalesResponse.Cookies;

The following is an example of returning cookies:

Local Message &SalesRequest, &SalesResponse;
Local Rowset &SALES_ORDER;
Global string &SalesCookies;

&SALES_ORDER = GetLevel0();
&SalesRequest = CreateMessage(OPERATION.SALES_ORDER_SYNC);
&SalesRequest.CopyRowsetDelta(&SALES_ORDER);

/* Insert the cookies in the request message */
&SalesRequest.Cookies = &SalesCookies;

/* Send the asynchronous request */
&SalesRequest.Publish();

Description

This property returns a number, indicating which segment is the current segment.

This property is read-only.

Description

This property returns the default version of the message as a string.

Note: This property has been deprecated and remains for backward compatibility only. Use the Message class OperationVersion property instead.

See OperationVersion.

This is the message version from the pub/sub contract, not the default message version of the message defined in the current system.

This property is valid for both synchronous and asynchronous messages.

This property is read-only.

Example

Local Message &MSG;
Local String &VER;

&MSG = %IntBroker.GetMessage();
&VER = &MSG.DefaultMessageVersion;

Description

Use this property to set the node name of a node that you do not want to publish this message to. For example, a single node may publish and subscribe to the same message. You can use this property to prevent the system from subscribing to the same message it publishes. This can help prevent circular processing where the original publisher eventually receives the same message.

This property is only valid for asynchronous messages.

This property is read-write.

Example

&MSG.DoNotPubToNodeName = &MSG.PubNodeName;
&MSG.Publish();

Description

This property returns a string representing a global unique identifier generated when the message was sent.

Note: This property has been deprecated and remains for backward compatibility only. Use the Message class TransactionId property instead.

See OperationVersion.

This property returns the unique identifier used with the message.

This property is valid only for synchronous messages.

This property is read-only.

Example

Local Message &request;
Local String &guid;

&request = %IntBroker.GetMessage();

&guid = &request.GUID;

Description

Use this property to return an integer constant representing the HTTP request method that was specified by the subscribing node (the consumer) in REST-based service operations. The request method determines the proper response message to send.

Value

Description

%IntBroker_HTTP_GET

HTTP GET method – Requests a representation of a resource.

%IntBroker_HTTP_POST

HTTP POST method – Submits data to be processed to the specified resource. This might result in the creation of a new resource or updates to an existing resource or both.

%IntBroker_HTTP_DELETE

HTTP DELETE method – Deletes the specified resource.

%IntBroker_HTTP_PUT

HTTP PUT method – Uploads a representation of the specified resource. This might result in the creation of a new resource or updates to an existing resource or both.

%IntBroker_HTTP_HEAD

HTTP HEAD method – Requests a representation of a resource without without the response body that would be returned in a GET request.

This property is read-only.

Example

If &MSG.HTTPMethod = %IntBroker_HTTP_POST Then
   
   /* populate the POST response data */
   
End-If;

If &MSG.HTTPMethod = %IntBroker_HTTP_GET Then
   
   /* populate the GET response data */
   
End-If;

Description

Use this property to return the HTTP response code for the transaction as an integer.

This property is read-only.

Example

&return_msg = %IntBroker.SyncRequest(&MSG);
If &return_msg.ResponseStatus = %IB_Status_Success Then
   &nRET = &return_msg.HTTPResponseCode;
End-If;

Description

Use the IBException property to return a reference to an exception object. The object is populated with information about the integration broker error.

This property is read-only.

Description

Use this property to return a reference to an IBInfo object.

This property is read-only.

Description

Use this property to set or return a Boolean value indicating whether this is the first of a set of correlated messages. On the first message to be published, set the InitializeConversationId property to True. After the message is published, retrieve the transaction ID from the message. This transaction ID should be used to set the conversation ID (that is, the correlation ID) for all subsequent messages to be published.

This property is read-write.

Description

Indicates whether the message definition has been set to inactive.

Note: This property has been deprecated and remains for backward compatibility only. Use the Message class IsOperationActive property instead.

See IsOperationActive.

This property is True if the message definition is active, False if it’s been inactivated. If you have a lot of PeopleCode associated with publishing a message, you might use this property to check if the message is active before you publish it.

This property is valid for both asynchronous and synchronous messages.

This property is read-only.

Example

&MSG = CreateMessage(OPERATION.MY_MESSAGE)
If &MSG.IsActive Then
  /* do PeopleCode processing */
  &MSG.Publish();
Else
  /* do other processing */
End-if;

Description

Use this property to return a Boolean value indicating whether the table truncation option has been selected on the bulk loader handler.

This property is read-only.

Example

If &MSG.IsBulkLoadTruncation = False Then
   
   /* then any truncation of tables would have to be performed here */
   
End-If;

Description

This property indicates if any fields in a message populated from page data have been changed since they were first loaded into the component buffer.

This is generally used in the following scenario:

You want to publish a message only if the end-user has changed a value on a page. The problem is that if the end-user makes a change to a field in the level three rowset, the IsChanged property for the top level row remains False. If the rowset is large, and you don't want to iterate through it to find a single IsChanged, you can use this property to quickly determine if something has changed at a lower level and the message should be published.

Note: This property should be used only when the message and the component do not have the same structure (that is, the same records at the same levels). If the message and the component have the same structure use the CopyRowsetDelta method instead.

This property takes a Boolean value: True if there are changed fields in the message, False otherwise.

This property is valid for both asynchronous and synchronous messages.

This property is read-only.

Example

&Msg = CreateMessage(OPERATION.MY_MESSAGE);
&Msg_Rowset = &Msg.GetRowset(); /* get first level in Msg RS */
&Msg_Detail = &Msg_Rowset(1).GetRowset(); /* get detail in Msg */
&Page_Rowset = GetRowset(); /* get page */
For &I = &Page_Rowset.Rowcount
  &Page_Detail = &Page_Rowset.GetRow(&I).GetRowset();
  &Msg_Detail.CopyRowset(&Page_Detail);
End-For;
/* Find if any data changed and should publish message */
If &Msg.IsDelta Then
   &Msg.Publish();
Else
   /* don't publish message and do other processing */
End-If;

Description

This property is True if an error has been found on any field in any record of the current message after executing the ExecuteEdits method on either a message object or a record object. This property can be used with the Field Class properties MessageSetNumber and MessageNumber to find the error message set number and error message number.

You can use this property in notification PeopleCode with the Exit function with a value of 1. This automatically rolls back any changes that were made to the database, saves the message errors to the message queue, and marks the message status as ERROR.

This property is valid for both asynchronous and synchronous messages.

This property is read-only.

Example

&MSG = %IntBroker.GetMessage();
&Rowset = &MSG.GetRowset();
&MSG.ExecuteEdits();
If &MSG.IsEditError Then
  Exit(1);
End-If;

Description

This property is True if the message object that was just instantiated was published locally. This property takes a Boolean value.

This property is valid for both asynchronous and synchronous messages.

This property is read-only.

Example

&MSG = %IntBroker.GetMessage();
If &MSG.IsLocal Then /*  LOCAL NODE */
  /* do processing specific to local node */
Else
  /* do processing specific to remote nodes */
End-If;

Description

Use the IsOperationActive property to determine if an operation is active or not.

This property returns a Boolean value: true if the operation is still active, false otherwise.

This property is read-only.

Description

Use the IsParts property to determine if the message is a container message, that is, composed of parts.

This property only determines if a message is a container message. If you'd like to know if the message is a rowset-based message with parts, use the IsPartsStructured property instead.

This property returns a Boolean value: true if the message executing the property is a container message, false otherwise.

This property is read-only.

Description

Use the IsPartsStructured property to determine if the message is a container message, that is, composed of parts, as well as a rowset-based message.

This property determines if a message is a container message as well as rowset-based. If you only want to know if the message is a container message, use the IsParts property instead.

This property returns a Boolean value: true if the message executing the property is a container message that is rowset-based, false otherwise.

This property is read-only.

Description

Use the IsRequest property to determine whether a message is a request message (as opposed to a response message.)

This property returns a Boolean value: true if the message object executing the property is a request message, false otherwise.

This property is read-only.

Description

Use the IsSourceNodeExternal property to determine whether the message came from an internal system or a third-party system.

This property returns a Boolean value: true if the message originated from a third-party system, false otherwise.

This property is read-only.

Description

This property indicates whether the message is rowset-based, that is, based on a rowset, or nonrowset-based that is, based on an XmlDoc. This property returns a Boolean value, true if the message is rowset-based, false otherwise.

This property is read-only.

Description

This property specifies the message detail, as a string. The message detail can be used to further identify a message.

Note: This property has been deprecated. It is no longer supported.

Description

This property returns the name of the message as a string.

This property is valid with both asynchronous and synchronous messages.

This property is read-only.

Description

This property returns the non-repudiation ID as a string. This property is populated with a unique string when the message is published.

This property is only valid with messages that use non-repudiation.

This property is read-only.

Description

Use the OperationName property to return the name of the operation associated with the message object executing the property, as a string.

This property is read-only.

Description

Use the OperationVersion property to determine version for the operation associated with the message object executing the property, as a string.

This property is read-only.

Description

Use the ParentTransactionId property to return the parent transaction ID, that is, the ID that is generated with the original request message from a third-party system.

This property is read-only.

Syntax

Use the PartCount property to determine the number of parts in a container message. This property is only valid with container messages. You will receive an error if you try to use it on a message that isn't a container message.

This property is read-only.

Description

This property refers to the publication identifier, which is a number.

Note: This property has been deprecated and remains for backward compatibility only. Use the Message class QueueSeqId property instead.

See QueueSeqId.

It’s generated for asynchronous messages when the message is published, and is sequential, based on the number of messages published for that channel. The message instance keys are a subset of the publication and subscription contract keys. This property is one of the message instance keys: the others are ChannelName and PubNodeName.

Note: The PubID property is not populated when the message is published from a notification.

This property is valid only with asynchronous messages.

This property is read-only.

Example

&MSG.Publish();
&PUBID = &MSG.PubID;

Description

This property refers to a string that contains the name of the publishing node. It is generated by the system when the message is published. The message instance keys are a subset of the publication and subscription contract keys.

This property is valid for both asynchronous and synchronous messages.

For a synchronous message, this property returns the name of the requesting node.

This property is read-only.

Example

&MSG = %IntBroker.GetMessage();
&PUBNODE = &MSG.PubNodeName;

Description

Use the QueueName property to return the name of the queue associated with the message.

This property is read-only.

Description

Use the QueueSeqId property to return the sequence number of the message in the message queue.

This property is read-only.

Description

This property is valid only for the returned response message from a synchronous request message.

This property indicates whether a response was successful or not.

Note: This is not the same as SetStatus, which is used only with the message monitor.

This property returns a numeric value: 0, the response was successful, any other number indicates an error.

This property is read-only.

Description

Use this property to set or return a string constant indicating whether the message segment is binary or text data:

Value

Description

%ContentTransfer_Binary

Transfer this segment as binary data.

Note: Any binary data must be encoded as text, which increases its size by up to 33%.

%ContentTransfer_Default

Transfer this segment as text data.

The HTTP target connector has a property called MTOM. When this property is set to Y, the transaction uses the Message Transmission Optimization Mechanism (MTOM) protocol for message transmission, which is more efficient for binary attachments.

This property is read-write.

Example

Local Message &MSG;

&MSG = CreateMessage(Message.FLIGHTDATA);

&MSG.SetXmlDoc(&xmldoc);

&MSG.CreateNextSegment();
&bRet = &MSG.SetContentString("your encoded image data here");
&MSG.SegmentContentType = "image/gif";
&MSG.SegmentContentTransfer = %ContentTransfer_Binary;

&MSG.CreateNextSegment();
&bRet = &MSG.SetContentString("your encoded video here");
&MSG.SegmentContentType = "video/mp4";
&MSG.SegmentContentTransfer = %ContentTransfer_Binary;

%IntBroker.Publish(&MSG);

Description

Use this property to set or return a string representing the content (or MIME) type for the message segment—for example, application/pdf. This property is read-write.

Example

&MSG.SegmentContentType = "video/mp4";

Description

This property returns the total number of segments for the message.

This property is read-only.

Description

Use this property to specify whether segments are stored in memory while being processed.

If you specify SegmentsByDatabase as false, you can only have the number of segments as specified in PSADMIN (Message Segment From DB). If you specify this property as true, you can have as many segments as you need.

The SegmentsByDatabase property also specifies whether the segments are kept in memory or written to the database when they are received. If you specify true, the segments are automatically written to the database. If you specify false, the segments are held in memory. If you specify true, then cancel out of the program processing the segments, the changes are not committed to the database.

This property is automatically set to true for message segments being processed using a Application Engine program.

This property is read-write.

Description

The Size property is the approximate size of the uncompressed XML data generated when the message is published. The availability and meaning of the Size property depends on the message type as follows:

  • For rowset-based message parts, the Size property is available and based on the estimated XML size.

  • For non-rowset-based messages, the Size property is available and based on the XML data size.

  • For container-based messages, the Size property is available on received messages only—that is for OnRequest or OnNotify PoepleCode events.

  • For container-based message parts, the Size property is available and based on the estimated XML size.

  • For document-based messages, the Size property is available and based on the XML data size.

The size is approximate for the following reasons:

  • The maximum size of fields is used except for the case of long text and image fields.

  • The active row count is used, without regard to whether the rows have been changed. In a CopyRowsetDelta, rows that are not changed, are not published.

  • It doesn't include the size of the XML tags.

This property can be used with the system property %MaxMessageSize in a batch Application Engine program to prevent the application from publishing a message that is too large.

This property is valid for both asynchronous and synchronous messages.

This property is read-only.

Example

If &MSG.Size > %MaxMessageSize Then
  &MSG.Publish();
Else
  /*Move more data into the message object */
End-If;

Description

This property refers to a string that contains the name of the notification process currently processing the message.

Note: This property has been deprecated and remains for backward compatibility only. Use the Message class ActionName property instead.

See ActionName.

It is available only when GetMessage is used in a notification PeopleCode program.

This property is only valid for asynchronous messages.

This property is read-only.

Example

&MSG = %IntBroker.GetMessage();
&SUBNAME = &MSG.SubName

Description

Use the SubQueueName to return or specify the name of the sub-queue associated with the message, as a string.

This property is read-write.

Description

This property returns a string containing the subscription process identifier. This is a unique sequential number.

Note: This property has been deprecated and remains for backward compatibility only. Use the Message class TransactionId property instead.

See TransactionId.

This property is populated only if the “Generate Subscription Process Instance” option is turned on in the Subscription Process definition.

The subscription process identifier corresponds to the subscription process instance, not the message instance. If there are multiple subscription processes for the same message each subscription process will have a different, unique ID.

If the subscription process terminated abnormally, its process instance is lost, and a new one is generated on the next retry (that is, there will be a gap in the sequence.)

This property is valid only for asynchronous messages.

This property is read-only.

Considerations for Using SubscriptionProcessId

Consider the following when using SubscriptionProcessId:

  • Using the Run PeopleCode option from Message Subscription does not generate the number. It is generated only if the Application Server is running the PeopleCode.

  • If for some reason you have to rerun the subscription, a new number is assigned.

  • Because generating the number is optional, your program must contain code to support the option being turned off. Here is a code example from ITEM_SYNC:

    If All(&MSG.SubscriptionProcessId) Then
      &EIP_CTL_ID = Generate_EIP_CTL_ID(4, &MSG.SubscriptionProcessId);
    Else
      &EIP_CTL_ID = Generate_EIP_CTL_ID(1, "Random");
    End-If;
  • If the flag is off, this property is blank. In this case, you may want to adopt a standard for generating a random number, as shown in the previous example.

Description

Use the TransactionId property to return the transaction ID for an already published message, as a string. This is a unique transaction identifier for the message.

This property is read-only.

Description

Use this property to set or return the index for the URI as an integer. This index corresponds to the row number in the URI grid of the REST Resource Definition section of the service operation definition.

This property is read-write.

Example

&MSG = CreateMessage(Message.WEATHERSTATION_GET);
&DOC = &MSG.GetURIDocument();
&COM = &DOC.DocumentElement;

&COM.GetPropertyByName("state").Value = "Washington";
&COM.GetPropertyByName("city").Value = "Redmond";
&COM.GetPropertyByName("day").Value = "today";
&COM.GetPropertyByName("week").Value = "first";
&COM.GetPropertyByName("year").Value = "2010";
&COM.GetPropertyByName("country").Value = "USA";
&MSG.URIResourceIndex = 1;

Description

Use the Version property to determine the version of the message executing the property, as a string.

This property is read-only.