Skip to content

Commit

Permalink
Rename remaining actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Mar 12, 2018
1 parent d9585e5 commit 865e113
Show file tree
Hide file tree
Showing 30 changed files with 195 additions and 194 deletions.
6 changes: 3 additions & 3 deletions cmd/docgen/templates/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ At its simplest, a node can be just a single action with no exits, wait or route
"uuid":"5a06445e-d790-4bd3-a10b-b47bdcc9abed",
"actions":[{
"uuid": "abc0a2bf-6b4a-4ee0-83e1-1eebae6948ac",
"type": "reply",
"type": "send_msg",
"text": "What is your name?"
}]
}
Expand All @@ -53,7 +53,7 @@ An exit consists of:
"uuid":"5a06445e-d790-4bd3-a10b-b47bdcc9abed",
"actions":[{
"uuid": "abc0a2bf-6b4a-4ee0-83e1-1eebae6948ac",
"type": "reply",
"type": "send_msg",
"text": "What is your name?"
}],
"exits": [{
Expand Down Expand Up @@ -140,7 +140,7 @@ have been started by a `start_flow` action previously in the flow:
Flows do not describe data flow but rather actions and logic branching. As such, variables collected in a flow and the state of the flow is accessed through
what is called the Context. The context contains variables representing the current contact in a flow, the last input from that contact
as well as the results collected in a flow and any webhook requests made during the flow. Variables in the context may be referred to
within actions by using the `@` symbol. For example, to greet a contact by their name in a reply action, the text of the reply can be `Hi @contact.name!`.
within actions by using the `@` symbol. For example, to greet a contact by their name in a send_msg action, the text of the send_msg can be `Hi @contact.name!`.

The `@` symbol can be escaped in templates by repeating it, ie, `Hi @@twitter` would output `Hi @twitter`.

Expand Down
12 changes: 6 additions & 6 deletions cmd/flowrunner/testdata/flows/all_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@
},
{
"uuid": "ac110f56-a66c-4462-921c-b2c6d1c6dadb",
"type": "send_msg",
"type": "send_broadcast",
"urns": [
"tel:+12065551212"
],
"text": "Hi @contact.name, are you ready?"
},
{
"uuid": "c0057fd9-be0a-43ea-91df-5c18e14f2c59",
"type": "send_msg",
"type": "send_broadcast",
"groups": [
{
"uuid": "2aad21f6-30b7-42c5-bd7f-1b720c154817",
Expand All @@ -117,18 +117,18 @@
},
{
"uuid": "f01d693b-2af2-49fb-9e38-146eb00937e9",
"type": "reply",
"type": "send_msg",
"text": "Hi @contact.name, are you ready to complete today's survey?"
},
{
"uuid": "d98c1e02-69df-4f95-8b89-8587a57ae0c3",
"type": "reply",
"type": "send_msg",
"text": "This is a message to each of @contact.name's urns.",
"all_urns": true
},
{
"uuid": "62a30ab4-d73c-447d-a989-39c49115153e",
"type": "reply",
"type": "send_msg",
"text": "This is a reply with attachments and quick replies",
"attachments": [
"image/jpeg:http://s3.amazon.com/bucket/[email protected]"
Expand All @@ -140,7 +140,7 @@
},
{
"uuid": "5508e6a7-26ce-4b3b-b32e-bb4e2e614f5d",
"type": "save_flow_result",
"type": "set_run_result",
"name": "Gender",
"value": "m",
"category": "Male"
Expand Down
4 changes: 2 additions & 2 deletions cmd/flowrunner/testdata/flows/brochure.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"uuid": "32bc60ad-5c86-465e-a6b8-049c44ecce49",
"actions": [
{
"type": "reply",
"type": "send_msg",
"uuid": "9d9290a7-3713-4c22-8821-4af0a64c0821",
"text": "Hi! What is your name?"
}
Expand Down Expand Up @@ -82,7 +82,7 @@
},
{
"uuid": "605e3486-503d-481c-94f7-cd553f196a8a",
"type": "reply",
"type": "send_msg",
"text": "Great, you are @contact.name, thanks for joining!"
}
]
Expand Down
4 changes: 2 additions & 2 deletions cmd/flowrunner/testdata/flows/date_parse.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"actions": [
{
"uuid": "e97cd6d5-3354-4dbd-85bc-6c1f87849eec",
"type": "reply",
"type": "send_msg",
"text": "Hi @contact.name! When were you born, enter in format yyyy.MM.dd"
}
],
Expand Down Expand Up @@ -60,7 +60,7 @@
},
{
"uuid": "d2a4052a-3fa9-4608-ab3e-5b9631440447",
"type": "reply",
"type": "send_msg",
"text": "Awesome, you were born on @(FORMAT_DATE(run.results.birth_date, \"MM-dd-yyyy\")) at @(FORMAT_DATE(run.results.birth_date, \"HH:mm\"))"
}
]
Expand Down
4 changes: 2 additions & 2 deletions cmd/flowrunner/testdata/flows/default_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"actions": [
{
"text": "What is your name?",
"type": "reply",
"type": "send_msg",
"uuid": "d3cd8da7-55f2-4bd3-9a0c-efc93c99e498"
}
]
Expand Down Expand Up @@ -61,7 +61,7 @@
"value": "@(WORD(run.results.contact_name, 1))"
},
{
"type": "reply",
"type": "send_msg",
"uuid": "aafb505c-603d-4025-864d-471345ed237d",
"text": "Great, pleased to meet you @contact.fields.first_name"
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/flowrunner/testdata/flows/dynamic_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
{
"uuid": "f01d693b-2af2-49fb-9e38-146eb00937e9",
"type": "reply",
"type": "send_msg",
"text": "Current groups: @contact.groups"
},
{
Expand All @@ -41,7 +41,7 @@
},
{
"uuid": "5bc4894f-9ef4-430e-a040-e688fd2dd578",
"type": "reply",
"type": "send_msg",
"text": "Current groups: @contact.groups"
},
{
Expand All @@ -55,7 +55,7 @@
},
{
"uuid": "279b0215-c9d5-4a90-b7df-f371812bcc78",
"type": "reply",
"type": "send_msg",
"text": "Current groups: @contact.groups"
}
]
Expand Down
2 changes: 1 addition & 1 deletion cmd/flowrunner/testdata/flows/node_loop.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"uuid": "32bc60ad-5c86-465e-a6b8-049c44ecce49",
"actions": [
{
"type": "reply",
"type": "send_msg",
"uuid": "9d9290a7-3713-4c22-8821-4af0a64c0821",
"text": "Hi! What is your name?"
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/flowrunner/testdata/flows/subflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"actions": [
{
"uuid": "49f6c984-620f-4d9b-98c4-8ead1d1ef4f6",
"type": "reply",
"type": "send_msg",
"text": "This is the parent flow"
},
{
Expand Down Expand Up @@ -61,7 +61,7 @@
"actions": [
{
"uuid": "5d51eae6-be0f-4cc7-9402-150aa1ed80a1",
"type": "reply",
"type": "send_msg",
"text": "Flow succeeded, they said @child.results.name"
}
]
Expand All @@ -71,7 +71,7 @@
"actions": [
{
"uuid": "d80b2a5c-3b5c-47cd-b6ea-2f59bf2bb477",
"type": "reply",
"type": "send_msg",
"text": "Flow failed"
}
]
Expand All @@ -92,7 +92,7 @@
"actions": [
{
"uuid": "e5a03dde-3b2f-4603-b5d0-d927f6bcc361",
"type": "reply",
"type": "send_msg",
"text": "What is your name?"
}
],
Expand Down Expand Up @@ -130,7 +130,7 @@
"actions": [
{
"uuid": "d63929fe-e999-42ef-abf1-4b281f58891e",
"type": "reply",
"type": "send_msg",
"text": "Got it!"
}
]
Expand Down
6 changes: 3 additions & 3 deletions cmd/flowrunner/testdata/flows/subflow_loop.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"actions": [
{
"uuid": "49f6c984-620f-4d9b-98c4-8ead1d1ef4f6",
"type": "reply",
"type": "send_msg",
"text": "This is the parent flow"
},
{
Expand All @@ -36,7 +36,7 @@
"actions": [
{
"uuid": "5d51eae6-be0f-4cc7-9402-150aa1ed80a1",
"type": "reply",
"type": "send_msg",
"text": "Flow succeeded"
}
]
Expand All @@ -57,7 +57,7 @@
"actions": [
{
"uuid": "e5a03dde-3b2f-4603-b5d0-d927f6bcc361",
"type": "reply",
"type": "send_msg",
"text": "This is the child flow"
},
{
Expand Down
16 changes: 8 additions & 8 deletions cmd/flowrunner/testdata/flows/subflow_other.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"actions": [
{
"text": "Hi there, let's go to the child.",
"type": "reply",
"type": "send_msg",
"uuid": "ac403443-4e93-4127-8b03-469598cd7ae2"
}
]
Expand Down Expand Up @@ -69,7 +69,7 @@
"actions": [
{
"text": "Hooray, you did it and said @child.results.answer. Say yes or no!",
"type": "reply",
"type": "send_msg",
"uuid": "54b10283-9863-4edf-abfa-705cf24a64fc"
}
]
Expand All @@ -86,7 +86,7 @@
"actions": [
{
"text": "Nope, that's neither",
"type": "reply",
"type": "send_msg",
"uuid": "27442755-3d94-499f-97d5-a9409ab83b67"
}
]
Expand Down Expand Up @@ -150,7 +150,7 @@
"actions": [
{
"text": "All Done! You said @child.results.answer in the child and @run.results.answer here.",
"type": "reply",
"type": "send_msg",
"uuid": "bd387e9c-1ea9-49c8-a292-858d8a23a2d0"
}
]
Expand All @@ -177,7 +177,7 @@
"actions": [
{
"text": "Welcome to the child, say yes or no!",
"type": "reply",
"type": "send_msg",
"uuid": "9b3d32d4-aa6c-44e0-95cd-92117c67738f"
}
]
Expand Down Expand Up @@ -241,7 +241,7 @@
"actions": [
{
"text": "Nope, that's neither.",
"type": "reply",
"type": "send_msg",
"uuid": "ef6b42af-9751-4120-972c-e60771904dd2"
}
]
Expand All @@ -258,7 +258,7 @@
"actions": [
{
"text": "You said yes",
"type": "reply",
"type": "send_msg",
"uuid": "7d17e71a-2967-4dbb-86a4-eda028aca38a"
}
]
Expand All @@ -275,7 +275,7 @@
"actions": [
{
"text": "You said no",
"type": "reply",
"type": "send_msg",
"uuid": "9b03c1fc-c74f-4e27-9349-24df53c6ce96"
}
]
Expand Down
2 changes: 1 addition & 1 deletion cmd/flowrunner/testdata/flows/triggered.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"actions": [
{
"uuid": "e97cd6d5-3354-4dbd-85bc-6c1f87849eec",
"type": "reply",
"type": "send_msg",
"text": "Hi @contact.name you were started in this flow by @parent.contact.name from the '@parent.flow' flow. He is from @parent.contact.fields.state and is aged @parent.results.age."
}
]
Expand Down
6 changes: 3 additions & 3 deletions cmd/flowrunner/testdata/flows/two_questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"actions": [
{
"uuid": "e97cd6d5-3354-4dbd-85bc-6c1f87849eec",
"type": "reply",
"type": "send_msg",
"text": "Hi @contact.name! What is your favorite color? (red/blue) Your number is @contact.urn"
}
],
Expand Down Expand Up @@ -142,7 +142,7 @@
},
{
"uuid": "d2a4052a-3fa9-4608-ab3e-5b9631440447",
"type": "reply",
"type": "send_msg",
"text": "@(TITLE(run.results.favorite_color.category_localized)) it is! What is your favorite soda? (pepsi/coke)"
}
],
Expand Down Expand Up @@ -204,7 +204,7 @@
},
{
"uuid": "0a8467eb-911a-41db-8101-ccf415c48e6a",
"type": "reply",
"type": "send_msg",
"text": "Great, you are done and like @run.results.soda! Webhook status was @run.webhook.status_code"
}
]
Expand Down
6 changes: 3 additions & 3 deletions cmd/flowrunner/testdata/flows/webhook_persists.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
"uuid": "59cee8f1-ed9e-453e-bc17-6f1996e959d0",
"text": "This is the first message.",
"type": "reply"
"type": "send_msg"
}
]
},
Expand Down Expand Up @@ -76,7 +76,7 @@
{
"uuid": "8453e418-03ec-40a0-935f-d757cd2ab075",
"text": "The status is @run.webhook.json.ok. Send something",
"type": "reply"
"type": "send_msg"
}
]
},
Expand Down Expand Up @@ -112,7 +112,7 @@
{
"uuid": "09cd20fb-9a8a-49a2-9c98-fac728c35300",
"text": "The status is now @run.webhook.json.ok",
"type": "reply"
"type": "send_msg"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/flowserver/static/start.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"actions": [
{
"uuid": "accca030-7963-4660-92e9-5b86d5f21d05",
"type": "reply",
"type": "send_msg",
"text": "You said '@run.input.text'"
}
]
Expand Down
2 changes: 1 addition & 1 deletion flows/actions/add_contact_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/nyaruka/goflow/flows/events"
)

// TypeAddContactGroups is our type for the add to group action
// TypeAddContactGroups is our type for the add to groups action
const TypeAddContactGroups string = "add_contact_groups"

// AddContactGroupsAction can be used to add a contact to one or more groups. An `contact_groups_added` event will be created
Expand Down
2 changes: 1 addition & 1 deletion flows/actions/add_contact_urn.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/nyaruka/goflow/flows/events"
)

// TypeAddContactURN is our type for add URN actions
// TypeAddContactURN is our type for the add URN action
const TypeAddContactURN string = "add_contact_urn"

// AddContactURNAction can be used to add a URN to the current contact. An `contact_urn_added` event
Expand Down
Loading

0 comments on commit 865e113

Please sign in to comment.