org.camunda.bpm.engine.impl.persistence.entity
Class ExternalTaskEntity

java.lang.Object
  extended by org.camunda.bpm.engine.impl.persistence.entity.ExternalTaskEntity
All Implemented Interfaces:
ExternalTask, DbEntity, HasDbRevision

public class ExternalTaskEntity
extends Object
implements ExternalTask, DbEntity, HasDbRevision

Author:
Thorben Lindhauer

Field Summary
protected  String activityId
           
protected  String activityInstanceId
           
protected  String errorMessage
           
protected  ExecutionEntity execution
           
protected  String executionId
           
protected  String id
           
protected  Date lockExpirationTime
           
protected static EnginePersistenceLogger LOG
           
protected  String processDefinitionId
           
protected  String processDefinitionKey
           
protected  String processInstanceId
           
protected  Integer retries
           
protected  int revision
           
protected  int suspensionState
           
protected  String topicName
           
protected  String workerId
           
 
Constructor Summary
ExternalTaskEntity()
           
 
Method Summary
 boolean areRetriesLeft()
           
 void complete(Map<String,Object> variables)
           
static ExternalTaskEntity createAndInsert(ExecutionEntity execution, String topic)
           
protected  void createIncident()
           
 void delete()
           
protected  void ensureActive()
           
protected  void ensureExecutionInitialized()
           
 void failed(String errorMessage, int retries, long retryDuration)
           
 String getActivityId()
           
 String getActivityInstanceId()
           
 String getErrorMessage()
           
 ExecutionEntity getExecution()
           
 String getExecutionId()
           
 String getId()
           
 Date getLockExpirationTime()
           
 Object getPersistentState()
          Returns a representation of the object, as would be stored in the database.
 String getProcessDefinitionId()
           
 String getProcessDefinitionKey()
           
 String getProcessInstanceId()
           
 Integer getRetries()
           
 int getRevision()
           
 int getRevisionNext()
           
 int getSuspensionState()
           
 String getTopicName()
           
 String getWorkerId()
           
 void insert()
           
 boolean isSuspended()
           
 void lock(String workerId, long lockDuration)
           
protected  void removeIncident()
           
 void setActivityId(String activityId)
           
 void setActivityInstanceId(String activityInstanceId)
           
 void setErrorMessage(String errorMessage)
           
 void setExecution(ExecutionEntity execution)
           
 void setExecutionId(String executionId)
           
 void setId(String id)
           
 void setLockExpirationTime(Date lockExpirationTime)
           
 void setProcessDefinitionId(String processDefinitionId)
           
 void setProcessDefinitionKey(String processDefinitionKey)
           
 void setProcessInstanceId(String processInstanceId)
           
 void setRetries(Integer retries)
           
 void setRetriesAndManageIncidents(int retries)
           
 void setRevision(int revision)
           
 void setSuspensionState(int suspensionState)
           
 void setTopicName(String topic)
           
 void setWorkerId(String workerId)
           
 String toString()
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected static final EnginePersistenceLogger LOG

id

protected String id

revision

protected int revision

topicName

protected String topicName

workerId

protected String workerId

lockExpirationTime

protected Date lockExpirationTime

retries

protected Integer retries

errorMessage

protected String errorMessage

suspensionState

protected int suspensionState

executionId

protected String executionId

processInstanceId

protected String processInstanceId

processDefinitionId

protected String processDefinitionId

processDefinitionKey

protected String processDefinitionKey

activityId

protected String activityId

activityInstanceId

protected String activityInstanceId

execution

protected ExecutionEntity execution
Constructor Detail

ExternalTaskEntity

public ExternalTaskEntity()
Method Detail

getId

public String getId()
Specified by:
getId in interface ExternalTask
Specified by:
getId in interface DbEntity
Returns:
the id of the task

setId

public void setId(String id)
Specified by:
setId in interface DbEntity

getTopicName

public String getTopicName()
Specified by:
getTopicName in interface ExternalTask
Returns:
the name of the topic the task belongs to

setTopicName

public void setTopicName(String topic)

