8 Replies Latest reply on Feb 6, 2013 7:59 AM by shahdhaval2020

    JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId

    priyakpandey

      Hi,

      Do i get TaskId of a human task in 'On Entry Actions'? How?

      Please help. This is kind of important. If i get taskId in 'On Entry Actions' then it would be helpful for my implementation.

      Thanks in advance

        • 1. Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId
          krisverlaenen

          You can't get it from the on-entry action, as the task simply doesn't exist yet at that point, sorry.

           

          Kris

          • 2. Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId
            priyakpandey

            Thank you for your reply.

            Will try other options

            • 3. Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId
              whizkid.samrat

              I am facing the same problem .

               

              Kindly suggest the best way to retrieve the taskID . Getting tasks by users seem like an unsure method as the processInstance can have multiple active tasks allocated to the same user at the same time.

               

              Help is requested

              • 4. Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId
                krisverlaenen

                Could you describe what you are trying to do? Where do you need to the task id and what would you use it for?

                 

                Kris

                • 5. Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId
                  whizkid.samrat

                  sure thing ,

                   

                  The jbpm5 Api suggests that to complete a task allocated to a user (in order to move the flow forward) i need to have a taskId.

                   

                      public void complete( long taskId, String userId, ContentData outputData,TaskOperationResponseHandler responseHandler );

                   

                  We are making a tender approval flow with human approvals, so as soon as a task is assigned to an approver , we want to capture the generated task id and current assignee and persist those along with the model data in our own tables, so as soon as the current assignee (Approver) takes an action, i would immediately know the taskID and hit the API , thus I need not bother about taskLists and fetching tasksAllocated to a user.

                   

                  The second thought is , Task object is internal to jbpm & contains nothing specific to the object (Model) on which the workflow is running , so even if a get a list of tasks allocated to a user, would it not require a seperate logic to identify which taskId corresponds to which process flow  ?

                   

                  Hence the question.

                   

                   

                  Maybe I am missing the point somewhere ,  a nudge in the right direction is appreciated

                  • 6. Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId
                    priyakpandey

                    I need task Id for application Integration purpose.

                     

                    I have an application which has its own portal and Process Creation/Task Completion etc. on JBPM is done using ReST calls to jbpm server.

                    My application has its own view and displays the information in its own way. This application needs to store the taskId so that it can fetch the task data/details from jbpm as required.

                    • 7. Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId
                      wtimpany

                      I am not sure if this will be of use, but we do a similar thing. 

                       

                      We create a relation between a "Human Task" and our own Application Model.  Since the Task ID does not exist before the Task is persisted, we pass our own Model Object ID to the Task.  I did not want to extend the Task Object to hold our FK, so I decided to use the "Priority" field in the Task to store the reference (this may have to change in the future if we need to use priorities).     The reason for not extending the Task, was that I wanted to use the vanilla JBPM code.

                       

                      We have a Script Task before the Human Task to inject our Model FK ID into the context, then use this context variable in the Task.

                       

                      Script Task: not the real code but it gives the idea.

                        // -- getBeanId returns Integer

                        kcontext.setVariable("myExternalModelID", MyExternalModelBean.getBeanId() );

                       

                      Human Task:

                        Priority property: #{myExternalModelID}

                       

                      Doing it this way alows us to then Join our Model Bean to the JBPM Task:  MyExternalModelBean.beanId == Task.priority

                      • 8. Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId
                        shahdhaval2020

                        Hi All,

                         

                        i want to make user registartion form in JBPM 5 ,need an help on how to make this example .Any link or example on it would be a great help.