10000 Updated dialog_manager to send EoC code like dialog_extensions. (#1504) · nickg33/botbuilder-python@354444e · GitHub
[go: up one dir, main page]

Skip to content

Commit 354444e

Browse files
authored
Updated dialog_manager to send EoC code like dialog_extensions. (microsoft#1504)
Also added checks in the test fo ensure we get the code back
1 parent b458369 commit 354444e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

libraries/botbuilder-dialogs/botbuilder/dialogs/dialog_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
DialogStateManager,
1717
DialogStateManagerConfiguration,
1818
)
19-
from botbuilder.schema import Activity, ActivityTypes
19+
from botbuilder.schema import Activity, ActivityTypes, EndOfConversationCodes
2020
from botframework.connector.auth import (
2121
AuthenticationConstants,
2222
ClaimsIdentity,
@@ -355,6 +355,9 @@ async def handle_skill_on_turn(
355355
type=ActivityTypes.end_of_conversation,
356356
value=turn_result.result,
357357
locale=turn_context.activity.locale,
358+
code=EndOfConversationCodes.completed_successfully
359+
if turn_result.status == DialogTurnStatus.Complete
360+
else EndOfConversationCodes.user_cancelled,
358361
)
359362
await turn_context.send_activity(activity)
360363

libraries/botbuilder-dialogs/tests/test_dialog_manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
ActivityTypes,
3939
ChannelAccount,
4040
ConversationAccount,
41+
EndOfConversationCodes,
4142
InputHints,
4243
)
4344
from botframework.connector.auth import AuthenticationConstants, ClaimsIdentity
@@ -237,6 +238,10 @@ async def test_handles_bot_and_skills(self):
237238
SimpleComponentDialog.eoc_sent.type,
238239
ActivityTypes.end_of_conversation,
239240
)
241+
self.assertEqual(
242+
SimpleComponentDialog.eoc_sent.code,
243+
EndOfConversationCodes.completed_successfully,
244+
)
240245
self.assertEqual(SimpleComponentDialog.eoc_sent.value, "SomeName")
241246
else:
242247
self.assertIsNone(

0 commit comments

Comments
 (0)
0