Yes, that sounds perfect.. <br>If you find that your processes are too similar you should evaluate treating all those differences using rules in order to just fire one single processes. But the only way to learn that is doing it in the way that you mention. Start simple, create a simple process for just one of the type of the files that you receive and then plug different work items based on the process that you want to apply to each type of file.<br>
<br>Just my two cents... <br><br>Greetings<br><br><div class="gmail_quote">On Tue, Aug 3, 2010 at 11:03 AM, Kenneth May <span dir="ltr">&lt;<a href="mailto:klcmay@gmail.com">klcmay@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am new to Drools, but am an experienced programmer.  I was hoping<br>
somebody with some Drools Flow experience could advise on a good<br>
approach for dealing with the following requirements:<br>
<br>
1) A large number of XML files are received: perhaps one every few<br>
seconds (or more frequently).  Each time a file is received I want to<br>
process these according to a pre-defined business process.  For<br>
example:<br>
- Calling a web service using some data contained in the file to do a<br>
calculation<br>
- Writing to a database<br>
- Copying the file to another directory<br>
- Sending an email<br>
- Logging progress<br>
<br>
NB Some of the logic in the flow may vary depending on data within the<br>
file which is being processed.<br>
<br>
2) The business process may vary slightly depending on the nature of<br>
the file being received.  For example I have four file types: A,B,C<br>
&amp;D.  I’d want to invoke 4 slightly different processes.  Each of these<br>
may have slight variations depending on the contents of the file.<br>
<br>
3) The business processes may be changed occasionally, but usually not<br>
drastically.  This doesn’t need to be done dynamically.<br>
<br>
<br>
I already have code which monitors a folder for new files.  With<br>
drools, I’m just not sure what the best pattern is for how to deal<br>
with this in an efficient manner.  I was thinking:<br>
<br>
Each time a file is received:<br>
- Do an initial parse to determine which business process to invoke,<br>
each of these would be built as a separate drools flow<br>
- Construct the knowledgebase, session etc<br>
- Start the relevant flow<br>
<br>
I’m pretty sure this isn’t the easiest or most efficient approach<br>
though!  Any thoughts?<br>
<br>
Thanks,<br>
<br>
Ken<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com">http://www.plugtree.com</a>  <br> - MyJourney @ <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br> - Co-Founder @ <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br>
 <br> - Salatino &quot;Salaboy&quot; Mauricio -<br>