Skip to content

Work Order Transitions

Endpoints Used

  1. GET /work-orders?service={serviceId}
    1. This end point can be used to get the work orders for the service.
  2. GET /statuses/{statusId}
    1. Used to get the work order status information.
  3. GET /status-transitions?source={currentStatusId}&count=all
    1. Gets a list of where the work order can be progressed too.

Goal

Managing a workflow involves guiding it from the beginning to the end and determining the appropriate status that a work order can transition to.

Steps to Follow

  1. Get all the work orders for you service.
    1. Identify which work order you want to work on based on the type.
    2. (Optional) If you lack awareness of the work order types, you can obtain all the types from the work order types endpoint specified in the API specification documentation.
  2. (Optional) Retrieve the current work order status from the work order status endpoint.
  3. Call the end point GET /status-transitions?source={currentStatusId}&count=all with the current work order status.
    1. (Looping) For each destination status, obtain the work order status details using the status ID.
  4. Modify the work order using the PUT endpoint specified in the API specification document.

Sequence Diagram

sequenceDiagram
    participant Service
    participant Work Order
    participant Work Order Type
    participant Work Order Status
    Service->>Work Order: Get the Work Orders for the Service
    Work Order->>Work Order Type: If required Get the Work Order Type
    Work Order->>Work Order Status: Get the current Work Order Status
    Work Order Status->>Work Order Transition: Get the statuses the Work Order can progress too
    loop Get Available Statuses
        Work Order Transition->>Work Order Status: Get each Work Order Status Information
    end
    Work Order Status->> Work Order: Update the Workorder with the new status