public class ExternalTaskEntity extends Object implements ExternalTask, DbEntity, HasDbRevision
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 |
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) |
void |
complete(Map<String,Object> variables) |
static ExternalTaskEntity |
createAndInsert(ExecutionEntity execution,
String topic,
long priority) |
protected void |
createIncident() |
protected IncidentContext |
createIncidentContext() |
void |
delete() |
protected void |
ensureActive() |
protected void |
ensureErrorByteArrayInitialized() |
protected void |
ensureExecutionInitialized() |
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() |
protected ByteArrayEntity |
getErrorByteArray() |
String |
getErrorDetails()
Method implementation relies on the command context object,
therefore should be invoked from the commands only
|
protected 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() |
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 |
removeIncident() |
void |
setActivityId(String activityId) |
void |
setActivityInstanceId(String activityInstanceId) |
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
protected 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)
protected String getErrorDetailsByteArrayId()
protected ByteArrayEntity getErrorByteArray()
protected void ensureErrorByteArrayInitialized()
public void delete()
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)
Copyright © 2018. All rights reserved.