def create():
     return Input(
         Grammar(
             watson_items=[
                 "Go back",
                 "$ back",
                 "$ previous",
                 "$ prior"
             ]
         ),
         children=[
             PageAction.set_to_previous(),
             Action("Show_Previous", operator="SET_TO_YES"),
             If(
                 elements=[
                     Condition(name="Current_Index", operator="EQUALS", root_text="10"),
                     Output(
                         prompt=Prompt(items=["Those were the first results"]),
                         children=[Goto(ref="profileCheck_2503183")]
                     )
                 ]
             ),
             Output(
                 prompt=GenericPrompt.ok(),
                 children=[
                     Output(
                         prompt=Prompt(
                             items=[
                                 "\"{Search_Now:\"{Search_Now}\", Style:\"{Style_Preference}\", Rating:\"{Color_Preference}\", Index:\"{Current_Index}\", Page:\"{Page}\"}\""
                             ]
                         ),
                         children=[
                             Action(var_name="Last_Results", operator="SET_TO_NO"),
                             GetUserInput(
                                 children=[
                                     Input(
                                         Grammar(watson_items=["UPDATE CURRENT_INDEX"]),
                                         children=[
                                             Action(var_name="Show_Next", operator="SET_TO_NO"),
                                             Action(var_name="Show_Previous", operator="SET_TO_NO"),
                                             If(
                                                 elements=[
                                                     Condition(name="First_Results", operator="EQUAL_TO_YES"),
                                                     Output(
                                                         prompt=Prompt(items=["Those were the first results"]),
                                                         children=[Goto(ref="getUserInput_2503174")]
                                                     )
                                                 ]
                                             ),
                                             If(
                                                 elements=[
                                                     Condition(name="Current_Index", operator="EQUALS",
                                                               root_text="10"),
                                                     Output(
                                                         prompt=Prompt(items=["Here are the first results"]),
                                                         children=[
                                                             Action(var_name="First_Results", operator="SET_TO_YES"),
                                                             AfterSearchResults.goto()
                                                         ]
                                                     )]
                                             ),
                                             Output(
                                                 prompt=Prompt(items=["Here is the previous set of results"]),
                                                 children=[AfterSearchResults.goto()]
                                             )
                                         ]
                                     )
                                 ]
                             )
                         ]
                     )
                 ]
             )
         ]
     )
Exemple #2
0
 def create():
     return Input(
         Grammar(
             watson_items=["Go back", "$ back", "$ previous", "$ prior"]),
         children=[
             PageAction.set_to_previous(),
             Action("Show_Previous", operator="SET_TO_YES"),
             If(elements=[
                 Condition(name="Current_Index",
                           operator="EQUALS",
                           root_text="10"),
                 Output(prompt=Prompt(
                     items=["Those were the first results"]),
                        children=[Goto(ref="profileCheck_2503183")])
             ]),
             Output(
                 prompt=GenericPrompt.ok(),
                 children=[
                     Output(prompt=Prompt(items=[
                         "\"{Search_Now:\"{Search_Now}\", Style:\"{Style_Preference}\", Rating:\"{Color_Preference}\", Index:\"{Current_Index}\", Page:\"{Page}\"}\""
                     ]),
                            children=[
                                Action(var_name="Last_Results",
                                       operator="SET_TO_NO"),
                                GetUserInput(children=[
                                    Input(
                                        Grammar(watson_items=
                                                ["UPDATE CURRENT_INDEX"]),
                                        children=[
                                            Action(var_name="Show_Next",
                                                   operator="SET_TO_NO"),
                                            Action(var_name="Show_Previous",
                                                   operator="SET_TO_NO"),
                                            If(elements=[
                                                Condition(
                                                    name="First_Results",
                                                    operator="EQUAL_TO_YES"
                                                ),
                                                Output(prompt=Prompt(items=[
                                                    "Those were the first results"
                                                ]),
                                                       children=[
                                                           Goto(
                                                               ref=
                                                               "getUserInput_2503174"
                                                           )
                                                       ])
                                            ]),
                                            If(elements=[
                                                Condition(
                                                    name="Current_Index",
                                                    operator="EQUALS",
                                                    root_text="10"),
                                                Output(prompt=Prompt(items=[
                                                    "Here are the first results"
                                                ]),
                                                       children=[
                                                           Action(
                                                               var_name=
                                                               "First_Results",
                                                               operator=
                                                               "SET_TO_YES"
                                                           ),
                                                           AfterSearchResults
                                                           .goto()
                                                       ])
                                            ]),
                                            Output(prompt=Prompt(items=[
                                                "Here is the previous set of results"
                                            ]),
                                                   children=[
                                                       AfterSearchResults.
                                                       goto()
                                                   ])
                                        ])
                                ])
                            ])
                 ])
         ])