Defines distinct callback functions invoked by the master controller whenever the state of an assigned order changes.

Hierarchy

  • OrderEventHandler

Methods

  • Invoked whenever an order's node or edge action state has changed (optional).

    Remarks

    If action state changes to FAILED, an accompanying error object may be reported by the AGV. However, if an order is rejected because an order action is not executable in the first place, this error is reported by the onOrderProcessed callback.

    To check whether the action is on a node or on an edge and to use the target parameter in a type-safe way, discriminate by ("nodeId" in target) or ("edgeId" in target), respectively.

    Parameters

    • actionState: ActionState

      the new action state

    • withError: Error

      an Error object in case a failed action reports an error; otherwise undefined

    • action: Action

      the related action

    • target: Edge | Node

      the node or edge related to the action

    • context: OrderContext

      context information of the order event

    Returns void

  • Invoked whenever an order's edge has been traversed (optional).

    An order (base) edge is traversed when the AGV has reached the edge's end node target position and all the edge's active actions are being terminated.

    Remarks

    This callback is only triggered for base edges, not for horizon edges.

    Parameters

    • edge: Edge

      the traversed edge

    • startNode: Node

      the start node of the traversed edge

    • endNode: Node

      the end node of the traversed edge

    • context: OrderContext

      context information of the order event

    Returns void

  • Invoked to report changes in certain State properties while an order's edge is being traversed (optional).

    Changes are being reported for the following State properties:

    • distanceSinceLastNode
    • driving
    • newBaseRequest
    • operatingMode
    • paused
    • safetyState

    Note that only the delta changes are reported relative to the previous edgeTraversing event. On the first event, the current values of all State properties as defined above are reported.

    Remarks

    The first invocation of this event handler is triggered as soon as the AGV is ready to traverse the edge. In this case, the driving state can still be false.

    Parameters

    • edge: Edge

      the traversing edge

    • startNode: Node

      the start node of the traversing edge

    • endNode: Node

      the end node of the traversing edge

    • stateChanges: Partial<Pick<State, "distanceSinceLastNode" | "driving" | "newBaseRequest" | "operatingMode" | "paused" | "safetyState">>

      edge-related State properties that have changed

    • invocationCount: number

      the one-based number of invocations of this callback for the current traversing edge (starts with 1 for the first invocation)

    • context: OrderContext

      context information of the order event

    Returns void

  • Invoked whenever an order's node has been traversed (optional).

    An order (base) node is traversed when the AGV has reached the node's target position and the node's actions are being triggered.

    Remarks

    This callback is only triggered for base nodes, not for horizon nodes.

    Parameters

    • node: Node

      the target node

    • nextEdge: Edge

      the released or unreleased edge following the traversed node or undefined if no such edge exists.

    • nextNode: Node

      the released or unreleased end node of the edge following the traversed node or undefined if no such node exists.

    • context: OrderContext

      context information of the order event

    Returns void

  • Invoked once when the assigned order has been processed successfully, canceled successfully (by instant action "cancelOrder"), or rejected with an error in the first place because the order is not executable by the AGV.

    Remarks

    An order is processed if all the order's base nodes/edges have been traversed and all base node/edge actions have been finished or failed. Yet, the order may still be active if it contains horizon nodes/edges. In such a case, you can then assign an order update or cancel the order.

    After this callback has been invoked, no more callbacks related to the assigned order are invoked afterwards. Events on a subsequent order update are emitted on the event handlers of the newly assigned order update.

    Parameters

    • withError: Error

      an Error object if order has been rejected in the first place because it is not executable; otherwise undefined

    • byCancelation: boolean

      true if executing order has been canceled before this callback is invoked; otherwise false

    • active: boolean

      true if order is still active after processing, otherwise false

    • context: OrderContext

      context information of the order event

    Returns void

Generated using TypeDoc