@Test public void testParallelStatusChangeAggregation() { LifeStepWorkflowItem job1 = new LifeStepWorkflowItem(); LifeStepWorkflowItem job2 = new LifeStepWorkflowItem(); Workflow wf = new Workflow.Parallel(); wf.add(job1, job2); job1.setStatus(new ProcessStatus(ProcessState.RUNNING, 0.4F)); job2.setStatus(new ProcessStatus(ProcessState.RUNNING, 0.2F)); assertEquals(new ProcessStatus(ProcessState.RUNNING, 0.3F), wf.getStatus()); job2.setStatus(new ProcessStatus(ProcessState.RUNNING, 0.8F)); assertEquals(new ProcessStatus(ProcessState.RUNNING, 0.6F), wf.getStatus()); job1.setStatus(new ProcessStatus(ProcessState.RUNNING, 0.8F)); assertEquals(new ProcessStatus(ProcessState.RUNNING, 0.8F), wf.getStatus()); }
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();  }