Event¶
Canonical path: o6.server.Event
Root shortcut: o6.Event
Event
dataclass
¶
Bases: MutableMapping[QualifiedName | str, Any]
Reusable server-side event draft.
Returned by Server.createEvent, and triggered as often as
needed. Because it is a mutable mapping of event fields, dict(event),
len(event), del event[key], and iteration all work, and the attributes
below can be reassigned between triggers.
Field keys are event-filter path strings such as "/BatchId", or
QualifiedName values when a namespace matters.
See Events.
Attributes¶
eventType
class-attribute
instance-attribute
¶
Functions¶
__init__
¶
__init__(
_server,
eventType=(
lambda: o6.NodeId(ns0.objtypes.BaseEventType)
)(),
source=(lambda: ns0.instances.server)(),
message="",
severity=1,
fields=dict(),
payloadSource=None,
)
trigger
¶
Emit this event once and return its EventId.
Field values are resolved from fields first, then from
payloadSource, then from the BaseEventType defaults.
Returns:
| Type | Description |
|---|---|
MaybeAwaitable[bytes]
|
The generated 16-byte EventId. |
Raises:
| Type | Description |
|---|---|
ValueError
|
|
StatusCodeError
|
The source node's EventNotifier does not permit events, or open62541 rejected the event. |