private EventForwardingOutputPort getSourcePort(Processor processor, Activity<?> activity, String portName, List<Edit<?>> editList) { OutputPort activityPort = net.sf.taverna.t2.workflowmodel.utils.Tools.getActivityOutputPort(activity, portName); //check if processor port exists EventForwardingOutputPort output = net.sf.taverna.t2.workflowmodel.utils.Tools.getProcessorOutputPort(processor, activity, activityPort); if (output == null) { //port doesn't exist so create a processor port and map it ProcessorOutputPort processorOutputPort = edits.createProcessorOutputPort(processor, activityPort.getName(), activityPort.getDepth(), activityPort.getGranularDepth()); editList.add(edits.getAddProcessorOutputPortEdit(processor, processorOutputPort)); editList.add(edits.getAddActivityOutputPortMappingEdit(activity, activityPort.getName(), activityPort.getName())); output = processorOutputPort; } return output; }
private void buildOutputPortMap() { outputMap = new HashMap<String, OutputPort>(); for (OutputPort outputPort : getOutputPorts()) { outputMap.put(outputPort.getName(), outputPort); } }
.getQualifiedName(); int outputDepth = outputMap.get(outputName) .getDepth(); outputData.put(outputName, dataFacade.register( outputLists.get(outputName), .getQualifiedName(); int outputDepth = outputMap.get(outputName) .getDepth(); outputData.put(outputName, dataFacade.register( resultList[i], outputDepth)); .get(0); String outputName = dataset.getName(); int outputDepth = outputMap.get(outputName).getDepth(); outputData.put(outputName, dataFacade.register( resultList[0], outputDepth));
private List<String> getActivityOutputPorts() { // TODO: Support multiple activities Activity<?> activity = getFirstProcessorActivity(); if (activity == null) { return new ArrayList<String>(); } List<String> ports = new ArrayList<String>(); for (OutputPort outPort : activity.getOutputPorts()) { if (outPort.getDepth() == 0) { ports.add(outPort.getName()); } } Collections.sort(ports); return ports; }
public static OutputPort getActivityOutputPort(Activity<?> activity, String portName) { OutputPort activityOutputPort = null; for (OutputPort outputPort : activity.getOutputPorts()) { if (outputPort.getName().equals(portName)) { activityOutputPort = outputPort; break; } } return activityOutputPort; }
.getQualifiedName(); int outputDepth = outputMap.get(outputName) .getDepth(); outputData.put(outputName, referenceService.register( outputLists.get(outputName), .getQualifiedName(); int outputDepth = outputMap.get(outputName) .getDepth(); outputData.put(outputName, referenceService.register( resultList[i], outputDepth, true, callback.getContext())); .get(0); String outputName = dataset.getName(); int outputDepth = outputMap.get(outputName).getDepth(); outputData.put(outputName, referenceService.register( resultList[0], outputDepth, true, callback.getContext()));
private EventForwardingOutputPort getSourcePort(Processor processor, Activity<?> activity, String portName, List<Edit<?>> editList) { OutputPort activityPort = net.sf.taverna.t2.workflowmodel.utils.Tools.getActivityOutputPort(activity, portName); //check if processor port exists EventForwardingOutputPort output = net.sf.taverna.t2.workflowmodel.utils.Tools.getProcessorOutputPort(processor, activity, activityPort); if (output == null) { //port doesn't exist so create a processor port and map it ProcessorOutputPort processorOutputPort = edits.createProcessorOutputPort(processor, activityPort.getName(), activityPort.getDepth(), activityPort.getGranularDepth()); editList.add(edits.getAddProcessorOutputPortEdit(processor, processorOutputPort)); editList.add(edits.getAddActivityOutputPortMappingEdit(activity, activityPort.getName(), activityPort.getName())); output = processorOutputPort; } return output; }
@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 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++; DataManager dManager = context.getDataManager(); Map<String, EntityIdentifier> emptyJobMap = new HashMap<String, EntityIdentifier>(); for (OutputPort op : parent.getOutputPorts()) { emptyJobMap.put(op.getName(), dManager.registerEmptyList(depth + op.getDepth())); } return new Job(owningProcess, index, emptyJobMap, context); }
public static OutputPort getActivityOutputPort(Activity<?> activity, String portName) { OutputPort activityOutputPort = null; for (OutputPort outputPort : activity.getOutputPorts()) { if (outputPort.getName().equals(portName)) { activityOutputPort = outputPort; break; } } return activityOutputPort; }
/** * @param activity * @param t2Processor * @throws EditException */ private void addOutputPorts(Activity<?> activity, Processor t2Processor) throws EditException { Set<OutputPort> outputPorts = activity.getOutputPorts(); for (OutputPort outputPort : outputPorts) { Edit<Processor> addOutputPortEdit = edits .getCreateProcessorOutputPortEdit(t2Processor, outputPort .getName(), outputPort.getDepth(), outputPort .getGranularDepth()); addOutputPortEdit.doEdit(); activity.getOutputPortMapping().put(outputPort.getName(), outputPort.getName()); } }
@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 XMLInputSplitter createSplitter() { List<String> inputNames = new ArrayList<String>(); List<String> inputTypes = new ArrayList<String>(); List<String> outputNames = new ArrayList<String>(); //FIXME: need to use the definition beans for now to get the mimetype. Need to use the actual InputPort once the mimetype becomes available again. for (ActivityInputPortDefinitionBean defBean : getConfiguration().getInputPortDefinitions()) { inputNames.add(defBean.getName()); inputTypes.add(defBean.getMimeTypes().get(0)); } for (OutputPort outputPorts : getOutputPorts()) { outputNames.add(outputPorts.getName()); } return new XMLInputSplitter(typeDescriptor,inputNames.toArray(new String[]{}),inputTypes.toArray(new String[]{}),outputNames.toArray(new String[]{})); }
/** * @param activity * @param t2Processor * @throws EditException */ private void addOutputPorts(Activity<?> activity, Processor t2Processor) throws EditException { Set<OutputPort> outputPorts = activity.getOutputPorts(); for (OutputPort outputPort : outputPorts) { ProcessorOutputPort port = edits.createProcessorOutputPort( t2Processor, outputPort.getName(), outputPort.getDepth(), outputPort.getGranularDepth()); Edit<Processor> addOutputPortEdit = edits .getAddProcessorOutputPortEdit(t2Processor, port); addOutputPortEdit.doEdit(); activity.getOutputPortMapping().put(outputPort.getName(), outputPort.getName()); } }
@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); }
private static ActivityOutputPort getActivityOutputPort( Activity<?> activity, ProcessorPort processorOutputPort) { ProcessorInputPort result = null; for (Entry<String, String> mapEntry : activity.getOutputPortMapping() .entrySet()) { if (mapEntry.getKey().equals(processorOutputPort.getName())) { for (OutputPort activityOutputPort : activity .getOutputPorts()) { if (activityOutputPort.getName().equals(mapEntry.getValue())) { return (ActivityOutputPort) activityOutputPort; } } break; } } return null; }
private EventForwardingOutputPort getSourcePort( net.sf.taverna.t2.workflowmodel.Processor processor, Activity<?> activity, String portName, List<Edit<?>> editList) { OutputPort activityPort = net.sf.taverna.t2.workflowmodel.utils.Tools .getActivityOutputPort(activity, portName); // check if processor port exists EventForwardingOutputPort output = net.sf.taverna.t2.workflowmodel.utils.Tools .getProcessorOutputPort(processor, activity, activityPort); if (output == null) { // port doesn't exist so create a processor port and map it ProcessorOutputPort processorOutputPort = edits .createProcessorOutputPort(processor, activityPort .getName(), activityPort.getDepth(), activityPort .getGranularDepth()); editList.add(edits.getAddProcessorOutputPortEdit(processor, processorOutputPort)); editList.add(edits.getAddActivityOutputPortMappingEdit(activity, activityPort.getName(), activityPort.getName())); output = processorOutputPort; } return output; }
private XMLInputSplitter createSplitter() { List<String> inputNames = new ArrayList<String>(); List<String> inputTypes = new ArrayList<String>(); List<String> outputNames = new ArrayList<String>(); //FIXME: need to use the definition beans for now to get the mimetype. Need to use the actual InputPort once the mimetype becomes available again. for (ActivityInputPortDefinitionBean defBean : getConfiguration().getInputPortDefinitions()) { inputNames.add(defBean.getName()); inputTypes.add(defBean.getMimeTypes().get(0)); } for (OutputPort outputPorts : getOutputPorts()) { outputNames.add(outputPorts.getName()); } return new XMLInputSplitter(typeDescriptor,inputNames.toArray(new String[]{}),inputTypes.toArray(new String[]{}),outputNames.toArray(new String[]{})); }
private EventForwardingOutputPort getSourcePort( net.sf.taverna.t2.workflowmodel.Processor processor, Activity<?> activity, String portName, List<Edit<?>> editList) { OutputPort activityPort = net.sf.taverna.t2.workflowmodel.utils.Tools .getActivityOutputPort(activity, portName); // check if processor port exists EventForwardingOutputPort output = net.sf.taverna.t2.workflowmodel.utils.Tools .getProcessorOutputPort(processor, activity, activityPort); if (output == null) { // port doesn't exist so create a processor port and map it ProcessorOutputPort processorOutputPort = edits .createProcessorOutputPort(processor, activityPort .getName(), activityPort.getDepth(), activityPort .getGranularDepth()); editList.add(edits.getAddProcessorOutputPortEdit(processor, processorOutputPort)); editList.add(edits.getAddActivityOutputPortMappingEdit(activity, activityPort.getName(), activityPort.getName())); output = processorOutputPort; } return output; }