2 Replies Latest reply on Aug 26, 2013 6:27 AM by 1012716

    Using multiple gateway and parametric role together

    1012716

      Hello friends,   I have a two requirements. In first requiremenet I have to create multiple instances of a task/ interactive activity. I am doing this using multiple gateway using the clone(this) method. The second requirement is to assign each created instance to a separate user. Want to achieve this using parametric role.  The parameter in parametric role is calculated in multiple gateway. Also the same parameter is used to create the number of cloned copies. Please suggest if this the right appraoch. All bpmn notations are in the samw swimlane of parametric role. Also would a separate instance id/number be created for the instances created in/using multiple gateway. Thanks, Namit

        • 1. Re: Using multiple gateway and parametric role together
          Dan Atwood

          (this is a 10g question)

           

          Sounds like you already have this figured out, but your logic in your Multiple gateway will look something like this:

           

          participants as Participant[]
          role as Role = Fuego.Lib.Role(roleName : yourRole)

          participants = role.participants

          for each part in participants do
             copy = clone(this)
             copy.participant.next = part
          end

           

          Although it will work, not sure why you'd want to use a parametric role when all you really need to do is to pass in the name of a role (the string variable "yourRole" in the logic shown above). 

           

          Dan

          1 person found this helpful
          • 2. Re: Using multiple gateway and parametric role together
            1012716

            Hi Dan, Thanks for your suggestion. But my requirement won't be satisfied without using parametric role. The scenario is we have a role named 'RegionalEmployees' and being parametric it has 4 parameters viz east, west north, south. Now I create 4 different participants viz user1, user2, user3, user4  and assign each user a certain role, eg. user1 assigned to role RegionalEmployees.East in the process administrator. Now when the process is initiated I get an arrayList of region Names. For each regionName from the list I create an instance and that instance should be assigned to a parametric role of RegionalEmployees. Eg. if 'East' is one of the value of ArayList then the instance created for the same should get assigned to User1. I feel this can be achieved only though parametric role. Please find below code snippet used in mutiple gateway. this.regionArr.insert(@int : 0, value : "East"); this.regionArr.insert(@int : 1, value : "West"); this.regionArr.insert(@int : 2, value : "North"); this.regionArr.insert(@int : 3, value : "South"); logMessage("this.regionArr.length()******************** " + this.regionArr.length(), severity:Fuego.Util.Severity.INFO); for(int i=0; i< this.regionArr.length(); i++){ copy = clone(this); regionName = regionArr[i]; logMessage("region* PP******************* " + copy.report.regionName, severity:Fuego.Util.Severity.INFO); } The code snippet suggested by you would assign the newly created instance to the next participant avaialble in that role. But my requirement is to make that instance assignment conditional based on the region Name. Awaiting your vaulable feedback. Thanks, Namit