Changing the database directly is not at all advisable, because jBPM will *not* 
realize you changed the node or "automagically" resume execution from there.

My suggestion was more along these lines. If your external program is 
sufficiently short lived, you can wait synchronously for it to finish. In this 
case you won't release the resources you have allocated (jBPM objects, JDBC 
connection). Use a node instead of a state and use this as the node action:
public void execute(ExecutionContext exeContext) throws Exception {
  |   // execute external program
  |   Process p = Runtime.exec("yourprogram");
  |   // wait for the program to terminate 
  |   p.waitFor();
  |   // resume the process
  |   exeContext.leaveNode();
  | }
If your program takes a long time to finish, you can use a separate thread in a 
non-managed environment or a message-driven bean in a managed environment. In 
this case all you need to keep is the token id,  so that you can reload the 
token and send a signal.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3921601#3921601

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3921601


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to