Message

Messages Life Cycle

Terms

  • Messages takes place as a result of (sent by):
    • Message Flow
      • A Message Flow MUST connect two separate Pools. 
      • They connect either to the Pool boundary or to any node within the Pool boundary. 
      • They MUST NOT connect two objects within the same Pool.
    • Send Task
    • Throw Intermediate Message Event
  • Message are received by
    • Any Node designated by a message flow (may be not accurate but correct)
    • Message Start Event
    • Receive Task
    • Catch Intermediate Message Event
  • Message target is determined
    • Internal Message: If target node is implemented in same process, through a Message Flow or by Name
    • External Message: If target node is not implemented in same process
  • Message can be received by:
    • A Start Event, which will start a new Process; Starter Message
    • Non-Start Event or Task, targeting an existing Process Instance (Case); a Continuation Message
  • Message has a
    • Name; that is a unique name to identify the message used for external messages to identify recipient node
    • Key (optional); for Continuation messages to identify the Case to receive the message
    • Data (optional); various attributes that are needed for the message

Definition

Message Attributes (name,key and Data) are defined in any of the following:

Message Flow

Send Task / Receive Task

Through Message Event/Catch Message Event

Implementation

Script Support to Messages

Script Variables

Script Events

Outgoing Messages are sent after the RUN event

Incoming Messages are Validated using the VALIDATE event and processed then SAVED event

 

1 Message Registry

All Message Receipeint other than Message Flow are registered

Internal Message are implemented by CaseItem table and ProcessItem table (for start event)

External Messages require the Designer to register message destination as one of the following:

External Send Registry Attributes:

Message Name, Script

External Receive Registry Attributes:

  1. Using REST, Post api/workflow/msg.messageName
  2. Using mapping, REST call, message Name, keys, data
  3. WP Action , message (see http://codex.wordpress.org/Plugin_API/Action_Reference for details)

OmniWorkFlow WebService Server

Issues

Using REST

Post api/Workflow/message/<messageName>

Security

You need a client key to invoke a webservice

 

1 Send the Message

2 Receive the Message

3 Identify Target type

  1. If Message is based on Message Flow, Target Node designated by the Process Model will be invoke.
  2. If Message is not registered, an Error is raised.
  3. If Target is designated as External, script will be executed.
  4. If Message Target node is a Start Event, a new Case will be created.
  5. If Message has no Key and Target node is in same process as Sending Node (Internal Message), message will be sent to target node for same Case
  6. If Message has Key, a Case will be located based on Target Process and a matching key

4 Execute the message

Starter Messages

 

When the MessageEngine receive a message will match the name to Start Event, will start the Process

Internal Messages

The messages are between nodes in same process

Target Node will be invoked and executed receiving the message data. No additional design work is required.

External Messages

Applies to

A Message can be attached to the following node type:

  • Event
    • Start – catch event
    • Intermediate – catch and throw
  • Task
    • Send Task
    • Receive Task

Contents

Message contents (fields) are defined as part of the process definition. ?? relationship between variables and Messages ? A Message is an object holding the data contents as defined Message fields are variables already available to various parts of the Process For Example If we define a Message at the Process level named ‘Pizza Order’ containing the following fields *pizza (multiple) ** size ** topping (multiple) ** deep/Thin * drinks (multiple) ** Kind ** Quantity Then the step receiving the message can access the message as: pizzaOrder->pizza[0]->size Also: count(pizzaOrder->pizza) etc

Send

Destination is determined at

Message are Send in two ways:

  • Message Flow
  • API Call

Receipt

Since a Message is sent using a “Message Flow”, then the Target Node is already defined by that flow. However, if there are several Nodes already Active ready to to receive the message the Message Key is used to match the appropriate Node. =Global vs Private Messages=

Global Message

Declared as a Process Start Event , not specific for any case, when the message is Received a new Process will start a Process and Create a new Case. Based on the Message Name a Process is located that can respond to this message, message contents are passed to the Case as Case variables.

Private Message

Defined within the scope of Process (and therefore a Case), When the Message is Received, a particular Case is located that can respond to the message based on the Message contents. Therefore, Message Name must be unique to the Process. Based on the Message Name a Process is located that can respond to this message, but a particular Case is searched to meet the message keys and the message contents are passed to the Case as Case variables. Therefore, Message Name must be unique to the Process and Message Key values must be unique to the Case

Leave a Reply