Difference between revisions of "Execution engine"

From AMTech WikiDocs
Jump to: navigation, search
Line 1: Line 1:
 
 
== How it works ==
 
== How it works ==
 
[[File:RuleEngineHowItWorks.jpg]]
 
[[File:RuleEngineHowItWorks.jpg]]
Line 25: Line 24:
 
     </syntaxhighlight>
 
     </syntaxhighlight>
 
;This is a strong mechanism you can use to trace the execution of your activities if, at a given moment, you think they are not working as expected.
 
;This is a strong mechanism you can use to trace the execution of your activities if, at a given moment, you think they are not working as expected.
 +
 
== Security context ==
 
== Security context ==
 
When you create a reasoner, a dialog appears where you should select a name and an execution behavior. In the case where the execution behavior is to visit all the things returned by the observer, you should also select the security context under which the reasoner will run. Two different options are available:  
 
When you create a reasoner, a dialog appears where you should select a name and an execution behavior. In the case where the execution behavior is to visit all the things returned by the observer, you should also select the security context under which the reasoner will run. Two different options are available:  
Line 33: Line 33:
 
*: It means that the observer will return all the things readable by the service. Also, all actions that create objects (things, observations, notifications, etc) will ask you to select between the security context of the observation being consumed and the security context of the thing being visited as the security context of the object being created.  
 
*: It means that the observer will return all the things readable by the service. Also, all actions that create objects (things, observations, notifications, etc) will ask you to select between the security context of the observation being consumed and the security context of the thing being visited as the security context of the object being created.  
 
[[File:action_security.png|650px|thumbnail|center|Security for objects being created]]
 
[[File:action_security.png|650px|thumbnail|center|Security for objects being created]]
 +
 +
== Extension module ==
 +
===EPC===
 +
===Debug===

Revision as of 15:55, 2 May 2016

How it works

RuleEngineHowItWorks.jpg

Execution feedback and/or errors

When an activity is being executed by the execution engine an observationlifecycle type is sent to the activity_lifecycle topic. Some events are reported through the property event, among this events:

  • Start of a reasoner (BEGIN)
  • End of a reasoner (END)
  • Execution errors (ERROR)

The following example illustrates activity "producer": "thingsInBoardroom" reporting action "resourceuri": "/amtech/activities/thingsInBoardroom/reasoners/createThingInBoardroomFromEddystoneBeacon/actions/ReportThingInBoardroom" started "event": "BEGIN"

    {
        "topic": "/activity_lifecycle/thingsInBoardroom",
        "guesttenants": [
            "_ALL"
        ],
        "event": "BEGIN",
        "@type": "/amtech/linkeddata/types/composite/observation/observationlifecycle",
        "producer": "thingsInBoardroom",
        "resourceuri": "/amtech/activities/thingsInBoardroom/reasoners/createThingInBoardroomFromEddystoneBeacon/actions/ReportThingInBoardroom",
        "detectiontime": "Tue Apr 26 21:41:09 UTC 2016",
        "@id": "/amtech/things/observations/983c488f-c3d4-44ec-85f2-795428d12d83",
        "occurrencetime": "Tue Apr 26 21:41:08 UTC 2016"
    }
This is a strong mechanism you can use to trace the execution of your activities if, at a given moment, you think they are not working as expected.

Security context

When you create a reasoner, a dialog appears where you should select a name and an execution behavior. In the case where the execution behavior is to visit all the things returned by the observer, you should also select the security context under which the reasoner will run. Two different options are available:

Security from observation or service
  • Observation's security context.
    It means that the observer will return only those things readable by the tenant of the observation. Also, all actions that create objects (things, observations, notifications, etc) will initialize the security context of the object being created with the security context of the observation being consumed.
  • Service's security context.
    It means that the observer will return all the things readable by the service. Also, all actions that create objects (things, observations, notifications, etc) will ask you to select between the security context of the observation being consumed and the security context of the thing being visited as the security context of the object being created.
Security for objects being created

Extension module

EPC

Debug