Difference between revisions of "CRUD observations"
From AMTech WikiDocs
Line 1: | Line 1: | ||
Crud observations are produced when a thing instance is created, updated or deleted. | Crud observations are produced when a thing instance is created, updated or deleted. | ||
− | + | The observations are sent if: | |
− | ** the thing type | + | * The resource is an instance of the core types AmtechM2mBridge or SmartTracker. (topic /<typeId>/<instanceId>/crud, ex. /amtechM2mBridge/bridge1/crud) |
+ | * The resource is contained inside a bridge instance (observation production, reasoners, actions, etc). They are sent to the same topic used for bridge crud, /crud/amtechM2mBridge/<bridgeInstanceId>, ex. /crud/amtechM2mBridge/bridge1 | ||
+ | * The resource is a thing of a type configured to send crud observations in at least one activity | ||
*** for creators, all activities he has created are analysed | *** for creators, all activities he has created are analysed | ||
*** for followers, all activities he is subscribed to are analysed | *** for followers, all activities he is subscribed to are analysed | ||
− | * | + | |
+ | Notes : | ||
+ | * The resource must have a valid status (not draft), otherwise the crud is not sent | ||
* The CRUD observations are sent to the topic /crud/<thingType> example "topic": "/crud/endCustomer" | * The CRUD observations are sent to the topic /crud/<thingType> example "topic": "/crud/endCustomer" | ||
− | |||
− | |||
* For things of type AmtechM2mBridge, the CRUD observation of a DELETE operation is not generated (for consistency with the logic that the deletion of a bridge deletes the topic /amtechM2mBridge where the crud observations for the bridge and its instances are) | * For things of type AmtechM2mBridge, the CRUD observation of a DELETE operation is not generated (for consistency with the logic that the deletion of a bridge deletes the topic /amtechM2mBridge where the crud observations for the bridge and its instances are) | ||
* Crud observations are only sent if the value of a property changes | * Crud observations are only sent if the value of a property changes | ||
** For properties of type collection such as the guest tenant or guest users, the content of the list is analyzed to determine if it changed. So an update of guest tenants [tenant1, tenant2] to [tenant2, tenant1] will not generate a crud observation. | ** For properties of type collection such as the guest tenant or guest users, the content of the list is analyzed to determine if it changed. So an update of guest tenants [tenant1, tenant2] to [tenant2, tenant1] will not generate a crud observation. | ||
* When creating things with a topology execution using a reasoner, are created via a PUT operation with the parameter createIfNotExist=true, so the crud observation generated will have the operation PUT | * When creating things with a topology execution using a reasoner, are created via a PUT operation with the parameter createIfNotExist=true, so the crud observation generated will have the operation PUT |
Revision as of 09:46, 7 September 2018
Crud observations are produced when a thing instance is created, updated or deleted. The observations are sent if:
- The resource is an instance of the core types AmtechM2mBridge or SmartTracker. (topic /<typeId>/<instanceId>/crud, ex. /amtechM2mBridge/bridge1/crud)
- The resource is contained inside a bridge instance (observation production, reasoners, actions, etc). They are sent to the same topic used for bridge crud, /crud/amtechM2mBridge/<bridgeInstanceId>, ex. /crud/amtechM2mBridge/bridge1
- The resource is a thing of a type configured to send crud observations in at least one activity
- for creators, all activities he has created are analysed
- for followers, all activities he is subscribed to are analysed
Notes :
- The resource must have a valid status (not draft), otherwise the crud is not sent
- The CRUD observations are sent to the topic /crud/<thingType> example "topic": "/crud/endCustomer"
- For things of type AmtechM2mBridge, the CRUD observation of a DELETE operation is not generated (for consistency with the logic that the deletion of a bridge deletes the topic /amtechM2mBridge where the crud observations for the bridge and its instances are)
- Crud observations are only sent if the value of a property changes
- For properties of type collection such as the guest tenant or guest users, the content of the list is analyzed to determine if it changed. So an update of guest tenants [tenant1, tenant2] to [tenant2, tenant1] will not generate a crud observation.
- When creating things with a topology execution using a reasoner, are created via a PUT operation with the parameter createIfNotExist=true, so the crud observation generated will have the operation PUT