OS1 Services
Orchestrator Service

Cancellation Manager Plugin

12min

Cancellation manager contains 3 plugins that have the following functions:

  1. WorkOrderCancelled: This plugin decides whether the order/workOrder and the corresponding job are eligible to be canceled. If yes, then it cancels the Order/WorkOrder and the corresponding job. If not, then it triggers an event in the Order service to fail the cancellation of the WorkOrder.
  2. JobCancelled: This plugin gets triggered when a job is successfully canceled. It will go ahead and cancel the corresponding WorkOrder.
  3. JobCancellationFailed: This plugin is used to trigger WorkOrder cancellation failure in case of a job cancellation failure.

Use case

These plugins enable the tenant to percolate the cancellation functionality from the Order-service to Dispatch-service and vice-versa.

Input

  1. WorkOrderCancelled:
  2. tenantId
  3. orderState
  4. orderSubState
  5. orderId
  6. workOrderId
  7. jobId
  8. jobState
  9. jobSubState
  10. Callback
  11. JobCancelled:
  12. tenantId
  13. orderId
  14. workOrderId
  15. jobId
  16. callback
  17. JobCancellationFailed:
  18. tenantId
  19. orderId
  20. workOrderId
  21. jobId
  22. callback

Output

  1. JobCancellationRequest
  2. WorkOrderCancelFailedEvent
  3. WorkOrderCancelledEvent

Logic

WorkOrderCancelled

This plugin uses order and job config files to check if the state and subState of the order allow the WorkOrder to be canceled. The config files are tenant-specific and contain a list of strings that contains the possible states and subStates for which the cancellation is allowed.

Output: JobCancellationRequest/WorkOrderCancelFailedEvent

JobCancelled

When a job is canceled, this plugin goes ahead and cancels the corresponding task. order.

Output: WorkOrderCancelledEvent

JobCancellationFailed

When the tenant tries to cancel a job but it fails, this plugin will go ahead and fail the work order cancellation.

Output: WorkOrderCancellationFailedEvent

Current Configuration

Rule

WorkOrderCancelled

WorkOrderCancelled


JobCancelled

JobCancelled


JobCancellationFailed

JobCancellationFailed


Plugin Workflow

WorkOrderCancelled

WorkOrderCancelled


JobCancelled

JobCancelled


JobCancellationFailed

JobCancellationFailed


Plugin

WorkOrderCancelled

WorkOrderCancelled


JobCancelled

JobCancelled


JobCancellationFailed

JobCancellationFailed