Skip to content
tr4n2uil edited this page Dec 9, 2012 · 7 revisions

A message is defined by any map that inherits the iobject interface.

iObject interface

The iobject interface defines one method run() that processes the execution of the message invoking the requested service and making the required changes in the environment memory.

message specifications

{
    'args': [],         // array of arguments to be taken from environment if not set in message
    'input': {},        // map of keys of input arguments to be set from 
                           corresponding value from environment
    'output': {},       // map of keys of output arguments to be set into 
                           corresponding value of environment
     key : value        // other key-value pairs as arguments to the service
}

run method

params: memory = {}     // map of arguments representing the environment for the message
algorithm:
    1.  Check for service specification in the message
    2.  Read the service instance by optionally using iRegistry interface
    3.  Read the service arguments
    4.  Copy arguments if necessary
    5.  Read service inputs
    6.  Set the index values
    7.  Copy required input if not exists
    8.  Copy optional input if not exists
    9.  Run the service with the message
    10. Copy output 
    11. Return memory

Example

The following is an example message in python:

memory = {}

message = snowblozm.iObject( { 
    'service': 'demo.Greet',
    'name': 'Hari' 
} )

memory = message.run( memory )

snowblozm core interfaces

Learn more about our other core interfaces:

Clone this wiki locally