/** * Returns true if processor contains a nested workflow in any of its * activities in any of its profiles. */ public boolean containsNestedWorkflow(Processor processor) { for (Profile profile : processor.getParent().getParent().getProfiles()) if (containsNestedWorkflow(processor, profile)) return true; return false; }
public void save(WorkflowReport wfReport, Bundle dataBundle) throws IOException { Path path = getWorkflowRunReport(dataBundle); save(wfReport, path); if (!Files.exists(getWorkflow(dataBundle))) // Usually already done by Run constructor setWorkflowBundle(wfReport.getDataBundle(), wfReport.getSubject() .getParent()); }
@Test public void cloneWorkflow() throws Exception { Workflow original = originalWfBundle.getMainWorkflow(); assertEquals(originalWfBundle, original.getParent()); Workflow clone = (Workflow) original.clone(); assertNull(clone.getParent()); assertEquals(original.getName(), clone.getName()); assertNotSame(original.getProcessors().getByName("Hello"), clone .getProcessors().getByName("Hello")); assertNotSame(original.getCurrentRevision(), clone.getCurrentRevision()); assertEquals(original.getCurrentRevision(), clone.getCurrentRevision()); }
@Test public void createBundle() throws Exception { WorkflowBundle wb = bundleIO.createBundle(); assertEquals(wb, wb.getMainWorkflow().getParent()); assertEquals(wb, wb.getMainProfile().getParent()); assertEquals("bundle1", wb.getName()); assertEquals("workflow1", wb.getMainWorkflow().getName()); assertEquals("profile1", wb.getMainProfile().getName()); assertNotNull(wb.getCurrentRevision()); assertNotNull(wb.getMainWorkflow().getCurrentRevision()); assertNotNull(wb.getMainProfile().getCurrentRevision()); }