[jboss-user] [JBoss Seam] - Re: @CreateProcess and process id

szaccaria do-not-reply at jboss.com
Mon Jul 2 08:04:16 EDT 2007


"pete.muir at 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?

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

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



More information about the jboss-user mailing list