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; }
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; }
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; }
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; }
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; }
private void createTree(T2Reference t2Ref, ProcessorResultTreeNode parentNode){ // If reference contains a list of data references if (t2Ref.getReferenceType() == T2ReferenceType.IdentifiedList) { IdentifiedList<T2Reference> list = referenceService .getListService().getList(t2Ref); if (list == null) { logger.error("Could not resolve list " + t2Ref + ", was run with in-memory storage?"); } ProcessorResultTreeNode listNode = new ProcessorResultTreeNode(list.size(), t2Ref, referenceService); // list node parentNode.add(listNode); for (T2Reference ref : list) { createTree(ref, listNode); } } else { // reference to single data or an error insertDataNode(t2Ref, parentNode); } }
.getReferenceService().getListService().getList(reference); List<Object> list = new ArrayList<Object>();
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); } }
T2ReferenceType.IdentifiedList)) { IdentifiedList<T2Reference> list = referenceService .getListService().getList(reference);
public void createTree(T2Reference t2Ref, InvocationContext context, WorkflowResultTreeNode parentNode){ // If reference contains a list of data references if (t2Ref.getReferenceType() == T2ReferenceType.IdentifiedList) { try { IdentifiedList<T2Reference> list = context.getReferenceService() .getListService().getList(t2Ref); if (list == null) { logger.warn("Could not resolve " + t2Ref); return; } WorkflowResultTreeNode listNode = new WorkflowResultTreeNode(t2Ref, context, ResultTreeNodeState.RESULT_LIST); // list node listNode.setContext(context); insertNodeInto(listNode, parentNode, parentNode.getChildCount()); for (T2Reference ref : list) { createTree(ref, context, listNode); } } catch (NullPointerException e) { logger .error("Error resolving data entity list " + t2Ref, e); } } else { // reference to single data or an error // insert data node WorkflowResultTreeNode dataNode = new WorkflowResultTreeNode(t2Ref, context, ResultTreeNodeState.RESULT_REFERENCE); // data node insertNodeInto(dataNode, parentNode, parentNode.getChildCount()); } }
case IdentifiedList: try { List<T2Reference> children = getListService().getList( ref); int position = 0;
case IdentifiedList: try { List<T2Reference> children = getListService().getList( ref); int position = 0;
IdentifiedList<T2Reference> list = dataToken .getContext().getReferenceService() .getListService().getList(reference); int[] elementIndex = new int[index.length + 1]; for (int indexElement = 0; indexElement < index.length; indexElement++) {
IdentifiedList<T2Reference> idList = listService.getList(id); List<Object> result = new ArrayList<Object>(); for (T2Reference child : idList) {
IdentifiedList<T2Reference> idList = listService.getList(id); List<Object> result = new ArrayList<Object>(); for (T2Reference child : idList) {
IdentifiedList<T2Reference> identifiedList = referenceService.getListService().getList(reference); List<Object> list = new ArrayList<Object>();
IdentifiedList<T2Reference> identifiedList = referenceService.getListService().getList(reference); List<Object> list = new ArrayList<Object>();
IdentifiedList<T2Reference> idList = listService.getList(id); if (idList == null) { throw new ReferenceServiceException("Could not find IdentifiedList " + id);
.getListService().getList(reference); int[] elementIndex = new int[index.length + 1]; for (int indexElement = 0; indexElement < index.length; indexElement++) {
IdentifiedList<T2Reference> idList = listService.getList(id);