コード例 #1
0
        public TeamReviewDialog(IIssueTrackingIntegrationService issueTrackingIntegrationService, SettingProvider settingProvider)
            : base(nameof(TeamReviewDialog))
        {
            _issueTrackingIntegrationService = issueTrackingIntegrationService;
            _settingProvider = settingProvider;

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                Init,
                SelectionStep,
                LoopStep,
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
コード例 #2
0
        public UserReviewDialog(IIssueTrackingIntegrationService issueTrackingIntegrationService, SettingProvider settingProvider)
            : base(nameof(UserReviewDialog))
        {
            _issueTrackingIntegrationService = issueTrackingIntegrationService;
            _settingProvider = settingProvider;
            AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                Init,
                SelectionStep,
                ProcessTicket,
                LoopStep,
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
コード例 #3
0
        public StandupRootDialog(IIssueTrackingIntegrationService issueTrackingIntegrationService, SettingProvider settingProvider)
            : base(nameof(StandupRootDialog))
        {
            _issueTrackingIntegrationService = issueTrackingIntegrationService;

            var dialog = new WaterfallDialog("standup", new WaterfallStep[]
            {
                StartDialogAsync,
                FinishDialogAsync
            });

            AddDialog(dialog);
            AddDialog(new TicketReviewDialog(settingProvider));
            AddDialog(new UserReviewDialog(_issueTrackingIntegrationService, settingProvider));
            AddDialog(new TeamReviewDialog(_issueTrackingIntegrationService, settingProvider));
            AddDialog(new TextPrompt(nameof(TextPrompt)));

            InitialDialogId = "standup";
        }
コード例 #4
0
        public RootDialog(IConfiguration configuration, SettingProvider settingProvider, IIssueTrackingIntegrationService issueTrackingIntegrationService)
            : base(nameof(RootDialog))
        {
            string[] paths    = { ".", "Dialogs", "RootDialog", "RootDialog.lg" };
            string   fullPath = Path.Combine(paths);

            var rootDialog = new AdaptiveDialog(nameof(AdaptiveDialog))
            {
                Generator  = new TemplateEngineLanguageGenerator(Templates.ParseFile(fullPath)),
                Recognizer = RecognizerFactory.CreateRecognizer(configuration),
                Triggers   = new List <OnCondition>()
                {
                    new OnConversationUpdateActivity()
                    {
                        Actions = new List <Dialog>()
                        {
                            new SendActivity("${WelcomeCard()}")
                        }
                    },
                    new OnIntent("Root")
                    {
                        Actions = new List <Dialog>()
                        {
                            new SendActivity("${WelcomeCard()}")
                        }
                    },
                    new OnIntent("MainMenu")
                    {
                        Actions = new List <Dialog>()
                        {
                            new SendActivity("${MainMenuCard()}")
                        }
                    },
                    new OnIntent("Standup")
                    {
                        Actions = new List <Dialog>()
                        {
                            new BeginDialog(nameof(StandupRootDialog)),
                            new SendActivity("${MainMenuCard()}")
                        }
                    },
                    new OnIntent("Planning")
                    {
                        Actions = new List <Dialog>()
                        {
                            new SendActivity("${NotAvailableFunctionalityMessage()}"),
                            new SendActivity("${MainMenuCard()}")
                        }
                    },
                    new OnIntent("Grooming")
                    {
                        Actions = new List <Dialog>()
                        {
                            new SendActivity("${NotAvailableFunctionalityMessage()}"),
                            new SendActivity("${MainMenuCard()}")
                        }
                    },
                    new OnIntent("Setup")
                    {
                        Actions = new List <Dialog>()
                        {
                            new SendActivity("${NotAvailableFunctionalityMessage()}"),
                            new SendActivity("${MainMenuCard()}")
                        }
                    },
                    new OnIntent("Help")
                    {
                        Condition = "#Help.Score >= 0.8",
                        Actions   = new List <Dialog>()
                        {
                            new SendActivity("${HelpCard()}")
                        }
                    },
                    new OnIntent("Cancel")
                    {
                        Condition = "#Cancel.Score >= 0.8",
                        Actions   = new List <Dialog>()
                        {
                            new ConfirmInput()
                            {
                                Prompt             = new ActivityTemplate("${Cancel.prompt()}"),
                                Property           = "turn.confirm",
                                Value              = "=@confirmation",
                                AllowInterruptions = "!@confirmation"
                            },
                            new IfCondition()
                            {
                                Condition = "turn.confirm == true",
                                Actions   = new List <Dialog>()
                                {
                                    new SendActivity("Cancelling all dialogs.."),
                                    new SendActivity("${MainMenuCard()}"),
                                    new CancelAllDialogs(),
                                },
                                ElseActions = new List <Dialog>()
                                {
                                    new SendActivity("${CancelCancelled()}"),
                                    new SendActivity("${MainMenuCard()}")
                                }
                            }
                        }
                    }
                }
            };

            AddDialog(rootDialog);
            AddDialog(new StandupRootDialog(issueTrackingIntegrationService, settingProvider));

            InitialDialogId = nameof(AdaptiveDialog);
        }