4 Replies Latest reply on Jul 17, 2009 9:35 AM by tejjbpm

    JSF question

    tejjbpm

      How to get the task id in a JSF expression..i wanted to display the processinstance start time and task id.. and i was able to get the first one using #{processInstance.getStart} but could not get the task id..

      Is there any useful documentation on the web where I can have a look at the way to access JSF expressions in JBPM?

      Thanks

        • 1. Re: JSF question
          kukeltje

          jBPM3: JSF expressions are/can be limited because sessions can be closed since things are lazy loaded. Either create a custom bean that handles request and/or use e.g. seam.

          If e.g. the taskInstance is loaded and this is 'outjected' in jsf, taskInstance.id works.

          • 2. Re: JSF question
            tejjbpm

            Thanks Ronald. I have decided to write a custom bean to retrieive task details based on process instance id which I have.

            List listActiveTasks = jbpmContext.getTaskMgmtSession().findTaskInstancesByProcessInstance(processInstance);
            Long taskId = (((TaskInstance) listActiveTasks.get(0)).getId());
            


            This works fine if I dont have a fork in my process definition. If I have a fork the list has more than one task id..any idea to deal with the situation?


            • 3. Re: JSF question
              kukeltje

              Yes, just make sure you 'know' which task you have to use.... This 'knowing' is completely depending on your application design. e.g. storing a reference to the task in your domain model or vice-versa

              • 4. Re: JSF question
                tejjbpm

                yes..sorted..thanks for your pointers..