The Action execution sequence and the related ActionMetaData for an Action execution through a reliable transport protocol like MQTT is described in Figure 26.

image029.png

Figure 26 – Action execution sequence reliable transport

The RequestId is unique within the context of a RequestorId and CorrelationData. Each Action request in a single NetworkMessage has a different RequestId. Multiple NetworkMessages with the same RequestorId and CorrelationData may be sent.

Multiple Responses may be sent in the same NetworkMessage if the corresponding requests have the same RequestorId and CorrelationData. The grouping of requests in NetworkMessages does not affect the grouping of Responses into NetworkMessages.

The Action execution sequence for an Action execution through a non-reliable transport protocol like UDP is described in Figure 27. The related ActionMetaData is described in Figure 26. It shows the use of the ActionState for a non-reliable transport protocol. The request and response messages are send in the PublishingInterval of the Responder as long as the ActionState requires the exchange of messages for a Action execution.

The state changes for Action execution are defined in Table 82 for the Requestor and in Table 83 for the Responder.

Table 82 – Action execution state changes Requestor

Current State

Condition

Event

State for next message

Idle

Start Action execution

Requestor sends Request Message with ActionState = Executing.

Executing

Executing

PublishingInterval expired and no Done or Executing received from Responder.

Requestor sends Request Message again with ActionState = Executing.

Executing

Executing

Received Done from Responder

Requestor sends Request Message with ActionState = Idle

Idle

Done

PublisihingInterval expire and no Idle received.

Requestor sends Request Message again with ActionState = Idle.

Idle

Done

Received Idle from Responder

None

Table 83 – Action execution state changes Responder

Current State

Condition

Event

State for next message

Idle

Receives RequestMessage for a new combination of RequestorId, CorrelationData and RequestId.

Begins processing Action.

Executing

Executing

PublshingInterval expired and Action execution is still in progress.

Responder sends Response Message with ActionState = Executing, Status = Good and the payload is empty.

Executing

Executing

Action execution completed.

Responder sends Response Message with ActionState = Done, Status = Action result and payload provided for Good and Uncertain Status and payload is empty for Bad Status.

Done

Done

PublshingInterval expired and did not receive Idle from Requestor yet

Responder sends Response Message again with ActionState = Done until Idle is received from the Requestor or the time duration defined by the TimeoutHint request parameter ends.

Done

Done

Received Idle from Requestor

None

image030.png

Figure 27 – Action execution sequence non-reliable transport

Errors during the execution of an Action are reported in the Status of the Action response message.

For some errors such as decoding errors for the request message, addressing errors or failing security checks, the Responder does not produce a response message. Therefore the Requestor should have an internal timeout setting to stop waiting for a response message.