Table 62 defines the UpdateEventDetails structure.

Table 62 – UpdateEventDetails Structure

Name

Type

Description

UpdateEventDetails

Structure

The details for insert, replace, and insert/replace history Event updates.

nodeId

NodeId

Node id of the Object to be updated.

performInsertReplace

PerformUpdateType

Value determines which action of insert, replace, or update is performed. The Delete enumeration value is not allow and will result in a Bad_InvalidArgument error.

filter

EventFilter

If the history of Notification conforms to the EventFilter, the history of the Notification is updated.

eventData[]

HistoryEventFieldList

List of Event Notifications to be inserted or updated (see 6.6.4 for HistoryEventFieldList definition).

Its representation in the AddressSpace is defined in Table 63.

Table 63 – UpdateEventDetails definition

Attribute

Value

BrowseName

UpdateEventDetails

IsAbstract

False

References

NodeClass

BrowseName

DataType

TypeDefinition

Other

Subtype of the HistoryUpdateDetails DataType defined in Table 56.

Conformance Units

Historical Access Replace Event

Historical Access Update Event

Historical Access Insert Event

This function is intended to insert new entries, e.g., backfilling of historical Events.

Setting performInsertReplace = INSERT inserts entries into the Event history database for one or more HistoricalEventNodes. The whereClause parameter of the EventFilter shall be empty. The selectClause shall, as a minimum, provide the following Event fields: EventType, and Time. It is also recommended that the SourceNode and the SourceName fields are provided.

If one of the required fields is not provided then the statusCode shall indicate Bad_ArgumentsMissing. If the historian does not support archiving the specified EventType then the statusCode shall indicate Bad_TypeDefinitionInvalid. If the SourceNode is not a valid source for Events then the related operationResults entry shall indicate Bad_SourceNodeIdInvalid. If the Time does not fall within a range that can be stored then the related operationResults entry shall indicate Bad_OutOfRange. The selectClause shall include all mandatory fields that are configured to be stored for the EventType. If the selectClause does not include a mandatory field then the statusCode shall indicate Bad_ArgumentsMissing. If the selectClause specifies fields which are not valid for the EventType or cannot be saved by the Historian then the related operationResults entry shall indicate Good_DataIgnored. Additional information about the ignored fields shall be provided through DiagnosticInformation related to the operationResults. The symbolicId contains the index of each ignored field separated with a space and the localizedText contains the symbolic names of the ignored fields.

The EventId is a Server generated opaque value and a Client cannot assume that it knows how to create unique EventIds. A Server shall automatically generate an EventId when not provided by the Client. If a Client does specify the EventId in the selectClause and it matches an existing EventId then the statusCode shall indicate Bad_EntryExists.

If any errors occur while processing individual fields then the related operationResults entry shall indicate Bad_InvalidArgument and the invalid fields shall be indicated in the DiagnosticInformation related to the operationResults entry.

The IndexRange parameter of the SimpleAttributeOperand is not valid for insert operations and the StatusCode shall specify Bad_IndexRangeInvalid if one is specified.

A Client may instruct the Server to choose a suitable default value for a field by specifying a value of null. If the Server is not able to select a suitable default then the corresponding entry in the operationResults array for the affected Event shall be Bad_InvalidArgument.

This function is intended to replace fields in existing Event entries, e.g., correct Event data that contained incorrect data due to a bad sensor.

Setting performInsertReplace = REPLACE replaces entries in the Event history database for the specified EventIds for one or more HistoricalEventNodes. The selectClause parameter of the EventFilter shall specify the EventId Property and the eventData shall contain the EventId which will be used to find the Event to be replaced. If no entry exists matching the specified EventId then no replace operation will be performed; instead, the operationResults entry for the eventData entry shall indicate Bad_NoEntryExists. The whereClause parameter of the EventFilter shall be empty.

If the selectClause specifies fields which are not valid for the EventType or cannot be saved or changed by the historian then the operationResults entry for the affected Event shall indicate Good_DataIgnored. Additional information about the ignored fields shall be provided through DiagnosticInformation related to the operationResults. The symbolicId contains the index of each ignored field separated with a space and the localizedText contains the symbolic names of the ignored fields.

If fatal errors occur while processing individual fields then the operationResults entry for the affected Event shall indicate Bad_InvalidArgument and the invalid fields shall be indicated in the DiagnosticInformation related to the operationResults entry.

This function is intended to unconditionally insert/replace Events.

Setting performInsertReplace = UPDATE inserts or replaces entries in the Event history database for the specified filter for one or more HistoricalEventNodes.

The Server will, based on its own criteria, attempt to determine if the Event already exists; if it does exist then the Event will be deleted and the new Event will be inserted (retaining the EventId). If the EventID was provided then the EventID will be used to determine if the Event already exists. If the Event does not exist then a new Event will be inserted, including the generation of a new EventId, if the provided EventId does not match the unique requirements in the Server for EventIds.

All of the restrictions, behaviours, and errors specified for the Insert functionality (see 6.9.4.2) also apply to this function.

If an existing Event entry was replaced successfully then the related operationResults entry shall be Good_EntryReplaced. If a new Event entry was created then the related operationResults entry shall be Good_EntryInserted. If the Server cannot determine whether it replaced or inserted an entry then the related operationResults entry shall be Good.