5 Replies Latest reply on Dec 4, 2007 10:29 AM by Jasmin Charbonneau

    how to specify routing depending on radio button selection

      Hi,

      I have a business requirement like I have two radio buttons namely
      1)Accept
      2)Decline
      If the user selects "Accept" radio button, the form should get routed to some "x" user or else
      If the user selects "Decline" radio button, the form should get routed to some "y" user.
      In my process designer I have two routes, i.e, one is pointing user "x" and the other is pointing user "y".

      now help me how to specify a condition to achieve the above routing.

      I am using a xfaForm variable that points to an XDP in the repository to render my document.
      here I also need to define a variable for radio button, so under Variables view which "Type" I need to select..? i.e, whether it should be a "boolean" or "string", plz suggest me..!

      regards,
      sudheer.
        • 1. Re: how to specify routing depending on radio button selection
          Jasmin Charbonneau Level 4
          You don't even need an extra variable. On the route that points to "x" you can add a condition and check the value of the radio button directly from the xfaForm variable using an xPath expression like:

          /process_data/xfaFormVar/object/data/xdp/dataset/data/MyNode/MySubNode/AcceptCheckBox

          if the value equals to the "on" value of your check box, it'll follow that route, otherwise it'll follow the route pointing to user "y".

          Jasmin
          • 2. Re: how to specify routing depending on radio button selection
            Level 1
            thanx a lot Jasmine.

            but I still have a routing issue like,
            I have 3 users namely, 1)A 2)B 3)C.
            User "A" will submit the form and it will get routed to user "B".Here I have the business requirement like if the user "B" selects "Accept" radio button then the form will get routed to user "C",but if the user "B" selects "Decline" radio button then the form should get routed to user "A"(my form contains 2 radio buttons i.e, Accept and Decline).

            I can able to achieve this upto the front flow like
            1) A--> B(Accept) --> C
            but I can't able to route the form back to user "A" once user "B" selects "decline" radio button.
            2) 1) A--> B(Decline) --> A.
            Here the user "A" can be anyone who logs-in, and once the user "B" selects "decline" radio button, then the form should get routed to the corresponding user who submits the form.

            my process designer looks like as follows:
            setValue --> user-"B" (Accepts)--> user-"C".

            kindly help me in resloving this issue.

            thanks and regards,
            sudheer.
            • 3. Re: how to specify routing depending on radio button selection
              HowardTreisman Level 1
              Hi Sudheer
              This should be quite straight forward.
              Coming out of B, you have two routes, X and Y. X has a condition on it that is only true if the user selects "Decline". Make sure that the evaluation order is X, then Y.
              X goes to a User step, with the Initial User set to "Creator".
              Y goes to a User step, with the Initial User set to C.
              Howard
              http://www.avoka.com
              • 4. Re: how to specify routing depending on radio button selection
                Level 1
                thanx Howard..!

                but I do have one more problem here i.e, there are two routes X and Y,here I specified a condition for the route X as follows:

                expresion1:
                /process_data/xfaFormVar/object/data/xdp/dataset/data/MyNode/MySubNode/AcceptCheckBox

                expression2:
                "On"

                for the route Y I have not specified any condition.
                I deployed with the above conditions but my form is always routing to user "C" whether if I select Accept or Decline.

                if the condition that I specified is incorrect, please help me how to go for a condition here.

                Note : I am using checkboxes for Accept and Decline fields not radiobuttons.

                regards,
                sudheer.
                • 5. Re: how to specify routing depending on radio button selection
                  Jasmin Charbonneau Level 4
                  Is this expression valid?:
                  "/process_data/xfaFormVar/object/data/xdp/dataset/data/MyNode/MySubNode/AcceptCheckBox"

                  I gave you an example with MyNode/MySubNode/AcceptCheckBox but it needs to correspond to the structure of your form.

                  Are you sure you're evaluating the right xPath expression that corresponds to the checkbox name on your form?

                  If you're not sure you can use /process_data/xfaFormVar/object/data/xdp/dataset/data//NameOfCheckbox where you need to replace xfaFormVar with your variable name and NameOfCheckbox with the name of your checkbox. The // notation will do a search in the whole XML structure.

                  Jasmin