public class ExternalTaskEntity extends Object implements ExternalTask, DbEntity, HasDbRevision, HasDbReferences
Modifier and Type | Field and Description |
---|---|
protected String |
activityId |
protected String |
activityInstanceId |
protected ByteArrayEntity |
errorDetailsByteArray |
protected String |
errorDetailsByteArrayId |
protected String |
errorMessage |
protected ExecutionEntity |
execution |
protected String |
executionId |
protected String |
id |
protected Date |
lockExpirationTime |
protected static EnginePersistenceLogger |
LOG |
static int |
MAX_EXCEPTION_MESSAGE_LENGTH
Note:
String.length() counts Unicode supplementary
characters twice, so for a String consisting only of those,
the limit is effectively MAX_EXCEPTION_MESSAGE_LENGTH / 2 |
protected long |
priority |
protected String |
processDefinitionId |
protected String |
processDefinitionKey |
protected String |
processInstanceId |
protected Integer |
retries |
protected int |
revision |
protected int |
suspensionState |
protected String |
tenantId |
protected String |
topicName |
protected String |
workerId |
Constructor and Description |
---|
ExternalTaskEntity() |
protected static final EnginePersistenceLogger LOG
public static final int MAX_EXCEPTION_MESSAGE_LENGTH
String.length()
counts Unicode supplementary
characters twice, so for a String consisting only of those,
the limit is effectively MAX_EXCEPTION_MESSAGE_LENGTH / 2protected String id
protected int revision
protected String topicName
protected String workerId
protected Date lockExpirationTime
protected Integer retries
protected String errorMessage
protected ByteArrayEntity errorDetailsByteArray
protected String errorDetailsByteArrayId
protected int suspensionState
protected String executionId
protected String processInstanceId
protected String processDefinitionId
protected String processDefinitionKey
protected String activityId
protected String activityInstanceId
protected String tenantId
protected long priority
protected ExecutionEntity execution
public String getId()
getId
in interface ExternalTask
getId
in interface DbEntity
public String getTopicName()
getTopicName
in interface ExternalTask
public void setTopicName(String topic)
public String getWorkerId()
getWorkerId
in interface ExternalTask
public void setWorkerId(String workerId)
public Date getLockExpirationTime()
getLockExpirationTime
in interface ExternalTask
public void setLockExpirationTime(Date lockExpirationTime)
public String getExecutionId()
getExecutionId
in interface ExternalTask
public void setExecutionId(String executionId)
public String getProcessDefinitionKey()
getProcessDefinitionKey
in interface ExternalTask
public void setProcessDefinitionKey(String processDefinitionKey)
public String getActivityId()
getActivityId
in interface ExternalTask
public void setActivityId(String activityId)
public String getActivityInstanceId()
getActivityInstanceId
in interface ExternalTask
public void setActivityInstanceId(String activityInstanceId)
public int getRevision()
getRevision
in interface HasDbRevision
public void setRevision(int revision)
setRevision
in interface HasDbRevision
public int getRevisionNext()
getRevisionNext
in interface HasDbRevision
public int getSuspensionState()
public void setSuspensionState(int suspensionState)
public boolean isSuspended()
isSuspended
in interface ExternalTask
public String getProcessInstanceId()
getProcessInstanceId
in interface ExternalTask
public void setProcessInstanceId(String processInstanceId)
public String getProcessDefinitionId()
getProcessDefinitionId
in interface ExternalTask
public void setProcessDefinitionId(String processDefinitionId)
public String getTenantId()
getTenantId
in interface ExternalTask
null
if the task belongs to no single tenant.public void setTenantId(String tenantId)
public Integer getRetries()
getRetries
in interface ExternalTask
null
.public void setRetries(Integer retries)
public String getErrorMessage()
getErrorMessage
in interface ExternalTask
null
if no failure was reported previously or if no error message
was submittedTo get the full error details,
use {@link ExternalTaskService#getExternalTaskErrorDetails(String)}
public boolean areRetriesLeft()
public long getPriority()
ExternalTask
getPriority
in interface ExternalTask
public void setPriority(long priority)
public Object getPersistentState()
DbEntity
getPersistentState
in interface DbEntity
public void insert()
public String getErrorDetails()
public void setErrorMessage(String errorMessage)
protected void setErrorDetails(String exception)
public String getErrorDetailsByteArrayId()
protected ByteArrayEntity getErrorByteArray()
protected void ensureErrorByteArrayInitialized()
public void delete()
protected void deleteFromExecutionAndRuntimeTable()
public void failed(String errorMessage, String errorDetails, int retries, long retryDuration)
errorMessage
- - short error message texterrorDetails
- - full error detailsretries
- - updated value of retries leftretryDuration
- - used for lockExpirationTime calculationpublic void bpmnError(String errorCode)
public void setRetriesAndManageIncidents(int retries)
protected void createIncident()
protected void removeIncident()
protected IncidentContext createIncidentContext()
public void lock(String workerId, long lockDuration)
public ExecutionEntity getExecution()
public void setExecution(ExecutionEntity execution)
protected void ensureExecutionInitialized()
protected void ensureActive()
public void unlock()
public static ExternalTaskEntity createAndInsert(ExecutionEntity execution, String topic, long priority)
protected void produceHistoricExternalTaskCreatedEvent()
protected void produceHistoricExternalTaskFailedEvent()
protected void produceHistoricExternalTaskSuccessfulEvent()
protected void produceHistoricExternalTaskDeletedEvent()
public void extendLock(long newLockExpirationTime)
public Set<String> getReferencedEntityIds()
getReferencedEntityIds
in interface HasDbReferences
public Map<String,Class> getReferencedEntitiesIdAndClass()
getReferencedEntitiesIdAndClass
in interface HasDbReferences
Copyright © 2018. All rights reserved.