[jboss-user] [jBPM] - Re: JBPM 5 Question On Mulitple Instances Node

Zeliang Huang do-not-reply at jboss.com
Wed Nov 2 05:57:43 EDT 2011


Zeliang Huang [http://community.jboss.org/people/ossa] created the discussion

"Re: JBPM 5 Question On Mulitple Instances Node"

To view the discussion, visit: http://community.jboss.org/message/634571#634571

--------------------------------------------------------------
Hi Maciej,

thanks for the insight. I think option 1 is exactly what I was looking for. 

I only know of one way to find and cancel other user tasks. below is my code. Is there other better to achieve this? Any help is appreciated. thanks !

|  |  | EntityManagerFactory emf = Persistence |
|  |  |  |  | .createEntityManagerFactory("org.jbpm.task"); |

|  |  | Query q = emf.createEntityManager().createNamedQuery( |
|  |  |  |  | "PreviousTaskByProcessInstancdId"); |
|  |  | q.setParameter("processInstanceId", new Long("2080")); |
|  |  |  |
|  |  |  |
|  |  | List<Task> i = q.getResultList(); |
|  |  | TaskClient client = new TaskClient(new MinaTaskClientConnector( |
|  |  |  |  | "YetAnotherClient", new MinaTaskClientHandler( |
|  |  |  |  |  |  | SystemEventListenerFactory.getSystemEventListener()))); |
|  |  | client.connect("127.0.0.1", 9123); |
|  |  | BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler(); |
|  |  | for (Task t : i) { |
|  |  |  | client.skip(t.getId(), "Administrator", responseHandler); |
|  |  | } |
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/634571#634571]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111102/618f783a/attachment.html 


More information about the jboss-user mailing list