Class IncidentEntity
- java.lang.Object
-
- org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity
-
- All Implemented Interfaces:
DbEntity,HasDbReferences,HasDbRevision,Incident
public class IncidentEntity extends java.lang.Object implements Incident, DbEntity, HasDbRevision, HasDbReferences
- Author:
- roman.smirnov
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringactivityIdprotected java.lang.Stringannotationprotected java.lang.StringcauseIncidentIdprotected java.lang.Stringconfigurationprotected java.lang.StringexecutionIdprotected java.lang.StringfailedActivityIdprotected java.lang.StringhistoryConfigurationprotected java.lang.Stringidprotected java.lang.StringincidentMessageprotected java.util.DateincidentTimestampprotected java.lang.StringincidentTypeprotected java.lang.StringjobDefinitionIdprotected static IncidentLoggerLOGprotected java.lang.StringprocessDefinitionIdprotected java.lang.StringprocessInstanceIdprotected intrevisionprotected java.lang.StringrootCauseIncidentIdprotected java.lang.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(java.lang.String incidentType)static IncidentEntitycreateAndInsertIncident(java.lang.String incidentType, IncidentContext context, java.lang.String message)java.util.List<IncidentEntity>createRecursiveIncidents()protected voidcreateRecursiveIncidents(java.lang.String rootCauseIncidentId, java.util.List<IncidentEntity> createdIncidents)Instantiate recursive a new incident a super execution (i.e.voiddelete()booleanequals(java.lang.Object obj)protected voidfireHistoricIncidentEvent(HistoryEventType eventType)java.lang.StringgetActivityId()Returns the id of the activity of the process instance on which this incident has happened.java.lang.StringgetAnnotation()Returns the annotation of this incidentjava.lang.StringgetCauseIncidentId()Returns the id of the incident on which this incident has been triggered.java.lang.StringgetConfiguration()Returns the payload of this incident.ExecutionEntitygetExecution()java.lang.StringgetExecutionId()Returns the specific execution on which this incident has happened.java.lang.StringgetFailedActivityId()Returns the id of the activity on which the last exception occurred.java.lang.StringgetHistoryConfiguration()Returns the history payload of this incident.java.lang.StringgetId()Returns the unique identifier for this incident.java.lang.StringgetIncidentMessage()Returns the incident message.java.util.DategetIncidentTimestamp()Time when the incident happened.java.lang.StringgetIncidentType()Returns the type of this incident to identify the kind of incident.java.lang.StringgetJobDefinitionId()Returns the id of the job definition the incident belongs to.java.lang.ObjectgetPersistentState()Returns a representation of the object, as would be stored in the database.ProcessDefinitionEntitygetProcessDefinition()java.lang.StringgetProcessDefinitionId()Returns the id of the process definition of this process instance on which the incident has happened.java.lang.StringgetProcessInstanceId()Returns the specific process instance on which this incident has happened.java.util.Map<java.lang.String,java.lang.Class>getReferencedEntitiesIdAndClass()Scope: IN-MEMORY referencesjava.util.Set<java.lang.String>getReferencedEntityIds()Scope: IN-MEMORY referencesintgetRevision()intgetRevisionNext()java.lang.StringgetRootCauseIncidentId()Returns the id of the root incident on which this transitive incident has been triggered.java.lang.StringgetTenantId()Returns the id of the tenant this incident belongs to.inthashCode()protected static voidinsert(IncidentEntity incident)protected voidremove(boolean resolved)voidresolve()voidsetActivityId(java.lang.String activityId)voidsetAnnotation(java.lang.String annotation)voidsetCauseIncidentId(java.lang.String causeIncidentId)voidsetConfiguration(java.lang.String configuration)voidsetExecution(ExecutionEntity execution)voidsetExecutionId(java.lang.String executionId)voidsetFailedActivityId(java.lang.String failedActivityId)voidsetHistoryConfiguration(java.lang.String historyConfiguration)voidsetId(java.lang.String id)voidsetIncidentMessage(java.lang.String incidentMessage)voidsetIncidentTimestamp(java.util.Date incidentTimestamp)voidsetIncidentType(java.lang.String incidentType)voidsetJobDefinitionId(java.lang.String jobDefinitionId)voidsetProcessDefinitionId(java.lang.String processDefinitionId)voidsetProcessInstanceId(java.lang.String processInstanceId)voidsetRevision(int revision)voidsetRootCauseIncidentId(java.lang.String rootCauseIncidentId)voidsetTenantId(java.lang.String tenantId)java.lang.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 java.lang.String id
-
incidentTimestamp
protected java.util.Date incidentTimestamp
-
incidentType
protected java.lang.String incidentType
-
executionId
protected java.lang.String executionId
-
activityId
protected java.lang.String activityId
-
processInstanceId
protected java.lang.String processInstanceId
-
processDefinitionId
protected java.lang.String processDefinitionId
-
causeIncidentId
protected java.lang.String causeIncidentId
-
rootCauseIncidentId
protected java.lang.String rootCauseIncidentId
-
configuration
protected java.lang.String configuration
-
incidentMessage
protected java.lang.String incidentMessage
-
tenantId
protected java.lang.String tenantId
-
jobDefinitionId
protected java.lang.String jobDefinitionId
-
historyConfiguration
protected java.lang.String historyConfiguration
-
failedActivityId
protected java.lang.String failedActivityId
-
annotation
protected java.lang.String annotation
-
-
Method Detail
-
createRecursiveIncidents
public java.util.List<IncidentEntity> createRecursiveIncidents()
-
createRecursiveIncidents
protected void createRecursiveIncidents(java.lang.String rootCauseIncidentId, java.util.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(java.lang.String incidentType, IncidentContext context, java.lang.String message)
-
create
protected static IncidentEntity create(java.lang.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 java.util.Set<java.lang.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 java.util.Map<java.lang.String,java.lang.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 java.lang.String getId()
Description copied from interface:IncidentReturns the unique identifier for this incident.
-
getIncidentTimestamp
public java.util.Date getIncidentTimestamp()
Description copied from interface:IncidentTime when the incident happened.- Specified by:
getIncidentTimestampin interfaceIncident
-
setIncidentTimestamp
public void setIncidentTimestamp(java.util.Date incidentTimestamp)
-
getIncidentType
public java.lang.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(java.lang.String incidentType)
-
getIncidentMessage
public java.lang.String getIncidentMessage()
Description copied from interface:IncidentReturns the incident message.- Specified by:
getIncidentMessagein interfaceIncident
-
setIncidentMessage
public void setIncidentMessage(java.lang.String incidentMessage)
-
getExecutionId
public java.lang.String getExecutionId()
Description copied from interface:IncidentReturns the specific execution on which this incident has happened.- Specified by:
getExecutionIdin interfaceIncident
-
setExecutionId
public void setExecutionId(java.lang.String executionId)
-
getActivityId
public java.lang.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(java.lang.String activityId)
-
getProcessInstanceId
public java.lang.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(java.lang.String processInstanceId)
-
getProcessDefinition
public ProcessDefinitionEntity getProcessDefinition()
-
getProcessDefinitionId
public java.lang.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(java.lang.String processDefinitionId)
-
getCauseIncidentId
public java.lang.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(java.lang.String causeIncidentId)
-
getRootCauseIncidentId
public java.lang.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(java.lang.String rootCauseIncidentId)
-
getConfiguration
public java.lang.String getConfiguration()
Description copied from interface:IncidentReturns the payload of this incident.- Specified by:
getConfigurationin interfaceIncident
-
setConfiguration
public void setConfiguration(java.lang.String configuration)
-
getTenantId
public java.lang.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(java.lang.String tenantId)
-
setJobDefinitionId
public void setJobDefinitionId(java.lang.String jobDefinitionId)
-
getJobDefinitionId
public java.lang.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 java.lang.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 java.lang.String getHistoryConfiguration()
Description copied from interface:IncidentReturns the history payload of this incident.- Specified by:
getHistoryConfigurationin interfaceIncident
-
setHistoryConfiguration
public void setHistoryConfiguration(java.lang.String historyConfiguration)
-
getFailedActivityId
public java.lang.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(java.lang.String failedActivityId)
-
getAnnotation
public java.lang.String getAnnotation()
Description copied from interface:IncidentReturns the annotation of this incident- Specified by:
getAnnotationin interfaceIncident
-
setAnnotation
public void setAnnotation(java.lang.String annotation)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-