If you set up an event handler on a node, work item or graph (using
pdg.Node.addEventHandler, pdg.WorkItem.addEventHandler or pdg.GraphContext.addEventHandler),
PDG passes an Event
object to the handler when the corresponding event occurs as the PDG graph is cooking.
Methods ¶
context
: pdg.GraphContext
Property
The PDG graph context that emitted the event, or contains the pdg.Node that emitted the event.
currentState
: pdg.workItemState
Property
If the event is a work item event, this is set to the current state of the work item.
dependencyId
: int
Property
If the event is a dependency or parent change event, this is the id of the dependency/parent work item
lastState
: pdg.workItemState
Property
If the event is a work item state change event, this is set to the previous work item state.
message
: str
Property
If the event is a warning or error, this string contains the message associated with that warning/error.
node
: pdg.Node
Property
The node that the event was emitted from, or None
if it as a top level
context event
workItemId
: int
Property
The id of the work item, if the event is a work item related event. This can be passed to pdg.Graph.workItemById.