4 Replies Latest reply on Jul 4, 2006 11:13 AM by Ivaylo Kabakov

    Seam + jbpm to create a wizard?

    Ivaylo Kabakov Newbie

      Hi all!
      First of all, thanks for Seam! It's wonderful and the more I use it, the more I enjoy it! :)

      Now I am trying to put something up using seam + jbpm, but I'm kinda stuck with trying to create a wizard-like connected pages/tasks.
      What happens is the process instance gets 'reset' so don't have the current taskId when moving through pages.

      I saw a topic here, some time ago, asking the same question (just couldn't find it right now) and the proposed solution was to start a conversation in order to keep the components. Well, I *am* in a conversation, but the same thing happens. Is there something specific that should be done? And, generally, is it possible/good idea to create a wizard style dialog with jbpm?

      Any tips/hints/suggestions/ideas about how it should be done are appreciated. Thanks!

        • 1. Re: Seam + jbpm to create a wizard?
          Gavin King Master

          Process and task ids are only propagated inside the scope of a conversation. That's why @BeginTask begins a conversation and @EndTask ends one.

          But note that neither @ResumeProcess nor @CreateProcess begin conversations. (By the way, @ResumeProcess will be massively improved, once I can get a feature request for "entity-driven processes" done in jBPM, so this is not yet perfect.)

          So the answer is:
          (1) make sure you have started a conversation
          (2) make sure it is being propagated

          • 2. Re: Seam + jbpm to create a wizard?
            Ivaylo Kabakov Newbie

            Thank you very much for your response, Gavin!

            I managed to get it working, but there's still a point I'm missing to get things clear. What I aimed at was a conversational stateful bean which controls the 'wizard'. So, I have a method which creates the process and a couple of methods which end the tasks according to the steps in the wizard. However, if annotate the methods with @EndTask, the stateful conversational bean gets destroyed. I assume that's because the end task ends the current conversation. Is there a way to avoid it?

            One more question - is it possible, using the seam integration, to create a process and start a task at the same time, i.e. in the same method? In the method annotated with @CreateProcess I don't have the first taskId and the only way to do it seems to implement the org.jbpm.graph.def.ActionHandler.execute() method and get the taskId from th? ExecutionContext argument, but I'm not sure it's quite elegant way to do it. Is there something I'm missing or I'm just not grasping the idea properly?

            Thanks again!

            • 3. Re: Seam + jbpm to create a wizard?
              Gavin King Master

              The component named "businessProcess" gives you an API for controlling all these things independent of conversations. But you will have to use current CVS, since this API did not make it into 1.0.1.

              Take care, I do not make any promises about the stability of CVS from day to day.

              • 4. Re: Seam + jbpm to create a wizard?
                Ivaylo Kabakov Newbie

                OK, I'll keep an eye on CVS changes.
                Thank you!