3 Replies Latest reply: Aug 14, 2013 2:43 AM by Sean Reardon-Oracle RSS

    Looping through the screen

    1001745

      Hi Experts,

       

      I have a requirement where we do not want to use screen flow and instead build appropriate logic in rulebase document.

       

      Original Requirement Detail: (Simple)

      Attribute_1 is shown to the user as drop down on a screen and available options in the drop down are "Form 1", "Form 2" and "Not Now". Suppose Attribute_1 is set with value "Form 1" then, user is taken to "Screen 1". Similarly if Attribute_1 is set with value "Form 2" then, user is taken to "Screen 2". Only if user selects "Not Now", investigation ends and user navigated back to "Summary" screen with outcome. If "Screen 1" or "Screen 2" rule fails, the investigation ends and user is navigated to summary screen.

       

      Modified Requirement that made things complex:

      After Attribute_1 is set with value "Form 1" then, user is navigated to "Screen 1" and after executing the "Screen 1" now it is expected to bring back to the screen with drop down where he can re-select "Form 2".

      Is is possible to loop check and bring the user back to the screen from where he selected this option?

       

      Thanks,

      Vinay

        • 1. Re: Looping through the screen
          Jasmine Lee-Oracle

          You first 'simple' example can be addressed with some procedural rules, e.g.

           

          the interview is complete if

          …..both

          …..…..the user selection = "Form 1" and

          …..…..the Form 1 data has been collected

          …..or

          …..both

          …..…..the user selection = "Form 2" and

          …..…..the Form 2 data has been collected

          …..or

          …..the user selection = "Not Now"

           

          the Form 1 data has been collected if

          …..it is known whether or not the person is happy

           

          the Form 2 data has been collected if

          …..it is known whether or not the person likes summer

           

          If you want the user to be able to investigate both Form 1 and Form 2 in the same interview session, then they cannot be selecting the Form from a drop-down list. A drop-down list associated with a variable (e.g. “the user selection” in the example above) represents a single value. It can’t be equal to both “Form 1” and “Form 2” in the same interview. If you need to offer the user the option of investigating both forms in the same interview, then I suggest using a Boolean for each. If you’re using a recent point release of OPA 10.4.x, then you could even make these Booleans checkboxes, e.g.

           

          Screen: Form Selection

          Does the user wish to investigate Form 1?.....[ ]

          Does the user wish to investigate Form 2?.....[ ]

           

          You don’t need to have a ‘not now’ option. If the user submits the screen without checking any boxes then you can interpret that as the user choosing not to investigate either of the forms.

           

          The associated procedural rule for this second example could be something like this:

           

          the interview is complete if

          …..either

          …..…..the user does not wish to investigate Form 1 or

          …..…..both

          …..…..…..the user wishes to investigate Form 1 and

          …..…..…..the Form 1 data has been collected

          …..and

          …..either

          …..…..the user does not wish to investigate Form 2 or

          …..…..both

          …..…..…..the user wishes to investigate Form 2 and

          …..…..…..the Form 2 data has been collected

           

          Cheers,

          Jasmine

          • 2. Re: Looping through the screen
            Jasmine Lee-Oracle

            For the form selection screen in the second example, you could simplify further by using free form text on the question controls in the screens file, e.g.

             

            Screen title: Form Selection

            Screen label: Please select the forms you wish to investigate:

            Boolean attribute with free-form text: Form 1 ..... [ ]

            Boolean attribute with free-form text: Form 2 ..... [ ]

             

            And you could simplify the procedural rule to this:

             

            the interview is complete if

            .....either

            ..........the user does not wish to investigate Form 1 or

            ..........the Form 1 data has been collected

            .....and

            .....either

            ..........the user does not wish to investigate Form 2 or

            ..........the Form 2 data has been collected

             

            Cheers,

            Jasmine

            • 3. Re: Looping through the screen
              Sean Reardon-Oracle

              For the "procedural loop" 2 options come to mind:

               

              1) You could have the original question on 2 screens. On the second screen you could use a screen attribute as the driver to get the screen to display (using procedural rules as outlined by Jasmine in her responses). The limitation of this is that it would only be able to bring you back to review the original answer once.

               

              2) there used to be an event supported out of the box which allowed you to "forget" the value of certain attributes. It's pretty dangerous and it was only in there because of some other issues which have long since been resolved so support was removed. But you could reimplement something similar and then get it to forget the screenattribute you have on the one and only screen you are collecting the form collection attribute. This would (potentially) allow you to revisit the question as many times as you like (assuming you have a clear procedural rule explaining the circumstances under which you would return).