@Test public void addWorkflows() { WorkflowInstance instance1 = new WorkflowInstance.Builder().setBusinessKey("instance1").build(); WorkflowInstance instance2 = new WorkflowInstance.Builder().setBusinessKey("instance2").build(); WorkflowInstance processedInstance1 = mock(WorkflowInstance.class, "processed1"); WorkflowInstance processedInstance2 = mock(WorkflowInstance.class, "processed2"); when(workflowInstancePreProcessor.process(instance1)).thenReturn(processedInstance1); when(workflowInstancePreProcessor.process(instance2)).thenReturn(processedInstance2); execution.addWorkflows(instance1, instance2); assertThat(execution.getNewWorkflows(), is(asList(processedInstance1, processedInstance2))); }
@Override public void addWorkflows(WorkflowInstance... workflows) { Assert.notNull(workflows, "workflows can not be null"); for (WorkflowInstance workflow : workflows) { Assert.notNull(workflow, "workflow can not be null"); WorkflowInstance processedInstance = workflowInstancePreProcessor.process(workflow); newWorkflows.add(processedInstance); } }
StateExecutionImpl extends ModelObject implements StateExecution { @Override public void addWorkflows(WorkflowInstance... workflows) { Assert.notNull(workflows, "workflows can not be null"); for (WorkflowInstance workflow : workflows) { Assert.notNull(workflow, "workflow can not be null"); WorkflowInstance processedInstance = workflowInstancePreProcessor.process(workflow); newWorkflows.add(processedInstance); } } }
StateExecutionImpl extends ModelObject implements StateExecution { @Override public void addWorkflows(WorkflowInstance... workflows) { Assert.notNull(workflows, "workflows can not be null"); for (WorkflowInstance workflow : workflows) { Assert.notNull(workflow, "workflow can not be null"); WorkflowInstance processedInstance = workflowInstancePreProcessor.process(workflow); newWorkflows.add(processedInstance); } } StateExecutionImpl(WorkflowInstance instance, ObjectStringMapper objectMapper, WorkflowInstanceDao workflowDao,
      WorkflowInstancePreProcessor workflowInstancePreProcessor, WorkflowInstanceService workflowInstanceService); }
StateExecutionImpl extends ModelObject implements StateExecution { @Override public void addWorkflows(WorkflowInstance... workflows) { Assert.notNull(workflows, "workflows can not be null"); for (WorkflowInstance workflow : workflows) { Assert.notNull(workflow, "workflow can not be null"); WorkflowInstance processedInstance = workflowInstancePreProcessor.process(workflow); newWorkflows.add(processedInstance); } } StateExecutionImpl(WorkflowInstance instance, ObjectStringMapper objectMapper, WorkflowInstanceDao workflowDao,
      WorkflowInstancePreProcessor workflowInstancePreProcessor, WorkflowInstanceService workflowInstanceService); DateTime getNextActivation(); String getNextState(); String getNextStateReason(); String getCurrentStateName(); @Override long getWorkflowInstanceId(); @Override String getWorkflowInstanceExternalId(); @Override String getBusinessKey(); @Override int getRetries(); @Override String getVariable(String name); @Override T getVariable(String name, Class<T> type); @Override @SuppressWarnings("unchecked") T getVariable(String name, Class<T> type, T defaultValue); @Override String getVariable(String name, String defaultValue); @Override void setVariable(String name, String value); @Override void setVariable(String name, Object value); void setNextActivation(DateTime activation); void setNextState(WorkflowState state); void setNextStateReason(String reason); boolean isRetry(); void setRetry(boolean isRetry); boolean isFailed(); Throwable getThrown(); void setFailed(); void setFailed(Throwable t); boolean isRetryCountExceeded(); @Override void addChildWorkflows(WorkflowInstance... childWorkflows); @Override void addWorkflows(WorkflowInstance... workflows); List<WorkflowInstance> getNewChildWorkflows(); List<WorkflowInstance> getNewWorkflows(); @Override List<WorkflowInstance> queryChildWorkflows(QueryWorkflowInstances query); @Override List<WorkflowInstance> getAllChildWorkflows(); @Override void wakeUpParentWorkflow(String... expectedStates); Optional<List<String>> getWakeUpParentWorkflowStates(); @Override WorkflowInstance.Builder workflowInstanceBuilder(); void setStateProcessInvoked(boolean isStateProcessInvoked); boolean isStateProcessInvoked(); @Override void setCreateAction(boolean createAction); boolean createAction(); @Override Optional<Integer> getSignal(); @Override void setSignal(Optional<Integer> signal, String reason); @Override Optional<Long> getParentId(); @Override void setHistoryCleaningForced(boolean historyCleaningForced); boolean isHistoryCleaningForced(); void handleRetryAfter(DateTime activation, AbstractWorkflowDefinition<?> definition); void handleFailure(AbstractWorkflowDefinition<?> definition, String failureReason); }
StateExecutionImpl extends ModelObject implements StateExecution { @Override public void addWorkflows(WorkflowInstance... workflows) { Assert.notNull(workflows, "workflows can not be null"); for (WorkflowInstance workflow : workflows) { Assert.notNull(workflow, "workflow can not be null"); WorkflowInstance processedInstance = workflowInstancePreProcessor.process(workflow); newWorkflows.add(processedInstance); } } StateExecutionImpl(WorkflowInstance instance, ObjectStringMapper objectMapper, WorkflowInstanceDao workflowDao,
      WorkflowInstancePreProcessor workflowInstancePreProcessor, WorkflowInstanceService workflowInstanceService); DateTime getNextActivation(); String getNextState(); String getNextStateReason(); String getCurrentStateName(); @Override long getWorkflowInstanceId(); @Override String getWorkflowInstanceExternalId(); @Override String getBusinessKey(); @Override int getRetries(); @Override String getVariable(String name); @Override T getVariable(String name, Class<T> type); @Override @SuppressWarnings("unchecked") T getVariable(String name, Class<T> type, T defaultValue); @Override String getVariable(String name, String defaultValue); @Override void setVariable(String name, String value); @Override void setVariable(String name, Object value); void setNextActivation(DateTime activation); void setNextState(WorkflowState state); void setNextStateReason(String reason); boolean isRetry(); void setRetry(boolean isRetry); boolean isFailed(); Throwable getThrown(); void setFailed(); void setFailed(Throwable t); boolean isRetryCountExceeded(); @Override void addChildWorkflows(WorkflowInstance... childWorkflows); @Override void addWorkflows(WorkflowInstance... workflows); List<WorkflowInstance> getNewChildWorkflows(); List<WorkflowInstance> getNewWorkflows(); @Override List<WorkflowInstance> queryChildWorkflows(QueryWorkflowInstances query); @Override List<WorkflowInstance> getAllChildWorkflows(); @Override void wakeUpParentWorkflow(String... expectedStates); Optional<List<String>> getWakeUpParentWorkflowStates(); @Override WorkflowInstance.Builder workflowInstanceBuilder(); void setStateProcessInvoked(boolean isStateProcessInvoked); boolean isStateProcessInvoked(); @Override void setCreateAction(boolean createAction); boolean createAction(); @Override Optional<Integer> getSignal(); @Override void setSignal(Optional<Integer> signal, String reason); @Override Optional<Long> getParentId(); @Override void setHistoryCleaningForced(boolean historyCleaningForced); boolean isHistoryCleaningForced(); void handleRetryAfter(DateTime activation, AbstractWorkflowDefinition<?> definition); void handleFailure(AbstractWorkflowDefinition<?> definition, String failureReason);  }