public class ExternalTaskEntity extends Object implements ExternalTask, DbEntity, HasDbRevision, HasDbReferences
Modifier and Type | Field and Description |
---|---|
protected String |
activityId |
protected String |
activityInstanceId |
protected String |
businessKey |
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() |
Modifier and Type | Method and Description |
---|---|
boolean |
areRetriesLeft() |
void |
bpmnError(String errorCode,
String errorMessage,
Map<String,Object> variables) |
void |
complete(Map<String,Object> variables,
Map<String,Object> localVariables) |
static ExternalTaskEntity |
createAndInsert(ExecutionEntity execution,
String topic,
long priority) |
protected void |
createIncident() |
protected IncidentContext |
createIncidentContext() |
void |
delete() |
protected void |
deleteFromExecutionAndRuntimeTable() |
protected void |
ensureActive() |
protected void |
ensureErrorByteArrayInitialized() |
protected void |
ensureExecutionInitialized() |
void |
extendLock(long newLockExpirationTime) |
void |
failed(String errorMessage,
String errorDetails,
int retries,
long retryDuration)
process failed state, make sure that binary entity is created for the errorMessage, shortError
message does not exceed limit, handle properly retry counts and incidents
|
String |
getActivityId() |
String |
getActivityInstanceId() |
String |
getBusinessKey()
Returns the business key of the process instance the external task belongs to
|
protected ByteArrayEntity |
getErrorByteArray() |
String |
getErrorDetails()
Method implementation relies on the command context object,
therefore should be invoked from the commands only
|
String |
getErrorDetailsByteArrayId() |
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.
|
long |
getPriority()
Returns the priority of the external task.
|
String |
getProcessDefinitionId() |
String |
getProcessDefinitionKey() |
String |
getProcessInstanceId() |
Map<String,Class> |
getReferencedEntitiesIdAndClass() |
Set<String> |
getReferencedEntityIds() |
Integer |
getRetries() |
int |
getRevision() |
int |
getRevisionNext() |
int |
getSuspensionState() |
String |
getTenantId() |
String |
getTopicName() |
String |
getWorkerId() |
void |
insert() |
boolean |
isSuspended() |
void |
lock(String workerId,
long lockDuration) |
protected void |
produceHistoricExternalTaskCreatedEvent() |
protected void |
produceHistoricExternalTaskDeletedEvent() |
protected void |
produceHistoricExternalTaskFailedEvent() |
protected void |
produceHistoricExternalTaskSuccessfulEvent() |
protected void |
removeIncident() |
void |
setActivityId(String activityId) |
void |
setActivityInstanceId(String activityInstanceId) |
void |
setBusinessKey(String businessKey) |
protected void |
setErrorDetails(String exception) |
void |
setErrorMessage(String errorMessage) |
void |
setExecution(ExecutionEntity execution) |
void |
setExecutionId(String executionId) |
void |
setId(String id) |
void |
setLockExpirationTime(Date lockExpirationTime) |
void |
setPriority(long priority) |
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 |
setTenantId(String tenantId) |
void |
setTopicName(String topic) |
void |
setWorkerId(String workerId) |
String |
toString() |
void |
unlock() |
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
protected String businessKey
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 String getBusinessKey()
ExternalTask
getBusinessKey
in interface ExternalTask
public void setBusinessKey(String businessKey)
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, String errorMessage, Map<String,Object> variables)
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 © 2020. All rights reserved.