JBoss Community

Re: JBPM 5 Question On Mulitple Instances Node

created by Zeliang Huang in jBPM - View the full discussion

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

Start a new discussion in jBPM at Community