You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by bmadhekar <bm...@hotmail.com> on 2013/08/10 20:44:57 UTC

Re: Newbie Pls help: ETL Example Modification Doesn't work

I tried extending ETL example with Complex class which has child elements, I
get error in convetBodyTo... does any body know Camel supports parent child
relations in class yet?

cvc-complex-type.2.3: Element 'convertBodyTo' cannot have character
[children], because the type's 
 content type is element-only.



--
View this message in context: http://camel.465427.n5.nabble.com/Newbie-Pls-help-ETL-Example-Modification-Doesn-t-work-tp2852839p5737072.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Newbie Pls help: ETL Example Modification Doesn't work

Posted by Willem jiang <wi...@gmail.com>.
Hi ,

You don't use the <convertyBodyTo> rightly.
Please change the route like this:
<convertBodyTo type="com.mycompany.product.service.jpa.Ticket"/>


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Monday, August 12, 2013 at 3:44 AM, bmadhekar wrote:

> here is my code,
>  
> Ticket is openJpa annotated class created in drools knowledge session, this
> class has two one-to-many relationships defined. Do I need Xml annotations?
>  
> <camelContext id="camelContext"
> xmlns="http://camel.apache.org/schema/spring">
> <route>
> <from uri="activemq:queue:commandsQueue" />
> <policy ref="fsDroolsPolicy">
> <unmarshal ref="xstream" />
> <to uri="drools:fsGridNode/fsKnowledgeSession" />
> <marshal ref="xstream" />
> <log message="${body}"/>
> </policy>
> </route>
>  
> <route>
> <from uri="direct://fsKnowledgeSession"/>
> <policy ref="fsDroolsPolicy">
> <convertBodyTo>Ticket.class</convertBodyTo>
> <to uri="jpa:com.mycompany.product.service.jpa.Ticket"/>
>  
> <log message="${body}"/>
> </policy>
> </route>
> </camelContext>
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Newbie-Pls-help-ETL-Example-Modification-Doesn-t-work-tp2852839p5737088.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: Newbie Pls help: ETL Example Modification Doesn't work

Posted by bmadhekar <bm...@hotmail.com>.
here is my code,

Ticket is openJpa annotated class created in drools knowledge session, this
class has two one-to-many relationships defined. Do I need Xml annotations?

<camelContext id="camelContext"
xmlns="http://camel.apache.org/schema/spring">
    <route>
      <from uri="activemq:queue:commandsQueue" />
      <policy ref="fsDroolsPolicy">
        <unmarshal ref="xstream" />
        <to uri="drools:fsGridNode/fsKnowledgeSession" />
        <marshal ref="xstream" />
        <log message="${body}"/>
      </policy>
    </route>

  <route>
    	<from uri="direct://fsKnowledgeSession"/>
    	<policy ref="fsDroolsPolicy">
    		<convertBodyTo>Ticket.class</convertBodyTo>
    		<to uri="jpa:com.mycompany.product.service.jpa.Ticket"/>
    	
    		<log message="${body}"/>
    	</policy>
    </route>
  </camelContext>



--
View this message in context: http://camel.465427.n5.nabble.com/Newbie-Pls-help-ETL-Example-Modification-Doesn-t-work-tp2852839p5737088.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Newbie Pls help: ETL Example Modification Doesn't work

Posted by Christian Müller <ch...@gmail.com>.
It looks like you made a mistake in your DSL. Can you share your code?

Best,
Christian
Am 11.08.2013 08:43 schrieb "bmadhekar" <bm...@hotmail.com>:

> I tried extending ETL example with Complex class which has child elements,
> I
> get error in convetBodyTo... does any body know Camel supports parent child
> relations in class yet?
>
> cvc-complex-type.2.3: Element 'convertBodyTo' cannot have character
> [children], because the type's
>  content type is element-only.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Newbie-Pls-help-ETL-Example-Modification-Doesn-t-work-tp2852839p5737072.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>