@Override public Void execute(CommandContext commandContext) { ensureNotEmpty(BadUserRequestException.class,"variableInstanceId", variableInstanceId); HistoricVariableInstanceEntity variable = commandContext.getHistoricVariableInstanceManager().findHistoricVariableInstanceByVariableInstanceId(variableInstanceId); ensureNotNull(NotFoundException.class, "No historic variable instance found with id: " + variableInstanceId, "variable", variable); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkDeleteHistoricVariableInstance(variable); } commandContext .getHistoricDetailManager() .deleteHistoricDetailsByVariableInstanceId(variableInstanceId); commandContext .getHistoricVariableInstanceManager() .deleteHistoricVariableInstanceByVariableInstanceId(variableInstanceId); return null; } }
@Override public Void execute(CommandContext commandContext) { ensureNotEmpty(BadUserRequestException.class,"variableInstanceId", variableInstanceId); HistoricVariableInstanceEntity variable = commandContext.getHistoricVariableInstanceManager().findHistoricVariableInstanceByVariableInstanceId(variableInstanceId); ensureNotNull(NotFoundException.class, "No historic variable instance found with id: " + variableInstanceId, "variable", variable); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkDeleteHistoricVariableInstance(variable); } commandContext .getHistoricDetailManager() .deleteHistoricDetailsByVariableInstanceId(variableInstanceId); commandContext .getHistoricVariableInstanceManager() .deleteHistoricVariableInstanceByVariableInstanceId(variableInstanceId); return null; } }