Difference between revisions of "Activities"

From AMTech WikiDocs
Jump to: navigation, search
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Activity ==
 
== Activity ==
There are 2 type of activities:
+
Activities are defined by Creators and they include the business rules for monitoring things, producing observations and notifications. They also include the access control definition
# Activities for real time intelligence needs : activities with [[Reasoners]]  
+
There are 2 types of activities:
# Activities for bridge execution on the edge : activities without reasoners, but including Actors, with the goal of defining services for the edge, that will include access to thing and observation types required by the edge intelligence runing on a bridge
+
# Activities for real-time intelligence needs : activities with [[Reasoners]]  
 +
# Activities for bridge execution on the edge : activities without Reasoners, but including Actors, with the goal of defining services for the edge, that will include access to thing and observation types required by the edge intelligence running on a bridge
  
[https://en.wikipedia.org/wiki/Business_activity_monitoring Activity] is a resource that links resource types Actor, Observer, Reasoner, Actions, Topics, Things, Observations and [[#Observation_production_configuration|Observation Production Configuration]] with the objectives of:   
+
[https://en.wikipedia.org/wiki/Business_activity_monitoring Activity] is a resource that links resource of type Actor, Observer, Reasoner, Actions, Topics, Things and Observations with the objectives of:   
*Deploy and publish reasoners to be executed in the cloud
+
*Deploy and publish Reasoners to be executed in the cloud
*Publish Observation production configuration to be executed at M2MBridge
+
 
*Deploy Edge Reasoners to be executed in the M2MBridge
 
*Deploy Edge Reasoners to be executed in the M2MBridge
 
*SaaS unit of deployment
 
*SaaS unit of deployment
 
**Allow followers to subscribe to activities
 
**Allow followers to subscribe to activities
 +
  
 
== Observers ==
 
== Observers ==
 +
* They allow filtering the things to be affected by the business logic.
 +
* Things can be filtered based on multiple search criteria
 +
* Filter can be applied to things in relation to an observation received.
 +
 
The activities have three collections of observers
 
The activities have three collections of observers
* observers
+
* Observers
* observers for API
+
* Observers for API
* observers for follower
+
* Observers for Follower
  
 
The first collection contains the [[Observers#Activity_observers|activity observers]] while the other two are links to query observers that will be shared with those subscribed to the service associated to the current activity. For details on defining or executing observers, please see [[Observers]].
 
The first collection contains the [[Observers#Activity_observers|activity observers]] while the other two are links to query observers that will be shared with those subscribed to the service associated to the current activity. For details on defining or executing observers, please see [[Observers]].
Line 23: Line 28:
 
* Actors are resources that define access control policies to thing and notification types
 
* Actors are resources that define access control policies to thing and notification types
 
* Actors are defined for a tenant and they are not shared with other tenants (although their names must be unique accross tenants)
 
* Actors are defined for a tenant and they are not shared with other tenants (although their names must be unique accross tenants)
* Actors are associated to activities, meaning that the follower admin that subscribes to the service will adquire all those access control policies. The follower admin can then selectively give actors to the other followers he invites.
+
* Actors are associated to activities, meaning that the follower admin that subscribes to the service will acquire all those access control policies. The follower admin can then selectively give actors to the other followers he invites.
 
+
== Thing types ==
+
* Things types are used in observers and reasoners
+
* Access to thing types is defined in the actors that are associated to the activity
+
* Thing types have a configuration for the production of observations that is used in the activity. Each thing type has the set of observations it may produce. This will be the observations available for selection when configuring the observation production of that thing type inside the activity observation production configuration
+
  
 
== Notification types ==
 
== Notification types ==
Line 44: Line 44:
 
See [[Actions]]
 
See [[Actions]]
  
==CRUD operations==
 
* When a CRUD (Create/Update/Delete) operation is executed over a thing instance an observation type observationresourcecrud is sent to the topic /crud/<thingType> example "topic": "/crud/endCustomer"
 
* This option is configured at Activity by adding the thing type to the Crud observations producers list
 
 
 
== API's observers ==
 
== API's observers ==
*list of [[Observers|observers]] published with the activity for integration, it can be request by [[Access_control#Roles|followers]] with [[Activities#Actors|access policies]] to the resources use in the configuration of the observer.
+
*List of [[Observers|observers]] published with the activity for integration, it can be requested by [[Access_control#Roles|followers]] with [[Activities#Actors|access policies]] to the resources used in the configuration of the observer.
  
 
== Validation for publication ==
 
== Validation for publication ==
Line 55: Line 51:
 
In order to be published, an activity must be a valid json resource according to its metadata. All resources contained in the activity must also be valid for their metadata.
 
In order to be published, an activity must be a valid json resource according to its metadata. All resources contained in the activity must also be valid for their metadata.
 
The follower specific validations are also performed on the activity (some generate warning, others generate errors that will not allow publication)
 
The follower specific validations are also performed on the activity (some generate warning, others generate errors that will not allow publication)
 +
 +
<br/>Validations errors (Do not allow to publish activity)
 
* Types involved in reasoners, observers and actors must be published
 
* Types involved in reasoners, observers and actors must be published
** If there is an unpublished type that is used, and it is owned by the activity owner, a warning is generated
+
* Types involved in reasoners and observers must have actors that give access to them
** If the unpublished type is owned by another user, an error is generated
+
* Types used in actors are involved in reasoners or observers (if not, a warning is generated)
+
* Actors must not contain policies for notifications of a different activity
+
 
* Reasoners must have topic, actions, and must have been run at least one in the debugger
 
* Reasoners must have topic, actions, and must have been run at least one in the debugger
 +
 +
<br/>Validation Warnings
 +
* Types used in actors must be involved in reasoners or observers
 +
* Properties have been added to a type that is already published
 +
* Types involved in reasoners, observers and actors have been already published but some properties were added to them after publication (the type should be published again)
  
 
== Publishing ==
 
== Publishing ==
 
Actions taken upon activity publication:
 
Actions taken upon activity publication:
* the service for the activity is generated/updated
+
* The service for the activity is generated/updated
* the observation production configuration, API Observers and Follower Observers are shared with service subscribers
+
* API Observers and Follower Observers are shared with service subscribers
* a test user with the role follower is created.  
+
* A test user with the role follower is created.
 +
* Types involved in the activity are automatically shared with the service guest tenants, with confirmation from the user
  
 
== Unpublishing ==
 
== Unpublishing ==
 
The topology of an activity can be undeployed by selecting the activity, and going to the Execution Status menu, where actions can be taken on the topology, such as watching the logs, and undeploying the topology.
 
The topology of an activity can be undeployed by selecting the activity, and going to the Execution Status menu, where actions can be taken on the topology, such as watching the logs, and undeploying the topology.
Note that the unpublish process has no effect on the publication of the activity, so all the resources shared, and the actors given to users subscribed to the acivity remain unchanged. The undeploy process has effect only on the topology.
+
Note that the unpublish process has no effect on the publication of the activity, so all the resources shared, and the actors given to users subscribed to the activity remain unchanged. The undeploy process has effect only on the topology.
 +
 
 +
== Subscribing to an activity ==
 +
Admin followers can subscribe to services shared with its tenant.
 +
Upon subscription to a service :
 +
* The admin follower acquires the actors of the service
 +
* Followers invited to the admin follower's tenant won't be updated with this new subscription. Invited followers actors are only updated via the Team menu option, when they are invited to a tenant, or when the admin follower unsubscribes from a service (see below)
 +
 
 +
Admin followers can unsubscribe from a service.
 +
Upon unsubscription to a service :
 +
* The follower loses the actors of the service. Note that actors of the service that the user received via another service the user is subscribed to, will remain associated to the user
 +
* All users that the follower invited to its tenant will be updated, removing the actors from the service from them, in case they have them.
  
 
Test User with role Follower
 
Test User with role Follower
* the test follower is automatically created when the creator publishes an activity
+
* The test follower is automatically created when the creator publishes an activity
* it is automatically subscribed to the service
+
* It is automatically subscribed to the service
* its credentials are sent by email to the creator.  
+
* Its credentials are sent by email to the creator.  
* it is generated with an ID in the form of follower_<creatorId>@@<creatorEmailDomain>.  
+
* It is generated with an ID in the form of follower_<creatorId>@@<creatorEmailDomain>.  
* this test follower allows the creator to test the follower experience, without having to create a new user and subscribe it to the services.
+
* This test follower allows the creator to test the follower experience, without having to create a new user and subscribe it to the services.
  
 
== When to deploy and publish ==
 
== When to deploy and publish ==
* a new reasoner has been created
+
* A new reasoner has been created
* an existing reasoner has been modified or deleted
+
* An existing reasoner has been modified or deleted
* a new action has been created
+
* A new action has been created
* an extincting action have been modified or deleted
+
* An existent action have been modified or deleted
* observation production configuration has changed
+
* Observation production configuration has changed
* actors has been modified  
+
* Actors has been modified  
;deployed activities are stooped for a short period of time an restarted
+
;Deployed activities are stooped for a short period of time an restarted
  
 
== When to publish only ==
 
== When to publish only ==
 
Publishing an activity is needed when:
 
Publishing an activity is needed when:
* a new configuration of observation production is added
+
* A new configuration of observation production is added
* a new observer is added to the list of Follower Observers or API Observers
+
* A new observer is added to the list of Follower Observers or API Observers
  
 
== How it works ==
 
== How it works ==
 
[[File:RuleEngineHowItWorks.jpg]]
 
[[File:RuleEngineHowItWorks.jpg]]
 +
 +
== Activity Tree view ==
 +
The activity tree view is a graph with 3 views
 +
*reasoners represents the relation between observation, topic, observer, reasoner, actions and actors
 +
[[File:Tv1.png|1150px|thumbnail|center|reasoners]]
 +
*actors represents the relation between thing, notification, access polices and actors
 +
[[File:Tv2.png|850px|thumbnail|center|actors]]
 +
*observations represents the observations produce by thing
 +
[[File:Tv3.png|850px|thumbnail|center|observations]]
 +
*The resources represented in the graph if they click navigate to the corresponding editors

Latest revision as of 11:42, 18 January 2021

Activity

Activities are defined by Creators and they include the business rules for monitoring things, producing observations and notifications. They also include the access control definition There are 2 types of activities:

  1. Activities for real-time intelligence needs : activities with Reasoners
  2. Activities for bridge execution on the edge : activities without Reasoners, but including Actors, with the goal of defining services for the edge, that will include access to thing and observation types required by the edge intelligence running on a bridge

Activity is a resource that links resource of type Actor, Observer, Reasoner, Actions, Topics, Things and Observations with the objectives of:

  • Deploy and publish Reasoners to be executed in the cloud
  • Deploy Edge Reasoners to be executed in the M2MBridge
  • SaaS unit of deployment
    • Allow followers to subscribe to activities


Observers

  • They allow filtering the things to be affected by the business logic.
  • Things can be filtered based on multiple search criteria
  • Filter can be applied to things in relation to an observation received.

The activities have three collections of observers

  • Observers
  • Observers for API
  • Observers for Follower

The first collection contains the activity observers while the other two are links to query observers that will be shared with those subscribed to the service associated to the current activity. For details on defining or executing observers, please see Observers.

Actors

  • Actors are resources that define access control policies to thing and notification types
  • Actors are defined for a tenant and they are not shared with other tenants (although their names must be unique accross tenants)
  • Actors are associated to activities, meaning that the follower admin that subscribes to the service will acquire all those access control policies. The follower admin can then selectively give actors to the other followers he invites.

Notification types

See Notifications

  • Notifications are defined as types in the same way that things and observations are.
  • A notification type contains well-known supported properties, such as subject and body.
  • Notifications types can be used in actor's policies to define access to the instances of the notifications types
  • Instances of a notification type can be generated using an action notify in a reasoner

Reasoners

See Reasoners

Actions

See Actions

API's observers

  • List of observers published with the activity for integration, it can be requested by followers with access policies to the resources used in the configuration of the observer.

Validation for publication

In order to be published, an activity must be a valid json resource according to its metadata. All resources contained in the activity must also be valid for their metadata. The follower specific validations are also performed on the activity (some generate warning, others generate errors that will not allow publication)


Validations errors (Do not allow to publish activity)

  • Types involved in reasoners, observers and actors must be published
  • Types involved in reasoners and observers must have actors that give access to them
  • Reasoners must have topic, actions, and must have been run at least one in the debugger


Validation Warnings

  • Types used in actors must be involved in reasoners or observers
  • Properties have been added to a type that is already published
  • Types involved in reasoners, observers and actors have been already published but some properties were added to them after publication (the type should be published again)

Publishing

Actions taken upon activity publication:

  • The service for the activity is generated/updated
  • API Observers and Follower Observers are shared with service subscribers
  • A test user with the role follower is created.
  • Types involved in the activity are automatically shared with the service guest tenants, with confirmation from the user

Unpublishing

The topology of an activity can be undeployed by selecting the activity, and going to the Execution Status menu, where actions can be taken on the topology, such as watching the logs, and undeploying the topology. Note that the unpublish process has no effect on the publication of the activity, so all the resources shared, and the actors given to users subscribed to the activity remain unchanged. The undeploy process has effect only on the topology.

Subscribing to an activity

Admin followers can subscribe to services shared with its tenant. Upon subscription to a service :

  • The admin follower acquires the actors of the service
  • Followers invited to the admin follower's tenant won't be updated with this new subscription. Invited followers actors are only updated via the Team menu option, when they are invited to a tenant, or when the admin follower unsubscribes from a service (see below)

Admin followers can unsubscribe from a service. Upon unsubscription to a service :

  • The follower loses the actors of the service. Note that actors of the service that the user received via another service the user is subscribed to, will remain associated to the user
  • All users that the follower invited to its tenant will be updated, removing the actors from the service from them, in case they have them.

Test User with role Follower

  • The test follower is automatically created when the creator publishes an activity
  • It is automatically subscribed to the service
  • Its credentials are sent by email to the creator.
  • It is generated with an ID in the form of follower_<creatorId>@@<creatorEmailDomain>.
  • This test follower allows the creator to test the follower experience, without having to create a new user and subscribe it to the services.

When to deploy and publish

  • A new reasoner has been created
  • An existing reasoner has been modified or deleted
  • A new action has been created
  • An existent action have been modified or deleted
  • Observation production configuration has changed
  • Actors has been modified
Deployed activities are stooped for a short period of time an restarted

When to publish only

Publishing an activity is needed when:

  • A new configuration of observation production is added
  • A new observer is added to the list of Follower Observers or API Observers

How it works

RuleEngineHowItWorks.jpg

Activity Tree view

The activity tree view is a graph with 3 views

  • reasoners represents the relation between observation, topic, observer, reasoner, actions and actors
reasoners
  • actors represents the relation between thing, notification, access polices and actors
actors
  • observations represents the observations produce by thing
observations
  • The resources represented in the graph if they click navigate to the corresponding editors