Cancellation Manager Plugin
Cancellation manager contains 3 plugins that have the following functions:
- 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.
- JobCancelled: This plugin gets triggered when a job is successfully canceled. It will go ahead and cancel the corresponding WorkOrder.
- JobCancellationFailed: This plugin is used to trigger WorkOrder cancellation failure in case of a job cancellation failure.
These plugins enable the tenant to percolate the cancellation functionality from the Order-service to Dispatch-service and vice-versa.
- WorkOrderCancelled:
- tenantId
- orderState
- orderSubState
- orderId
- workOrderId
- jobId
- jobState
- jobSubState
- Callback
- JobCancelled:
- tenantId
- orderId
- workOrderId
- jobId
- callback
- JobCancellationFailed:
- tenantId
- orderId
- workOrderId
- jobId
- callback
- JobCancellationRequest
- WorkOrderCancelFailedEvent
- WorkOrderCancelledEvent
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
When a job is canceled, this plugin goes ahead and cancels the corresponding task. order.
Output: WorkOrderCancelledEvent
When the tenant tries to cancel a job but it fails, this plugin will go ahead and fail the work order cancellation.
Output: WorkOrderCancellationFailedEvent
WorkOrderCancelled
JobCancelled
JobCancellationFailed
WorkOrderCancelled
JobCancelled
JobCancellationFailed
WorkOrderCancelled
JobCancelled
JobCancellationFailed