Search in sources :

Example 1 with HistoryManager

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();
}
Also used : HistoryManager(org.activiti.engine.impl.history.HistoryManager) ArrayList(java.util.ArrayList) InterpretableExecution(org.activiti.engine.impl.pvm.runtime.InterpretableExecution)

Aggregations

ArrayList (java.util.ArrayList)1 HistoryManager (org.activiti.engine.impl.history.HistoryManager)1 InterpretableExecution (org.activiti.engine.impl.pvm.runtime.InterpretableExecution)1