I am new to Drools, but am an experienced programmer. I was hoping
somebody with some Drools Flow experience could advise on a good
approach for dealing with the following requirements:
1) A large number of XML files are received: perhaps one every few
seconds (or more frequently). Each time a file is received I want to
process these according to a pre-defined business process. For
example:
- Calling a web service using some data contained in the file to do a
calculation
- Writing to a database
- Copying the file to another directory
- Sending an email
- Logging progress
NB Some of the logic in the flow may vary depending on data within the
file which is being processed.
2) The business process may vary slightly depending on the nature of
the file being received. For example I have four file types: A,B,C
&D. I’d want to invoke 4 slightly different processes. Each of these
may have slight variations depending on the contents of the file.
3) The business processes may be changed occasionally, but usually not
drastically. This doesn’t need to be done dynamically.
I already have code which monitors a folder for new files. With
drools, I’m just not sure what the best pattern is for how to deal
with this in an efficient manner. I was thinking:
Each time a file is received:
- Do an initial parse to determine which business process to invoke,
each of these would be built as a separate drools flow
- Construct the knowledgebase, session etc
- Start the relevant flow
I’m pretty sure this isn’t the easiest or most efficient approach
though! Any thoughts?
Thanks,
Ken