Hi Guillaume,

Ok i'll open a JIRA for that.

Regards the possible solution:

1) Our first solution ( for time reason ) will be to port the old lw component to servicemix bean. ( I just need to change the inherited class )

2) To port this solution to servicemix-scripting we need to manage the exchange in similar way as the TransformBeanSupport class, but in that case we need to specify a target endpoint.

3) The "pipeline solution" is good but it's a little tricky, and maybe it will not work because in
the groovy code we manage the output message content.

Andrea

Guillaume Nodet ha scritto:
Ok, I think I see now.
Well,  I guess it should be possible to port this feature from the lw
component to servicemix-scripting.  Wanna raise a JIRA for that ?
Though we might want to add a flag to control this behavior.
I suppose another solution would be to simply add a pipeline before
the scripting endpoint, and that would work just the same.

On Fri, Nov 14, 2008 at 5:08 PM, Andrea Zoppello <[EMAIL PROTECTED]> wrote:
Yes Guillaume,

Here the example, btw the point is that the old components ( as all the
lightweight components one extending TransformComponentSupport)  let you to
trasparently manage the case of receiving an InOnly or InOut exchange.

With the old component, when the component receive an InOnly exchange, it
provides to create automatically a new InOnly exchange with the content of
the out message you set in groovy.

Here the example:

// DOM4j is in the cp
import org.dom4j.*;
import org.dom4j.xpath.*;

// Get the input as a String and set the output content
def String xmlInput  = null;
xmlInput = new String(inMessage.bodyText);

def org.dom4j.Document document = DocumentHelper.parseText(xmlInput);
parCustomerType = document.valueOf("/Customer/@customerType");

def String decodedCustomerType = "GENERIC";

if (parCustomerType == "1"){
  decodedCustomerType = "CUSTOMER_TYPE_1";
}

if (parCustomerType == "2"){
  decodedCustomerType = "CUSTOMER_TYPE_2";
}

outMessage.bodyText =
"<DECODED_CUSTOMER_TYPE>"+decodedCustomerType+"</DECODED_CUSTOMER_TYPE>";
Guillaume Nodet ha scritto:
I'm not sure to understand.  Could you please paste one of your groovy
script ?

On Fri, Nov 14, 2008 at 4:38 PM, Andrea Zoppello <[EMAIL PROTECTED]>
wrote:

Hi all,

As i know from smx 3.3/4 the plain old ( and very good ) scripting
component, will
be replaced by servicemix-scripting.

I know it's better because it's standard and so on, but i've still some
doubt about this one.

In particular with the old component ( the lighteight one ) i was able to
do
something like:

Start -> Script1 -> Script 2-> End

Where all the transition represent InOnly Exchange. This was provided by
the
TransformComponentSupport class where in the groovy code i was able to
get
the output message and to set the content into.

Maybe i'm wrong but looking at the code of the new component, when this
one
receives
an InOnly Exchange only the done message is sent back.

At this point the better solution for me is to port the old grrovy code
to
support servicemix-bean??? Any idea???

Any idea??








Reply via email to