7 Replies Latest reply on Nov 16, 2007 4:50 AM by Pete Muir

    Problems understanding Seam's jBPM support

    Marcus Schmidke Newbie

      Hello all,

      I'm writing a Seam application which even uses jBPM for some simple business process.

      I have no problems using jBPM itself, but since I am using Seam, of course I want to use all benefits Seam gives to me, so I tried to understand chapters 7.3ff of Seam documentation, but there is still one big question:

      Which is the suggested way to work with jBPM objects in my own code? Mainly, how should I create the JbpmContext?

      Usually, I write:

      @In
      private org.hibernate.Session session;
      ...
      JbpmConfiguration config = JbpmConfiguration.getInstance();
      JbpmContext context = config.createJbpmContext();
      context.setSession(session);
      ProcessInstance pi = context.loadProcessInstanceForUpdate(72150L);
      ...
      context.close();
      


      This is the normal jBPM way. Is there also a seam improved way? For example, by injection?

      What about JbpmContext lifecycle? May I hold it in a SFSB Seam component field? (Can it be passivated?)

      In my SFSB, I use extended Hibernate Sessions as suggested by Seam:
      @Create
      @Begin(flushMode = FlushModeType.MANUAL)
      public void create() {
      }
      @End
      public String actionButton() {
       session.flush();
       return "startseite";
      }
      


      How can I combine this best with jBPM?

      Any suggestions?


      Marcus.