2 Replies Latest reply on May 30, 2012 3:24 AM by bhaskarven

    Reading User Form Variables

    bhaskarven

      I have a question regarding the User Forn variables. I was under the impression that freemarker template (ftl)

      files have to be created for user forms. But I was able to run the HelloProcess example discussed in this forum.

      I believe the XML code creates the user interface form.

       

      1. I tried to read my own ftl file by changing the TaskName property in the XML. I have the Hello.ftl deployed

          in the resources directory of the project as I have seen it in an example. But it does not display my form.

          It is still reading the hardcoded contents in the XML

       

        <dataInputAssociation>
          <targetRef>_4_TaskNameInput</targetRef>
          <assignment>
            <from xsi:type="tFormalExpression">Hello</from>
            <to xsi:type="tFormalExpression">_4_TaskNameInput</to>
          </assignment>
        </dataInputAssociation>

       

      2. I see a complete button to submit the form. But that is not harcoded anywhere in the XML. Where does it come

          from ? The XML file of the BPMN diagram is attached for your reference.

       

      I would like to read my own ftl files rather than hardcoding the contents in the XML. In the Developers Guide I saw

      an example where the ftl file is included in the XML with the following construct. But I do not have any examples

      on that usage of how input/output is done through the form.

       

          <userTask id="requestVacation" name="Request Vacation"
            implementation="other">
           <potentialOwner resourceRef="user" jbpm:type="group">
              <resourceAssignmentExpression>
                <formalExpression>user</formalExpression>
              </resourceAssignmentExpression>
            </potentialOwner>
            <rendering id="requestForm">
              <jbpm:form>org/jbpm/examples/bpmn/usertask/taskform/request_vacation.ftl</jbpm:form>
            </rendering>
          </userTask>

       

      Your response will be highly appreciated.

        • 1. Re: Reading User Form Variables
          swiderski.maciej

          Developers guide that you refer to is for v4 which introduced early support for BPMN2 but it is not developed any more. To get more details about task forms in jBPM5 have a look at documentation.

           

          I am not sure I completely follow what you are trying to achieve here. As task forms are used to complete the task instance not to initialize it. If you are looking for a way to initialize userTask data inputs you can refer to process variables that can be set either on process instance start (using process form) or by any other task that has been already completed.

           

          HTH

          1 of 1 people found this helpful
          • 2. Re: Reading User Form Variables
            bhaskarven

            Thanks for the clarification. There was another example which guided me on how to use the ftl forms.

            Since there are different ways to do the same thing ( using Java code, hardcoding in XML, using UI forms )

            I was a bit confused. Thanks to this example I was able to download and run it.

             

            https://community.jboss.org/people/bpmn2user/blog/2011/02/21/jbpm5-example-for-forms-with-variables

             

            Thanks to bpmn2user for the excellent example and the explanations.