public void receiveEvent(WorkflowDataToken token) { eventCount++; result = referenceService.renderIdentifier(token.getData(), Object.class, null); System.out.println(token); }
T2Reference resultsRef = token.getData();
T2Reference resultsRef = token.getData();
public void resultTokenProduced(WorkflowDataToken dataToken, String portname) { if (dataToken.getIndex().length == 0) { T2Reference reference = dataToken.getData(); System.out.println("Output reference made = " + reference); Object value = reference; if (reference.containsErrors()) { System.out.println("Contains errors!"); printAllErrors(context.getReferenceService().resolveIdentifier( reference, null, context)); } else { try { value = context.getReferenceService().renderIdentifier( reference, Object.class, context); } catch (ReferenceServiceException ex) { ex.printStackTrace(); } } resultMap.put(portname, value); synchronized (this) { outputCount--; } } }
public void pushToken(WorkflowDataToken dt, String owningProcess, int desiredDepth) { if (dt.getData().getDepth() == desiredDepth) { // System.out.println("** Job : "+dt.getData()); pushData(getName(), owningProcess, dt.getIndex(), dt.getData(), dt .getContext()); } else { ReferenceService rs = dt.getContext().getReferenceService(); Iterator<ContextualizedT2Reference> children = rs.traverseFrom(dt .getData(), dt.getData().getDepth() - 1); while (children.hasNext()) { ContextualizedT2Reference ci = children.next(); int[] newIndex = new int[dt.getIndex().length + ci.getIndex().length]; int i = 0; for (int indx : dt.getIndex()) { newIndex[i++] = indx; } for (int indx : ci.getIndex()) { newIndex[i++] = indx; } pushToken(new WorkflowDataToken(owningProcess, newIndex, ci .getReference(), dt.getContext()), owningProcess, desiredDepth); } // System.out.println("** Completion : "+dt.getData()); pushCompletion(getName(), owningProcess, dt.getIndex(), dt .getContext()); } }
public void pushToken(WorkflowDataToken dt, String owningProcess, int desiredDepth) { if (dt.getData().getDepth() == desiredDepth) { pushData(getName(), owningProcess, dt.getIndex(), dt.getData(), dt .getContext()); } else { ReferenceService rs = dt.getContext().getReferenceService(); Iterator<ContextualizedT2Reference> children = rs.traverseFrom(dt .getData(), dt.getData().getDepth() - 1); while (children.hasNext()) { ContextualizedT2Reference ci = children.next(); int[] newIndex = new int[dt.getIndex().length + ci.getIndex().length]; int i = 0; for (int indx : dt.getIndex()) { newIndex[i++] = indx; } for (int indx : ci.getIndex()) { newIndex[i++] = indx; } pushToken(new WorkflowDataToken(owningProcess, newIndex, ci .getReference(), dt.getContext()), owningProcess, desiredDepth); } pushCompletion(getName(), owningProcess, dt.getIndex(), dt .getContext()); } }
public void pushToken(WorkflowDataToken dt, String owningProcess, int desiredDepth) { if (dt.getData().getDepth() == desiredDepth) { // System.out.println("** Job : "+dt.getData()); pushData(getName(), owningProcess, dt.getIndex(), dt.getData(), dt.getContext()); } else { DataManager dManager = dt.getContext().getDataManager(); Iterator<ContextualizedIdentifier> children = dManager.traverse(dt .getData(), dt.getData().getDepth() - 1); while (children.hasNext()) { ContextualizedIdentifier ci = children.next(); int[] newIndex = new int[dt.getIndex().length + ci.getIndex().length]; int i = 0; for (int indx : dt.getIndex()) { newIndex[i++] = indx; } for (int indx : ci.getIndex()) { newIndex[i++] = indx; } pushToken(new WorkflowDataToken(owningProcess, newIndex, ci .getDataRef(), dt.getContext()), owningProcess, desiredDepth); } // System.out.println("** Completion : "+dt.getData()); pushCompletion(getName(), owningProcess, dt.getIndex(), dt.getContext()); } }
protected void receiveEvent(WorkflowDataToken token, String portName) { int portIndex = inputPortNameToIndex(portName); if (portIndex == -1) { throw new WorkflowStructureException( "Received event on a port that doesn't exist, huh?"); } int[] currentIndex = token.getIndex(); int[] newIndex = new int[currentIndex.length + 1]; newIndex[0] = portIndex; for (int i = 0; i < currentIndex.length; i++) { newIndex[i + 1] = currentIndex[i]; } output.sendEvent(new WorkflowDataToken(token.getOwningProcess(), newIndex, token.getData(), token.getContext())); }
throw new IllegalStateException("Already pushed for port " + portName); pushedDataMap.put(portName, token.getData()); workflowDataProvenanceItem.setPortName(portName); workflowDataProvenanceItem.setInputPort(true); workflowDataProvenanceItem.setData(token.getData()); workflowDataProvenanceItem.setReferenceService(context.getReferenceService()); workflowDataProvenanceItem.setParentId(workflowItem.getIdentifier());
portName, token.getData(), context.getReferenceService()); workflowDataProvenanceItem.setParentId(workflowItem.getIdentifier()); workflowDataProvenanceItem.setIdentifier(UUID.randomUUID().toString());
T2Reference reference = dataToken.getData();
"Input depth filter not configured on input port, failing"); } else { int tokenDepth = token.getData().getDepth(); if (tokenDepth == filterDepth) { if (filterDepth == getDepth()) { .getData(), token.getContext()); } else { pushToken(token, newOwner, getDepth()); T2Reference ref = token.getData(); ReferenceService rs = token.getContext() .getReferenceService();
"Input depth filter not configured on input port, failing"); } else { int tokenDepth = token.getData().getDepth(); if (tokenDepth == filterDepth) { if (filterDepth == getDepth()) { .getData(), token.getContext()); } else { pushToken(token, newOwner, getDepth()); T2Reference ref = token.getData(); ReferenceService rs = token.getContext() .getReferenceService();
"Input depth filter not configured on input port, failing"); } else { int tokenDepth = token.getData().getDepth(); if (tokenDepth == filterDepth) { if (filterDepth == getDepth()) { .getData(), token.getContext()); } else { pushToken(token, newOwner, getDepth()); EntityIdentifier ref = token.getData(); int currentDepth = tokenDepth; while (currentDepth < filterDepth) {
workflowDataProvenanceItem.setPortName(portName); workflowDataProvenanceItem.setInputPort(false); workflowDataProvenanceItem.setData(token.getData()); workflowDataProvenanceItem.setReferenceService(context.getReferenceService()); workflowDataProvenanceItem.setParentId(workflowItem.getIdentifier());
T2Reference reference = dataToken.getData();