Class LockedExternalTaskImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.externaltask.LockedExternalTaskImpl
-
- All Implemented Interfaces:
LockedExternalTask
public class LockedExternalTaskImpl extends java.lang.Object implements LockedExternalTask
- Author:
- Thorben Lindhauer
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
activityId
protected java.lang.String
activityInstanceId
protected java.lang.String
businessKey
protected java.lang.String
errorDetails
protected java.lang.String
errorMessage
protected java.lang.String
executionId
protected java.util.Map<java.lang.String,java.lang.String>
extensionProperties
protected java.lang.String
id
protected java.util.Date
lockExpirationTime
protected long
priority
protected java.lang.String
processDefinitionId
protected java.lang.String
processDefinitionKey
protected java.lang.String
processDefinitionVersionTag
protected java.lang.String
processInstanceId
protected java.lang.Integer
retries
protected java.lang.String
tenantId
protected java.lang.String
topicName
protected VariableMapImpl
variables
protected java.lang.String
workerId
-
Constructor Summary
Constructors Constructor Description LockedExternalTaskImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LockedExternalTaskImpl
fromEntity(ExternalTaskEntity externalTaskEntity, java.util.List<java.lang.String> variablesToFetch, boolean isLocal, boolean deserializeVariables, boolean includeExtensionProperties)
Construct representation of locked ExternalTask from corresponding entity.java.lang.String
getActivityId()
java.lang.String
getActivityInstanceId()
java.lang.String
getBusinessKey()
Returns the business key of the process instance the external task belongs tojava.lang.String
getErrorDetails()
java.lang.String
getErrorMessage()
java.lang.String
getExecutionId()
java.util.Map<java.lang.String,java.lang.String>
getExtensionProperties()
Returns a map of custom extension properties if the fetch instructions indicate to include extension properties.java.lang.String
getId()
java.util.Date
getLockExpirationTime()
long
getPriority()
Returns the priority of the locked external task.java.lang.String
getProcessDefinitionId()
java.lang.String
getProcessDefinitionKey()
java.lang.String
getProcessDefinitionVersionTag()
java.lang.String
getProcessInstanceId()
java.lang.Integer
getRetries()
java.lang.String
getTenantId()
java.lang.String
getTopicName()
VariableMap
getVariables()
java.lang.String
getWorkerId()
-
-
-
Field Detail
-
id
protected java.lang.String id
-
topicName
protected java.lang.String topicName
-
workerId
protected java.lang.String workerId
-
lockExpirationTime
protected java.util.Date lockExpirationTime
-
retries
protected java.lang.Integer retries
-
errorMessage
protected java.lang.String errorMessage
-
errorDetails
protected java.lang.String errorDetails
-
processInstanceId
protected java.lang.String processInstanceId
-
executionId
protected java.lang.String executionId
-
activityId
protected java.lang.String activityId
-
activityInstanceId
protected java.lang.String activityInstanceId
-
processDefinitionId
protected java.lang.String processDefinitionId
-
processDefinitionKey
protected java.lang.String processDefinitionKey
-
processDefinitionVersionTag
protected java.lang.String processDefinitionVersionTag
-
tenantId
protected java.lang.String tenantId
-
priority
protected long priority
-
variables
protected VariableMapImpl variables
-
businessKey
protected java.lang.String businessKey
-
extensionProperties
protected java.util.Map<java.lang.String,java.lang.String> extensionProperties
-
-
Method Detail
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfaceLockedExternalTask
- Returns:
- the id of the task
-
getTopicName
public java.lang.String getTopicName()
- Specified by:
getTopicName
in interfaceLockedExternalTask
- Returns:
- the name of the topic the task belongs to
-
getWorkerId
public java.lang.String getWorkerId()
- Specified by:
getWorkerId
in interfaceLockedExternalTask
- Returns:
- the id of the worker that has locked the task
-
getLockExpirationTime
public java.util.Date getLockExpirationTime()
- Specified by:
getLockExpirationTime
in interfaceLockedExternalTask
- Returns:
- the absolute time at which the lock expires
-
getRetries
public java.lang.Integer getRetries()
- Specified by:
getRetries
in interfaceLockedExternalTask
- Returns:
- the number of retries left. The number of retries is provided by
a task client, therefore the initial value is
null
.
-
getErrorMessage
public java.lang.String getErrorMessage()
- Specified by:
getErrorMessage
in interfaceLockedExternalTask
- Returns:
- the full error message submitted with the latest reported failure executing this task;
null
if no failure was reported previously or if no error message was submitted - See Also:
ExternalTaskService.handleFailure(String, String, String, int, long)
-
getProcessInstanceId
public java.lang.String getProcessInstanceId()
- Specified by:
getProcessInstanceId
in interfaceLockedExternalTask
- Returns:
- the id of the process instance the task exists in
-
getExecutionId
public java.lang.String getExecutionId()
- Specified by:
getExecutionId
in interfaceLockedExternalTask
- Returns:
- the id of the execution that the task is assigned to
-
getActivityId
public java.lang.String getActivityId()
- Specified by:
getActivityId
in interfaceLockedExternalTask
- Returns:
- the id of the activity for which the task is created
-
getActivityInstanceId
public java.lang.String getActivityInstanceId()
- Specified by:
getActivityInstanceId
in interfaceLockedExternalTask
- Returns:
- the id of the activity instance in which context the task exists
-
getProcessDefinitionId
public java.lang.String getProcessDefinitionId()
- Specified by:
getProcessDefinitionId
in interfaceLockedExternalTask
- Returns:
- the id of the process definition the tasks activity belongs to
-
getProcessDefinitionKey
public java.lang.String getProcessDefinitionKey()
- Specified by:
getProcessDefinitionKey
in interfaceLockedExternalTask
- Returns:
- the key of the process definition the tasks activity belongs to
-
getProcessDefinitionVersionTag
public java.lang.String getProcessDefinitionVersionTag()
- Specified by:
getProcessDefinitionVersionTag
in interfaceLockedExternalTask
- Returns:
- the version tag of the process definition the tasks activity belongs to
-
getTenantId
public java.lang.String getTenantId()
- Specified by:
getTenantId
in interfaceLockedExternalTask
- Returns:
- the id of the tenant the task belongs to. Can be
null
if the task belongs to no single tenant.
-
getVariables
public VariableMap getVariables()
- Specified by:
getVariables
in interfaceLockedExternalTask
- Returns:
- a map of variables that contains an entry for every variable that was specified at fetching time, if such a variable exists in the tasks ancestor execution hierarchy.
-
getErrorDetails
public java.lang.String getErrorDetails()
- Specified by:
getErrorDetails
in interfaceLockedExternalTask
- Returns:
- error details submitted with the latest reported failure executing this task;
null
if no failure was reported previously or if no error details was submitted - See Also:
ExternalTaskService.handleFailure(String, String, String, String, int, long)
-
getPriority
public long getPriority()
Description copied from interface:LockedExternalTask
Returns the priority of the locked external task. The default priority is 0.- Specified by:
getPriority
in interfaceLockedExternalTask
- Returns:
- the priority of the external task
-
getBusinessKey
public java.lang.String getBusinessKey()
Description copied from interface:LockedExternalTask
Returns the business key of the process instance the external task belongs to- Specified by:
getBusinessKey
in interfaceLockedExternalTask
- Returns:
- the business key
-
getExtensionProperties
public java.util.Map<java.lang.String,java.lang.String> getExtensionProperties()
Description copied from interface:LockedExternalTask
Returns a map of custom extension properties if the fetch instructions indicate to include extension properties. If extension properties are included, the returned map contains any extension property that is defined in the model definition of the external task. If extension properties not included or no properties are defined for the external task, the map will be empty.- Specified by:
getExtensionProperties
in interfaceLockedExternalTask
- Returns:
- a map with all defined custom extension properties, never
null
-
fromEntity
public static LockedExternalTaskImpl fromEntity(ExternalTaskEntity externalTaskEntity, java.util.List<java.lang.String> variablesToFetch, boolean isLocal, boolean deserializeVariables, boolean includeExtensionProperties)
Construct representation of locked ExternalTask from corresponding entity. During mapping variables will be collected,during collection variables will not be deserialized and scope will not be set to local.- Parameters:
externalTaskEntity
- - source persistent entity to use for fieldsvariablesToFetch
- - list of variable names to fetch, if null then all variables will be fetchedisLocal
- - if true only local variables will be collected- Returns:
- object with all fields copied from the ExternalTaskEntity, error details fetched from the database and variables attached
-
-