4 Replies Latest reply on Jan 10, 2011 7:05 PM by Kris Verlaenen

    Map between task to form

    Odelya Holiday Novice



      I am stuck with the question - how do I map from a task to a JSF form to be displayed when the user reaches the task?


      Or actually, how do I map between task to a java class that should handle it?

        • 1. Re: Map between task to form
          Kris Verlaenen Master

          By default, the jbpm-console will be looking for task forms (freemarker templates as described in the documentation) for all the tasks that need to be executed.  This task UI then simply calls the human task service with the necessary data whenever the user completes a task etc.


          If you don't want to use this approach but want to provide your own task forms using a different technology, you can always simply create your own UI that calls the necessary human task service methods whenever appropriate.  If you're happy with the jbpm-console but only want to extend the task form solution, that is also possible but will require a deep dive and quite some technical skills.  I suggest you try to catch me on irc to discuss this if you think this is the best approach.


          Not sure what you mean with a Java class having to handle a human task.  A human task represents a task that needs to be executed by a human.  If you want to specify an automatic task, you should probably use a service tasks aka work item node.  If you simply want to have your own java code handle human tasks instead of our human task service, you can simply create your own work item handler (java class) and register that for the "Human Task".



          • 2. Re: Map between task to form
            Odelya Holiday Novice

            I found that there is OnEntryAction and OnExitAction. They are not documented - however - can I use them to invoke any Java class? does it have to implement/extend any class?

            • 3. Map between task to form
              reza sadeghzadeh Newbie

              Hi Odelya,


              Did you find out any solution for this problem?

              I have the same issue, but I want to implement this mechanism in Liferay portal, but I don't know exactly how can I handle JSF page to show users when they are faceing with a human task in my liferay portlet?

              I know that there is a forms.xml file that store node and related forms that jbpm-console can display them to users but I didn't find a solution to i can implement in my application.


              any idea ?

              • 4. Map between task to form
                Kris Verlaenen Master

                On-entry / on-exit actions are like script nodes, just hidden.  Unfortunately, they are not defined in the BPMN2 specification.  I will be adding them as a custom extension though.  They can execute any java code you want.


                In general, your actions should be simple though, if you want to invoke some external services or similar, you probably want to model this as a service node aka domain-specific work item node.  Chech the documentation for a chapter on how to do that.  You can then register a handler for your work item, which is a Java class that can then do anything you want.