0 Replies Latest reply on Feb 16, 2007 3:04 PM by Dennys Fredericci

    Hibernate + LazyLoading + Custom Task

    Dennys Fredericci Newbie

      Hi!

      I have a problem with Customizing task instances...


      looked at UserGuide...

      Chapter 11. Task management

      11.10. Customizing task instances



      I implemented one Custom Task, but when the jbpm engine search a task instance

      JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
      TaskInstance taskInstance = (TaskInstance)
      jbpmContext.loadTaskInstance(id);
      



      the method loadTaskInstance return TaskInstance...

      it must have returned the CustomTaskInstance!!!



      Orinigal mapping...

      
       <class name="org.jbpm.taskmgmt.exe.TaskInstance"
       table="JBPM_TASKINSTANCE"
       discriminator-value="T">
       <id name="id" column="ID_"><generator class="native" /></id>
       <discriminator type="char" column="CLASS_"/>
      
      ....
      




      My solution mapping...

      
       <class name="org.jbpm.taskmgmt.exe.TaskInstance"
       table="JBPM_TASKINSTANCE"
       discriminator-value="T" lazy="false">
       <id name="id" column="ID_"><generator class="native" /></id>
       <discriminator type="char" column="CLASS_"/>
      
      


      set the property lazy to false....


      Thus to only obtain with that jbpm engine return CustomTaskInstance!!!


      A better way exists to make with that jbpm engine return CustomTaskInstance ??


      Tks!!!