Skip to content

Add EndOfConversationCodes to EndOfConversation activity from Skill #1402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from botframework.connector.auth import (
ClaimsIdentity,
SkillValidation,
AuthenticationConstants,
GovernmentConstants,
)
from botbuilder.core import BotAdapter, StatePropertyAccessor, TurnContext
from botbuilder.core.skills import SkillHandler, SkillConversationReference

from botbuilder.dialogs import (
Dialog,
DialogEvents,
DialogSet,
DialogTurnStatus,
)
from botbuilder.schema import Activity, ActivityTypes
from botframework.connector.auth import (
ClaimsIdentity,
SkillValidation,
AuthenticationConstants,
GovernmentConstants,
)
from botbuilder.schema import Activity, ActivityTypes, EndOfConversationCodes


class DialogExtensions:
Expand Down Expand Up @@ -87,6 +86,9 @@ async def run_dialog(
type=ActivityTypes.end_of_conversation,
value=result.result,
locale=turn_context.activity.locale,
code=EndOfConversationCodes.completed_successfully
if result.status == DialogTurnStatus.Complete
else EndOfConversationCodes.user_cancelled,
)
await turn_context.send_activity(activity)

Expand Down
5 changes: 3 additions & 2 deletions libraries/botbuilder-dialogs/tests/test_dialogextensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import aiounittest

from botframework.connector.auth import ClaimsIdentity, AuthenticationConstants
from botbuilder.core import (
TurnContext,
MessageFactory,
Expand All @@ -28,8 +29,7 @@
TranscriptLoggerMiddleware,
ConsoleTranscriptLogger,
)
from botbuilder.schema import ActivityTypes, Activity
from botframework.connector.auth import ClaimsIdentity, AuthenticationConstants
from botbuilder.schema import ActivityTypes, Activity, EndOfConversationCodes
from botbuilder.dialogs import (
ComponentDialog,
TextPrompt,
Expand Down Expand Up @@ -111,6 +111,7 @@ async def handles_bot_and_skills_test_cases(
self.eoc_sent, "Skills should send EndConversation to channel"
)
assert ActivityTypes.end_of_conversation == self.eoc_sent.type
assert EndOfConversationCodes.completed_successfully == self.eoc_sent.code
assert self.eoc_sent.value == "SomeName"
else:
self.assertIsNone(
Expand Down