use of org.camunda.bpm.engine.impl.history.event.HistoryEventType in project camunda-bpm-platform by camunda.
the class IncidentEntity method remove.
protected void remove(boolean resolved) {
ExecutionEntity execution = getExecution();
if (execution != null) {
// Extract possible super execution of the assigned execution
ExecutionEntity superExecution = null;
if (execution.getId().equals(execution.getProcessInstanceId())) {
superExecution = execution.getSuperExecution();
} else {
superExecution = execution.getProcessInstance().getSuperExecution();
}
if (superExecution != null) {
// get the incident, where this incident is the cause
IncidentEntity parentIncident = superExecution.getIncidentByCauseIncidentId(getId());
if (parentIncident != null) {
// remove the incident
parentIncident.remove(resolved);
}
}
// remove link to execution
execution.removeIncident(this);
}
// always delete the incident
Context.getCommandContext().getDbEntityManager().delete(this);
// update historic incident
HistoryEventType eventType = resolved ? HistoryEventTypes.INCIDENT_RESOLVE : HistoryEventTypes.INCIDENT_DELETE;
fireHistoricIncidentEvent(eventType);
}
use of org.camunda.bpm.engine.impl.history.event.HistoryEventType in project camunda-bpm-platform by camunda.
the class DetermineHistoryLevelCmdTest method failWhenExistingHistoryLevelIsNotRegistered.
@Test
public void failWhenExistingHistoryLevelIsNotRegistered() {
// init the db with custom level
HistoryLevel customLevel = new HistoryLevel() {
@Override
public int getId() {
return 99;
}
@Override
public String getName() {
return "custom";
}
@Override
public boolean isHistoryEventProduced(HistoryEventType eventType, Object entity) {
return false;
}
};
ProcessEngineConfigurationImpl config = config("true", "custom");
config.setCustomHistoryLevels(Arrays.asList(customLevel));
processEngineImpl = (ProcessEngineImpl) config.buildProcessEngine();
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("The configured history level with id='99' is not registered in this config.");
config.getCommandExecutorSchemaOperations().execute(new DetermineHistoryLevelCmd(Collections.<HistoryLevel>emptyList()));
}
Aggregations