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)
ExternalTaskServicelock in interface ExternalTaskServiceexternalTask - which lock will be extendedlockDuration - specifies the lock duration in millisecondspublic void lock(String externalTaskId, long lockDuration)
ExternalTaskServicelock in interface ExternalTaskServiceexternalTaskId - the id of the external task whose lock will be extendedlockDuration - specifies the lock duration in millisecondspublic void unlock(ExternalTask externalTask)
ExternalTaskServiceunlock in interface ExternalTaskServiceexternalTask - which will be unlockedpublic void complete(ExternalTask externalTask)
ExternalTaskServicecomplete in interface ExternalTaskServiceexternalTask - which will be completedpublic void complete(ExternalTask externalTask, Map<String,Object> variables)
ExternalTaskServicecomplete in interface ExternalTaskServiceexternalTask - 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)
ExternalTaskServicecomplete in interface ExternalTaskServiceexternalTask - 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)
ExternalTaskServicecomplete in interface ExternalTaskServiceexternalTaskId - 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)
ExternalTaskServicehandleFailure in interface ExternalTaskServiceexternalTask - 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)
ExternalTaskServicehandleFailure in interface ExternalTaskServiceexternalTaskId - 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)
ExternalTaskServicehandleFailure in interface ExternalTaskServiceexternalTaskId - 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)
ExternalTaskServicehandleBpmnError in interface ExternalTaskServiceexternalTask - 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)
ExternalTaskServicehandleBpmnError in interface ExternalTaskServiceexternalTask - 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)
ExternalTaskServicehandleBpmnError in interface ExternalTaskServiceexternalTask - 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)
ExternalTaskServicehandleBpmnError in interface ExternalTaskServiceexternalTaskId - 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)
ExternalTaskServiceextendLock in interface ExternalTaskServiceexternalTask - which lock will be extendednewDuration - specifies the the new lock duration in millisecondspublic void extendLock(String externalTaskId, long newDuration)
ExternalTaskServiceextendLock in interface ExternalTaskServiceexternalTaskId - the id of the external task which lock will be extendednewDuration - specifies the the new lock duration in millisecondsCopyright © 2022. All rights reserved.