public WorkflowReport load(Bundle bundle) throws IOException, ReaderException, ParseException { Path path = getWorkflowRunReport(bundle); WorkflowBundle workflow = getWorkflowBundle(bundle); return load(path, workflow); }
public Run(String id, Bundle bundle) throws IOException, ReaderException, ParseException { this.ID = id; executionID = null; executionEnvironment = null; workflowReport = workflowReportJson.load(bundle); workflowBundle = DataBundles.getWorkflowBundle(bundle); dataBundle = bundle; workflow = workflowBundle.getMainWorkflow(); profile = workflowBundle.getMainProfile(); }
@Test public void getBundle() throws Exception { Bundle bundle = run.getDataBundle(); // Contains a copy of workflow assertEquals(wfBundle.getGlobalBaseURI(), DataBundles.getWorkflowBundle(bundle).getGlobalBaseURI()); // Contains a run report Path runReport = DataBundles.getWorkflowRunReport(bundle); assertTrue(Files.exists(runReport)); JsonNode runReportJson = DataBundles.getWorkflowRunReportAsJson(bundle); assertEquals("COMPLETED", runReportJson.get("state").asText()); }
@Ignore @Test public void getWorkflowBundle() throws Exception { WorkflowBundleIO wfBundleIO = new WorkflowBundleIO(); WorkflowBundle wfBundle = wfBundleIO.createBundle(); String name = wfBundle.getName(); String wfName = wfBundle.getMainWorkflow().getName(); URI id = wfBundle.getIdentifier(); DataBundles.setWorkflowBundle(dataBundle, wfBundle); // Reload the bundle wfBundle = DataBundles.getWorkflowBundle(dataBundle); assertEquals(name, wfBundle.getName()); assertEquals(wfName, wfBundle.getMainWorkflow().getName()); assertEquals(id, wfBundle.getIdentifier()); }