[jboss-user] [jBPM Users] - Re: workflow design about wait states

mmusaji do-not-reply at jboss.com
Wed Sep 16 04:53:02 EDT 2009


Perhaps I'm missing something... This is an example of how my application will start of the workflow. My comments in the code explain what I need to happen. I'm using the same process definition previously posted.

I need the workflow to start and then this method to wait until a signal is recieved from the workflow before reading the variable back out the executionService.


  | @WebMethod
  |     public String request() {
  |         try {
  |             InitialContext ctx = new InitialContext();
  |             this.processEngine = (ProcessEngine)ctx.lookup("java:/ProcessEngine");
  |             
  |             ExecutionService execService = (ExecutionService)
  |             this.processEngine.get(ExecutionService.class);
  |             
  |             //kicks off workflow (1)
  |             ProcessInstance processInstance = execService.startProcessInstanceByKey("process", variables);
  |             
  |             //between above the line and this line, we need a wait of some sort but depending on how long
  |             //the workflow takes to complete... 
  |             
  |             //should not be read until the workflow is complete
  |             myObject = (MyObject)execService.getVariable(processInstance.getId(), "myObjectDetails");
  |             
  |             
  |             result = "My Object Details: " + myObject.getDetails();
  |             
  |         } catch (Exception e) {
  |             e.printStackTrace();
  |         }
  |         
  |         return result;
  |     }
  | 



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

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



More information about the jboss-user mailing list