Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [JBoss jBPM] - Some questions on Process Instance.

scott.stark@jboss.org

2007-07-19


I just wanted to make sure I am doing some things using the best practice.  I think I am doing some things that are not just 100% correct and work coincidentally

I have the process instance that I want to work with. What is the best method to get a Node so I can signal it?  Also what is the best method to get a task so I can end it?

My Logic I am using on Node is....

|         ProcessInstance pi = jbpmContext.getProcessInstance(pid);
|        
|         Token token = pi.findToken("MyNode1");
|         token.signal("Pass");  // transition
|

My logic on a Task Node is...this is the one I think is not the best practice.


|   ProcessInstance pi = jbpmContext.getProcessInstance(pid);
|        
|   Collection tis = pi.getTaskMgmtInstance().getTaskInstances();
|   Iterator li = tis.iterator();
|   while (li.hasNext())
|   {
|       TaskInstance ti = (TaskInstance)li.next();
|       if (ti.getEnd() == null)
|       {
|         String ami = (String)ti.getVariable(ProcessVariables.ART_MASTER_ID);
|         if (ami.equals(String.valueOf(artMasterId)))
|         {
|             ti.start(actorId);
|             am = qm.retrieveArtMaster(artMasterId);
|         }
|       }
|    }
|

Thanks

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065935
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.