3 Replies Latest reply on Feb 3, 2013 1:46 PM by simholte

    WorkItem definition paramater and process variable mapping in Designer

    simholte

      Hello,

       

      I'm trying to create a custom work item definition and map process variables to the paramaters.  But if the name of the process variable doesn't match the name of the WI paramater the BPMN2 file created has an incomplete dataInputAssociation.

       

      WI definition:

       

      import org.drools.process.core.datatype.impl.type.StringDataType;

      [

         [

          "name" : "Log",

          "parameters" : [

            "Message" : new StringDataType()

          ],

          "displayName" : "Log",

          "icon" : "http://localhost:8080/drools-guvnor/rest/packages/ebtsx/assets/defaultlogicon/binary"

        ]

      ]

       

      Variable definition:

      msg:String

      Untitled2.jpg

      Assign the Paramater of the WI to the variable.

      Message->msg

      Untitled3.jpg

       

      Click on "BPMN2"

      <bpmn2:dataInputAssociation id="_JYTDp2muEeKEtcYn_A4DTg">

              <bpmn2:sourceRef>Message</bpmn2:sourceRef>

      </bpmn2:dataInputAssociation>

      Untitled.jpg

       

      You can see that the dataInputAssociation is incomplete.  I attached the bpmn2 file.

       

      I'm sure I'm doing something wrong so if someone could point me down the correct path I would appreciate it.

       

      Guvnor version 5.4

      Designer version 2.4

      JBOSS AS7

        • 1. Re: WorkItem definition paramater and process variable mapping in Designer
          kornilovs

          Try write  #{msg} in colomn "To Value", if you want set  String "msg" to you Service Task.

          If you want Get parameters from service task add "results"

            [

              "name" : "GetConstant",

              "parameters" : [

              "ReqType" : new StringDataType(),

              "Name"    : new StringDataType()

              ],

              "results" : [

                  "Result" : new UndefinedDataType()

              ],

              "category" : "Const",

              "displayName" : "GetConstantByName",

              "icon" : "..."

            ],

          • 2. Re: WorkItem definition paramater and process variable mapping in Designer
            tsurdilovic

            In your exampel "Message" is a data input of your task and in your data input assignments you want to map an existing process variable or a data object to it, not the other way around; your data input assignment should be "msg is mapped to Message".

             

            HTH

            • 3. Re: WorkItem definition paramater and process variable mapping in Designer
              simholte

              Well that just makes too much sense.  I was reading it like a parameter assignment of a method since the WI parameter Data Inputs are prepopulated on the left hand side of the equation.  But I need to think of it as a mapping interface and my WI parameters as variables that only have scope within that particular node.

               

              Thanks for clearing this up and taking the time to answer my question.