Package org.camunda.bpm.client.task.impl
Class ExternalTaskImpl
- java.lang.Object
-
- org.camunda.bpm.client.task.impl.ExternalTaskImpl
-
- All Implemented Interfaces:
ExternalTask
public class ExternalTaskImpl extends java.lang.Object implements ExternalTask
- Author:
- Tassilo Weidner
-
-
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.util.Map<java.lang.String,VariableValue>
receivedVariableMap
protected java.lang.Integer
retries
protected java.lang.String
tenantId
protected java.lang.String
topicName
protected java.util.Map<java.lang.String,TypedValueField>
variables
protected java.lang.String
workerId
-
Constructor Summary
Constructors Constructor Description ExternalTaskImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getActivityId()
java.lang.String
getActivityInstanceId()
java.util.Map<java.lang.String,java.lang.Object>
getAllVariables()
Returns untyped variables that exist in the task's ancestor execution hierarchyVariableMap
getAllVariablesTyped()
Returns typed variables that exist in the task's ancestor execution hierarchyVariableMap
getAllVariablesTyped(boolean deserializeObjectValues)
Returns typed variables that exist in the task's ancestor execution hierarchyjava.lang.String
getBusinessKey()
Returns the business key of the process instance the external task is associated withjava.lang.String
getErrorDetails()
java.lang.String
getErrorMessage()
java.lang.String
getExecutionId()
java.util.Map<java.lang.String,java.lang.String>
getExtensionProperties()
Returns all available extension properties.java.lang.String
getExtensionProperty(java.lang.String propertyKey)
Returns the value of the extension property for a given key ornull
if the property was not available.java.lang.String
getId()
java.util.Date
getLockExpirationTime()
long
getPriority()
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()
<T> T
getVariable(java.lang.String variableName)
Returns an untyped variable of the task's ancestor execution hierarchyjava.util.Map<java.lang.String,TypedValueField>
getVariables()
<T extends TypedValue>
TgetVariableTyped(java.lang.String variableName)
Returns a typed variable of the task's ancestor execution hierarchy<T extends TypedValue>
TgetVariableTyped(java.lang.String variableName, boolean deserializeObjectValues)
Returns a typed variable of the task's ancestor execution hierarchyjava.lang.String
getWorkerId()
void
setActivityId(java.lang.String activityId)
void
setActivityInstanceId(java.lang.String activityInstanceId)
void
setBusinessKey(java.lang.String businessKey)
void
setErrorDetails(java.lang.String errorDetails)
void
setErrorMessage(java.lang.String errorMessage)
void
setExecutionId(java.lang.String executionId)
void
setExtensionProperties(java.util.Map<java.lang.String,java.lang.String> extensionProperties)
void
setId(java.lang.String id)
void
setLockExpirationTime(java.util.Date lockExpirationTime)
void
setPriority(long priority)
void
setProcessDefinitionId(java.lang.String processDefinitionId)
void
setProcessDefinitionKey(java.lang.String processDefinitionKey)
void
setProcessDefinitionVersionTag(java.lang.String processDefinitionVersionTag)
void
setProcessInstanceId(java.lang.String processInstanceId)
void
setReceivedVariableMap(java.util.Map<java.lang.String,VariableValue> receivedVariableMap)
void
setRetries(java.lang.Integer retries)
void
setTenantId(java.lang.String tenantId)
void
setTopicName(java.lang.String topicName)
void
setVariables(java.util.Map<java.lang.String,TypedValueField> variables)
void
setWorkerId(java.lang.String workerId)
java.lang.String
toString()
-
-
-
Field Detail
-
activityId
protected java.lang.String activityId
-
activityInstanceId
protected java.lang.String activityInstanceId
-
errorMessage
protected java.lang.String errorMessage
-
errorDetails
protected java.lang.String errorDetails
-
executionId
protected java.lang.String executionId
-
id
protected java.lang.String id
-
lockExpirationTime
protected java.util.Date lockExpirationTime
-
processDefinitionId
protected java.lang.String processDefinitionId
-
processDefinitionKey
protected java.lang.String processDefinitionKey
-
processDefinitionVersionTag
protected java.lang.String processDefinitionVersionTag
-
processInstanceId
protected java.lang.String processInstanceId
-
retries
protected java.lang.Integer retries
-
workerId
protected java.lang.String workerId
-
topicName
protected java.lang.String topicName
-
tenantId
protected java.lang.String tenantId
-
priority
protected long priority
-
variables
protected java.util.Map<java.lang.String,TypedValueField> variables
-
businessKey
protected java.lang.String businessKey
-
extensionProperties
protected java.util.Map<java.lang.String,java.lang.String> extensionProperties
-
receivedVariableMap
protected java.util.Map<java.lang.String,VariableValue> receivedVariableMap
-
-
Method Detail
-
setActivityId
public void setActivityId(java.lang.String activityId)
-
setActivityInstanceId
public void setActivityInstanceId(java.lang.String activityInstanceId)
-
setErrorMessage
public void setErrorMessage(java.lang.String errorMessage)
-
setErrorDetails
public void setErrorDetails(java.lang.String errorDetails)
-
setExecutionId
public void setExecutionId(java.lang.String executionId)
-
setId
public void setId(java.lang.String id)
-
setLockExpirationTime
public void setLockExpirationTime(java.util.Date lockExpirationTime)
-
setProcessDefinitionId
public void setProcessDefinitionId(java.lang.String processDefinitionId)
-
setProcessDefinitionKey
public void setProcessDefinitionKey(java.lang.String processDefinitionKey)
-
setProcessDefinitionVersionTag
public void setProcessDefinitionVersionTag(java.lang.String processDefinitionVersionTag)
-
setProcessInstanceId
public void setProcessInstanceId(java.lang.String processInstanceId)
-
setRetries
public void setRetries(java.lang.Integer retries)
-
setWorkerId
public void setWorkerId(java.lang.String workerId)
-
setTopicName
public void setTopicName(java.lang.String topicName)
-
setTenantId
public void setTenantId(java.lang.String tenantId)
-
setPriority
public void setPriority(long priority)
-
setVariables
public void setVariables(java.util.Map<java.lang.String,TypedValueField> variables)
-
setBusinessKey
public void setBusinessKey(java.lang.String businessKey)
-
getVariables
public java.util.Map<java.lang.String,TypedValueField> getVariables()
-
setReceivedVariableMap
public void setReceivedVariableMap(java.util.Map<java.lang.String,VariableValue> receivedVariableMap)
-
getActivityId
public java.lang.String getActivityId()
- Specified by:
getActivityId
in interfaceExternalTask
- Returns:
- the id of the activity that this external task belongs to
-
getActivityInstanceId
public java.lang.String getActivityInstanceId()
- Specified by:
getActivityInstanceId
in interfaceExternalTask
- Returns:
- the id of the activity instance that the external task belongs to
-
getErrorMessage
public java.lang.String getErrorMessage()
- Specified by:
getErrorMessage
in interfaceExternalTask
- Returns:
- the error message that was supplied when the last failure of this task was reported
-
getErrorDetails
public java.lang.String getErrorDetails()
- Specified by:
getErrorDetails
in interfaceExternalTask
- Returns:
- the error details submitted with the latest reported failure executing this task
-
getExecutionId
public java.lang.String getExecutionId()
- Specified by:
getExecutionId
in interfaceExternalTask
- Returns:
- the id of the execution that the external task belongs to
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfaceExternalTask
- Returns:
- the id of the external task
-
getLockExpirationTime
public java.util.Date getLockExpirationTime()
- Specified by:
getLockExpirationTime
in interfaceExternalTask
- Returns:
- the date that the task's most recent lock expires or has expired
-
getProcessDefinitionId
public java.lang.String getProcessDefinitionId()
- Specified by:
getProcessDefinitionId
in interfaceExternalTask
- Returns:
- the id of the process definition the external task is defined in
-
getProcessDefinitionKey
public java.lang.String getProcessDefinitionKey()
- Specified by:
getProcessDefinitionKey
in interfaceExternalTask
- Returns:
- the key of the process definition the external task is defined in
-
getProcessDefinitionVersionTag
public java.lang.String getProcessDefinitionVersionTag()
- Specified by:
getProcessDefinitionVersionTag
in interfaceExternalTask
- Returns:
- the version tag of the process definition the tasks activity belongs to
-
getProcessInstanceId
public java.lang.String getProcessInstanceId()
- Specified by:
getProcessInstanceId
in interfaceExternalTask
- Returns:
- the id of the process instance the external task belongs to
-
getRetries
public java.lang.Integer getRetries()
- Specified by:
getRetries
in interfaceExternalTask
- Returns:
- the number of retries the task currently has left
-
getWorkerId
public java.lang.String getWorkerId()
- Specified by:
getWorkerId
in interfaceExternalTask
- Returns:
- the id of the worker that possesses or possessed the most recent lock
-
getTopicName
public java.lang.String getTopicName()
- Specified by:
getTopicName
in interfaceExternalTask
- Returns:
- the topic name of the external task
-
getTenantId
public java.lang.String getTenantId()
- Specified by:
getTenantId
in interfaceExternalTask
- Returns:
- the id of the tenant the external task belongs to
-
getPriority
public long getPriority()
- Specified by:
getPriority
in interfaceExternalTask
- Returns:
- the priority of the external task
-
getBusinessKey
public java.lang.String getBusinessKey()
Description copied from interface:ExternalTask
Returns the business key of the process instance the external task is associated with- Specified by:
getBusinessKey
in interfaceExternalTask
- Returns:
- the business key
-
getAllVariables
public java.util.Map<java.lang.String,java.lang.Object> getAllVariables()
Description copied from interface:ExternalTask
Returns untyped variables that exist in the task's ancestor execution hierarchy- Specified by:
getAllVariables
in interfaceExternalTask
- Returns:
- a map of untyped variables that contains an entry for each variable
-
getVariable
public <T> T getVariable(java.lang.String variableName)
Description copied from interface:ExternalTask
Returns an untyped variable of the task's ancestor execution hierarchy- Specified by:
getVariable
in interfaceExternalTask
- Type Parameters:
T
- the type of the variable- Parameters:
variableName
- of the variable to be returned- Returns:
- an untyped variable if such a named variable exists
- null if such a named variable not exists
-
getAllVariablesTyped
public VariableMap getAllVariablesTyped()
Description copied from interface:ExternalTask
Returns typed variables that exist in the task's ancestor execution hierarchy- Specified by:
getAllVariablesTyped
in interfaceExternalTask
- Returns:
- a map of typed variables that contains an entry for each variable
-
getAllVariablesTyped
public VariableMap getAllVariablesTyped(boolean deserializeObjectValues)
Description copied from interface:ExternalTask
Returns typed variables that exist in the task's ancestor execution hierarchy- Specified by:
getAllVariablesTyped
in interfaceExternalTask
- Parameters:
deserializeObjectValues
--
false
to retrieve the object without deserialization -
true
to retrieve the deserialized object
-
- Returns:
- a map of typed variables that contains an entry for each variable
-
getVariableTyped
public <T extends TypedValue> T getVariableTyped(java.lang.String variableName)
Description copied from interface:ExternalTask
Returns a typed variable of the task's ancestor execution hierarchy- Specified by:
getVariableTyped
in interfaceExternalTask
- Type Parameters:
T
- the type of the variable- Parameters:
variableName
- of the variable to be returned- Returns:
- a typed variable if such a named variable exists
- null if such a named variable not exists
-
getVariableTyped
public <T extends TypedValue> T getVariableTyped(java.lang.String variableName, boolean deserializeObjectValues)
Description copied from interface:ExternalTask
Returns a typed variable of the task's ancestor execution hierarchy- Specified by:
getVariableTyped
in interfaceExternalTask
- Type Parameters:
T
- the type of the variable- Parameters:
variableName
- of the variable to be returneddeserializeObjectValues
--
false
to retrieve the object without deserialization -
true
to retrieve the deserialized object
-
- Returns:
- a typed variable if such a named variable exists
- null if such a named variable not exists
-
getExtensionProperties
public java.util.Map<java.lang.String,java.lang.String> getExtensionProperties()
Description copied from interface:ExternalTask
Returns all available extension properties. Extension properties must be defined at the external task activity inside the BPMN model and explicitly fetched (e.g. by callingTopicSubscriptionBuilder.includeExtensionProperties(boolean)
) to be available. If no extension properties are available the returned map will be empty.- Specified by:
getExtensionProperties
in interfaceExternalTask
- Returns:
- a map of available extension properties, never
null
-
setExtensionProperties
public void setExtensionProperties(java.util.Map<java.lang.String,java.lang.String> extensionProperties)
-
getExtensionProperty
public java.lang.String getExtensionProperty(java.lang.String propertyKey)
Description copied from interface:ExternalTask
Returns the value of the extension property for a given key ornull
if the property was not available.- Specified by:
getExtensionProperty
in interfaceExternalTask
- Returns:
- the extension property, or
null
if not available - See Also:
ExternalTask.getExtensionProperties()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-