Discussion:
please help me work with variabe. I'm a newbie
Mariano Capurro
2012-06-27 12:15:34 UTC
Permalink
Hi
<br /><br />
can you please share if you are getting exceptions or provide more details on your problem?
<br /><br />
I guess that you need to build the Java Transformers. To do so, create a class that extends org.mule.transformer.AbstractMessageTransformer. You will need to implement the method:
<br /><br />
<code>
<br />
public Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException
<br />
{
<br /><br />
}
<br />
</code>
<br /><br />
The object MuleMessage has all the methods to access your properties and mainly the message payload. The returned object will be the payload used to answer back.
<br /><br />
You can also define what is the type of the payload you accept in the constructor of your transformer and your return type:
<br /><br />
<code>
<br />
public MyTransformer() {
<br />
this&#46;registerSourceType(DataTypeFactory&#46;create(MyInputClass&#46;class));
<br />
this&#46;setReturnDataType(DataTypeFactory&#46;create(MyOutputClass&#46;class));
<br />
}
<br />
</code>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Pablo La Greca
2012-06-27 15:25:55 UTC
Permalink
Hi,
<br /><br />
Please specify which mule version are you using.
<br /><br />
I think what you need is store the incoming message to an invocation variable. Invocation variables are preserved in the flow scope.
<br /><br />
Previous 3.3 version
<br /><br />
After the inbound endpoint put this transformer:
<br /><br />
Then you can retrieve it through the expression #[header:INVOCATION:originalPayload].
<br /><br />
Since 3.3
<br /><br />
and to access it use the expression #[flowVars['originalPayload']]
<br /><br />
HTH, Pablo.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...