Hide Forgot
Created attachment 550258 [details] insertElements command reproducer I have following camel-drools configuration: camelContext.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { JaxbDataFormat jdf = new JaxbDataFormat(); jdf.setContextPath("com.redhat.jaxbinsertelements.domain"); jdf.setPrettyPrint(true); from("direct:test-session").policy(new DroolsPolicy()).unmarshal(jdf).to("drools://testnode/ksession").marshal(jdf); from("direct:unmarshall").policy(new DroolsPolicy()).unmarshal(jdf); from("direct:marshall").policy(new DroolsPolicy()).marshal(jdf); } }); I am trying to insert multiple facts into a session using InsertElement command. XML is created manually from example in documentation (http://docs.jboss.org/drools/release/5.3.0.Final/droolsjbpm-integration-docs/). When I am executing the command no exception is thrown, bud also no facts are inserted into the session. Here is my XML: <batch-execution> <insert-elements return-objects="true"> <objects xsi:type="person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <age>50</age> <id>0</id> <likes>nobody</likes> <name>John</name> </objects> <objects xsi:type="person" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <age>24</age> <id>0</id> <likes>himself</likes> <name>Peter</name> </objects> </insert-elements> </batch-execution> When I use marshaller to create XML from command instance contructed by API, this solution works, but the XML structure looks different: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <batch-execution> <insert-elements return-objects="true"> <list> <element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="person"> <age>30</age> <id>0</id> <likes>spicy meals</likes> <name>Alice</name> </element> <element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="person"> <age>35</age> <id>0</id> <likes>Alice</likes> <name>Carl</name> </element> </list> </insert-elements> </batch-execution> ------------------------------------------------------------------------------ See an attachment for the details, it contains maven project, so build it and run.
Camel isn't being productised yet. So check with prakash/johng before progressing further on this one. If the bug seems genuine, please re-open a jira for .org and we'll make sure it's fixed there.
ERD states that the Camel integration is being productized. (https://docspace.corp.redhat.com/docs/DOC-76523)
This reproduce code uses the drools-grid stuff too: GridImpl grid = new GridImpl(); grid.addService(WhitePages.class, new WhitePagesImpl()); GridNode node = grid.createGridNode("testnode"); Context context = new JndiContext(); context.bind("testnode", node); node.set("ksession", session); CamelContext camelContext = new DefaultCamelContext(context); Please see the comments in this issue for more information: https://bugzilla.redhat.com/show_bug.cgi?id=771203 I am presuming it's also due to the drools-grid code breaking things. If not, please reopen.
here is a pull request with reproducers for these 3 connected issues: https://github.com/droolsjbpm/droolsjbpm-integration/pull/12
The documentation was wrong. Fixed the documentation and applied the testcase on master and changed the testcase to test the correct way. Here's the documentation fix on the branch: https://github.com/droolsjbpm/droolsjbpm-integration/commit/fa1d136e877b5d0d334ee06fa50c2d886b5af894
Please verify this issue on ER5.