Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
fd302b6
Composer: DotNet 57.teams-conversation-bot
tracyboehrer Apr 21, 2021
a25397c
Experimental: Added Composer teams sample 51
tracyboehrer Apr 26, 2021
ec6ed63
Added CustomAction project
tracyboehrer Apr 27, 2021
366a842
Composer sample: Update experiments readme for #57
tracyboehrer Apr 27, 2021
7ff5d5e
Composer samples: Added some template examples
tracyboehrer Apr 27, 2021
229a2fe
Composer samples: Changed structure
tracyboehrer Apr 27, 2021
14971ec
Composer samples: Added MultiplyDialog component
tracyboehrer Apr 27, 2021
e0daea7
Composer samples: Restructure
tracyboehrer Apr 27, 2021
a25a85a
Composer Sample: Documented CustomAction as Component and as local Di…
tracyboehrer Apr 29, 2021
8776e14
Composer Samples: Moved to proposed new location
tracyboehrer May 4, 2021
4bbe9ca
Merge branch 'main' into ComposerSamples
tracyboehrer May 4, 2021
dd4a0a9
Composer Samples: Consolidated various composer related samples
tracyboehrer May 4, 2021
8a97677
Composer Samples: Removed CustomAction project
tracyboehrer May 4, 2021
cee2b30
Update .gitignore to allow some composer-sample "packages" folders
tracyboehrer May 4, 2021
98e5e89
Composer Samples: Sample packages
tracyboehrer May 4, 2021
0d47a60
Composer Samples: Updated MultiplyDialog.csproj to handle exported co…
tracyboehrer May 5, 2021
5df3751
Composer Samples: Added MemberUpdates custom triggers sample
tracyboehrer May 6, 2021
c065a2a
Composer Sampes: Removed JS adaptive samples for the time being
tracyboehrer May 6, 2021
1dc782d
Composer Samples: Updated SDK depedency for MultiplyDialog
tracyboehrer May 6, 2021
523f1e8
Composer Samples: Added MultiplyDialog and MemberUpdates package readmes
tracyboehrer May 6, 2021
74f8871
Composer Samples: Corrected packagId's
tracyboehrer May 6, 2021
f997000
Composer Samples: Corrected package project filenames
tracyboehrer May 6, 2021
85891db
Composer Samples .gitignore
tracyboehrer May 6, 2021
d4df137
Composer Samples gitignore
tracyboehrer May 6, 2021
794f04f
Composer Samples: revert gitignore
tracyboehrer May 6, 2021
b44a51a
Composer Samples: Corrected teams-message-extensions-action sample
tracyboehrer May 6, 2021
67734e9
Composer Samples: Added CustomTriggers project, moved Teams samples t…
tracyboehrer May 6, 2021
860723c
Composer Samples: Added CustomAction project
tracyboehrer May 6, 2021
f1a837b
Composer Samples: Added package DialogAndTriggerPackage
tracyboehrer May 6, 2021
3662014
Composer Samples: Added samples from Composer branch for DotNet
tracyboehrer May 6, 2021
97a9843
Composer Samples: Removed test sample templates
tracyboehrer May 6, 2021
3e96b69
Composer Samples: Removed EmptyBot project sample
tracyboehrer May 6, 2021
e889fd1
Composer Samples: Added JS Composer sample projects
tracyboehrer May 7, 2021
bfd44a3
Composer Sample: Added a BotComponent-less sample for a custom action
tracyboehrer May 7, 2021
e210fa4
Composer Sample: Changed name of CustomAction sample
tracyboehrer May 7, 2021
13397af
Composer Samples: Moved CustomAction and CustomTriggers projects to e…
tracyboehrer May 7, 2021
cf921d8
Composer Samples: Added missing dialogs to JS and Dotnet ActionsSample
tracyboehrer May 10, 2021
aa7deb5
Composer Samples: Updated package readmes
tracyboehrer May 10, 2021
0ecd356
Composer Samples: Moved CustomAction back to dotnet projects. Moved …
tracyboehrer May 11, 2021
3014cb2
Composer Samples: Updated README for CustomAction
tracyboehrer May 11, 2021
e758f6d
Moved orchestrator composer samples to samples/composer-samples
tsuwandy May 11, 2021
978c418
Added missing appsettings.json, renamed SchoolNavigator2->SchoolNavig…
tsuwandy May 11, 2021
296142c
Composer Samples: Updates OrchestratorDispatch appsetting to include …
tracyboehrer May 11, 2021
aa6314f
Composer Samples: Updated Orchestrator samples to use latest Composer…
tracyboehrer May 11, 2021
01c553b
deleted ModelTuning from botbuilder-samples and moved to botframework…
tsuwandy May 11, 2021
f14b5cb
Add custom trigger composer project sample
andrewclear-ms May 16, 2021
b2efc39
Update uischema
andrewclear-ms May 16, 2021
ee973d3
Composer Samples: Updated/added readmes for CustomAction and CustomTr…
tracyboehrer May 17, 2021
084c542
Composer Samples: Removed Nuget.config from projects
tracyboehrer May 20, 2021
8380255
Composer Samples: Remove Nuget.config from JS project
tracyboehrer May 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ PublishScripts/
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# except is specific places in composer-samples
!composer-samples/csharp_dotnetcore/packages/*
!composer-samples/javascript_nodejs/packages/*
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs.Declarative;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.Bot.Components.Samples.DialogAndTriggerPackage
{
/// <summary>
/// Definition of a <see cref="Microsoft.Bot.Builder.BotComponent"/> that allows registration of
/// services, custom actions, memory scopes and adapters.
/// </summary>
/// To make your components available to the system you derive from BotComponent and register services to add functionality.
/// These components then are consumed in appropriate places by the systems that need them. When using Composer, Startup gets called
/// automatically on the components by the bot runtime, as long as the components are registered in the configuration.
public class MemberUpdatesBotComponent : BotComponent
{
/// <summary>
/// Entry point for bot components to register types in resource explorer, consume configuration and register services in the
/// services collection.
/// </summary>
/// <param name="services">Services collection to register dependency injection.</param>
/// <param name="configuration">Configuration for the bot component.</param>
public override void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
// Anything that could be done in Startup.ConfigureServices can be done here.
// In this case, the OnMembersAdded and OnMembersRemoved needs to be added as a new DeclarativeTypes.
services.AddSingleton<DeclarativeType>(sp => new DeclarativeType<OnMembersAdded>(OnMembersAdded.Kind));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackageId>Microsoft.Bot.Components.Samples.DialogAndTriggerPackage</PackageId>
<Description>This library implements .NET support for a custom trigger and an Adaptive dialog.</Description>
<Summary>This library implements .NET support for a custom trigger (OnMembersAdded) and an Adaptive dialog (WelcomeDialog).</Summary>
<ContentTargetFolders>content</ContentTargetFolders>
<PackageTags>msbot-component;msbot-content;msbot-trigger</PackageTags>
</PropertyGroup>

<ItemGroup>
<Content Include="**/*.schema" />
<Content Include="**/*.uischema" />
<None Include="exported/**/*.*" Pack="true" PackagePath="exported" />
<None Include="README.md" Condition="Exists('README.md')" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime" Version="4.13.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Microsoft.Bot.Components.Samples.DialogAndTriggerPackage

