0
votes

How I can run flow(s) automatically

Anyone can tell me how flow(s) run automatically.

Basically I am trying to read data from csv file and wants to store it in database. I have created flow for it and run, it start the application as you can see below:


INFO 2013-11-26 11:31:47,401 [main] org.mule.module.launcher.MuleDeploymentService: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Started app 'read_csv_file' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

After this point I have no idea what I need to do to execute this flow. From where I need to hit this flow. I am stuck here please help me

3
well it all depends on how you intend to read the csv file, from a local directory, file, webserver.. Use the suitable inbound endpoint and place that as your entry point. there are a lot of examples etc in the documentation e.g for file transports mulesoft.org/documentation/display/current/…. if you have e.g a file-endpoint as your inbound endpoint , depending on your setup it will listen to any file placed in the listening directory, place the file in the directory specified and it will be read by the flowdunn less

3 Answers

1
votes

Mule Flows are triggered by an event. It can be an event generated from another flow or it can be an event on the inbound-endpoint.

From the post it can be understood that the flow needs to be triggered from outside the application. So better use an Inbound-Endpointat the start of the flow to trigger the flow.

For your case you can use an file:inbound-endpoint at the start of your flow.

<flow name="main_flow">

         <file:inbound-endpoint path="/path/to/input/folder"  doc:name="File"></file:inbound-endpoint>
       ......
     .........  Message processors  ....
 </flow>
0
votes

Flows are automatically started, you don't need to "run" them.

Messages will be processed depending on the message sources you have in your flows, which are the ones triggering the flow execution.

I would suggest you to carefully read the documentation:
http://www.mulesoft.org/documentation/display/current/Mule+Application+Architecture

0
votes

You can either use a File component that reads the file from the location you mention depending on the polling frequency. Or If you try to read your file using a java component or expression or Groovy script you can automatically trigger using flow by using a Quartz component at the beginning of the flow.