Uploaded image for project: 'ServiceMix Components'
  1. ServiceMix Components
  2. SMXCOMP-249

Setting XML Attributes in Messages & Auto Reply to support InOut w/o calling answer()/route() in .drl files

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • servicemix-drools-2009.01
    • servicemix-drools
    • None
    • Patch to Drools SE build 3.2.2-712210

    Description

      Worked with Gert on this. Asked if we could add the ability to set XML attribute values identified by an XPath to a supplied String value and a supplied XML attribute value identified by an XPath. Also, asked if would could add a way to ensure that the 'out' message is returned for InOptionalOut, InRobustOut, and InOut Exchanges where the endpoint is a Provider and returning the 'in' message if the 'out' does not exist.

      Wasn't able to test because I couldn't get a JBI instance to initialize (jbi.ini()) in the DroolsComponentTest.

      XML Attribute updating ability:

      Message.java:
      +Added setAttributeWithValue(xpathTo, string value) & setAttributeWithAttribute(xpathTo, xpathFrom)

      Auto Reply:

      DroolsEndpoint.java:
      +Added feature to drools()

      DroolsExecutionContext.java
      +Added answer() as wrapper to JbiHelper to support Auto Reply

      Improve Consistency:

      Exchange.java:
      +Added IN_MESSAGE & OUT_MESSAGE

      JbiHelper.java:
      +Used Exchange.IN_MESSAGE & Exchange.OUT_MESSAGE
      +Added JBI_HELPER_KEY

      Testing:

      DroolsComponentTest.java
      +Added testAutoReply(), testModifyXMLWithAValue(), testModifyXMLWithAnAttribute()

      AutoReply.drl, XPathAttrMod-StringValue.drl, XPathAttrMod-XPathAttr.drl

      Attachments

        1. AutoReply.drl
          1.0 kB
          Brian Taylor
        2. DroolsComponentTest.java
          14 kB
          Brian Taylor
        3. DroolsEndpoint.java
          13 kB
          Brian Taylor
        4. DroolsExecutionContext.java
          4 kB
          Brian Taylor
        5. Exchange.java
          4 kB
          Brian Taylor
        6. InOut MEP As Provider Using AutoReply Use Case.jpg
          137 kB
          Brian Taylor
        7. JbiHelper.java
          7 kB
          Brian Taylor
        8. Message.java
          5 kB
          Brian Taylor
        9. SM-1683.diff
          23 kB
          Gert Vanthienen
        10. XPathAttrMod-StringValue.drl
          1 kB
          Brian Taylor
        11. XPathAttrMod-XPathAttr.drl
          1 kB
          Brian Taylor

        Activity

          People

            gertvanthienen Gert Vanthienen
            objectorange Brian Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: