Pablo La Greca
2013-06-04 14:47:07 UTC
You will first need access to the MuleContext of your application. Let say you want to invoke a flow from within a MessageProcessor.
<br /><br />
<code>
<br />
public class MyMessageProcessor implement MessageProcessor, MuleContextAware
<br />
{
<br />
private MuleContext muleContext;
<br /><br />
public void setMuleContext(MuleContext context)
<br />
{
<br />
this.muleContext = muleContext;
<br />
}
<br /><br />
public MuleEvent process(MuleEvent event)
<br />
{
<br />
Flow flow = (Flow)muleContext.getRegistry().lookupFlowConstruct("flowName");
<br />
//here you can mutate the payload, variables, properties, etc. before calling the flow
<br />
return flow.process(event);
<br />
}
<br />
}
<br />
</code>
<br /><br />
HTH, Pablo.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
<br /><br />
<code>
<br />
public class MyMessageProcessor implement MessageProcessor, MuleContextAware
<br />
{
<br />
private MuleContext muleContext;
<br /><br />
public void setMuleContext(MuleContext context)
<br />
{
<br />
this.muleContext = muleContext;
<br />
}
<br /><br />
public MuleEvent process(MuleEvent event)
<br />
{
<br />
Flow flow = (Flow)muleContext.getRegistry().lookupFlowConstruct("flowName");
<br />
//here you can mutate the payload, variables, properties, etc. before calling the flow
<br />
return flow.process(event);
<br />
}
<br />
}
<br />
</code>
<br /><br />
HTH, Pablo.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email