8 Replies Latest reply on Jan 7, 2013 6:29 PM by Tihomir Surdilovic

    Jboss Guvnor JBPMN process variable

    priyag gupta Newbie

      Hi all,

       

      I wish to make a JBPM process using guvnor. I am able to design the process but I am not aware as how to define and associate process variables with the process. Because of this my form is coming blank when I generate it for user tasks. Can someone share some information on how to do this.

        • 1. Re: Jboss Guvnor JBPMN process variable
          Tihomir Surdilovic Master

          1. Click on any white area of your canvas, the properties section on the right side should have title: Properties (BPMN-Diagram)

          2. Open the properties section

          3. Expand if needed the "Extra" section of your properties

          4. Find the "Variable Definitions" property and click on the arrow at the end of the input box - this will open the variable definition editor

           

          sc2.png

          5. Click on "Add Variable":

          sc1.png

          6. Enter your process variable name, and select either a standard type (optional) or a Custom type (optional). If you don't select anything it will default to Object type.

          7. Add more if process vars if needed.

           

          HTH

          • 2. Re: Jboss Guvnor JBPMN process variable
            priyag gupta Newbie

            Hi Timhomir,

             

            Thanks for your reply. I have created some simple variable using this variable definition. Now I want to know how these variables can be associated with form on user tasks in process. I am attaching the image of my process. On start of process I want that form generated should have all this variables that I have defined as process variables like Name, Age, salary, grade. How can I do this. Also I need this on my user step i.e. Accounting approval.

             

            Regards

            Priya

            • 3. Re: Jboss Guvnor JBPMN process variable
              Tihomir Surdilovic Master

              You have two options, one is to use Designer to generate your process and task forms for you, for that click on the:

               

              button-create-task-forms.png

               

              in the navbar. You can then edit your process and task forms in Designer as well, for that see: http://surdilovic.wordpress.com/2012/08/06/process-and-task-form-editing-in-jbpm-designer/

               

              HTH

              • 4. Re: Jboss Guvnor JBPMN process variable
                priyag gupta Newbie

                Thanks. This link is very useful. Now I have 2 more doubts:

                 

                1. We defined process variables which was used on form. This is fine. But for user workstep do we need to define again the variables in DataInputset and DataOutputset or do we have selection wizard available for these field from process variables.

                 

                2. Apart from defining variables in designer (as shown in above demo) if I have already uploaded a POJO model and set it in my working set, can I use these variables in form? How to do this? Is there some demo or document available for doing so?

                • 5. Re: Jboss Guvnor JBPMN process variable
                  Tihomir Surdilovic Master

                  1. Tasks have local data inputs and data outputs (BPMN2 spec). You have to map process variables / data objects to Task data inputs and also if needed map Task data outputs back out to process variables / data objects.

                  jBPM Designer also has an intuitive data input / output editor similar to the process variables editor which you can use to visualy do the mappings

                   

                  2. Process variables, data objects, data inputs/outputs can have a type. This can be a custom type (type of your spefic class) as well, so you should be able to use that in a form.

                   

                  HTH

                  1 of 1 people found this helpful
                  • 6. Re: Jboss Guvnor JBPMN process variable
                    priyag gupta Newbie

                    Thanks Tihomir. This worked. I am able to map process variables and generate forms now. Now I want to use rules inside my process. Do we have some demo of how to configure rule task in a process.

                    • 7. Re: Jboss Guvnor JBPMN process variable
                      Hugo Borda Newbie

                      Tihomir, I have related questions to this topic and that is "Is it possible to map to a Java collection of some fashion?"  My process has a lot of variables and instead of creating individual variables I would like to create a key/value collection.  I could not find an example of assign to a particular element in a collection, could you please tell me if that is even possible?

                       

                      Regards, Hugo

                      • 8. Re: Jboss Guvnor JBPMN process variable
                        Tihomir Surdilovic Master

                        It is possible but the current task/subprocess/data object mapping support in the tooling is not really good for dealing with collections and the runtime support for transformations can be improved. I am revising data mappings at the moment so hopefully can address most issues soon in Designer. Workaround currently is to use single value types in data mappings and then populate the process variable (collections) via script tasks.

                         

                        HTH