Difference between revisions of "Observations production and consumption"

From AMTech WikiDocs
Jump to: navigation, search
(Observations Produced)
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=The M2MBridge produces 3 observations about its life-cycle, if those observations have been configured at the observation production configuration=
+
==Observations Produced==
    # '''m2mBridgeStarted''' when load process has finished
+
In addition to custom observations defined by plugins, the M2MBridge can produce observation types regarding its life-cycle. These observations are only produced if they have been configured as such in the bridge instance used to clone, with the exception of m2mBridgeError which is a mandatory observation production configuration. This is the list of configurable observation's production configuration:
    # '''m2mBridgeStopped''' when unload process has finished
+
# '''m2mBridgeStarted''' that is sent when the load process has finished. It needs to be configured in the "Bridge Started Observation" property of the bridge instance used as a template to clone.
    # '''m2mBridgeError''' if an error occurred at the M2MBridge level logic
+
# '''m2mBridgeStopped''' that is sent when the unload process has finished. It needs to be configured in the "Bridge Stopped Observation" property of the bridge instance used as a template to clone.
    # Any other observation produce by plugins  
+
# '''m2mBridgeHeartbeat''' that is sent with a frequency to advertise that the bridge is alive. It needs to be configured in the "Bridge Heartbeat Observation" property of the bridge instance used as a template to clone.
=The M2MBridge consumes 2 observations types, if those observation have been configured at the observation production configuration
+
# '''m2mBridgeError''' that is sent every time an error occurs in the execution of the M2MBridge. This is the only mandatory configuration and it needs to be set up in the "Bridge Error Observation" property of the bridge instance used as template to clone.
    # '''observationresourcecrud''' when a property of things instance related with the M2MBridge changes
+
# Observation types produced by plugins (plugin implementation dependent)
    # observations types implemented for a plugin as commands, the M2MBridge validates that it has a valid targetthings, the instance that will process the command
+
 
*The validation observation production configuration logic validates that only one topic has been set for Asynchronous operations
+
*Placeholders (See [[Sensor%27s_network#Placeholders_substitution|Placeholders]])
 +
** #{userId} bridge instance user id; set at [[Edge_Configuration|Edge configuration]]
 +
** #{tenantId} bridge instance tenant; set at [[Edge_Configuration|Edge configuration]]
 +
** #{bridgeId} bridge instance name; composed  by concatenating templateId Bridge instance ID to be cloned and bridgeIdPrefix Prefix to add to the unique M2MBridge identifter  see [[Edge_Configuration|Edge configuration]]
 +
 
 +
==Observations Consumed==
 +
The M2MBridge may consume observations of two different types, when those observations have been configured in the observation production configuration.
 +
# '''observationresourcecrud''' when a property of a thing instance related to the M2MBridge changes.
 +
# '''command''' - Observation types implemented for a plugin as a [[Actions#Send_command|command]] to be sent to devices. The M2MBridge validates that it has a valid [[Sensor%27s_network#targetthings|targetthings]]  (the instance type that will process the [[Actions#Send_command|command]])
 +
 
 +
==Observations Validation==
 +
The validation of the [[Observation_production_config|observation production configuration]] checks multiple  [[Validation|conditions]].
 +
The action of validation is executed at

Latest revision as of 21:10, 24 April 2018

Observations Produced

In addition to custom observations defined by plugins, the M2MBridge can produce observation types regarding its life-cycle. These observations are only produced if they have been configured as such in the bridge instance used to clone, with the exception of m2mBridgeError which is a mandatory observation production configuration. This is the list of configurable observation's production configuration:

  1. m2mBridgeStarted that is sent when the load process has finished. It needs to be configured in the "Bridge Started Observation" property of the bridge instance used as a template to clone.
  2. m2mBridgeStopped that is sent when the unload process has finished. It needs to be configured in the "Bridge Stopped Observation" property of the bridge instance used as a template to clone.
  3. m2mBridgeHeartbeat that is sent with a frequency to advertise that the bridge is alive. It needs to be configured in the "Bridge Heartbeat Observation" property of the bridge instance used as a template to clone.
  4. m2mBridgeError that is sent every time an error occurs in the execution of the M2MBridge. This is the only mandatory configuration and it needs to be set up in the "Bridge Error Observation" property of the bridge instance used as template to clone.
  5. Observation types produced by plugins (plugin implementation dependent)
  • Placeholders (See Placeholders)
    • #{userId} bridge instance user id; set at Edge configuration
    • #{tenantId} bridge instance tenant; set at Edge configuration
    • #{bridgeId} bridge instance name; composed by concatenating templateId Bridge instance ID to be cloned and bridgeIdPrefix Prefix to add to the unique M2MBridge identifter see Edge configuration

Observations Consumed

The M2MBridge may consume observations of two different types, when those observations have been configured in the observation production configuration.

  1. observationresourcecrud when a property of a thing instance related to the M2MBridge changes.
  2. command - Observation types implemented for a plugin as a command to be sent to devices. The M2MBridge validates that it has a valid targetthings (the instance type that will process the command)

Observations Validation

The validation of the observation production configuration checks multiple conditions. The action of validation is executed at