public UpdateDataflowInternalIdentifierEdit(Dataflow dataflow,String newId) { super(dataflow); this.newId=newId; this.oldId=dataflow.getIdentifier(); }
private void populateBeanElementForDataflow(Dataflow dataflow, Element bean) { bean.setAttribute(BEAN_ENCODING,DATAFLOW_ENCODING); Element dataflowElement = new Element(DATAFLOW,T2_WORKFLOW_NAMESPACE); dataflowElement.setAttribute(DATAFLOW_REFERENCE,dataflow.getIdentifier()); bean.addContent(dataflowElement); }
private static void rememberSubworkflows(final Processor p) throws SerializationException { for (final Activity<?> a : p.getActivityList()) if (a instanceof NestedDataflow) { NestedDataflow da = (NestedDataflow) a; Dataflow df = da.getNestedDataflow(); if (!requiredSubworkflows.containsKey(df.getIdentifier())) { requiredSubworkflows.put(df.getIdentifier(), DataflowXMLSerializer.getInstance() .serializeDataflow(df)); for (Processor sp : df.getProcessors()) rememberSubworkflows(sp); } } }
private static void rememberSubworkflows(Processor p) throws SerializationException { for (Activity a : p.getActivityList()) { if (a instanceof NestedDataflow) { NestedDataflow da = (NestedDataflow) a; Dataflow df = da.getNestedDataflow(); if (!requiredSubworkflows.containsKey(df.getIdentifier())) { requiredSubworkflows.put(df.getIdentifier(), DataflowXMLSerializer.getInstance().serializeDataflow(df)); for (Processor sp : df.getProcessors()) { rememberSubworkflows(sp); } } } } }
public Element serializeDataflow(Dataflow dataflow) throws SerializationException { Set<Dataflow> innerDataflows = new HashSet<Dataflow>(); gatherDataflows(dataflow,innerDataflows); Element result = new Element(WORKFLOW, T2_WORKFLOW_NAMESPACE); // For future use result.setAttribute(WORKFLOW_VERSION, "1"); result.setAttribute(PRODUCED_BY, this.getProducedBy()); Element dataflowElement = DataflowXMLSerializer.getInstance().serializeDataflow(dataflow); dataflowElement.setAttribute(DATAFLOW_ROLE, DATAFLOW_ROLE_TOP); result.addContent(dataflowElement); Set<String> outputIds = new HashSet<String>(); for (Dataflow innerDataflow : innerDataflows) { String currentId = innerDataflow.getIdentifier(); if (outputIds.add(currentId)) { Element innerDataflowElement = DataflowXMLSerializer.getInstance().serializeDataflow(innerDataflow); innerDataflowElement.setAttribute(DATAFLOW_ROLE,DATAFLOW_ROLE_NESTED); result.addContent(innerDataflowElement); } } return result; }
String internalIdentifier = dataFlow.getIdentifier(); Edit<?> edit = event.getEdit(); dataflowEditMap.put(edit, internalIdentifier); String newId = dataFlow.getIdentifier(); String newId = dataFlow.getIdentifier();
public String processWorkflowStructure(Dataflow df) { topLevelDataflowName = df.getLocalName(); topLevelDataflowID = df.getIdentifier(); // check whether we already have this WF in the DB List<String> workflowIds = null; try { workflowIds = pq.getAllworkflowIds(); } catch (SQLException e) { logger.warn("Problem processing workflow structure", e); } if (workflowIds != null && workflowIds.contains(topLevelDataflowID)) { // already in the DB } else { logger.info("new workflow structure with ID "+topLevelDataflowID); ProvenanceProcessor provProc = new ProvenanceProcessor(); provProc.setIdentifier(UUID.randomUUID().toString()); provProc.setProcessorName(topLevelDataflowName); provProc.setFirstActivityClassName(ProvenanceProcessor.DATAFLOW_ACTIVITY); provProc.setWorkflowId(topLevelDataflowID); provProc.setTopLevelProcessor(true); // record the top level dataflow as a processor in the DB try { pw.addProcessor(provProc); // pw.addProcessor(topLevelDataflowName, DATAFLOW_PROCESSOR_TYPE, topLevelDataflowID, true); // true -> is top level } catch (SQLException e) { logger.warn("Can't add processor " + topLevelDataflowID, e); } } // logger.info("top level wf name: "+topLevelDataflowName); return processDataflowStructure(df, topLevelDataflowID, df.getLocalName()); // null: no external name given to top level dataflow }
@Test public void testGetDataflow() throws Exception { assertNotNull(componentVersion.getDataflow()); assertEquals(dataflow.getIdentifier(), componentVersion.getDataflow() .getIdentifier()); }
@Test public void testGetDataflow() throws Exception { assertNotNull(componentVersion.getDataflow()); assertEquals(dataflow.getIdentifier(), componentVersion.getDataflow() .getIdentifier()); }
Dataflow dataflow = openDataflow.getDataflow(); logger.info("Loaded workflow: " + dataflow.getLocalName() + " " + dataflow.getIdentifier() + " from " + source + " using " + handler); return openDataflow;
DataflowCollation.NESTED_ISSUES, worstStatus, subReports); report.setProperty("dataflowIdentifier", subFlow.getIdentifier()); report.setWasTimeConsuming(includeTimeConsuming); reports.add(report);
workflowItem.setProcessId(instanceOwningProcessId); workflowItem.setIdentifier(workflowRunId); workflowItem.setParentId(dataflow.getIdentifier()); workflowItem.setWorkflowId(dataflow.getIdentifier());
savedDataflow.getDataflow(); logger.info("Saved workflow: " + dataflow.getLocalName() + " " + dataflow.getIdentifier() + " to " + savedDataflow.getCanonicalSource() + " using " + handler);
if (isFirstWorkflowStructure()) { String dataflowId = workflowProvenanceItem.getDataflow().getIdentifier(); String instanceId = provenanceItem.getIdentifier(); } else { String dataflowId = workflowProvenanceItem.getDataflow().getIdentifier(); String instanceId = provenanceItem.getIdentifier(); workflowIDStack.add(0,df.getIdentifier());
@Test public void testAddVersionBasedOn() throws Exception { assertNotNull(component.getComponentVersion(1)); assertNull(component.getComponentVersion(2)); Version componentVersion = component.addVersionBasedOn(dataflow, "Some description"); assertNotNull(componentVersion); assertEquals(component, componentVersion.getComponent()); assertEquals(2, componentVersion.getVersionNumber().intValue()); assertEquals(dataflow.getIdentifier(), componentVersion.getDataflow() .getIdentifier()); }
@Test public void testAddVersionBasedOn() throws Exception { assertNotNull(component.getComponentVersion(1)); assertNull(component.getComponentVersion(2)); Version componentVersion = component.addVersionBasedOn(dataflow, "Some description"); assertNotNull(componentVersion); assertEquals(component, componentVersion.getComponent()); assertEquals(2, componentVersion.getVersionNumber().intValue()); assertEquals(dataflow.getIdentifier(), componentVersion.getDataflow() .getIdentifier()); }
wfNestingMap.put(nested.getIdentifier(), dataflowID); // child -> parent processDataflowStructure(nested, nested.getIdentifier(), p.getLocalName());