@Test public void testSequential() throws Exception { Workflow.Sequential wf = new Workflow.Sequential(); LifeStepWorkflowItem job1 = new LifeStepWorkflowItem(); LifeStepWorkflowItem job2 = new LifeStepWorkflowItem(); wf.add(job1, job2); wf.submit(); assertEquals(ProcessState.UNKNOWN, job1.getStatus().getState()); assertEquals(ProcessState.UNKNOWN, job2.getStatus().getState()); assertEquals(ProcessState.UNKNOWN, wf.getStatus().getState()); incLifeStep(job1, job2); assertEquals(ProcessState.SCHEDULED, job1.getStatus().getState()); assertEquals(ProcessState.UNKNOWN, job2.getStatus().getState()); assertEquals(ProcessState.SCHEDULED, wf.getStatus().getState()); incLifeStep(job1, job2); assertEquals(ProcessState.RUNNING, job1.getStatus().getState()); assertEquals(ProcessState.UNKNOWN, job2.getStatus().getState()); assertEquals(ProcessState.RUNNING, wf.getStatus().getState()); incLifeStep(job1, job2); assertEquals(ProcessState.COMPLETED, job1.getStatus().getState()); assertEquals(ProcessState.SCHEDULED, job2.getStatus().getState()); assertEquals(ProcessState.RUNNING, wf.getStatus().getState()); incLifeStep(job1, job2); assertEquals(ProcessState.COMPLETED, job1.getStatus().getState()); assertEquals(ProcessState.RUNNING, job2.getStatus().getState()); assertEquals(ProcessState.RUNNING, wf.getStatus().getState()); incLifeStep(job1, job2); assertEquals(ProcessState.COMPLETED, job1.getStatus().getState()); assertEquals(ProcessState.COMPLETED, job2.getStatus().getState()); assertEquals(ProcessState.COMPLETED, wf.getStatus().getState()); incLifeStep(job1, job2); assertEquals(ProcessState.COMPLETED, job1.getStatus().getState()); assertEquals(ProcessState.COMPLETED, job2.getStatus().getState()); assertEquals(ProcessState.COMPLETED, wf.getStatus().getState()); assertEquals(1, job1.getSubmitCount()); assertEquals(1, job2.getSubmitCount()); }
public void add(WorkflowItem... items) { for (WorkflowItem item : items) { item.addWorkflowStatusListener(this); } itemList.addAll(Arrays.asList(items)); if (!itemList.isEmpty()) { aggregateChildInformation(); } }
Workflow extends AbstractWorkflowItem implements WorkflowStatusListener { public void add(WorkflowItem... items) { for (WorkflowItem item : items) { item.addWorkflowStatusListener(this); } itemList.addAll(Arrays.asList(items)); if (!itemList.isEmpty()) { aggregateChildInformation(); } } }
Workflow extends AbstractWorkflowItem implements WorkflowStatusListener { public void add(WorkflowItem... items) { for (WorkflowItem item : items) { item.addWorkflowStatusListener(this); } itemList.addAll(Arrays.asList(items)); if (!itemList.isEmpty()) { aggregateChildInformation(); } } protected  Workflow(WorkflowItem... items); }
Workflow extends AbstractWorkflowItem implements WorkflowStatusListener { public void add(WorkflowItem... items) { for (WorkflowItem item : items) { item.addWorkflowStatusListener(this); } itemList.addAll(Arrays.asList(items)); if (!itemList.isEmpty()) { aggregateChildInformation(); } } protected  Workflow(WorkflowItem... items); void add(WorkflowItem... items); boolean isSustainable(); void setSustainable(boolean sustainable); @Override void kill(); @Override void updateStatus(); @Override void handleStatusChanged(WorkflowStatusEvent event); @Override Object[] getJobIds(); @Override WorkflowItem[] getItems(); }
Workflow extends AbstractWorkflowItem implements WorkflowStatusListener { public void add(WorkflowItem... items) { for (WorkflowItem item : items) { item.addWorkflowStatusListener(this); } itemList.addAll(Arrays.asList(items)); if (!itemList.isEmpty()) { aggregateChildInformation(); } } protected  Workflow(WorkflowItem... items); void add(WorkflowItem... items); boolean isSustainable(); void setSustainable(boolean sustainable); @Override void kill(); @Override void updateStatus(); @Override void handleStatusChanged(WorkflowStatusEvent event); @Override Object[] getJobIds(); @Override WorkflowItem[] getItems();  }