private T2Reference replaceErrors(T2Reference value, List<T2Reference> exceptions) { return replaceErrors(value, value.getDepth(), exceptions); }
private T2Reference considerReference(T2Reference value, List<T2Reference> exceptions) { if (!value.containsErrors()) { return value; } else if (!value.getReferenceType().equals(IdentifiedList)) { return replaceErrors(value, exceptions); } else if (exceptionHandling.failLists()) { T2Reference failure = findFirstFailure(value); T2Reference replacement = replaceErrors(failure, value.getDepth(), exceptions); return replacement; } else { IdentifiedList<T2Reference> originalList = listService .getList(value); List<T2Reference> replacementList = new ArrayList<T2Reference>(); for (T2Reference subValue : originalList) replacementList.add(considerReference(subValue, exceptions)); return referenceService.register(replacementList, value.getDepth(), true, context); } }
/** * Returns an Element representing the data item, identfied as either input * or output. References to data are currently resolved to their actual * values */ public static Element getDataItemAsXML(DataProvenanceItem provenanceItem) { String name; if (provenanceItem.getEventType().equals(SharedVocabulary.INPUTDATA_EVENT_TYPE)) { name = "inputdata"; } else { name = "outputdata"; } Element result = new Element(name); result.setAttribute("identifier", provenanceItem.getIdentifier()); result.setAttribute("processID", provenanceItem.getProcessId()); result.setAttribute("parent", provenanceItem.getParentId()); for (String port : provenanceItem.getDataMap().keySet()) { Element portElement = new Element("port"); portElement.setAttribute("name", port); portElement.setAttribute("depth", Integer.toString(provenanceItem.getDataMap() .get(port).getDepth())); result.addContent(portElement); portElement.addContent(resolveToElement(provenanceItem.getDataMap().get(port), provenanceItem.getReferenceService())); Element element = new Element("some_stuff"); portElement.addContent(element); } return result; }
int depth = items.get(0).getDepth(); T2ReferenceListImpl newList = new T2ReferenceListImpl(); int counter = 0; for (T2Reference ref : items) { if (ref.getDepth() != depth) { throw new ListServiceException( "Mismatched depths in list registration; reference at index '" + counter + "' has depth " + ref.getDepth() + " but all preceeding items have depth " + depth);
int depth = items.get(0).getDepth(); if (depth < 0) { throw new ListServiceException("Can't register list of depth less than 1, but first item " + items.get(0) + " has depth " + depth); int counter = 0; for (T2Reference ref : items) { if (ref.getDepth() != depth) { throw new ListServiceException( "Mismatched depths in list registration; reference at index '" + counter + "' has depth " + ref.getDepth() + " but all preceeding items have depth " + depth);
int depth = items.get(0).getDepth(); T2ReferenceListImpl newList = new T2ReferenceListImpl(); int counter = 0; for (T2Reference ref : items) { if (ref.getDepth() != depth) { throw new ListServiceException( "Mismatched depths in list registration; reference at index '" + counter + "' has depth " + ref.getDepth() + " but all preceeding items have depth " + depth);
int currentDepth = source.getDepth(); while (currentDepth > desiredDepth) { List<ContextualizedT2Reference> newSet = new ArrayList<ContextualizedT2Reference>();
/** * Construct a deep copy of the given T2Reference * * @param source * T2Reference to copy */ private T2ReferenceImpl(T2Reference source) { super(); setNamespacePart(source.getNamespacePart()); setLocalPart(source.getLocalPart()); setContainsErrors(source.containsErrors()); setReferenceType(source.getReferenceType()); setDepth(source.getDepth()); }
/** * Construct a deep copy of the given T2Reference * * @param source * T2Reference to copy */ private T2ReferenceImpl(T2Reference source) { super(); setNamespacePart(source.getNamespacePart()); setLocalPart(source.getLocalPart()); setContainsErrors(source.containsErrors()); setReferenceType(source.getReferenceType()); setDepth(source.getDepth()); }
int currentDepth = source.getDepth(); while (currentDepth > desiredDepth) { List<ContextualizedT2Reference> newSet = new ArrayList<ContextualizedT2Reference>();
/** * Construct a deep copy of the given T2Reference * * @param source * T2Reference to copy */ private T2ReferenceImpl(T2Reference source) { super(); setNamespacePart(source.getNamespacePart()); setLocalPart(source.getLocalPart()); setContainsErrors(source.containsErrors()); setReferenceType(source.getReferenceType()); setDepth(source.getDepth()); }
int currentDepth = source.getDepth(); while (currentDepth > desiredDepth) { List<ContextualizedT2Reference> newSet = new ArrayList<ContextualizedT2Reference>();
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 { 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()); } }
"Input depth filter not configured on input port, failing"); } else { int tokenDepth = token.getData().getDepth(); if (tokenDepth == filterDepth) { if (filterDepth == getDepth()) {
"Input depth filter not configured on input port, failing"); } else { int tokenDepth = token.getData().getDepth(); if (tokenDepth == filterDepth) { if (filterDepth == getDepth()) {