This sample package contains a dialog and supporting declarative assets for greeting new and returning users, as well as a custom trigger that fires when new members join the conversation.

## Getting started

* Published it to a NuGet feed. For testing purposes, this is easiest when done to a [local feed](https://docs.microsoft.com/nuget/hosting-packages/local-feeds). After setting up the local feed, add it to the Package Manager in Composer so that your local packages can be installed in a bot.

* Once you've installed the package in Composer, you can use it in your bot.

## Feedback and issues

If you encounter any issues with this package, or would like to share any feedback please open an Issue in our [GitHub repository](https://github.com/microsoft/botframework-components/issues/new/choose).
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://schemas.botframework.com/schemas/component/v1.0/component.schema",
"$role": [ "implements(Microsoft.ITrigger)", "extends(Microsoft.OnCondition)" ],
"title": "On Members Added",
"description": "Actions to perform on receipt of an activity with type 'ConversationUpdate' and MembersAdded > 0.",
"type": "object",
"required": [
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://schemas.botframework.com/schemas/ui/v1.0/ui.schema",
"form": {
"order": [
"condition",
"*"
],
"hidden": [
"actions"
],
"label": "Members Added",
"subtitle": "Members Added ConversationUpdate activity",
"description": "Handle the events fired when a members have been added to a conversation.",
"helpLink": "https://aka.ms/bf-composer-docs-conversation-update-activity"
},
"trigger": {
"label": "Members Added (ConversationUpdate activity)",
"order": 5.2,
"submenu": "Activities"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Licensed under the MIT License.
// Copyright (c) Microsoft Corporation. All rights reserved.

using System.Collections.Generic;
using System.Runtime.CompilerServices;
using AdaptiveExpressions;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Dialogs.Adaptive.Conditions;
using Microsoft.Bot.Schema;
using Newtonsoft.Json;

namespace Microsoft.Bot.Components.Samples.DialogAndTriggerPackage
{
/// <summary>
/// Actions triggered when ConversationUpdateActivity is received with Activity.MembersAdded > 0.
/// </summary>
public class OnMembersAdded : OnActivity
{
/// <summary>
/// Gets the unique name (class identifier) of this trigger.
/// </summary>
/// <remarks>
/// There should be at least a .schema file of the same name. There can optionally be a
/// .uischema file of the same name that describes how Composer displays this trigger.
/// </remarks>
[JsonProperty("$kind")]
public new const string Kind = "Microsoft.OnMembersAdded";

/// <summary>
/// Initializes a new instance of the <see cref="OnMembersAdded"/> class.
/// </summary>
/// <param name="actions">Optional, list of <see cref="Dialog"/> actions.</param>
/// <param name="condition">Optional, condition which needs to be met for the actions to be executed.</param>
/// <param name="callerPath">Optional, source file full path.</param>
/// <param name="callerLine">Optional, line number in source file.</param>
[JsonConstructor]
public OnMembersAdded(List<Dialog> actions = null, string condition = null, [CallerFilePath] string callerPath = "", [CallerLineNumber] int callerLine = 0)
: base(type: ActivityTypes.ConversationUpdate, actions: actions, condition: condition, callerPath: callerPath, callerLine: callerLine)
{
}

/// <inheritdoc/>
protected override Expression CreateExpression()
{
// The Activity.MembersAdded list must have more than 0 items.
return Expression.AndExpression(Expression.Parse($"count({TurnPath.Activity}.MembersAdded) > 0"), base.CreateExpression());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$kind": "Microsoft.AdaptiveDialog",
"$designer": {
"$designer": {
"name": "WelcomeDialog",
"description": "Greets new and returning users",
"id": "8pOkoq"
},
"name": "WelcomeDialog"
},
"autoEndDialog": true,
"defaultResultProperty": "dialog.result",
"triggers": [
{
"$kind": "Microsoft.OnBeginDialog",
"$designer": {
"id": "tcqJ5M",
"name": "BeginDialog"
},
"actions": [
{
"$kind": "Microsoft.IfCondition",
"$designer": {
"id": "sF0fYv"
},
"condition": "exists(user.greeted)",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"$designer": {
"id": "PsAJ3p"
},
"activity": "${SendActivity_WelcomeReturningUser()}"
}
],
"elseActions": [
{
"$kind": "Microsoft.SendActivity",
"$designer": {
"id": "f3uG2y"
},
"activity": "${SendActivity_WelcomeNewUser()}"
},
{
"$kind": "Microsoft.SetProperty",
"$designer": {
"id": "ucFnwQ"
},
"property": "user.greeted",
"value": "true"
}
]
}
]
}
],
"$schema": "https://raw.githubusercontent.com/microsoft/BotFramework-Composer/stable/Composer/packages/server/schemas/sdk.schema",
"generator": "WelcomeDialog.lg",
"id": "WelcomeDialog",
"recognizer": "WelcomeDialog.lu.qna"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[import](common.lg)

# SendActivity_WelcomeReturningUser()
[Activity
Text = ${SendActivity_WelcomeReturningUser_text()}
]

# SendActivity_WelcomeReturningUser_text()
- 🖐️ Welcome back! How can I help you today?
- 🖐️ Hello again! What can I help with?
- 🖐️ Good to see you again. What do you want to do today?
- 🖐️ Hey, there! Let's get started.
- 🖐️ Hello again! How can I help?

# SendActivity_WelcomeNewUser()
[Activity
Text = ${SendActivity_WelcomeNewUser_text()}
]

# SendActivity_WelcomeNewUser_text()
- 🖐️ Hey, there! How can I help you today?
- 🖐️ Hi! How can I help?
- 🖐️ Hello! What do you want to do today?
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$kind": "Microsoft.LuisRecognizer",
"id": "LUIS_WelcomeDialog",
"applicationId": "=settings.luis.WelcomeDialog_en_us_lu.appId",
"version": "=settings.luis.WelcomeDialog_en_us_lu.version",
"endpoint": "=settings.luis.endpoint",
"endpointKey": "=settings.luis.endpointKey"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$kind": "Microsoft.MultiLanguageRecognizer",
"id": "LUIS_WelcomeDialog",
"recognizers": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$kind": "Microsoft.CrossTrainedRecognizerSet",
"recognizers": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs.Declarative;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.Bot.Components.Samples.MemberUpdates
{
/// <summary>
/// Definition of a <see cref="Microsoft.Bot.Builder.BotComponent"/> that allows registration of
/// services, custom actions, memory scopes and adapters.
/// </summary>
/// To make your components available to the system you derive from BotComponent and register services to add functionality.
/// These components then are consumed in appropriate places by the systems that need them. When using Composer, Startup gets called
/// automatically on the components by the bot runtime, as long as the components are registered in the configuration.
public class MemberUpdatesBotComponent : BotComponent
{
/// <summary>
/// Entry point for bot components to register types in resource explorer, consume configuration and register services in the
/// services collection.
/// </summary>
/// <param name="services">Services collection to register dependency injection.</param>
/// <param name="configuration">Configuration for the bot component.</param>
public override void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
// Anything that could be done in Startup.ConfigureServices can be done here.
// In this case, the OnMembersAdded and OnMembersRemoved needs to be added as a new DeclarativeTypes.
services.AddSingleton<DeclarativeType>(sp => new DeclarativeType<OnMembersAdded>(OnMembersAdded.Kind));
services.AddSingleton<DeclarativeType>(sp => new DeclarativeType<OnMembersRemoved>(OnMembersRemoved.Kind));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackageId>Microsoft.Bot.Components.Samples.MemberUpdates</PackageId>
<Description>This library implements .NET support for custom triggers for conversation member updates.</Description>
<Summary>This library implements .NET support for custom triggers for conversation member updates. OnMembersAdded and OnMembersRemoved.</Summary>
<ContentTargetFolders>content</ContentTargetFolders>
<PackageTags>msbot-component;msbot-trigger</PackageTags>
</PropertyGroup>

<ItemGroup>
<Content Include="**/*.schema" />
<Content Include="**/*.uischema" />
<None Include="exported/**/*.*" Pack="true" PackagePath="exported" />
<None Include="README.md" Condition="Exists('README.md')" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bot.Builder.Dialogs.Adaptive.Runtime" Version="4.13.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Microsoft.Bot.Component.Samples.MemberUpdates

This sample demonstrates custom triggers for [Bot Framework Composer](https://docs.microsoft.com/composer) that fires when members are added or removed from the conversation.

## Getting started

* Published it to a NuGet feed. For testing purposes, this is easiest when done to a [local feed](https://docs.microsoft.com/nuget/hosting-packages/local-feeds). After setting up the local feed, add it to the Package Manager in Composer so that your local packages can be installed in a bot.

* Once you've installed the package in Composer, you can use it in your bot.

## Feedback and issues

If you encounter any issues with this package, or would like to share any feedback please open an Issue in our [GitHub repository](https://github.com/microsoft/botbuilder-samples/issues/new/choose).
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://schemas.botframework.com/schemas/component/v1.0/component.schema",
"$role": [ "implements(Microsoft.ITrigger)", "extends(Microsoft.OnCondition)" ],
"title": "On Members Added",
"description": "Actions to perform on receipt of an activity with type 'ConversationUpdate' and MembersAdded > 0.",
"type": "object",
"required": [
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://schemas.botframework.com/schemas/ui/v1.0/ui.schema",
"form": {
"order": [
"condition",
"*"
],
"hidden": [
"actions"
],
"label": "Members Added",
"subtitle": "Members Added ConversationUpdate activity",
"description": "Handle the events fired when a members have been added to a conversation.",
"helpLink": "https://aka.ms/bf-composer-docs-conversation-update-activity"
},
"trigger": {
"label": "Members Added (ConversationUpdate activity)",
"order": 5.2,
"submenu": "Activities"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://schemas.botframework.com/schemas/component/v1.0/component.schema",
"$role": [ "implements(Microsoft.ITrigger)", "extends(Microsoft.OnCondition)" ],
"title": "On Members Removed",
"description": "Actions to perform on receipt of an activity with type 'ConversationUpdate' and MembersRemoved > 0.",
"type": "object",
"required": [
]
}
Loading