private Set<T2Reference> getErrors(T2Reference ref) { Set<T2Reference> result = new HashSet<T2Reference>(); if (ref.getReferenceType().equals(ReferenceSet)) { // nothing } else if (ref.getReferenceType().equals(IdentifiedList)) { IdentifiedList<T2Reference> originalList = listService.getList(ref); for (T2Reference subValue : originalList) if (subValue.containsErrors()) result.addAll(getErrors(subValue)); } else { result.add(ref); } return result; }
try { IdentifiedList<T2Reference> newList = listService .registerEmptyList(currentDepth, context); return newList.getId(); } catch (ListServiceException lse) { .registerList(references, context); return newList.getId(); } catch (ListServiceException lse) {
public boolean delete(T2Reference reference) throws ReferenceServiceException { boolean result=false; switch (reference.getReferenceType()) { case IdentifiedList: result=listService.delete(reference); break; case ReferenceSet: result=referenceSetService.delete(reference); break; case ErrorDocument: result=errorDocumentService.delete(reference); break; default: throw new ReferenceServiceException( "Unknown reference type!"); } return result; }
List<T2Reference> idlist = listItems.get(outputName); newDataMap.put(outputName, context.getReferenceService() .getListService().registerList(idlist, context).getId());
@Override /** * Used to construct a Job of empty lists at the appropriate depth in the * event of a completion hitting the crystalizer before it sees a child * node, i.e. the result of iterating over an empty collection structure of * some kind. */ public Job getEmptyJob(String owningProcess, int[] index, InvocationContext context) { int wrappingDepth = parent.resultWrappingDepth; if (wrappingDepth < 0) throw new RuntimeException( "Processor ["+owningProcess+"] hasn't been configured, cannot emit empty job"); // The wrapping depth is the length of index array that would be used if // a single item of the output port type were returned. We can examine // the index array for the node we're trying to create and use this to // work out how much we need to add to the output port depth to create // empty lists of the right type given the index array. int depth = wrappingDepth - index.length; // TODO - why was this incrementing? // depth++; ReferenceService rs = context.getReferenceService(); Map<String, T2Reference> emptyJobMap = new HashMap<String, T2Reference>(); for (OutputPort op : parent.getOutputPorts()) { emptyJobMap.put(op.getName(), rs.getListService() .registerEmptyList(depth + op.getDepth()).getId()); } return new Job(owningProcess, index, emptyJobMap, context); }
List<T2Reference> idlist = listItems.get(outputName); newDataMap.put(outputName, context.getReferenceService() .getListService().registerList(idlist).getId());
@Override /** * Used to construct a Job of empty lists at the appropriate depth in the * event of a completion hitting the crystalizer before it sees a child * node, i.e. the result of iterating over an empty collection structure of * some kind. */ public Job getEmptyJob(String owningProcess, int[] index, InvocationContext context) { int wrappingDepth = parent.resultWrappingDepth; if (wrappingDepth < 0) throw new RuntimeException( "Processor ["+owningProcess+"] hasn't been configured, cannot emit empty job"); // The wrapping depth is the length of index array that would be used if // a single item of the output port type were returned. We can examine // the index array for the node we're trying to create and use this to // work out how much we need to add to the output port depth to create // empty lists of the right type given the index array. int depth = wrappingDepth - index.length; // TODO - why was this incrementing? // depth++; ReferenceService rs = context.getReferenceService(); Map<String, T2Reference> emptyJobMap = new HashMap<String, T2Reference>(); for (OutputPort op : parent.getOutputPorts()) { emptyJobMap.put(op.getName(), rs.getListService() .registerEmptyList(depth + op.getDepth(), context).getId()); } return new Job(owningProcess, index, emptyJobMap, context); }
targetDir.mkdir(); int count = 0; List<T2Reference> elements = referenceService.getListService().getList(ref); for (T2Reference subRef : elements) { writeDataObject(targetDir, "" + count++, subRef,
try { IdentifiedList<T2Reference> newList = listService .registerEmptyList(currentDepth); return newList.getId(); } catch (ListServiceException lse) { .registerList(references); return newList.getId(); } catch (ListServiceException lse) {
.getListService(); IdentifiedList<T2Reference> registeredList = listService .registerList(outputList, context); WorkflowDataToken workflowDataToken = new WorkflowDataToken( owningProcess, new int[0], registeredList.getId(),
int portDepth = op.getDepth(); emptyListMap.put(portName, refService.getListService() .registerEmptyList(portDepth).getId());
public static List<ErrorDocument> getErrorDocuments(T2Reference reference, ReferenceService referenceService) { List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>(); if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = referenceService .getErrorDocumentService(); errorDocuments.add(errorDocumentService.getError(reference)); } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { ListService listService = referenceService.getListService(); IdentifiedList<T2Reference> list = listService.getList(reference); for (T2Reference listReference : list) { errorDocuments .addAll(getErrorDocuments(listReference, referenceService)); } } return errorDocuments; }
try { IdentifiedList<T2Reference> newList = listService .registerEmptyList(currentDepth, context); return newList.getId(); } catch (ListServiceException lse) { .registerList(references, context); return newList.getId(); } catch (ListServiceException lse) {
.getListService(); IdentifiedList<T2Reference> registeredList = listService .registerList(outputList); WorkflowDataToken workflowDataToken = new WorkflowDataToken( owningProcess, new int[0], registeredList.getId(),
int portDepth = op.getDepth(); emptyListMap.put(portName, refService.getListService() .registerEmptyList(portDepth, jobEvent.getContext()).getId());
public static List<ErrorDocument> getErrorDocuments(T2Reference reference, ReferenceService referenceService) { List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>(); if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = referenceService .getErrorDocumentService(); errorDocuments.add(errorDocumentService.getError(reference)); } else if (reference.getReferenceType().equals( T2ReferenceType.IdentifiedList)) { ListService listService = referenceService.getListService(); IdentifiedList<T2Reference> list = listService.getList(reference); for (T2Reference listReference : list) { errorDocuments .addAll(getErrorDocuments(listReference, referenceService)); } } return errorDocuments; }
ref = rs.getListService().registerList(newList).getId(); currentDepth++;
public static List<ErrorDocument> getErrorDocuments(T2Reference reference, InvocationContext context) { List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>(); if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) { ErrorDocumentService errorDocumentService = context.getReferenceService().getErrorDocumentService(); errorDocuments.add(errorDocumentService.getError(reference)); } else if (reference.getReferenceType().equals(T2ReferenceType.IdentifiedList)) { ListService listService = context.getReferenceService().getListService(); IdentifiedList<T2Reference> list = listService.getList(reference); for (T2Reference listReference : list) { errorDocuments.addAll(getErrorDocuments(listReference, context)); } } return errorDocuments; }
ref = rs.getListService().registerList(newList, token.getContext()).getId(); currentDepth++;
private T2Reference findFirstFailure(T2Reference value) { IdentifiedList<T2Reference> originalList = listService.getList(value); for (T2Reference subValue : originalList) { if (subValue.getReferenceType().equals(ErrorDocument)) return subValue; if (subValue.getReferenceType().equals(IdentifiedList)) if (subValue.containsErrors()) return findFirstFailure(subValue); // No need to consider value } return null; }