Work Order Transitions
Endpoints Used
- GET
/work-orders?service={serviceId}
- This end point can be used to get the work orders for the service.
- GET
/statuses/{statusId}
- Used to get the work order status information.
- GET
/status-transitions?source={currentStatusId}&count=all
- 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
- Get all the work orders for you service.
- Identify which work order you want to work on based on the type.
- (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.
- (Optional) Retrieve the current work order status from the work order status endpoint.
- Call the end point GET
/status-transitions?source={currentStatusId}&count=all
with the current work order status.- (Looping) For each destination status, obtain the work order status details using the status ID.
- 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