protected List<ExecutionEntity> loadFromDb(final String processInstanceId, final CommandContext commandContext) { List<ExecutionEntity> executions = commandContext.getExecutionManager().findExecutionsByProcessInstanceId(processInstanceId); ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId); // initialize parent/child sets if (processInstance != null) { processInstance.restoreProcessInstance(executions, null, null, null, null, null, null); } return executions; }
protected List<ExecutionEntity> loadFromDb(final String processInstanceId, final CommandContext commandContext) { List<ExecutionEntity> executions = commandContext.getExecutionManager().findExecutionsByProcessInstanceId(processInstanceId); ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId); // initialize parent/child sets if (processInstance != null) { processInstance.restoreProcessInstance(executions, null, null, null, null, null, null); } return executions; }
processInstance.restoreProcessInstance(executions, null, null, null, null, null, null);
@Test public void testRestoreProcessInstance() { //given parent execution List<ExecutionEntity> entities = new ArrayList<ExecutionEntity>(); ExecutionEntity parent = new ExecutionEntity(); parent.setId("parent"); entities.add(parent); //when restore process instance is called parent.restoreProcessInstance(entities, null, null, null, null, null, null); //then no problem should occure //when child is added and restore is called again ExecutionEntity entity = new ExecutionEntity(); entity.setId("child"); entity.setParentId(parent.getId()); entities.add(entity); parent.restoreProcessInstance(entities, null, null, null, null, null, null); //then again no problem should occure //when parent is deleted from the list entities.remove(parent); //then exception is thrown because child reference to parent which does not exist anymore thrown.expect(ProcessEngineException.class); thrown.expectMessage("Cannot resolve parent with id 'parent' of execution 'child', perhaps it was deleted in the meantime"); parent.restoreProcessInstance(entities, null, null, null, null, null, null); }
processInstance.restoreProcessInstance(executions, null, null, null, null, null, null);
protected List<ExecutionEntity> loadFromDb(final String processInstanceId, final CommandContext commandContext) { List<ExecutionEntity> executions = commandContext.getExecutionManager().findExecutionsByProcessInstanceId(processInstanceId); ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId); // initialize parent/child sets if (processInstance != null) { processInstance.restoreProcessInstance(executions, null, null, null, null, null, null); } return executions; }
processInstance.restoreProcessInstance(executions, eventSubscriptions, variables, tasks, jobs, incidents, externalTasks);
processInstance.restoreProcessInstance(executions, eventSubscriptions, variables, tasks, jobs, incidents, externalTasks);
processInstance.restoreProcessInstance(executions, null, null, null, null, null, null);
@Test public void testRestoreProcessInstance() { //given parent execution List<ExecutionEntity> entities = new ArrayList<ExecutionEntity>(); ExecutionEntity parent = new ExecutionEntity(); parent.setId("parent"); entities.add(parent); //when restore process instance is called parent.restoreProcessInstance(entities, null, null, null, null, null, null); //then no problem should occure //when child is added and restore is called again ExecutionEntity entity = new ExecutionEntity(); entity.setId("child"); entity.setParentId(parent.getId()); entities.add(entity); parent.restoreProcessInstance(entities, null, null, null, null, null, null); //then again no problem should occure //when parent is deleted from the list entities.remove(parent); //then exception is thrown because child reference to parent which does not exist anymore thrown.expect(ProcessEngineException.class); thrown.expectMessage("Cannot resolve parent with id 'parent' of execution 'child', perhaps it was deleted in the meantime"); parent.restoreProcessInstance(entities, null, null, null, null, null, null); }
processInstance.restoreProcessInstance(executions, eventSubscriptions, variables, tasks, jobs, incidents, externalTasks);