Is there a way to register external events for jbpm, such that they cause a "state transition"?
jBPM is a workflow engine. It isn't designed to listen for events and react to them. That is up to the developer.
You could slice this two ways:
1. write an action that looks for the file and signals the token to continue (your suggestion). The process isn't in a wait state, but is running your code waiting for the file.
2. put the process in a wait state and have a separate proces look for the file. When the file was located it would signal the token with the same results. The trick would be knowing the token_id, so I'd go with option 1.
write a timer that periodically checks for the file and only continues when present. (then you wouldn't need a thread :-)
personally i'd go for the external polling mech. you would have to mark your token in some kind and then query it in order to signal the correct token. but maybe you can code the tokenId or something else into the filename.
I also think the external polling is the simplest and most flexible solution. Besides that, you will want to correlate the file with the processinstance/token anyway, so using the tokenid in the filename or have a correlation table where this is done are two possible solutions.
Thanks for your replies - this is kind of what I expected (i.e. having to code up your own incoming event triggers to fit into jBPM process flow), but I'm just in the evaluation of jBPM as a fit for our requirements so expertise is much appreciated!
I suppose I thought that there may have been some sort of event registration/mgmt plug-in for jBPM as some of the examples refer to "incoming emails" as triggers to movemenmt in the process chain - but I suppose, as befire, this is coded up by the jBPM developer also.
Thanks again for your input