@Override public RemoteSingleRun make(byte[] workflow, String creator, UsageRecordReceiver urReceiver, UUID id) throws RemoteException { if (creator == null) throw new RemoteException("no creator"); try { URI wfid = io.readBundle(new ByteArrayInputStream(workflow), null) .getMainWorkflow().getIdentifier(); out.println("Creating run from workflow <" + wfid + "> for <" + creator + ">"); return new LocalWorker(command, workflow, urReceiver, id, seedEnvironment, javaInitParams, this); } catch (RemoteException e) { throw e; } catch (Exception e) { throw new RemoteException("bad instance construction", e); } }
public WorkflowBean resolveUri(URI uri, WorkflowBundle wfBundle) { if (wf.getIdentifier().equals(uri)) return wf; String rel = Workflow.WORKFLOW_ROOT.relativize(uri).toASCIIString();
@Test public void workflowIdentifier() { Workflow wf = wfBundle.getMainWorkflow(); String uuidPath = uriTools.relativePath(Workflow.WORKFLOW_ROOT, wf.getIdentifier()).getPath(); assertTrue(uuidPath.endsWith("/")); // Should be a valid uuid UUID.fromString(uuidPath.substring(0, uuidPath.length() - 1)); }
@Test public void workflowIdentifier() throws Exception { assertEquals( "http://ns.taverna.org.uk/2010/workflow/00626652-55ae-4a9e-80d4-c8e9ac84e2ca/", workflowBundle.getMainWorkflow().getIdentifier() .toASCIIString()); }
@Override public void visitWorkflow(Workflow bean) { Set<DataLink> dataLinks = bean.getDataLinks(); Set<ControlLink> controlLinks = bean.getControlLinks(); // ports are done in Ported NamedSet<Processor> processors = bean.getProcessors(); URI workflowIdentifier = bean.getIdentifier(); if (workflowIdentifier != null) { if (!workflowIdentifier.isAbsolute()) listener.nonAbsoluteURI(bean, "workflowIdentifier", workflowIdentifier); else if (workflowIdentifier.getScheme().equals("file")) listener.nonAbsoluteURI(bean, "workflowIdentifier", workflowIdentifier); } if (checkComplete) { if (dataLinks == null) listener.nullField(bean, "dataLinks"); if (controlLinks == null) listener.nullField(bean, "controlLinks"); if (processors == null) listener.nullField(bean, "processors"); if (workflowIdentifier == null) listener.nullField(bean, "workflowIdentifier"); } }
workflow.setName(wf.getName()); if (wf.getIdentifier() != null) { Resource wfId = rdfObjectFactory.createResource(); wfId.setResource(wf.getIdentifier().toASCIIString()); workflow.setWorkflowIdentifier(wfId);