User Tools

Site Tools


sib:callers:generalcaller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
sib:callers:generalcaller [2019/05/13 11:37]
hubbe
sib:callers:generalcaller [2019/09/20 07:23] (current)
hubbe
Line 32: Line 32:
  return callback( {success:​true,​ message:"​Caller method run", _sibheader: msg._sibheader} );   return callback( {success:​true,​ message:"​Caller method run", _sibheader: msg._sibheader} );
  },  },
 + init: ( thisCaller )=>{},
  inputFormat:​ (topic, msg, callback)=>​{  inputFormat:​ (topic, msg, callback)=>​{
  // Format the input data  // Format the input data
Line 39: Line 40:
  // Format the output data  // Format the output data
  callback( msg );  callback( msg );
- },  + },
- +
  mqtt: "​mqtt://​localhost",​ //​ MQTT Server to listen to  mqtt: "​mqtt://​localhost",​ //​ MQTT Server to listen to
  topic: "​SIB/​SAMPLES/​GENERALCALLER",​ //​ MQTT Topic to subscribe to  topic: "​SIB/​SAMPLES/​GENERALCALLER",​ //​ MQTT Topic to subscribe to
Line 58: Line 58:
   * _name: A plaintext description of this service   * _name: A plaintext description of this service
   * getData(topic,​ msg, callback): The data collection method. The topic and message triggering the workflow is passed as arguments and on completion the callback method must be run with the response data in JSON format as the only argument.   * getData(topic,​ msg, callback): The data collection method. The topic and message triggering the workflow is passed as arguments and on completion the callback method must be run with the response data in JSON format as the only argument.
 +  * init(thisCaller):​ If defined this method is executed when the service is starting up as the last step of initialization. //​thisCaller//​ is a reference to the instance of the caller that does the method call.
   * inputFormat(topic,​ msg, callback): The method that is run on service activation. The original message is passed as the argument and the input to the callback method must be a JSON formatted message conforming to the SIB message standard.   * inputFormat(topic,​ msg, callback): The method that is run on service activation. The original message is passed as the argument and the input to the callback method must be a JSON formatted message conforming to the SIB message standard.
   * outputFormat(topic,​ msg, callback): This message is run on the response data before publishing to the response topic. The response message is passed as the argument and the input to the callback method must be a JSON formatted message conforming to the SIB message standard.   * outputFormat(topic,​ msg, callback): This message is run on the response data before publishing to the response topic. The response message is passed as the argument and the input to the callback method must be a JSON formatted message conforming to the SIB message standard.
sib/callers/generalcaller.txt · Last modified: 2019/09/20 07:23 by hubbe