title: Mule 3: Controlling whether a flow is allowed to be executed
body: <p><strong>My current situation:</strong></p>
  
  <p>I currently have a Mule ESB application with three flows which process messages originating from two different sources, these three flows are tied together using a VM queue.</p>
  
  <p><strong>Flow #1:</strong></p>
  
  <p>Inbound (Endpoint #1) -> (Perform message processing and transformations) -> Outbound (Endpoint #3)</p>
  
  <p><strong>Flow #2:</strong></p>
  
  <p>Inbound (Endpoint #2) ->  (Perform message processing and transformations) -> Outbound (Endpoint #3)</p>
  
  <p><strong>Flow #3</strong></p>
  
  <p>Inbound (Endpoint #3) -> (Perform message processing and transformations, do stuff) -> Outbound</p>
  
  <p><strong>Problem/ Issue:</strong></p>
  
  <p>Now what I want to do is introduce a fourth flow, Flow #4, that gets state information from an inbound endpoint and based off this information be able to prevent Flow #3 from ever being executed/ prevent it from processing its inbound messages.</p>
  
  <p>In other words, what I'd ideally like is to have Flow #4 run at the startup of the ESB application (like all flows seem to automatically do), and based on the state information it gets from its inbound message, prevent/ allow or enable/ disable Flow #3 from ever processing messages from Endpoint #3.  </p>
  
  <p>The following are what I ideally require:</p>
  
  <p><strong>Requirements:</strong></p>
  
  <ol>
  <li>Must be able to accomplish solely through the mule flow XML, no additional POJO/ custom Java objects.</li>
  <li>Flow #4 must be performed at startup of the ESB application and only the first inbound message needs to ever be processed.</li>
  <li>Ideally, I don't want Flow #3 to have a composite inbound source or have to evaluate every inbound message the state of some global variable.</li>
  </ol>
  
  <p>What's the best way to accomplish what I want to do?</p>
  
  <p>If there is no real good solution, then if I must omit #3 requirement, then what's the best way to accomplish such a global variable that is shared between two independent flows that aren't tied together by some outbound -> inbound endpoint in the XML config?  I've tried using session properties, but they require that the flows be tied together as either subflows or by an endpoint.</p>
  
  <p>Thanks.</p>