/** * @param originalCallback * @param invocationContext * @param exceptionHandling2 */ public ProxyCallback(AsynchronousActivityCallback originalCallback, InvocationContext invocationContext, ExceptionHandling exceptionHandling2) { super(); this.originalCallback = originalCallback; this.exceptionHandling = exceptionHandling2; context = invocationContext; referenceService = context.getReferenceService(); listService = referenceService.getListService(); errorService = referenceService.getErrorDocumentService(); }
List<T2Reference> idlist = listItems.get(outputName); newDataMap.put(outputName, context.getReferenceService() .getListService().registerList(idlist, context).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; }
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; }
@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); }
@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); }
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); } }
.getListService(); IdentifiedList<T2Reference> registeredList = listService .registerList(outputList);
.getListService(); IdentifiedList<T2Reference> registeredList = listService .registerList(outputList, context);
.getReferenceService().getListService().getList(reference); List<Object> list = new ArrayList<Object>();
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()); } }
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> identifiedList = referenceService.getListService().getList(reference); List<Object> list = new ArrayList<Object>();
String portName = op.getName(); int portDepth = op.getDepth(); emptyListMap.put(portName, refService.getListService() .registerEmptyList(portDepth).getId());
String portName = op.getName(); int portDepth = op.getDepth(); emptyListMap.put(portName, refService.getListService() .registerEmptyList(portDepth, jobEvent.getContext()).getId());
.getListService().getList(reference); int[] elementIndex = new int[index.length + 1]; for (int indexElement = 0; indexElement < index.length; indexElement++) {
ref = rs.getListService().registerList(newList).getId(); currentDepth++;
ref = rs.getListService().registerList(newList, token.getContext()).getId(); currentDepth++;