Sathya Pillutla
Sathya Pillutla

Reputation: 69

Starting a mule flow programmatically using groovy

I need to control the execution of a flow manually through a HTTP call.

I have been told I can disable the flow from executing during startup using the initialState="stopped" attribute on the flow. (How to stop a mule flow from running after startup)

I need to know how to start the flow back using a groovy script.

Using mule 3.2.2.

Upvotes: 2

Views: 3513

Answers (1)

David Dossot
David Dossot

Reputation: 33413

This should do it:

<scripting:component>
    <scripting:script engine="groovy">
        muleContext.registry.lookupFlowConstruct('targetFlow').start()
    </scripting:script>
</scripting:component>

Upvotes: 8

Related Questions