public void tokenReceived(WorkflowDataToken token, String portName) { if (rootOutputDirectory != null) { //only save individual results if a directory is specified if (portsAndDepth.containsKey(portName)) { int[] index = token.getIndex(); if (depthSeen.get(portName) == -1) depthSeen.put(portName, index.length); if (index.length >= depthSeen.get(portName)) { //storeToken(token, portName); } } else { logger .error("Result recieved for unexpected Port: " + portName); } } }
if (token.getIndex().length == 0){ receivedAllResultsForPort.put(portName, new Boolean(Boolean.TRUE));
public void resultTokenProduced(WorkflowDataToken token, String portName) { if (instanceOwningProcessId.equals(token.getOwningProcess())) { synchronized (this) { if (token.getIndex().length == 0) { portsToComplete--; } if (portsToComplete == 0) { // Received complete events on all ports, can // un-register this node from the monitor MonitorManager.getInstance().deregisterNode( instanceOwningProcessId.split(":")); } } for (ResultListener resultListener : resultListeners .toArray(new ResultListener[resultListeners.size()])) { resultListener.resultTokenProduced(token .popOwningProcess(), portName); } } }
if (token.getIndex().length == 0){ receivedAllResultsForPort.put(portName, new Boolean(Boolean.TRUE));
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--; } } }
/** * Forward the event through the output port Also informs any * ResultListeners on the output port to the new token. */ public void receiveEvent(WorkflowDataToken token) { // Pull the dataflow process identifier from the owning process // and push the modified token out // I'd rather avoid casting to the implementation but in this // case we're in the same package - the only reason to do this // is to allow dummy implementations of parts of this // infrastructure during testing, in 'real' use this should // always be a dataflowimpl if (token.getIndex().length == 0 && dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).sentFinalToken(portName, token .getOwningProcess()); } WorkflowDataToken newToken = token.popOwningProcess(); sendEvent(newToken); for (ResultListener listener : resultListeners .toArray(new ResultListener[] {})) { listener.resultTokenProduced(newToken, this.getName()); } }
/** * Forward the event through the output port Also informs any * ResultListeners on the output port to the new token. */ public void receiveEvent(WorkflowDataToken token) { // Pull the dataflow process identifier from the owning process // and push the modified token out // I'd rather avoid casting to the implementation but in this // case we're in the same package - the only reason to do this // is to allow dummy implementations of parts of this // infrastructure during testing, in 'real' use this should // always be a dataflowimpl if (token.getIndex().length == 0 && dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).sentFinalToken(portName, token .getOwningProcess()); } WorkflowDataToken newToken = token.popOwningProcess(); sendEvent(newToken); for (ResultListener listener : resultListeners .toArray(new ResultListener[] {})) { listener.resultTokenProduced(newToken, this.getName()); } }
/** * Forward the event through the output port Also informs any * ResultListeners on the output port to the new token. */ public void receiveEvent(WorkflowDataToken token) { // Pull the dataflow process identifier from the owning process // and push the modified token out // I'd rather avoid casting to the implementation but in this // case we're in the same package - the only reason to do this // is to allow dummy implementations of parts of this // infrastructure during testing, in 'real' use this should // always be a dataflowimpl if (token.getIndex().length == 0 && dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).sentFinalToken(portName, token .getOwningProcess()); } WorkflowDataToken newToken = token.popOwningProcess(); sendEvent(newToken); List<ResultListener> listeners; synchronized (resultListeners) { // thread safe copy before we push tokens (avoiding deadlock with WorkflowInstanceFacade) listeners = new ArrayList<ResultListener>(resultListeners); } for (ResultListener listener : listeners) { listener.resultTokenProduced(newToken, this.getName()); } }
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()); } }
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()); } }
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())); }
if (token.getIndex().length == 0) { if (pushedDataMap.containsKey(portName)) { throw new IllegalStateException("Already pushed for port " + portName); workflowDataProvenanceItem.setParentId(instanceOwningProcessId); workflowDataProvenanceItem.setProcessId(instanceOwningProcessId); workflowDataProvenanceItem.setIndex(token.getIndex()); workflowDataProvenanceItem.setFinal(token.isFinal()); context.getProvenanceReporter().addProvenanceItem(
if (token.getIndex().length == 0) { portsToComplete--;
workflowDataProvenanceItem.setParentId(instanceOwningProcessId); workflowDataProvenanceItem.setProcessId(instanceOwningProcessId); workflowDataProvenanceItem.setIndex(token.getIndex()); workflowDataProvenanceItem.setFinal(token.isFinal()); context.getProvenanceReporter().addProvenanceItem( if (token.getIndex().length == 0) { synchronized (WorkflowInstanceFacadeImpl.this) { portsToComplete--;
public void resultTokenProduced(WorkflowDataToken dataToken, String portName) { int[] index = dataToken.getIndex(); if (this.portName.equals(portName)) { if (depthSeen == -1) {
pushData(getName(), newOwner, token.getIndex(), token .getData(), token.getContext()); } else { pushCompletion(getName(), newOwner, token.getIndex(), token.getContext()); } else if (tokenDepth < filterDepth) { if (token.getIndex().length == 0) { DataManager dManager = token.getContext().getDataManager(); EntityIdentifier ref = token.getData();
public void resultTokenProducedGui(WorkflowDataToken dataToken, String portName) { int[] index = dataToken.getIndex(); if (this.portName.equals(portName)) { if (depthSeen == -1) {