7 Replies Latest reply on Feb 26, 2007 3:44 AM by Olivier Debels

    De-Persistence problem with Node?

    Pablo Ramero Newbie

      I'm using jBPM 3.1.4, Weblogic 8.1, Hibernate 3.2.2.

      I stored the following test process definition:

      <process-definition name='"joe"'>
       <start-state name='start'>
       <transition to='s' />
       </start-state>
       <task-node name='myTaskNode'>
       <transition to='end' />
       </task-node>
       <end-state name='end' />
      </process-definition>
      


      Then created an instance, and signaled() it once.

      I then (later, in a different jbpmContext) do the following:

       ProcessInstance pi = context.loadProcessInstance(215);
      
       Token tok = pi.getRootToken();
      
       Node n = tok.getNode();
      
      
       System.out.println(n.getName());
       System.out.println(n.toString());
       System.out.println(n.getClass().getName());
      
       TaskNode n = (TaskNode)t2.getNode();
      


      The output of the three System.out.println()s is:

      myTaskNode
      TaskNode(myTaskNode)
      org.jbpm.graph.def.Node$$EnhancerByCGLIB$$92204161
      


      Which is immediately followed by:

      java.lang.ClassCastException

      Which is obviously because the class "org.jbpm.graph.def.Node$$EnhancerByCGLIB$$92204161" cannot be cast to a TaskNode.

      But how come the task knows it's a tasknode but isn't? I say it knows it is a task node, because it's toString() method returns "TaskNode(myTaskNode)".