Skip to content

Commit

Permalink
Update OnConversationUpdate actions
Browse files Browse the repository at this point in the history
  • Loading branch information
luhan2017 committed Dec 19, 2019
1 parent 76a7f2e commit b416dee
Show file tree
Hide file tree
Showing 12 changed files with 284 additions and 52 deletions.
28 changes: 27 additions & 1 deletion Composer/packages/lib/shared/src/dialogFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,33 @@ const initialDialogShape = {
},
'Microsoft.OnConversationUpdateActivity': {
$type: 'Microsoft.OnConversationUpdateActivity',
condition: "toLower(turn.Activity.membersAdded[0].name) != 'bot'",
actions: [
{
$type: 'Microsoft.Foreach',
$designer: {
name: 'Loop: for each item',
},
itemsProperty: 'turn.Activity.membersAdded',
actions: [
{
$type: 'Microsoft.IfCondition',
$designer: {
name: 'Branch: if/else',
},
condition: 'string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)',
actions: [
{
$type: 'Microsoft.SendActivity',
$designer: {
name: 'Send a response',
},
activity: '',
},
],
},
],
},
],
},
'Microsoft.SendActivity': {
activity: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,34 @@
"name": "Greeting (ConversationUpdate)",
"id": "954390"
},
"constraint": "toLower(turn.Activity.membersAdded[0].name) != 'bot'",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$type": "Microsoft.Foreach",
"$designer": {
"id": "640616"
"id": "518944",
"name": "Loop: for each item"
},
"activity": "@{bfdactivity-640616()}"
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$designer": {
"id": "640616",
"name": "Send a response"
},
"activity": "@{bfdactivity-640616()}"
}
]
}
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,32 @@
"triggers": [
{
"$type": "Microsoft.OnConversationUpdateActivity",
"condition": "toLower(turn.Activity.membersAdded[0].name) != 'bot'",
"actions": [
{
"$type": "Microsoft.SendActivity",
"activity": "@{help()}"
"$type": "Microsoft.Foreach",
"$designer": {
"id": "518944",
"name": "Loop: for each item"
},
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)",
"actions": [
{
"$type": "Microsoft.SendActivity",
"activity": "@{help()}"
}
]
}
]
}
],
"$designer": {
"id": "690456"
}
]
},
{
"$type": "Microsoft.OnIntent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,34 @@
"name": "Greeting (ConversationUpdate)",
"id": "791275"
},
"condition": "toLower(turn.Activity.membersAdded[0].name) != 'bot'",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$type": "Microsoft.Foreach",
"$designer": {
"name": "Send an Activity",
"id": "859266"
"id": "518944",
"name": "Loop: for each item"
},
"activity": "@{help()}"
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$designer": {
"id": "859266",
"name": "Send a response"
},
"activity": "@{help()}"
}
]
}
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,26 @@
"$designer": {
"id": "376720"
},
"condition": "toLower(turn.Activity.membersAdded[0].name) != 'bot'"
"actions": [
{
"$type": "Microsoft.Foreach",
"$designer": {
"id": "518944",
"name": "Loop: for each item"
},
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,26 @@
"$designer": {
"id": "376720"
},
"condition": "toLower(turn.Activity.membersAdded[0].name) != 'bot'"
"actions": [
{
"$type": "Microsoft.Foreach",
"$designer": {
"id": "518944",
"name": "Loop: for each item"
},
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,34 @@
"id": "376720",
"name": "Welcome user"
},
"condition": "toLower(turn.Activity.membersAdded[0].name) != 'bot'",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$type": "Microsoft.Foreach",
"$designer": {
"name": "Send an Activity",
"id": "753396"
"id": "518944",
"name": "Loop: for each item"
},
"activity": "@{bfdactivity-753396()}"
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$designer": {
"id": "753396",
"name": "Send a response"
},
"activity": "@{bfdactivity-753396()}"
}
]
}
]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,34 @@
"id": "376720",
"name": "Welcome message"
},
"condition": "toLower(turn.Activity.membersAdded[0].name) != 'bot'",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$type": "Microsoft.Foreach",
"$designer": {
"id": "266608",
"name": "Send a response"
"id": "518944",
"name": "Loop: for each item"
},
"activity": "@{bfdactivity-266608()}"
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$designer": {
"id": "266608",
"name": "Send a response"
},
"activity": "@{bfdactivity-266608()}"
}
]
}
]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,36 @@
},
{
"$type": "Microsoft.OnConversationUpdateActivity",
"constraint": "toLower(turn.Activity.membersAdded[0].name) != 'bot'",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$type": "Microsoft.Foreach",
"$designer": {
"id": "729500"
"id": "518944",
"name": "Loop: for each item"
},
"activity": "@{bfdactivity-729500()}"
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$designer": {
"id": "729500",
"name": "Send a response"
},
"activity": "@{bfdactivity-729500()}"
}
]
}
]
}
],
"$designer": {
"id": "109137"
}
]
}
],
"generator": "common.lg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,34 @@
"name": "Greeting (ConversationUpdate)",
"id": "452701"
},
"condition": "toLower(turn.Activity.membersAdded[0].name) != 'bot'",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$type": "Microsoft.Foreach",
"$designer": {
"name": "Send an Activity",
"id": "576166"
"id": "518944",
"name": "Loop: for each item"
},
"activity": "@{bfdactivity-576166()}"
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$type": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else"
},
"condition": "string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)",
"actions": [
{
"$type": "Microsoft.SendActivity",
"$designer": {
"id": "576166",
"name": "Send a response"
},
"activity": "@{bfdactivity-576166()}"
}
]
}
]
}
]
},
Expand Down
Loading

0 comments on commit b416dee

Please sign in to comment.