Messenger Cycle

The Messenger cycle is the XML processing cycle that consists of the processing of an input message within a single database transaction. The input in a messenger cycle comes from an XML message and the output includes a response XML message. The Messenger cycle also includes framework methods that are used to include user-defined logic. In a Messenger cycle steps, such as initialization, validation, parsing message, and serialization are automatic.

Defining the Processing Logic

A special type of serializable class is used to define the processing logic to be executed for an input XML message. This class is called a Messenger class and is defined with Stereotype=Messenger. The Messenger class defines the format of an XML message and the processing logic to handle the message when it is input to the system. The Messenger class is an entry point for processing an input XML message. An XML message is passed to an instance of the corresponding Messenger class for processing.

In a Messenger cycle a Messenger class is defined to implement the Serialization that defines the structure and layout of the input XML message. Then, the class implements an automatic processing cycle to receive an XML message and execute user-defined processing logic.

Basic Steps in a Messenger Class

The basic steps in a messenger class are as follows:

  1. Parsing the input message and populating an instance of the Messenger class with the data from the message.

  2. Validating the input data from the message.

  3. Executing user-defined logic.

  4. Returning a response XML message (optional).

Including User-Defined Logic

Built-in framework methods are available in which user-written logic can be included to perform any user-defined business rules or processing including reading from and writing to the database.

The framework methods are

The following image shows the Messenger cycle:

The Messenger Cycle is similar to the Ispec cycle, except that the input comes from an XML message instead of a client form and the output can include a response XML message.