5.5.6 AddComment Method

The AddComment Method is used to apply a comment to a specific state of a Condition instance. Normally, the NodeId of the Object instance is passed as the ObjectId to the Call Service. However, some Servers do not expose Condition instances in the AddressSpace. Therefore, all Servers shall also allow Clients to call the AddComment Method by specifying ConditionId as the ObjectId. The Method cannot be called with an ObjectId of the ConditionType Node.

Signature

	AddComment(
		[in] ByteString EventId
		[in] LocalizedText Comment
		);

The parameters are defined in Table 15

Table 15 – AddComment arguments
Argument Description
EventIdEventId identifying a particular Event Notification where a state was reported for a Condition.
CommentA localized text that shall be applied to the Condition.

Method result codes in Table 16 (defined in Call Service)

Table 16 – AddComment result codes
Result Code Description
Bad_MethodInvalidThe MethodId provided does not correspond to the ObjectId provided. See 10000-4 for the general description of this result code.
Bad_EventIdUnknownSee Table 137 for the description of this result code.
Bad_NodeIdInvalid

Used to indicate that the specified ObjectId is not valid or that the Method was called on the ConditionType Node.

See 10000-4 for the general description of this result code.

Bad_InvalidArgumentThe Comment string provided exceeds the allowed length for the comment or is invalid in some other manner.

Comments

Comments are added to Event occurrences identified via an EventId. EventIds where the related EventType is not a ConditionType (or subtype of it) and thus does not support Comments are rejected.

If the Comment field is NULL (both locale and text are empty) it shall be ignored, and any existing comments will remain unchanged, and an error (Bad_InvalidArgument) shall be returned. To reset the Comment an empty text with a locale shall be provided.

A ConditionEvent with all Condition values, where the Comment Variable contains the added text, will be sent for the \state identified by the EventId. If a comment is added to a previous state (i.e. a state for which the Server has created a branch), the BranchId and all Condition values of this branch will be sent.

Table 17 specifies the AddressSpace representation for the AddComment Method.

Table 17 – AddComment Method AddressSpace definition
Attribute Value
BrowseNameAddComment
References NodeClass BrowseName DataType TypeDefinition ModellingRule
HasProperty Variable InputArgumentsArgument[] PropertyTypeMandatory
AlwaysGeneratesEventObjectTypeAuditConditionCommentEventTypeDefined in 5.10.4
ConformanceUnits
A & C Comment

If Auditing is supported, this Method shall generate an Event of AuditConditionCommentEventType for all invocations of the Method.