Watched Folder

1
0
-1

Hi everyone, I just doing my first step in this software and I would like if you can help me with this issue. I need to trigger a workflow after a file arrives into a specific folder. In case the files could be large and in those case I have to be sure the file is complete before to trigger the workflow. Thanks in advanced for your help.

1 answer

1
+1
-1
This one is the BEST answer!

My view is this is really an external application which as you say then triggers a process.

There are many systems that do Folder Watch and can execute other systems, check you don't already have one of these in place for the business and use that. It will be much more efficient.

Otherwise I would write a small java program that you can startup at computer start time (automatically) and then execute the necessary REST Calls to start the process for the file(s).

I did a Google Search for java folder watch and found these to be good references for watching a folder:
https://docs.oracle.com/javase/tutorial/essential/io/notification.html

http://stackoverflow.com/questions/23452527/watching-a-directory-for-cha... http://stackoverflow.com/questions/16251273/can-i-watch-for-single-file-... http://stackoverflow.com/questions/4941869/directory-listener-in-java http://andreinc.net/2013/12/06/java-7-nio-2-tutorial-writing-a-simple-fi...

The program could of course be written in any language that can watch folders, C++ etc. Your choice.

NOTE: Bonita Processes can ONLY access paths within the Realm of Apache Tomcat. So the directory you want to monitor has to be in there somewhere, and make sure it is secured down to only those processes that need it.

For writing the REST part you need to Login, Start the Process and then Logout, see here:
http://documentation.bonitasoft.com/?page=_rest-api

also note the following:
http://documentation.bonitasoft.com/?page=manage-files-using-upload-serv...

regards
Seán

PS: As this reply answers your question, please mark as resolved by ticking the tick mark on the left of this reply.

Comments

Submitted by pgfg73 on Wed, 09/07/2016 - 01:59

Hi Sean, Than so much for your answer !!!! I will work with your recommendations and let you know the result

Notifications