Skip to content
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
Expand Up @@ -58,6 +58,7 @@ public virtual IEnumerable<DeclarativeType> GetDeclarativeTypes(ResourceExplorer
yield return new DeclarativeType<OnConversationUpdateActivity>(OnConversationUpdateActivity.Kind);
yield return new DeclarativeType<OnEndOfConversationActivity>(OnEndOfConversationActivity.Kind);
yield return new DeclarativeType<OnTypingActivity>(OnTypingActivity.Kind);
yield return new DeclarativeType<OnInstallationUpdateActivity>(OnInstallationUpdateActivity.Kind);
yield return new DeclarativeType<OnHandoffActivity>(OnHandoffActivity.Kind);
yield return new DeclarativeType<OnChooseIntent>(OnChooseIntent.Kind);
yield return new DeclarativeType<OnQnAMatch>(OnQnAMatch.Kind);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://schemas.botframework.com/schemas/component/v1.0/component.schema",
"$role": [ "implements(Microsoft.ITrigger)", "extends(Microsoft.OnCondition)" ],
"title": "On InstallationUpdate activity",
"description": "Actions to perform on receipt of an activity with type 'InstallationUpdate'.",
"type": "object",
"required": [
"actions"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://schemas.botframework.com/schemas/ui/v1.0/ui.schema",
"form": {
"order": [
"condition",
"*"
],
"hidden": [
"actions"
],
"label": "Installation updated",
"subtitle": "Installation updated activity"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Licensed under the MIT License.
// Copyright (c) Microsoft Corporation. All rights reserved.

using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Microsoft.Bot.Schema;
using Newtonsoft.Json;

namespace Microsoft.Bot.Builder.Dialogs.Adaptive.Conditions
{
/// <summary>
/// Actions triggered when a InstallationUpdateActivity is received.
/// </summary>
public class OnInstallationUpdateActivity : OnActivity
{
[JsonProperty("$kind")]
public new const string Kind = "Microsoft.OnInstallationUpdateActivity";

[JsonConstructor]
public OnInstallationUpdateActivity(List<Dialog> actions = null, string condition = null, [CallerFilePath] string callerPath = "", [CallerLineNumber] int callerLine = 0)
: base(type: ActivityTypes.InstallationUpdate, actions: actions, condition: condition, callerPath: callerPath, callerLine: callerLine)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ public void OnConditionWithCondition()
},
$"((turn.activity.type == '{ActivityTypes.Typing}') && ((turn.dialogEvent.name == '{AdaptiveEvents.ActivityReceived}') && (turn.test == 1)))");

AssertExpression(
new OnInstallationUpdateActivity()
{
Condition = "turn.test == 1"
},
$"((turn.activity.type == '{ActivityTypes.InstallationUpdate}') && ((turn.dialogEvent.name == '{AdaptiveEvents.ActivityReceived}') && (turn.test == 1)))");

AssertExpression(
new OnEndOfConversationActivity()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
}
]
},
{
"$kind": "Microsoft.OnInstallationUpdateActivity",
"condition": "turn.activity.text == 'OnInstallationUpdateActivity'",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"activity": "OnInstallationUpdateActivity"
}
]
},
{
"$kind": "Microsoft.OnEndOfConversationActivity",
"condition": "turn.activity.text == 'OnEndOfConversationActivity'",
Expand Down Expand Up @@ -165,6 +175,17 @@
"$kind": "Microsoft.Test.AssertReply",
"text": "OnTypingActivity"
},
{
"$kind": "Microsoft.Test.UserActivity",
"activity": {
"type": "installationUpdate",
"text": "OnInstallationUpdateActivity"
}
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "OnInstallationUpdateActivity"
},
{
"$kind": "Microsoft.Test.UserActivity",
"activity": {
Expand Down
109 changes: 90 additions & 19 deletions tests/tests.schema
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@
{
"$ref": "#/definitions/Microsoft.OnHandoffActivity"
},
{
"$ref": "#/definitions/Microsoft.OnInstallationUpdateActivity"
},
{
"$ref": "#/definitions/Microsoft.OnIntent"
},
Expand Down Expand Up @@ -3841,10 +3844,10 @@
"type": "string"
},
{
"$ref": "#/definitions/Microsoft.OrchestratorRecognizer"
"$ref": "#/definitions/Microsoft.OrchestratorRecognizer"
},
{
"$ref": "#/definitions/Microsoft.LuisRecognizer"
"$ref": "#/definitions/Microsoft.LuisRecognizer"
},
{
"$ref": "#/definitions/Microsoft.QnAMakerRecognizer"
Expand Down Expand Up @@ -3934,6 +3937,9 @@
{
"$ref": "#/definitions/Microsoft.OnHandoffActivity"
},
{
"$ref": "#/definitions/Microsoft.OnInstallationUpdateActivity"
},
{
"$ref": "#/definitions/Microsoft.OnIntent"
},
Expand Down Expand Up @@ -6123,6 +6129,71 @@
}
}
},
"Microsoft.OnInstallationUpdateActivity": {
"$role": [
"implements(Microsoft.ITrigger)",
"extends(Microsoft.OnCondition)"
],
"title": "On InstallationUpdate activity",
"description": "Actions to perform on receipt of an activity with type 'InstallationUpdate'.",
"type": "object",
"required": [
"actions",
"$kind"
],
"additionalProperties": false,
"patternProperties": {
"^\\$": {
"title": "Tooling property",
"description": "Open ended property for tooling."
}
},
"properties": {
"condition": {
"$ref": "#/definitions/condition",
"title": "Condition",
"description": "Condition (expression).",
"examples": [
"user.vip == true"
]
},
"actions": {
"type": "array",
"title": "Actions",
"description": "Sequence of actions to execute.",
"items": {
"$kind": "Microsoft.IDialog",
"$ref": "#/definitions/Microsoft.IDialog"
}
},
"priority": {
"$ref": "#/definitions/integerExpression",
"title": "Priority",
"description": "Priority for trigger with 0 being the highest and < 0 ignored."
},
"runOnce": {
"$ref": "#/definitions/booleanExpression",
"title": "Run Once",
"description": "True if rule should run once per unique conditions",
"examples": [
true,
"=f(x)"
]
},
"$kind": {
"title": "Kind of dialog object",
"description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)",
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9.]*$",
"const": "Microsoft.OnInstallationUpdateActivity"
},
"$designer": {
"title": "Designer information",
"type": "object",
"description": "Extra information for the Bot Framework Composer."
}
}
},
"Microsoft.OnIntent": {
"$role": [
"implements(Microsoft.ITrigger)",
Expand Down Expand Up @@ -7087,23 +7158,23 @@
]
},
"strictFiltersCompoundOperationType": {
"$ref": "#/definitions/stringExpression",
"title": "StrictFiltersCompoundOperationType",
"description": "Join operator for Strict Filters.",
"oneOf": [
{
"title": "StrictFilters CompoundOperation Type",
"description": "Value of Join Operator to be used as Conjunction with Strict Filter Value.",
"enum": [
"AND",
"OR"
],
"default": "AND"
},
{
"$ref": "#/definitions/equalsExpression"
}
]
"$ref": "#/definitions/stringExpression",
"title": "strictFiltersCompoundOperationType",
"description": "Join operator for Strict Filters.",
"oneOf": [
{
"title": "StrictFilters CompoundOperation Type",
"description": "Value of Join Operator to be used as Conjunction with Strict Filter Value.",
"enum": [
"AND",
"OR"
],
"default": "AND"
},
{
"$ref": "#/definitions/equalsExpression"
}
]
},
"$kind": {
"title": "Kind of dialog object",
Expand Down
13 changes: 13 additions & 0 deletions tests/tests.uischema
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,19 @@
"subtitle": "Handoff activity"
}
},
"Microsoft.OnInstallationUpdateActivity": {
"form": {
"hidden": [
"actions"
],
"label": "Installation updated",
"order": [
"condition",
"*"
],
"subtitle": "Installation updated activity"
}
},
"Microsoft.OnIntent": {
"form": {
"hidden": [
Expand Down