Module io.automatiko.engine.api
Interface WorkItemManager
- All Known Subinterfaces:
InternalWorkItemManager
public interface WorkItemManager
A work item manager is responsible for finding the right work item handler
when a work item should be executed and should be notified when this work
item has been completed (or aborted).
-
Method Summary
Modifier and TypeMethodDescriptionvoidabortWorkItem(String id, Policy<?>... policies) Notifies the work item manager that the work item with the given id could not be executed and should be aborted.voidNotifies the work item manager that the work item with the given id has been completed.voiddispose()voidfailWorkItem(String id, Throwable error) Notifies the work item manager that the work item with the given id could not be executed and should be marked as failed.voidregisterWorkItemHandler(String workItemName, WorkItemHandler handler) Register the given handler for all work items of the given type of workvoidretryWorkItem(String workItemID, Map<String, Object> params) default voidtransitionWorkItem(String id, Transition<?> transition) Transition work item with given id into the next life cycle phase.
-
Method Details
-
completeWorkItem
Notifies the work item manager that the work item with the given id has been completed. Results related to the execution of this work item can be passed.- Parameters:
id- the id of the work item that has been completedresults- the results related to this work item, ornullif there are no results
-
abortWorkItem
Notifies the work item manager that the work item with the given id could not be executed and should be aborted.- Parameters:
id- the id of the work item that should be aborted
-
registerWorkItemHandler
Register the given handler for all work items of the given type of work- Parameters:
workItemName- the type of work this work item handler can executehandler- the handler for executing work items
-
transitionWorkItem
Transition work item with given id into the next life cycle phase.- Parameters:
id- work item id to be transitionedtransition- actual transition to apply to work item
-
dispose
void dispose() -
retryWorkItem
-
failWorkItem
Notifies the work item manager that the work item with the given id could not be executed and should be marked as failed.- Parameters:
id- the id of the work item that should be abortederror- error that occured during execution
-