esi-msi-function

esi-msi-function This class is the base clase for the MSI function mapping. For consistency, all functions used by the MSI function mapping must be in a class which directly inherits from this base class. The two methods INPUT and OUTPUT only define examples how an input mehtode as well as an output message must be designed, they don’t have any function and produce an error, indivating, that they are not yet defined. Eiter overwrite them with a usefull implementation in the derived class, or shadow them with non functional properties ( e.g. INPUT= false, OUTPUT= false) so that they can not be called by accident.)

Dependencies

library version inmation core library

esi-class

2.0.0

yes

Available functions

All functions have to be called according to the ESI standard, using colons, e.g. lib:FUNCTIONNAME(params)

Documentation

INPUT(data,optTable,msgId,mapTable,msgConfig)

Input function template

Parameters

data

the input data

optTable

lua table with custom options

msgId

an Id of the incomming message, which can be used in bidirection messages to find the correct pending message. This allows to have several message in execution in parallel.

mapTable

the central mapping table from the MessageProcessor.

msgConfig

the message configuration object, which calls this methode.

Returns

  • return a directReponse, which has the same format as the input data.

  • if the respose shall be generated by the OUTPUT function, this must be nil.

  • providing a msgId is not needed for a directResponse (message is never pending).

OUTPUT(optTable,mapTable,msgConfig)

Output function template

Parameters

optTable

lua table with custom options specific to this function

mapTable

the central mapping table from the MessageProcessor.

msgConfig

the message configuration object, which calls this methode.

Returns

  • the values paramResponse, abortReponse and msgId (required for bidirectional messages only)

  • if the paramResponse is given, this is used to create a Production Parameter message,

  • if that is not given, the second parameter is used to create an abort message

  • the msgId allows to find the correct pending message for this function.

  • That way several messages can run in parallel.