1 2 3 4 Previous Next 53 Replies Latest reply on Jun 20, 2007 11:30 AM by gavin.king Go to original post
      • 45. Re: Seam jBPM: use annotation or pages.xml to get next task?

         

        "petemuir" wrote:
        Then wire it up
        <page view-id="/assignTask.xhtml" action="#{taskFinder.autoStart()}">
         <navigation>
         ...
         </navigation>
        </page>


        Thanks, sounds good, I'll give it a try.

        "petemuir" wrote:
        In fact, can you create a JIRA issue for both a task selector and a way of auto-starting tasks - we can probably wrap it up in @CreateProcess / create-process in pages.xml


        I'll keep you informed about my progress and will indeed file a feature request -- if only to provide means to document the stuff in the Seam manual ;-)

        Thanks,
        Arjan.

        • 46. Re: Seam jBPM: use annotation or pages.xml to get next task?
          kukeltje

          guys, what about jbpm being able to store a view-id in the processdefinition with a task? Currently jbpm has some forms.xml file which does kind of what is described here in the pages.xml.

          Besides that, afaik, jBPM 3.2 already is able to do something like autostart. I'll look into that tomorrow

          • 47. Re: Seam jBPM: use annotation or pages.xml to get next task?

             

            "kukeltje" wrote:
            afaik, jBPM 3.2 already is able to do something like autostart

            I could only find 16.4.8. task-node, which states:
            create-tasks - attribute - optional {yes|no|true|false}, default is true. Can be set to false when a runtime calculation has to determine which of the tasks have to be created. In that case, add an action on node-enter, create the tasks in the action and set create-tasks to false.

            end-tasks - attribute - optional {yes|no|true|false}, default is false. In case remove-tasks is set to true, on node-leave, all the tasks that are still open are ended.

            However, it defaults to true, according to the quote above, the source code and the XSD:
            <xs:element name="task-node">
             <xs:complexType>
             :
             <xs:attribute name="create-tasks" type="booleanType" default="true"/>
             <xs:attribute name="end-tasks" type="booleanType" default="false"/>

            So, setting this to true, which it already is, would not make much difference I guess. So: is this what you're referring to?

            Thanks,
            Arjan.

            • 48. Re: Seam jBPM: use annotation or pages.xml to get next task?

               

              "petemuir" wrote:
              Then wire it up
              <page view-id="/assignTask.xhtml" action="#{taskFinder.autoStart()}">
               <navigation>
               ...
               </navigation>
              </page>


              This works great for some process definitions, but I cannot get this to work with sub-processes.

              When I start some process that immediately delegates to some sub-process, then a ProcessInstance is injected, but TaskMgmtInstance#getTaskInstances() returns zero elements in the getSingleTaskInstance I posted earlier:
              @In ProcessInstance processInstance;
              
              public TaskInstance getSingleTaskInstance() {
               // BEWARE: THIS IS WRONG. This returns all the taskInstances
               // for the process instance, which includes task instances
               // that have already been completed previously.
               Collection<TaskInstance> taskInstances =
               processInstance.getTaskMgmtInstance().getTaskInstances();
              
               if (taskInstances.size() != 1) {
               log.error("Expected single task, found #0", taskInstances.size());
               return null;
               }
               return taskInstances.iterator().next();
              }


              So I guess jBPM simply has not created the sub-process yet. Debugging shows that the process instance is indeed the parent process instance at that point.

              As for the warning in the code above: I guess I should use getUnfinishedTasks(Token), or discard the finished tasks that getTaskInstances() returns.

              Arjan.

              • 49. Re: Seam jBPM: use annotation or pages.xml to get next task?
                gavin.king

                This is done in CVS, Brad, please try it out!

                • 50. Re: Seam jBPM: use annotation or pages.xml to get next task?

                   

                  "gavin.king@jboss.com" wrote:
                  This is done in CVS, Brad, please try it out!


                  Ok - it will take me a few days to review this issue and try this out.

                  Thanks,
                  Brad

                  • 51. tip: put this tip in the seam reference
                    koenhandekyn

                    gavin's tip is trivial when you see it but for starters it's not something that you immediately come up with.

                    i would advise to integrate this tip into the reference manual

                    koen

                    • 52. Re: Seam jBPM: use annotation or pages.xml to get next task?

                      the seam nightly builds are still 'stuck' on 06.14.2007 as the last build - any chance the nightly builds will resume being posted regularly?

                      Thanks,
                      Brad

                      • 53. Re: Seam jBPM: use annotation or pages.xml to get next task?
                        gavin.king

                        We're looking into it. CVS builds fine.

                        1 2 3 4 Previous Next