public interface ExternalTaskService
Service that provides possibilities to interact with fetched and locked tasks.
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> localVariables)
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.
|
void lock(String externalTaskId, long lockDuration)
externalTaskId
- the id of the external task whose lock will be extendedlockDuration
- specifies the lock duration in millisecondsNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredConnectionLostException
- if the connection could not be establishedvoid lock(ExternalTask externalTask, long lockDuration)
externalTask
- which lock will be extendedlockDuration
- specifies the lock duration in millisecondsNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredConnectionLostException
- if the connection could not be establishedvoid unlock(ExternalTask externalTask)
externalTask
- which will be unlockedNotFoundException
- if the task has been canceled and therefore does not exist anymoreConnectionLostException
- if the connection could not be establishedvoid complete(ExternalTask externalTask)
externalTask
- which will be completedNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the tasks most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedValueMapperException
- void complete(ExternalTask externalTask, Map<String,Object> variables)
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.NotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedValueMapperException
- void complete(ExternalTask externalTask, Map<String,Object> variables, Map<String,Object> localVariables)
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.NotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedValueMapperException
- void complete(String externalTaskId, Map<String,Object> variables, Map<String,Object> localVariables)
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.void handleFailure(ExternalTask externalTask, String errorMessage, String errorDetails, int retries, long retryTimeout)
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.NotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedvoid handleFailure(String externalTaskId, String errorMessage, String errorDetails, int retries, long retryTimeout)
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.NotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedvoid handleFailure(String externalTaskId, String errorMessage, String errorDetails, int retries, long retryTimeout, Map<String,Object> variables, Map<String,Object> localVariables)
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 tolocalVariables
- a map of variables to set on the execution locallyNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedvoid handleBpmnError(ExternalTask externalTask, String errorCode)
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.NotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedvoid handleBpmnError(ExternalTask externalTask, String errorCode, String errorMessage)
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 caughtNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedvoid handleBpmnError(ExternalTask externalTask, String errorCode, String errorMessage, Map<String,Object> variables)
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 caughtNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedvoid handleBpmnError(String externalTaskId, String errorCode, String errorMessage, Map<String,Object> variables)
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 caughtNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredNotResumedException
- if the corresponding process instance could not be resumedConnectionLostException
- if the connection could not be establishedvoid extendLock(ExternalTask externalTask, long newDuration)
externalTask
- which lock will be extendednewDuration
- specifies the the new lock duration in millisecondsNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredConnectionLostException
- if the connection could not be establishedvoid extendLock(String externalTaskId, long newDuration)
externalTaskId
- the id of the external task which lock will be extendednewDuration
- specifies the the new lock duration in millisecondsNotFoundException
- if the task has been canceled and therefore does not exist anymoreNotAcquiredException
- if the task's most recent lock could not be acquiredConnectionLostException
- if the connection could not be establishedCopyright © 2022. All rights reserved.