1 Reply Latest reply: Jun 1, 2012 5:56 AM by Ben Rogers RSS

    User answered question vs. rulebase determined answer

    887112
      Is there a way to tell within OPA whether a question was answered by the user instead of by a rule?

      I am controlling the screen flow by checking if an attribute has been answered but a requirement came up to automatically answer every question on this particular page with rules, but they still want the page to be displayed to the user for them to change the answers to these questions.
        • 1. Re: User answered question vs. rulebase determined answer
          Ben Rogers
          Hi
          You could use either a shortcut rule, or use a Dynamic Default Value on the screens.
          Either way, you need to declare a "mirror" attribute for each question.
          Such as:
          the person's age (the true base attribute)
          the person's suggested age (the value which you want to be pre-populated).

          So either you will have a shortcut rule:

          Shortcut rule
          the person's age = the person's suggested age

          Then you can do whatever you like for the person's suggested age rule...

          the person's suggested age = YearDifference(the person's date of birth, the current date)... etc...

          The shortcut rule will set the base attribute to the suggested age automatically. When you navigate to the screen, it will be pre-populated with the value of suggested age.

          Or, you could use a Dynamic Default Value. When you put "the person's age" on a question screen, select the Dynamic Default Value to "the person's suggested age"

          I would say the Dynamic Default Value option is more appropriate, as then you will be able to differentiate in the debugger etc which questions have definitely been asked and confirmed by the customer on a screen. With the shortcut rules, you can't tell at any point in time if it was the customer who confirmed it, as it is always set by the rule as soon as the rulebase loads up.

          Hope this helps!
          Ben