The ActionState is used to indicate the current state of an Action execution. It is an enumeration of the possible states. The enumeration values are described in Table 80.

Table 80 – ActionState values

Name

Value

Description

Idle

0

The Action is waiting for activation by a Requestor

Executing

1

The Action is managing an Action execution.

Done

2

The Action was completed,The related return values of the last Action call are available

The ActionState representation in the AddressSpace is defined in Table 81.

Table 81 – ActionState definition

Attribute

Value

BrowseName

ActionState

IsAbstract

False

References

Node Class

BrowseName

DataType

TypeDefinition

Others

Subtype of Enumeration defined in OPC 10000-5

HasProperty

Variable

EnumStrings

LocalizedText []

PropertyType

Conformance Units

PubSub Parameters PublishedDataSet Action

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.

The Action specific use of PubSub configuration parameters is defined in Table 84.

Note that the reliability of the protocol depends on the QoS levels supported by the protocol. Any Broker-based middleware that is using a QoS of AtLeastOnce or greater is reliable (see 6.4.2.5.4). Broker-less middle is not reliable if it does not support any DatagramQoS (see 6.4.1.2.6).

Table 84 – Action specific use of parameters

PubSubComponent

Parameter

Description

PubSubConnectionDataType

ReaderGroups

Readers are not used for Actions.

WriterGroupDataType

PublishingInterval

The value is 0 for reliable transport protocols.

The value shall be larger than 0 for non-reliable transport protocols.

The Requestor and Responder resends Action messages that have not been acknowledged by the receiver with this frequency.

KeepAliveTime

This value is not used and set to 0.

HeaderLayoutUri

For JSON messages the JSON-NetworkMessage header layout URI is used (see A.3.4).

For UADP messages this value is UADP-Dynamic header layout URI is used (see A.2.2).

BrokerWriterGroupTransportDataType

QueueName

The address that the Requestor uses to send requests to the Responder.

RequestedDelivery‌Guarantee

Shall be AtLeastOnce or better

UadpWriterGroupMessageDataType

SamplingOffset

Always -1.

NetworkMessageContentMask

Bit 0: PublisherId is always 1

JsonWriterGroupMessageDataType

NetworkMessageContentMask

Bit 0: NetworkMessageHeader is always 1.

Bit 1: DataSetMessageHeader is always 1.

Bit 2: SingleDataSetMessage is always 0.

Bit 3: PublisherId is always 1

Bit 5: ReplyTo is is always 0.

DataSetWriterDataType

DataSetFieldContentMask

Always 0.

KeyFrameCount

Always 0.

DataSetName

The name of the ActionMetaData.

UadpDataSetWriterMessageDataType

DataSetMessageContentMask

Bit 1: PicoSeconds is always 0.

Bit 2: Status is always 1, however, it is not sent in requests.

JsonDataSetWriterMessageDataType

DataSetMessageContentMask

Bit 2: SequenceNumber is always 0.

Bit 4: Status is always 1, however, it is not sent in requests.

Bit 5: MessageType is always 0.

Bit 8: PublisherId is always 0

DatagramWriterGroupTransport2DataType

MessageRepeatCount

Always 0

MessageRepeatDelay

Always 0

BrokerDataSetWriterTransportDataType

QueueName

Not used.

RequestedDelivery‌Guarantee

Not used.

MetaDataQueueName

The address used to send ActionMetaData Messages.