use of org.camunda.bpm.engine.impl.history.event.HistoricCaseInstanceEventEntity in project camunda-bpm-platform by camunda.
the class CacheAwareCmmnHistoryEventProducer method loadCaseInstanceEventEntity.
@Override
protected HistoricCaseInstanceEventEntity loadCaseInstanceEventEntity(CaseExecutionEntity caseExecutionEntity) {
final String caseInstanceId = caseExecutionEntity.getCaseInstanceId();
HistoricCaseInstanceEventEntity cachedEntity = findInCache(HistoricCaseInstanceEventEntity.class, caseInstanceId);
if (cachedEntity != null) {
return cachedEntity;
} else {
return newCaseInstanceEventEntity(caseExecutionEntity);
}
}
use of org.camunda.bpm.engine.impl.history.event.HistoricCaseInstanceEventEntity in project camunda-bpm-platform by camunda.
the class DefaultCmmnHistoryEventProducer method createCaseInstanceUpdateEvt.
public HistoryEvent createCaseInstanceUpdateEvt(DelegateCaseExecution caseExecution) {
final CaseExecutionEntity caseExecutionEntity = (CaseExecutionEntity) caseExecution;
// create event instance
HistoricCaseInstanceEventEntity evt = loadCaseInstanceEventEntity(caseExecutionEntity);
// initialize event
initCaseInstanceEvent(evt, caseExecutionEntity, HistoryEventTypes.CASE_INSTANCE_UPDATE);
return evt;
}
use of org.camunda.bpm.engine.impl.history.event.HistoricCaseInstanceEventEntity in project camunda-bpm-platform by camunda.
the class DefaultCmmnHistoryEventProducer method createCaseInstanceCreateEvt.
public HistoryEvent createCaseInstanceCreateEvt(DelegateCaseExecution caseExecution) {
final CaseExecutionEntity caseExecutionEntity = (CaseExecutionEntity) caseExecution;
// create event instance
HistoricCaseInstanceEventEntity evt = newCaseInstanceEventEntity(caseExecutionEntity);
// initialize event
initCaseInstanceEvent(evt, caseExecutionEntity, HistoryEventTypes.CASE_INSTANCE_CREATE);
// set create time
evt.setCreateTime(ClockUtil.getCurrentTime());
// set create user id
evt.setCreateUserId(Context.getCommandContext().getAuthenticatedUserId());
// set super case instance id
CmmnExecution superCaseExecution = caseExecutionEntity.getSuperCaseExecution();
if (superCaseExecution != null) {
evt.setSuperCaseInstanceId(superCaseExecution.getCaseInstanceId());
}
// set super process instance id
ExecutionEntity superExecution = caseExecutionEntity.getSuperExecution();
if (superExecution != null) {
evt.setSuperProcessInstanceId(superExecution.getProcessInstanceId());
}
return evt;
}
use of org.camunda.bpm.engine.impl.history.event.HistoricCaseInstanceEventEntity in project camunda-bpm-platform by camunda.
the class DefaultCmmnHistoryEventProducer method createCaseInstanceCloseEvt.
public HistoryEvent createCaseInstanceCloseEvt(DelegateCaseExecution caseExecution) {
final CaseExecutionEntity caseExecutionEntity = (CaseExecutionEntity) caseExecution;
// create event instance
HistoricCaseInstanceEventEntity evt = loadCaseInstanceEventEntity(caseExecutionEntity);
// initialize event
initCaseInstanceEvent(evt, caseExecutionEntity, HistoryEventTypes.CASE_INSTANCE_CLOSE);
// set end time
evt.setEndTime(ClockUtil.getCurrentTime());
if (evt.getStartTime() != null) {
evt.setDurationInMillis(evt.getEndTime().getTime() - evt.getStartTime().getTime());
}
return evt;
}
Aggregations