public class ExternalTaskServiceImpl extends Object implements ExternalTaskService
Modifier and Type | Field and Description |
---|---|
protected EngineClient |
engineClient |
protected static ExternalTaskClientLogger |
LOG |
Constructor and Description |
---|
ExternalTaskServiceImpl(EngineClient engineClient) |
Modifier and Type | Method and Description |
---|---|
void |
complete(ExternalTask externalTask)
Completes a task.
|
void |
complete(ExternalTask externalTask,
Map<String,Object> variables)
Completes a task.
|
void |
complete(ExternalTask externalTask,
Map<String,Object> variables,
Map<String,Object> localVariables)
Completes a task.
|
void |
complete(String externalTaskId,
Map<String,Object> variables,
Map<String,Object> localVariables)
Completes a task.
|
void |
extendLock(ExternalTask externalTask,
long newDuration)
Extends the timeout of the lock by a given amount of time.
|
void |
extendLock(String externalTaskId,
long newDuration)
Extends the timeout of the lock by a given amount of time.
|
void |
handleBpmnError(ExternalTask externalTask,
String errorCode)
Reports a business error in the context of a running task.
|
void |
handleBpmnError(ExternalTask externalTask,
String errorCode,
String errorMessage)
Reports a business error in the context of a running task.
|
void |
handleBpmnError(ExternalTask externalTask,
String errorCode,
String errorMessage,
Map<String,Object> variables)
Reports a business error in the context of a running task.
|
void |
handleBpmnError(String externalTaskId,
String errorCode,
String errorMessage,
Map<String,Object> variables)
Reports a business error in the context of a running task.
|
void |
handleFailure(ExternalTask externalTask,
String errorMessage,
String errorDetails,
int retries,
long retryTimeout)
Reports a failure to execute a task.
|
void |
handleFailure(String externalTaskId,
String errorMessage,
String errorDetails,
int retries,
long retryTimeout)
Reports a failure to execute a task.
|
void |
handleFailure(String externalTaskId,
String errorMessage,
String errorDetails,
int retries,
long retryTimeout,
Map<String,Object> variables,
Map<String,Object> locaclVariables)
Reports a failure to execute a task.
|
void |
lock(ExternalTask externalTask,
long lockDuration)
Locks a task by a given amount of time.
|
void |
lock(String externalTaskId,
long lockDuration)
Locks a task by a given amount of time.
|
void |
unlock(ExternalTask externalTask)
Unlocks a task and clears the tasks lock expiration time and worker id.
|
protected static final ExternalTaskClientLogger LOG
protected EngineClient engineClient
public ExternalTaskServiceImpl(EngineClient engineClient)
public void lock(ExternalTask externalTask, long lockDuration)
ExternalTaskService
lock
in interface ExternalTaskService
externalTask
- which lock will be extendedlockDuration
- specifies the lock duration in millisecondspublic void lock(String externalTaskId, long lockDuration)
ExternalTaskService
lock
in interface ExternalTaskService
externalTaskId
- the id of the external task whose lock will be extendedlockDuration
- specifies the lock duration in millisecondspublic void unlock(ExternalTask externalTask)
ExternalTaskService
unlock
in interface ExternalTaskService
externalTask
- which will be unlockedpublic void complete(ExternalTask externalTask)
ExternalTaskService
complete
in interface ExternalTaskService
externalTask
- which will be completedpublic void complete(ExternalTask externalTask, Map<String,Object> variables)
ExternalTaskService
complete
in interface ExternalTaskService
externalTask
- which will be completedvariables
- are set in the tasks ancestor execution hierarchy The key and the value represent
the variable name and its value. Map can consist of both typed and untyped variables.public void complete(ExternalTask externalTask, Map<String,Object> variables, Map<String,Object> localVariables)
ExternalTaskService
complete
in interface ExternalTaskService
externalTask
- which will be completedvariables
- are set in the tasks ancestor execution hierarchy. The key and the value represent
the variable name and its value. Map can consist of both typed and untyped variables.localVariables
- are set in the execution of the external task instance. The key and the value represent
the variable name and its value. Map can consist of both typed and untyped variables.public void complete(String externalTaskId, Map<String,Object> variables, Map<String,Object> localVariables)
ExternalTaskService
complete
in interface ExternalTaskService
externalTaskId
- the id of the external task which will be completedvariables
- are set in the tasks ancestor execution hierarchy. The key and the value represent
the variable name and its value. Map can consist of both typed and untyped variables.localVariables
- are set in the execution of the external task instance. The key and the value represent
the variable name and its value. Map can consist of both typed and untyped variables.public void handleFailure(ExternalTask externalTask, String errorMessage, String errorDetails, int retries, long retryTimeout)
ExternalTaskService
handleFailure
in interface ExternalTaskService
externalTask
- external task for which a failure will be reportederrorMessage
- indicates the reason of the failure.errorDetails
- provides a detailed error description.retries
- specifies how often the task should be retried. Must be >= 0.
If 0, an incident is created and the task cannot be fetched anymore
unless the retries are increased again. The incident's message is set
to the errorMessage parameter.retryTimeout
- specifies a timeout in milliseconds before the external task
becomes available again for fetching. Must be >= 0.public void handleFailure(String externalTaskId, String errorMessage, String errorDetails, int retries, long retryTimeout)
ExternalTaskService
handleFailure
in interface ExternalTaskService
externalTaskId
- the id of the external task for which a failure will be reportederrorMessage
- indicates the reason of the failure.errorDetails
- provides a detailed error description.retries
- specifies how often the task should be retried. Must be >= 0.
If 0, an incident is created and the task cannot be fetched anymore
unless the retries are increased again. The incident's message is set
to the errorMessage parameter.retryTimeout
- specifies a timeout in milliseconds before the external task
becomes available again for fetching. Must be >= 0.public void handleFailure(String externalTaskId, String errorMessage, String errorDetails, int retries, long retryTimeout, Map<String,Object> variables, Map<String,Object> locaclVariables)
ExternalTaskService
handleFailure
in interface ExternalTaskService
externalTaskId
- the id of the external task for which a failure will be reportederrorMessage
- indicates the reason of the failure.errorDetails
- provides a detailed error description.retries
- specifies how often the task should be retried. Must be >= 0.
If 0, an incident is created and the task cannot be fetched anymore
unless the retries are increased again. The incident's message is set
to the errorMessage parameter.retryTimeout
- specifies a timeout in milliseconds before the external task
becomes available again for fetching. Must be >= 0.variables
- a map of variables to set on the execution the external task is assigned tolocaclVariables
- a map of variables to set on the execution locallypublic void handleBpmnError(ExternalTask externalTask, String errorCode)
ExternalTaskService
handleBpmnError
in interface ExternalTaskService
externalTask
- external task for which a BPMN error will be reportederrorCode
- that indicates the predefined error. The error code
is used to identify the BPMN error handler.public void handleBpmnError(ExternalTask externalTask, String errorCode, String errorMessage)
ExternalTaskService
handleBpmnError
in interface ExternalTaskService
externalTask
- external task for which a BPMN error will be reportederrorCode
- that indicates the predefined error. The error code
is used to identify the BPMN error handler.errorMessage
- which will be passed when the BPMN error is caughtpublic void handleBpmnError(ExternalTask externalTask, String errorCode, String errorMessage, Map<String,Object> variables)
ExternalTaskService
handleBpmnError
in interface ExternalTaskService
externalTask
- external task for which a BPMN error will be reportederrorCode
- that indicates the predefined error. The error code
is used to identify the BPMN error handler.errorMessage
- which will be passed when the BPMN error is caughtvariables
- which will be passed to the execution when the BPMN error is caughtpublic void handleBpmnError(String externalTaskId, String errorCode, String errorMessage, Map<String,Object> variables)
ExternalTaskService
handleBpmnError
in interface ExternalTaskService
externalTaskId
- the id of the external task for which a BPMN error will be reportederrorCode
- that indicates the predefined error. The error code
is used to identify the BPMN error handler.errorMessage
- which will be passed when the BPMN error is caughtvariables
- which will be passed to the execution when the BPMN error is caughtpublic void extendLock(ExternalTask externalTask, long newDuration)
ExternalTaskService
extendLock
in interface ExternalTaskService
externalTask
- which lock will be extendednewDuration
- specifies the the new lock duration in millisecondspublic void extendLock(String externalTaskId, long newDuration)
ExternalTaskService
extendLock
in interface ExternalTaskService
externalTaskId
- the id of the external task which lock will be extendednewDuration
- specifies the the new lock duration in millisecondsCopyright © 2022. All rights reserved.