use of org.activiti.engine.impl.history.HistoryManager in project Activiti by Activiti.
the class ExecutionEntity method destroyScope.
public void destroyScope(String reason) {
if (log.isDebugEnabled()) {
log.debug("performing destroy scope behavior for execution {}", this);
}
// remove all child executions and sub process instances:
HistoryManager historyManager = Context.getCommandContext().getHistoryManager();
List<InterpretableExecution> executions = new ArrayList<InterpretableExecution>(getExecutions());
for (InterpretableExecution childExecution : executions) {
if (childExecution.getSubProcessInstance() != null) {
childExecution.getSubProcessInstance().deleteCascade(reason);
}
historyManager.recordActivityEnd((ExecutionEntity) childExecution);
childExecution.deleteCascade(reason);
}
if (activityId != null) {
historyManager.recordActivityEnd(this);
}
removeTasks(reason);
removeJobs();
}
Aggregations