Class IncidentEntity
- java.lang.Object
-
- org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity
-
- All Implemented Interfaces:
DbEntity,HasDbReferences,HasDbRevision,Incident
public class IncidentEntity extends Object implements Incident, DbEntity, HasDbRevision, HasDbReferences
- Author:
- roman.smirnov
-
-
Field Summary
Fields Modifier and Type Field Description protected StringactivityIdprotected Stringannotationprotected StringcauseIncidentIdprotected Stringconfigurationprotected StringexecutionIdprotected StringfailedActivityIdprotected StringhistoryConfigurationprotected Stringidprotected StringincidentMessageprotected DateincidentTimestampprotected StringincidentTypeprotected StringjobDefinitionIdprotected static IncidentLoggerLOGprotected StringprocessDefinitionIdprotected StringprocessInstanceIdprotected intrevisionprotected StringrootCauseIncidentIdprotected StringtenantId-
Fields inherited from interface org.camunda.bpm.engine.runtime.Incident
EXTERNAL_TASK_HANDLER_TYPE, FAILED_JOB_HANDLER_TYPE
-
-
Constructor Summary
Constructors Constructor Description IncidentEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static IncidentEntitycreate(String incidentType)static IncidentEntitycreateAndInsertIncident(String incidentType, IncidentContext context, String message)List<IncidentEntity>createRecursiveIncidents()protected voidcreateRecursiveIncidents(String rootCauseIncidentId, List<IncidentEntity> createdIncidents)Instantiate recursive a new incident a super execution (i.e.voiddelete()booleanequals(Object obj)protected voidfireHistoricIncidentEvent(HistoryEventType eventType)StringgetActivityId()Returns the id of the activity of the process instance on which this incident has happened.StringgetAnnotation()Returns the annotation of this incidentStringgetCauseIncidentId()Returns the id of the incident on which this incident has been triggered.StringgetConfiguration()Returns the payload of this incident.ExecutionEntitygetExecution()StringgetExecutionId()Returns the specific execution on which this incident has happened.StringgetFailedActivityId()Returns the id of the activity on which the last exception occurred.StringgetHistoryConfiguration()Returns the history payload of this incident.StringgetId()Returns the unique identifier for this incident.StringgetIncidentMessage()Returns the incident message.DategetIncidentTimestamp()Time when the incident happened.StringgetIncidentType()Returns the type of this incident to identify the kind of incident.StringgetJobDefinitionId()Returns the id of the job definition the incident belongs to.ObjectgetPersistentState()Returns a representation of the object, as would be stored in the database.ProcessDefinitionEntitygetProcessDefinition()StringgetProcessDefinitionId()Returns the id of the process definition of this process instance on which the incident has happened.StringgetProcessInstanceId()Returns the specific process instance on which this incident has happened.Map<String,Class>getReferencedEntitiesIdAndClass()Scope: IN-MEMORY referencesSet<String>getReferencedEntityIds()Scope: IN-MEMORY referencesintgetRevision()intgetRevisionNext()StringgetRootCauseIncidentId()Returns the id of the root incident on which this transitive incident has been triggered.StringgetTenantId()Returns the id of the tenant this incident belongs to.inthashCode()protected static voidinsert(IncidentEntity incident)protected voidremove(boolean resolved)voidresolve()voidsetActivityId(String activityId)voidsetAnnotation(String annotation)voidsetCauseIncidentId(String causeIncidentId)voidsetConfiguration(String configuration)voidsetExecution(ExecutionEntity execution)voidsetExecutionId(String executionId)voidsetFailedActivityId(String failedActivityId)voidsetHistoryConfiguration(String historyConfiguration)voidsetId(String id)voidsetIncidentMessage(String incidentMessage)voidsetIncidentTimestamp(Date incidentTimestamp)voidsetIncidentType(String incidentType)voidsetJobDefinitionId(String jobDefinitionId)voidsetProcessDefinitionId(String processDefinitionId)voidsetProcessInstanceId(String processInstanceId)voidsetRevision(int revision)voidsetRootCauseIncidentId(String rootCauseIncidentId)voidsetTenantId(String tenantId)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.db.HasDbReferences
getDependentEntities
-
-
-
-
Field Detail
-
LOG
protected static final IncidentLogger LOG
-
revision
protected int revision
-
id
protected String id
-
incidentTimestamp
protected Date incidentTimestamp
-
incidentType
protected String incidentType
-
executionId
protected String executionId
-
activityId
protected String activityId
-
processInstanceId
protected String processInstanceId
-
processDefinitionId
protected String processDefinitionId
-
causeIncidentId
protected String causeIncidentId
-
rootCauseIncidentId
protected String rootCauseIncidentId
-
configuration
protected String configuration
-
incidentMessage
protected String incidentMessage
-
tenantId
protected String tenantId
-
jobDefinitionId
protected String jobDefinitionId
-
historyConfiguration
protected String historyConfiguration
-
failedActivityId
protected String failedActivityId
-
annotation
protected String annotation
-
-
Method Detail
-
createRecursiveIncidents
public List<IncidentEntity> createRecursiveIncidents()
-
createRecursiveIncidents
protected void createRecursiveIncidents(String rootCauseIncidentId, List<IncidentEntity> createdIncidents)
Instantiate recursive a new incident a super execution (i.e. super process instance) which is affected from this incident. For example: a super process instance called via CallActivity a new process instance on which an incident happened, so that the super process instance has an incident too.
-
createAndInsertIncident
public static IncidentEntity createAndInsertIncident(String incidentType, IncidentContext context, String message)
-
create
protected static IncidentEntity create(String incidentType)
-
insert
protected static void insert(IncidentEntity incident)
-
delete
public void delete()
-
resolve
public void resolve()
-
remove
protected void remove(boolean resolved)
-
fireHistoricIncidentEvent
protected void fireHistoricIncidentEvent(HistoryEventType eventType)
-
getReferencedEntityIds
public Set<String> getReferencedEntityIds()
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntityIdsin interfaceHasDbReferences- Returns:
- the ids of the entities that this entity references. Should only return ids for entities of the same type
-
getReferencedEntitiesIdAndClass
public Map<String,Class> getReferencedEntitiesIdAndClass()
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClassin interfaceHasDbReferences- Returns:
- a map of the ids and the entities' classes that this entity references. It's used when trying to determine if there was an Optimistic Locking occurrence on an INSERT or UPDATE of an object of this type.
-
getId
public String getId()
Description copied from interface:IncidentReturns the unique identifier for this incident.
-
getIncidentTimestamp
public Date getIncidentTimestamp()
Description copied from interface:IncidentTime when the incident happened.- Specified by:
getIncidentTimestampin interfaceIncident
-
setIncidentTimestamp
public void setIncidentTimestamp(Date incidentTimestamp)
-
getIncidentType
public String getIncidentType()
Description copied from interface:IncidentReturns the type of this incident to identify the kind of incident.For example:
failedJobswill be returned in the case of an incident, which identify failed job during the execution of a process instance.- Specified by:
getIncidentTypein interfaceIncident- See Also:
Incident.FAILED_JOB_HANDLER_TYPE,Incident.EXTERNAL_TASK_HANDLER_TYPE
-
setIncidentType
public void setIncidentType(String incidentType)
-
getIncidentMessage
public String getIncidentMessage()
Description copied from interface:IncidentReturns the incident message.- Specified by:
getIncidentMessagein interfaceIncident
-
setIncidentMessage
public void setIncidentMessage(String incidentMessage)
-
getExecutionId
public String getExecutionId()
Description copied from interface:IncidentReturns the specific execution on which this incident has happened.- Specified by:
getExecutionIdin interfaceIncident
-
setExecutionId
public void setExecutionId(String executionId)
-
getActivityId
public String getActivityId()
Description copied from interface:IncidentReturns the id of the activity of the process instance on which this incident has happened.- Specified by:
getActivityIdin interfaceIncident
-
setActivityId
public void setActivityId(String activityId)
-
getProcessInstanceId
public String getProcessInstanceId()
Description copied from interface:IncidentReturns the specific process instance on which this incident has happened.- Specified by:
getProcessInstanceIdin interfaceIncident
-
setProcessInstanceId
public void setProcessInstanceId(String processInstanceId)
-
getProcessDefinition
public ProcessDefinitionEntity getProcessDefinition()
-
getProcessDefinitionId
public String getProcessDefinitionId()
Description copied from interface:IncidentReturns the id of the process definition of this process instance on which the incident has happened.- Specified by:
getProcessDefinitionIdin interfaceIncident
-
setProcessDefinitionId
public void setProcessDefinitionId(String processDefinitionId)
-
getCauseIncidentId
public String getCauseIncidentId()
Description copied from interface:IncidentReturns the id of the incident on which this incident has been triggered.- Specified by:
getCauseIncidentIdin interfaceIncident
-
setCauseIncidentId
public void setCauseIncidentId(String causeIncidentId)
-
getRootCauseIncidentId
public String getRootCauseIncidentId()
Description copied from interface:IncidentReturns the id of the root incident on which this transitive incident has been triggered.- Specified by:
getRootCauseIncidentIdin interfaceIncident
-
setRootCauseIncidentId
public void setRootCauseIncidentId(String rootCauseIncidentId)
-
getConfiguration
public String getConfiguration()
Description copied from interface:IncidentReturns the payload of this incident.- Specified by:
getConfigurationin interfaceIncident
-
setConfiguration
public void setConfiguration(String configuration)
-
getTenantId
public String getTenantId()
Description copied from interface:IncidentReturns the id of the tenant this incident belongs to. Can benullif the incident belongs to no single tenant.- Specified by:
getTenantIdin interfaceIncident
-
setTenantId
public void setTenantId(String tenantId)
-
setJobDefinitionId
public void setJobDefinitionId(String jobDefinitionId)
-
getJobDefinitionId
public String getJobDefinitionId()
Description copied from interface:IncidentReturns the id of the job definition the incident belongs to. Can benullif the incident belongs to no job definition.- Specified by:
getJobDefinitionIdin interfaceIncident
-
setExecution
public void setExecution(ExecutionEntity execution)
-
getExecution
public ExecutionEntity getExecution()
-
getPersistentState
public Object getPersistentState()
Description copied from interface:DbEntityReturns 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:
getPersistentStatein interfaceDbEntity
-
setRevision
public void setRevision(int revision)
- Specified by:
setRevisionin interfaceHasDbRevision
-
getRevision
public int getRevision()
- Specified by:
getRevisionin interfaceHasDbRevision
-
getRevisionNext
public int getRevisionNext()
- Specified by:
getRevisionNextin interfaceHasDbRevision
-
getHistoryConfiguration
public String getHistoryConfiguration()
Description copied from interface:IncidentReturns the history payload of this incident.- Specified by:
getHistoryConfigurationin interfaceIncident
-
setHistoryConfiguration
public void setHistoryConfiguration(String historyConfiguration)
-
getFailedActivityId
public String getFailedActivityId()
Description copied from interface:IncidentReturns the id of the activity on which the last exception occurred.- Specified by:
getFailedActivityIdin interfaceIncident
-
setFailedActivityId
public void setFailedActivityId(String failedActivityId)
-
getAnnotation
public String getAnnotation()
Description copied from interface:IncidentReturns the annotation of this incident- Specified by:
getAnnotationin interfaceIncident
-
setAnnotation
public void setAnnotation(String annotation)
-
-