Examples of OtherwiseDefinition


Examples of org.apache.camel.model.OtherwiseDefinition

        ChoiceDefinition choice = (ChoiceDefinition)processor;
        buffer.append(".").append(choice.getShortName()).append("()");
        for (WhenDefinition when : choice.getWhenClauses()) {
            ProcessorDefinitionRenderer.render(buffer, when);
        }
        OtherwiseDefinition other = choice.getOtherwise();
        if (other != null) {
            ProcessorDefinitionRenderer.render(buffer, other);
        }
        buffer.append(".end()");
    }
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

        ChoiceDefinition choice = (ChoiceDefinition)processor;
        buffer.append(".").append(choice.getShortName()).append("()");
        for (WhenDefinition when : choice.getWhenClauses()) {
            ProcessorDefinitionRenderer.render(buffer, when);
        }
        OtherwiseDefinition other = choice.getOtherwise();
        if (other != null) {
            ProcessorDefinitionRenderer.render(buffer, other);
        }
        buffer.append(".end()");
    }
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

        assertEquals("log1", log1.getId());

        ToDefinition to1 = (ToDefinition) when.getOutputs().get(1);
        assertEquals("camel", to1.getId());

        OtherwiseDefinition other = (OtherwiseDefinition) choice.getOutputs().get(1);
        assertEquals("otherwise1", other.getId());

        LogDefinition log2 = (LogDefinition) other.getOutputs().get(0);
        assertEquals("log2", log2.getId());

        ToDefinition to2 = (ToDefinition) other.getOutputs().get(1);
        assertEquals("to1", to2.getId());

        ToDefinition to3 = (ToDefinition) other.getOutputs().get(2);
        assertEquals("foo", to3.getId());

        ToDefinition to4 = (ToDefinition) route.getOutputs().get(1);
        assertEquals("end", to4.getId());
    }
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

        assertEquals("log1", log1.getId());

        ToDefinition to1 = (ToDefinition) when.getOutputs().get(1);
        assertEquals("camel", to1.getId());

        OtherwiseDefinition other = (OtherwiseDefinition) choice.getOutputs().get(1);
        assertEquals("otherwise1", other.getId());

        LogDefinition log2 = (LogDefinition) other.getOutputs().get(0);
        assertEquals("log2", log2.getId());

        ToDefinition to2 = (ToDefinition) other.getOutputs().get(1);
        assertEquals("to1", to2.getId());

        ToDefinition to3 = (ToDefinition) other.getOutputs().get(2);
        assertEquals("foo", to3.getId());

        ToDefinition to4 = (ToDefinition) route.getOutputs().get(1);
        assertEquals("end", to4.getId());
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

    }

    @SuppressWarnings("rawtypes")
    @Override
    public ProcessorDefinition createCamelDefinition() {
        OtherwiseDefinition answer = new OtherwiseDefinition();

        answer.setInheritErrorHandler(toXmlPropertyValue(PROPERTY_INHERITERRORHANDLER, Objects.<Boolean>getField(this, "inheritErrorHandler")));

        super.savePropertiesToCamelDefinition(answer);
        return answer;
    }
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

    @Override
    protected void loadPropertiesFromCamelDefinition(ProcessorDefinition processor) {
        super.loadPropertiesFromCamelDefinition(processor);

        if (processor instanceof OtherwiseDefinition) {
            OtherwiseDefinition node = (OtherwiseDefinition) processor;

            this.setInheritErrorHandler(Objects.<Boolean>getField(node, "inheritErrorHandler"));
        } else {
            throw new IllegalArgumentException("ProcessorDefinition not an instanceof OtherwiseDefinition. Was " + processor.getClass().getName());
        }
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

      List<ProcessorDefinition> list = new ArrayList<ProcessorDefinition>();
      List<WhenDefinition> whenClauses = choice.getWhenClauses();
      if (whenClauses != null) {
        list.addAll(whenClauses);
      }
      OtherwiseDefinition otherwise = choice.getOtherwise();
      if (otherwise != null) {
        list.add(otherwise);
      }
      return list;
    } else {
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

    assertSize(whenClauses, 1);
    WhenDefinition wd1 = whenClauses.get(0);
    ToDefinition ed2 = assertSingleOutput(wd1, ToDefinition.class);
    assertEquals("when -> to", "seda:b", ed2.getUri());
   
    OtherwiseDefinition od1 = c1.getOtherwise();
    assertNotNull("Should have Otherwise", od1);
    ToDefinition ed3 = assertSingleOutput(od1, ToDefinition.class);
    assertEquals("otherwise -> to", "seda:c", ed3.getUri());

    RouteContainer routeContainer = new RouteContainer();
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

        assertEquals("log1", log1.getId());

        ToDefinition to1 = (ToDefinition) when.getOutputs().get(1);
        assertEquals("camel", to1.getId());

        OtherwiseDefinition other = (OtherwiseDefinition) choice.getOutputs().get(1);
        assertEquals("otherwise1", other.getId());

        LogDefinition log2 = (LogDefinition) other.getOutputs().get(0);
        assertEquals("log2", log2.getId());

        ToDefinition to2 = (ToDefinition) other.getOutputs().get(1);
        assertEquals("to1", to2.getId());

        ToDefinition to3 = (ToDefinition) other.getOutputs().get(2);
        assertEquals("foo", to3.getId());

        ToDefinition to4 = (ToDefinition) route.getOutputs().get(1);
        assertEquals("end", to4.getId());
View Full Code Here

Examples of org.apache.camel.model.OtherwiseDefinition

        assertEquals("log1", log1.getId());

        ToDefinition to1 = (ToDefinition) when.getOutputs().get(1);
        assertEquals("camel", to1.getId());

        OtherwiseDefinition other = (OtherwiseDefinition) choice.getOutputs().get(1);
        assertEquals("otherwise1", other.getId());

        LogDefinition log2 = (LogDefinition) other.getOutputs().get(0);
        assertEquals("log2", log2.getId());

        ToDefinition to2 = (ToDefinition) other.getOutputs().get(1);
        assertEquals("to1", to2.getId());

        ToDefinition to3 = (ToDefinition) other.getOutputs().get(2);
        assertEquals("foo", to3.getId());

        ToDefinition to4 = (ToDefinition) route.getOutputs().get(1);
        assertEquals("end", to4.getId());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.