setContext(token.getContext());
context = token.getContext();
.getContext().getReferenceService() .getListService().getList(reference); int[] elementIndex = new int[index.length + 1]; resultTokenProduced(new WorkflowDataToken(dataToken .getOwningProcess(), elementIndex, id, dataToken.getContext()), portName); c++; .getOwningProcess(), dataToken.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()); } }
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()); } }
newIndex[i + 1] = currentIndex[i]; InvocationContext context = token.getContext(); output.sendEvent(new WorkflowDataToken(owningProcess, newIndex, token.getData(), context));
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()); } }
newIndex[i + 1] = currentIndex[i]; InvocationContext context = token.getContext(); output.sendEvent(new WorkflowDataToken(owningProcess, newIndex, token.getData(), context));
.getContext().getReferenceService() .getListService().getList(reference); int[] elementIndex = new int[index.length + 1]; resultTokenProducedGui(new WorkflowDataToken(dataToken .getOwningProcess(), elementIndex, id, dataToken.getContext()), portName); c++; .getOwningProcess(), dataToken.getContext());
.getData(), token.getContext()); } else { pushToken(token, newOwner, getDepth()); .getContext()); } else if (tokenDepth < filterDepth) { ReferenceService rs = token.getContext() .getReferenceService(); int currentDepth = tokenDepth; ref = rs.getListService().registerList(newList, token.getContext()).getId(); currentDepth++; .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())); }
/** * Receive an input event, relay it through the internal output port to all * connected entities */ public void receiveEvent(WorkflowDataToken t) { WorkflowDataToken transformedToken = t.pushOwningProcess(dataflow.getLocalName()); // 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 (dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).tokenReceived(transformedToken .getOwningProcess(), t.getContext()); } for (Datalink dl : internalOutput.getOutgoingLinks()) { dl.getSink().receiveEvent(transformedToken); } }
/** * Receive an input event, relay it through the internal output port to all * connected entities */ public void receiveEvent(WorkflowDataToken t) { WorkflowDataToken transformedToken = t.pushOwningProcess(dataflow.getLocalName()); // 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 (dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).tokenReceived(transformedToken .getOwningProcess(), t.getContext()); } for (Datalink dl : internalOutput.getOutgoingLinks()) { dl.getSink().receiveEvent(transformedToken); } }
/** * Receive an input event, relay it through the internal output port to all * connected entities */ public void receiveEvent(WorkflowDataToken t) { WorkflowDataToken transformedToken = t.pushOwningProcess(dataflow.getLocalName()); // 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 (dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).tokenReceived(transformedToken .getOwningProcess(), t.getContext()); } for (Datalink dl : internalOutput.getOutgoingLinks()) { dl.getSink().receiveEvent(transformedToken); } }
.getData(), token.getContext()); } else { pushToken(token, newOwner, getDepth()); .getContext()); } else if (tokenDepth < filterDepth) { ReferenceService rs = token.getContext() .getReferenceService(); int currentDepth = tokenDepth; .getContext());
.getData(), token.getContext()); } else { pushToken(token, newOwner, getDepth()); pushCompletion(getName(), newOwner, token.getIndex(), token.getContext()); } else if (tokenDepth < filterDepth) { DataManager dManager = token.getContext().getDataManager(); EntityIdentifier ref = token.getData(); int currentDepth = tokenDepth; currentDepth++; pushData(getName(), newOwner, new int[0], ref, token.getContext());