Activities
From AMTech WikiDocs
Contents
Activity
Observers
(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 adquire 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
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
Observation production configuration
- Objective
- Identify which things type and observations type are required. The following example shows an example where a thing type LLRPReader produces 2 observations type observationresourcecrud and graiEPC
- Configure observations' properties required to produce selected observations and enforce security including topic, targetthings, producer, guestusers, and guesttenants. (See Observations and observation types). The following example illustrates an graiEPC observation type with:
- topic thingsInBoardroom/LLRPReader/#{smoothingResult}, placeholder #{smoothingResult} is used to group observations in child branches new or lost
- producer reunionMexicoEDN:llrpantenna#{antennaId}, placeholder #{antennaId} is used to group identify what antenna id produced the observation
- targetthings resource id reunionMexicoEDN:llrpantenna#{antennaId}:#{serialNumber}, placeholders #{antennaId} and #{serialNumber} are used to antenna id and product serial number from graiEPC values to uniquely identify the target thing.
- Placeholders
- Allows to set identifiers that will be substituted by real values at different intelligence layers, the following example illustrates.
- guesttenants #{companyPrefix}, placeholder is used to set a guesttenants from graiEPC value companyPrefix allowing to control the access to observations and things from the intelligence in the edge.
- topic thingsInBoardroom/LLRPReader/#{smoothingResult}/#{country}, placeholder is used to group observations in child branches by countries.
- Relation with thing types observation production configuration (See Thing types)
- Each thing type defines which observation types produces as part of the type semantic. The following example illustrates selecting observation type graiEPC produced by LLRPReader type.
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)
- 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
- 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
Publishing
Actions taken upon activity publication:
- the service for the activity is generated/updated
- a test user with the role follower is created. The test follower is automatically subscribed to the service. Its credentials are sent by email to the creator
- the observation production configuration, API Observers and Follower Observers are shared with service subscribers
When to deploy and publish
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