[jboss-user] [JBoss jBPM] - Checking for RuntimeActions in GraphElement

RAlfoeldi do-not-reply at jboss.com
Thu Nov 30 12:21:43 EST 2006


Hi everybody,

I'm back at hacking a jBPM App and I've just run into my favorite topic:

Is it possible that the 


  | GraphElement
  | 
  | List getRuntimeActionsForEvent(ExecutionContext executionContext, String eventType) {
  |     List runtimeActionsForEvent = null;
  |     List runtimeActions = executionContext.getProcessInstance().getRuntimeActions();
  |     if (runtimeActions!=null) {
  |       Iterator iter = runtimeActions.iterator();
  |       while (iter.hasNext()) {
  |         RuntimeAction runtimeAction = (RuntimeAction) iter.next();
  |         // if the runtime-action action is registered on this element and this eventType
  |         if ( (this==runtimeAction.getGraphElement())
  |              && (eventType.equals(runtimeAction.getEventType()))
  |            ) {
  |           // ... add its action to the list of runtime actions 
  |           if (runtimeActionsForEvent==null) runtimeActionsForEvent = new ArrayList();
  |           runtimeActionsForEvent.add(runtimeAction.getAction());
  |         }
  |       }
  |     }
  |     return runtimeActionsForEvent;
  |   }
  | 

isn't really what you want?

If you debug it you will (sometimes) have the situation that thisis a straight forward Java Object and runtimeAction.getGraphElement() resolves to a Node$$EnhancerByCGLIB$$xxxxx. Both objects represent the same node (same id, the CGLIB even refs to the 'this' instance in its 'target' field.... but '==' obviously fails.

Am I missing something? Bug? Jira? Help?

Greetings from Bern



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

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



More information about the jboss-user mailing list