@Override public void visitProcessor(Processor bean) { if (checkComplete) { if (bean.getIterationStrategyStack() == null) { listener.nullField(bean, "iterationStrategyStack"); } } }
@Override public void setParent(Processor parent) { if (this.parent == parent) { return; } if (this.parent != null && this.parent.getIterationStrategyStack() == this) { this.parent.setIterationStrategyStack(null); } this.parent = parent; if (parent != null && parent.getIterationStrategyStack() != this) { parent.setIterationStrategyStack(this); } }
@Override public boolean accept(Visitor visitor) { if (visitor.visitEnter(this)) { List<Iterable<? extends WorkflowBean>> children = new ArrayList<Iterable<? extends WorkflowBean>>(); children.add(getInputPorts()); children.add(getOutputPorts()); outer: for (Iterable<? extends WorkflowBean> it : children) { for (WorkflowBean bean : it) { if (!bean.accept(visitor)) { break outer; } } } if (getIterationStrategyStack() != null) { getIterationStrategyStack().accept(visitor); } } return visitor.visitLeave(this); }
Integer calculateResultWrappingDepth(Map<InputProcessorPort, Integer> inputDepths) { Processor p = validatorState.get().getProcessor(); IterationStrategyStack iss = p.getIterationStrategyStack(); if (iss == null) { validatorState.get().getEventListener().missingIterationStrategyStack(p);
@Test public void resolveProcessorIterationStrategyStack() throws Exception { Processor hello = wfBundle.getMainWorkflow().getProcessors() .getByName("Hello"); assertSame( hello.getIterationStrategyStack(), uriTools.resolveUri( HELLO_URI.resolve("iterationstrategy/"), wfBundle)); }
@Test public void uriForIterationStrategyStack() throws Exception { URI uri = uriTools .uriForBean(wfBundle.getMainWorkflow().getProcessors() .getByName("Hello").getIterationStrategyStack()); assertEquals(HELLO_URI + "iterationstrategy/", uri.toASCIIString()); }
@Test public void resolveProcessorIterationStrategyRoot() throws Exception { Processor hello = wfBundle.getMainWorkflow().getProcessors() .getByName("Hello"); assertSame(hello.getIterationStrategyStack().get(0), uriTools.resolveUri(HELLO_URI.resolve("iterationstrategy/0/"), wfBundle)); }
@Test public void uriForIterationStrategyRoot() throws Exception { Processor hello = wfBundle.getMainWorkflow().getProcessors() .getByName("Hello"); URI uri = uriTools.uriForBean(hello.getIterationStrategyStack().get(0)); assertEquals(HELLO_URI + "iterationstrategy/0/", uri.toASCIIString()); }
@Test public void resolveProcessorIterationStrategy() throws Exception { Processor hello = wfBundle.getMainWorkflow().getProcessors() .getByName("Hello"); assertSame(hello.getIterationStrategyStack().get(0), uriTools.resolveUri( HELLO_URI.resolve("iterationstrategy/0/"), wfBundle)); }
@Test public void uriForIterationStrategyCross() throws Exception { Processor hello = wfBundle.getMainWorkflow().getProcessors() .getByName("Hello"); CrossProduct crossProduct = (CrossProduct) hello .getIterationStrategyStack().get(0); URI uri = uriTools.uriForBean(crossProduct.get(0)); assertEquals(HELLO_URI + "iterationstrategy/0/0/", uri.toASCIIString()); }
@Test public void resolveProcessorIterationStrategyNode() throws Exception { Processor hello = wfBundle.getMainWorkflow().getProcessors() .getByName("Hello"); CrossProduct rootStrategyNode = (CrossProduct) hello .getIterationStrategyStack().get(0); assertSame(rootStrategyNode.get(0), uriTools.resolveUri( HELLO_URI.resolve("iterationstrategy/0/0/"), wfBundle)); }