Reputation: 219
I'm trying to set an invocation property in Mule 3.3.1 to be used in a "Choice" flow control. My flow has a transformer (extending the AbstractTransformer) and in it I'd like to set an invocation property based on certain logic. I can set it in the .mflow file:
<message-properties-transformer scope="invocation" doc:name="Set Invocation Variable">
<add-message-property key="someKey" value="someValue"/>
</message-properties-transformer>
However, I'm not sure how I would do this programmatically in my transformer. My ultimate goal is to dynamically pass the operation field in a soap client based on the mule message. Any suggestions would be appreciated.
Upvotes: 1
Views: 3524
Reputation: 2319
Extend AbstractMessageTransformer and use message.setInvocationProperty:
public class MyTransformer extends AbstractMessageTransformer {
@Override
public Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException {
message.setInvocationProperty("someKey", "someValue");
return message;
}
}
Upvotes: 3