getWorkerId

public String getWorkerId()
Specified by:
getWorkerId in interface ExternalTask
Returns:
the id of the worker that has locked the task

setWorkerId

public void setWorkerId(String workerId)

getLockExpirationTime

public Date getLockExpirationTime()
Specified by:
getLockExpirationTime in interface ExternalTask
Returns:
the absolute time at which the lock expires

setLockExpirationTime

public void setLockExpirationTime(Date lockExpirationTime)

getExecutionId

public String getExecutionId()
Specified by:
getExecutionId in interface ExternalTask
Returns:
the id of the execution that the task is assigned to

setExecutionId

public void setExecutionId(String executionId)

getProcessDefinitionKey

public String getProcessDefinitionKey()
Specified by:
getProcessDefinitionKey in interface ExternalTask
Returns:
the key of the process definition the task's activity belongs to

setProcessDefinitionKey

public void setProcessDefinitionKey(String processDefinitionKey)

getActivityId

public String getActivityId()
Specified by:
getActivityId in interface ExternalTask
Returns:
the id of the activity for which the task is created

setActivityId

public void setActivityId(String activityId)

getActivityInstanceId

public String getActivityInstanceId()
Specified by:
getActivityInstanceId in interface ExternalTask
Returns:
the id of the activity instance in which context the task exists

setActivityInstanceId

public void setActivityInstanceId(String activityInstanceId)

getRevision

public int getRevision()
Specified by:
getRevision in interface HasDbRevision

setRevision

public void setRevision(int revision)
Specified by:
setRevision in interface HasDbRevision

getRevisionNext

public int getRevisionNext()
Specified by:
getRevisionNext in interface HasDbRevision

getSuspensionState

public int getSuspensionState()

setSuspensionState

public void setSuspensionState(int suspensionState)

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface ExternalTask
Returns:
true if the external task is suspended; a suspended external task cannot be completed, thereby preventing process continuation

getProcessInstanceId

public String getProcessInstanceId()
Specified by:
getProcessInstanceId in interface ExternalTask
Returns:
the id of the process instance the task exists in

setProcessInstanceId

public void setProcessInstanceId(String processInstanceId)

getProcessDefinitionId

public String getProcessDefinitionId()
Specified by:
getProcessDefinitionId in interface ExternalTask
Returns:
the id of the process definition the task's activity belongs to

setProcessDefinitionId

public void setProcessDefinitionId(String processDefinitionId)

getRetries

public Integer getRetries()
Specified by:
getRetries in interface ExternalTask
Returns:
the number of retries left. The number of retries is provided by a task client, therefore the initial value is null.

setRetries

public void setRetries(Integer retries)

getErrorMessage

public String getErrorMessage()
Specified by:
getErrorMessage in interface ExternalTask
Returns:
the 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)

setErrorMessage

public void setErrorMessage(String errorMessage)

areRetriesLeft

public boolean areRetriesLeft()

getPersistentState

public Object getPersistentState()
Description copied from interface: DbEntity
Returns a representation of the object, as would be stored in the database. Used when deciding if updates have occurred to the object or not since it was last loaded.

Specified by:
getPersistentState in interface DbEntity

insert

public void insert()

delete

public void delete()

complete

public void complete(Map<String,Object> variables)

failed

public void failed(String errorMessage,
                   int retries,
                   long retryDuration)

setRetriesAndManageIncidents

public void setRetriesAndManageIncidents(int retries)

createIncident

protected void createIncident()

removeIncident

protected void removeIncident()

lock

public void lock(String workerId,
                 long lockDuration)

getExecution

public ExecutionEntity getExecution()

setExecution

public void setExecution(ExecutionEntity execution)

ensureExecutionInitialized

protected void ensureExecutionInitialized()

ensureActive

protected void ensureActive()

toString

public String toString()
Overrides:
toString in class Object

unlock

public void unlock()

createAndInsert

public static ExternalTaskEntity createAndInsert(ExecutionEntity execution,
                                                 String topic)


Copyright © 2016 camunda services GmbH. All rights reserved.