Discussion:
How to invoke a Private Flow or Sub Flow programmatically ?
Pablo La Greca
2013-06-04 14:47:07 UTC
Permalink
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&#46;muleContext = muleContext;
<br />
}
<br /><br />
public MuleEvent process(MuleEvent event)
<br />
{
<br />
Flow flow = (Flow)muleContext&#46;getRegistry()&#46;lookupFlowConstruct(&quot;flowName&quot;);
<br />
&#47;&#47;here you can mutate the payload, variables, properties, etc&#46; before calling the flow
<br />
return flow&#46;process(event);
<br />
}
<br />
}
<br />
</code>
<br /><br />
HTH, Pablo.

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

http://xircles.codehaus.org/manage_email

Loading...