Hi Philip,

    I'd just like to illustrate what I meant with an example. Why don't you try 
it this way and tell me if it works for you:


  | <process-definition name="sample-event-listener">
  |     <start-state>
  |     <transition to="event-listener"/>
  |     </start-state>
  | 
  |     <state name="event-listener">
  |         <event type="node-enter">
  |             <action class="..." />
  |         </event>
  |     <transition name="end-process" to="end-state"/>
  |     </state>
  | 
  |     <end-state name="end-state"/>
  |     
  | </process-definition>

action handler class:

  | public void execute(ExecutionContext ctx) throws Exception {
  |     long processid = ctx.getProcessInstance().getId();
  | 
  |     //since this is asynchronous, it will pass this immediately 
  |     //and return handle to the main context
  |     AsyncEventListenerThread th = new AsyncEventListenerThread( id );
  |     th.start();     
  | }

the sample listener thread

  | public class AsyncEventListenerThread extends Thread {
  |     long processid = processid;     
  | 
  |     public AsyncEventListenerThread( long processid ) {
  |     this.processid = processid;
  |     }
  | 
  |     public void run() {
  |     //place your event listenter here. A JMS client would be good here 
  |         //after event arrives, call a new JbpmSession, locate the process, 
  |     //signal it and save and don't forget to close the jbpm context. 
  |     }
  | }

While you're at it, try also reading on asynchronous continuations. Maybe they 
have something there that's already done for this job. I have not yet read on 
that, let me know. Good luck.

Regards,

Elmo

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

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


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to