1 Reply Latest reply on Jun 7, 2011 5:07 AM by Tom Fennelly

    Smooks - Possibility to set message property from within smooks ?

    Anonymous User Newbie

      Hello experts,

       

      is it possible to set a user message property from within smooks ?

       

      Normally you can set user message properties from within Java like this:

       

      1) message.getProperties().setProperty("com.xxx.yyy.uuu","blahblah")

       

      and Smooks Config. look typically like this

       

      2)

       

         <resource-config selector="INVOICE/HEAD">

              <resource>org.milyn.javabean.BeanPopulator</resource>

              <param name="beanId">invoiceHeader</param>

              <param name="beanClass">java.util.HashMap</param>

              <param name="bindings">

                  <binding property="invoiceNo" type="String" selector="INVOICE_NO" />

            ...

              </param>       

          </resource-config>

       

       

      How is it possible to set a message property (see (1)) within (2) ?

       

      Br,

       

      Dennis

        • 1. Re: Smooks - Possibility to set message property from within smooks ?
          Tom Fennelly Master

          I'm afraid it's not possible using the out of the box components.  However... it would be easy enough to implement custom ESB action that sets the ESB Message into the Smooks BeanContext before message filtering starts and then have something like a Groovy scriptlet to make the relevant updates to the ESB message.  You couldn't make these updates using the normal Smooks configurations because Smooks does not manage the lifecycle of the ESB Message (it didn't create the ESB Message object).