This content has been marked as final.
Show 2 replies
-
1. Re: @CreateProcess and process id
pmuir Jul 2, 2007 6:31 AM (in response to szaccaria)The process isn't created until after the method completes so during the method the processId isn't available.
-
2. Re: @CreateProcess and process id
szaccaria Jul 2, 2007 8:04 AM (in response to szaccaria)"pete.muir@jboss.org" wrote:
The process isn't created until after the method completes so during the method the processId isn't available.
Any workaround idea for this? I must to retriew the processid from the db throught a variable that put in the context like dvd example of seam... public String cancelOrder() { em.refresh(order); if ( order.getStatus() != Status.OPEN ) { return null; } order.setStatus(Status.CANCELLED); JbpmContext context = ManagedJbpmContext.instance(); ProcessInstance pi = (ProcessInstance) context.getSession() .createQuery("select pi from LongInstance si join si.processInstance pi " + "where si.name = 'orderId' and si.value = :orderId") .setLong("orderId", order.getOrderId()) .uniqueResult(); pi.signal("cancel"); context.save(pi); return findOrders(); } ...
that i found in the ShowOrdersAction class?