camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Xml schema RouteDefinition
Date Sun, 30 Jun 2013 13:08:20 GMT
Hi

Yeah there is no reason why it can be 0. It should really be 1..n.
Though 99% uses a single <from> in a route.

So yeah if we can have the schema generated with 1 as minimum then
that would be better.

Feel free to log a JIRA and provide a patch.

On 6/30/13, AlanFoster <alan@alanfoster.me> wrote:
> Hi guys,
>
> I'm just wondering if there are any technical reasons why a RouteDefinition
> is allowed zero to unbounded occurrences of the `from` element;
>
> From the Schema for camel 2.10.0 -
>
> <xs:complexType name="routeDefinition">
>     <xs:complexContent>
>       <xs:extension base="tns:processorDefinition">
>         <xs:sequence>
>           <xs:element ref="tns:from" minOccurs="0" maxOccurs="unbounded"/>
>           <xs:choice minOccurs="0" maxOccurs="unbounded">
>               ......
>           </xs:choice>
>         </xs:sequence>
>          ......
>       </xs:extension>
>     </xs:complexContent>
>   </xs:complexType>
>
> We can see from the generated Schema that we are allowed a route that looks
> like the following :
>
> <route>
>    <log message="Hello World" />
> </route>
>
> But we will receive the following error if we try to run it
>
> java.lang.IllegalArgumentException: Route has no inputs: Route[[] ->
> [Log[hello World]]]
>
> IE, can we add a required = true annotation to force a min-occurs = 1 in
> the
> generated schema, or are there technical reasons why this isn't a good
> idea?
>
> Cheers
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Xml-schema-RouteDefinition-tp5735010.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>


-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message