3 Replies Latest reply on Aug 24, 2006 12:00 PM by kukeltje

    How can I add forms?

      Hello,

      what is the best way to add customized forms to a jbpm process?
      So far, I'm trying to build my forms as a java UI, but I've run into problems. I went along the TaskAssignment example from the jbpm.3_BRANCH_3_1 project that is included in the starters kit. The idea is that the AssignmentHandler calls my form, user enters data and the data is given back to the process.
      Since I wanted to use a diagram I built with the designer, I used the created gpd.xml file when creating the ProcessDefinition. It seems the parseXMLReader method skips the 'to' attributes of the xml file because I get a warning for each transition, although the 'to's appear correctly in the xml-file.
      At the end it also tells me that "token 'Token(/)' can't be signalled cause it is currently not positioned in a node". I used the same code as in the example, except the part mentioned above.
      Unlike the example, I'm not doing it as a JUnit TestCase, but after a quick look at the definition of TestCase that shouldn't lead to the mentioned problems.

      Any help would be appreciated.

      CU
      FLo

        • 1. Re: How can I add forms?
          kukeltje

           

          "mailinator" wrote:
          what is the best way to add customized forms to a jbpm process?


          For 3.1 by building your own webapp, for 3.2 there will be some functionality (if you search the forum, you will find more info)

          "mailinator" wrote:

          So far, I'm trying to build my forms as a java UI, but I've run into problems. I went along the TaskAssignment example from the jbpm.3_BRANCH_3_1 project that is included in the starters kit. The idea is that the AssignmentHandler calls my form, user enters data and the data is given back to the process.

          I would not make a 'task' in the assignmenthandler, I'd make a separate task before that to fill a variable which can be used by the assignmenthandler

          "mailinator" wrote:

          Since I wanted to use a diagram I built with the designer, I used the created gpd.xml file when creating the ProcessDefinition. It seems the parseXMLReader method skips the 'to' attributes of the xml file because I get a warning for each transition, although the 'to's appear correctly in the xml-file.
          ??? Mind that branches are not stable, releases are, what is the behaviour of 3.1.2?
          "mailinator" wrote:

          At the end it also tells me that "token 'Token(/)' can't be signalled cause it is currently not positioned in a node". I used the same code as in the example, except the part mentioned above.
          The same except...... so could there be an error in there? What do you do? Is there an error? What does the debug show (do not post to much)
          "mailinator" wrote:


          Unlike the example, I'm not doing it as a JUnit TestCase, but after a quick look at the definition of TestCase that shouldn't lead to the mentioned problems.

          Any help would be appreciated.


          Here you are.....
          CU
          FLo


          • 2. Re: How can I add forms?

             

            "kukeltje" wrote:
            ??? Mind that branches are not stable, releases are, what is the behaviour of 3.1.2?
            There are only two projects available in the import dialog: The above Branch and jbpm.db
            By the way, the processXMLReader method first didn't work at all until I added commons-logging-1.1.jar and dom4j-1.6.1.jar

            "kukeltje" wrote:
            The same except...... so could there be an error in there? What do you do?
            Well, it basically comes down to these lines:
            FileReader input;
            try {
             input = new FileReader("processes/eTravel/gpd.xml");
             ProcessDefinition processDefinition = ProcessDefinition.parseXmlReader(input);
             ProcessInstance processInstance = new ProcessInstance(processDefinition);
             Token token = processInstance.getRootToken();
             token.signal();
            } catch (FileNotFoundException e) {
             e.printStackTrace();
            }

            "kukeltje" wrote:
            Is there an error? What does the debug show (do not post to much)
            Well, as I said, I get complains from the XmlReader for each transition:
            24.08.2006 12:43:47 org.jbpm.jpdl.xml.JpdlXmlReader addWarning
            WARNUNG: process xml warning: node 'Travel Finished' has a transition without a 'to'-attribute to specify its destinationNode

            And at the end comes the exception:
            Exception in thread "main" org.jbpm.JbpmException: token 'Token(/)' can't be signalled cause it is currently not positioned in a node
            at org.jbpm.graph.exe.Token.signal(Token.java:118)
            at eTravel.ETravelMain.main(ETravelMain.java:22)


            Thanks for taking the time.

            CU
            FLo


            • 3. Re: How can I add forms?
              kukeltje

              version: Then you proably do something wrong. There are versions in cvs (and binaries on the normal download page!!)

              you refer to an error which could have it's origin in your process, can you post it?

              How does your code compare to the unittests that come with jbpm. Check that.