5 Replies Latest reply on Jul 20, 2009 8:39 AM by manish hotwani

    JBPM 4 task form examples

    manish hotwani Newbie

      Hi,

      Can anyone please post some material/link on how to use form templates with tasks in jbpm 4. I need to associate different UI pages with the different tasks of a process. I tried googling but couldn't get much help. There is an example on taskforms in the jbpm examples but i couldn't run it.
      I am new to jbpm and any help on this would be appreciated.

        • 1. Re: JBPM 4 task form examples
          Ronald van Kuijk Master

          Have you seen the sticky post at the top? It mentions several other things to search besides google. E.g. the jira....

          https://jira.jboss.org/jira/browse/JBPM-2423

          • 2. Re: JBPM 4 task form examples
            manish hotwani Newbie

            I had seen that issue before. Actually the problem is that I haven't deployed the examples because I am using tomcat and not jboss(and I couldn't configure the jbpm examples to run on tomcat). I just ran the junit test cases in eclipse.
            I have built a simple process and I want to manage the states/variables associated with the process instance through a web interface (the web project is to be deployed on tomcat and not jboss).
            The task form example shows how to access the process variables in the ftl file and how to associate an ftl file with a task. But I need to know how to use this ftl file (associated with a task) to render on the UI when the process is executing that task.

            • 3. Re: JBPM 4 task form examples
              Ronald van Kuijk Master

              That is in the jbpm4 console source (the form plugin interface and the form plugin)

              • 4. Re: JBPM 4 task form examples
                manish hotwani Newbie

                Thanks kukeltje for pointing that out. I tried implementing it but I am getting the error "Task form resource 'task1.ftl' does not exists. The ftl file (task1.ftl) is in the same package as process definition file.
                I tried importing the file in 2 different ways :

                - <task g="338,58,177,52" name="...." swimlane="..." form="task1.ftl"> ...
                - <task g="338,58,177,52" name="...." swimlane="..." form="com/test/jbpm/process/task1.ftl"> ...

                but I am getting the same error in both the cases.

                I believe that the process definition and the content of the ftl file are stored in the jbpm4_lob table (at the time of the deployment of the process) in the form of a blob. But in my case only the process definition is getting stored in the jbpm4_lob table.

                Do you have any idea on what could be the reason behind the form resource file not getting loaded?

                • 5. Re: JBPM 4 task form examples
                  manish hotwani Newbie

                  I figured out the reason why the ftl file was not getting loaded.

                  I was under the impression that RepositoryService would load the task form resources on its own when it encounters them in the process definition. But the fact is that every resource has to be explicitly loaded using the NewDeployment#addResourceFromClassPath() method.

                  My mistake. Sorry for that question.