0 Replies Latest reply on May 16, 2011 9:31 AM by Robert Morse

    JBPM for Dummies

    Robert Morse Apprentice

      I'm trying to get a relatively simple workflow process to work under Seam 2.2.2.FINAL, JBoss AS 5.1.0.GA, and PrimeFaces 1.1.  What follows is a brief description of what I'm trying to solve:
      I'm capturing information for a rather lengthy credit application which is composed of 30 or so input screens.  At the time of entry, the data entry person may not have all of the available
      information, so there is an option to save an incomplete application.  This action starts the workflow process which places information about the application in a general pool.  Another user
      may select the application from the pool and finish entering the application.  Once completed, it moves on to several other steps.

      Saving the incomplete application and beginning the business process in JBPM works just fine.   I have a UI screen that allows a user to select an application from the pool and place it in
      their individual pool.  This also works.   The bulk of the code to do this is taken from Chapter 14 Managing the Business Process, in SIA.

      I am only placing the id of the application in the business process.   The problems arise when a user wishes to retrieve the application and make changes to it.  Initially, I had a method
      annotated with @BeginTask that would retrieve the ID, and use it to retrieve the application.  It would then redirect to the appropriate view id.   This worked, but I noticed that the UI
      was significantly slower.   Not just a little bit, but an order of magnitude slower!  To get around this, I removed the @BeginTask annotation, and instead found the Task by traversing The
      the JbpmContext that I now injected into my Seam POJO component.  This worked, and eliminated the drastic slow-down in the UI.  However, the injection of the JbpmContext now causes a

      JbpmContext may only be used inside a transaction

      exception.  This exception appears to be benign, but I'm obviously doing something wrong.

      The most troubling issue I'm facing is when I try to end a task.  As before, I find the appropriate task in the JbpmContext, and then attempt to end it and specify the transition.  This
      causes a:

      org.hibernate.LazyInitializationException: could not initialize proxy - no Session
           at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:86)
           at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:140)
           at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
           at org.jbpm.taskmgmt.def.Task_$$_javassist_144.getTaskNode(Task_$$_javassist_144.java)
           at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:415)

      I'm obviously doing something very wrong, and would appreciate any pointers on how to avoid these exceptions.