Skip to content
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

override OnComputeId in AdaptiveSkillDialog #3882

Merged
merged 4 commits into from
May 7, 2020
Merged
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
Expand Up @@ -7,6 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
using AdaptiveExpressions.Properties;
using Microsoft.Bot.Builder.Dialogs.Adaptive.Templates;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Schema;
using Newtonsoft.Json;
Expand Down Expand Up @@ -161,5 +162,22 @@ public override Task<DialogTurnResult> ContinueDialogAsync(DialogContext dc, Can

return base.ContinueDialogAsync(dc, cancellationToken);
}

protected override string OnComputeId()
{
var appId = SkillAppId?.ToString() ?? string.Empty;
string activity;

if (Activity is ActivityTemplate at)
{
activity = StringUtils.Ellipsis(at.Template.Trim(), 30);
}
else
{
activity = StringUtils.Ellipsis(Activity?.ToString().Trim(), 30);
}

return $"{this.GetType().Name}['{appId}','{activity}']";
}
}
}