Search in sources :

Example 1 with VariableInstanceLifecycleListener

use of org.camunda.bpm.engine.impl.core.variable.scope.VariableInstanceLifecycleListener in project camunda-bpm-platform by camunda.

the class CaseExecutionEntity method remove.

// delete/remove ///////////////////////////////////////////////////////
@SuppressWarnings({ "unchecked", "rawtypes" })
public void remove() {
    super.remove();
    for (VariableInstanceEntity variableInstance : variableStore.getVariables()) {
        invokeVariableLifecycleListenersDelete(variableInstance, this, Arrays.<VariableInstanceLifecycleListener<CoreVariableInstance>>asList((VariableInstanceLifecycleListener) VariableInstanceEntityPersistenceListener.INSTANCE));
        variableStore.removeVariable(variableInstance.getName());
    }
    CommandContext commandContext = Context.getCommandContext();
    for (CaseSentryPartEntity sentryPart : getCaseSentryParts()) {
        commandContext.getCaseSentryPartManager().deleteSentryPart(sentryPart);
    }
    // finally delete this execution
    commandContext.getCaseExecutionManager().deleteCaseExecution(this);
}
Also used : CoreVariableInstance(org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance) CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext) VariableInstanceEntity(org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity) VariableInstanceLifecycleListener(org.camunda.bpm.engine.impl.core.variable.scope.VariableInstanceLifecycleListener)

Aggregations

CoreVariableInstance (org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance)1 VariableInstanceLifecycleListener (org.camunda.bpm.engine.impl.core.variable.scope.VariableInstanceLifecycleListener)1 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)1 VariableInstanceEntity (org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity)1