Skip to content

Instantly share code, notes, and snippets.

@awinograd
Created June 8, 2020 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awinograd/00700457a40f1993ca2ff3ea8c603134 to your computer and use it in GitHub Desktop.
Save awinograd/00700457a40f1993ca2ff3ea8c603134 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
"id": "session-06",
"initial": "__start",
"context": {},
"states": {
"__start": {
"on": {
"BEGIN": "session-06"
}
},
"ERROR": {},
"__final": {
"type": "final"
},
"session-06": {
"on": {
"": "setSessionName"
}
},
"setSessionName": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"sessionName": "session-06"
}
}
],
"on": {
"": "setup"
}
},
"setup": {
"on": {
"": "setup::setup"
}
},
"setup::setup": {
"on": {
"": "setup::setBotName"
}
},
"setup::setBotName": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"botName": "Aviva"
}
}
],
"on": {
"": "setup::write-progress-setup"
}
},
"setup::write-progress-setup": {
"meta": {
"writeProgress": true,
"ID": "setup::write-progress-setup",
"props": {
"content": "{{if .convoID}}{{.convoID}}{{end}}",
"progress": "Started"
}
},
"on": {
"ADVANCE": "welcome"
},
"entry": [
"writeProgress",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"welcome": {
"meta": {
"ID": "welcome",
"props": {
"text": [
"Hi there again."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "mood"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"mood": {
"on": {
"": "promptMoodCheck::promptMoodCheck"
}
},
"promptMoodCheck::promptMoodCheck": {
"on": {
"": "promptMoodCheck::moodStart"
}
},
"promptMoodCheck::moodStart": {
"meta": {
"ID": "promptMoodCheck::moodStart",
"props": {
"text": [
"First, how is your mood today on a scale of 1-10?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMoodCheck::mood-check-input-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMoodCheck::mood-check-input-store": {
"on": {
"": "promptMoodCheck::mood-check-input"
}
},
"promptMoodCheck::mood-check-input-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "mood"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMoodCheck::moodEnd",
"onError": "ERROR"
}
},
"promptMoodCheck::mood-check-input": {
"meta": {
"ID": "promptMoodCheck::mood-check-input",
"props": {
"minValue": 1,
"maxValue": 10,
"step": 1,
"value": 5,
"labels": {
"1": "Terrible",
"2": "Very bad",
"3": "Bad",
"4": "Not great",
"5": "Ok",
"6": "Not bad",
"7": "Good",
"8": "Great",
"9": "Really great",
"10": "Outstanding"
}
},
"kind": 103,
"from": 1
},
"on": {
"InputSlider": "promptMoodCheck::mood-check-input-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMoodCheck::moodEnd": {
"meta": {
"ID": "promptMoodCheck::moodEnd",
"props": {
"text": [
"Thank you for sharing. Keep in mind, if you need help right away, call the National Suicide Prevention Lifeline for free confidential help (1-800-273-8255).",
"Now, let's continue."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "myplan"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"myplan": {
"on": {
"": "promptMyPlanCheck::promptMyPlanCheck"
}
},
"promptMyPlanCheck::promptMyPlanCheck": {
"on": {
"": "promptMyPlanCheck::myPlanCheckStart"
}
},
"promptMyPlanCheck::myPlanCheckStart": {
"on": {
"": "promptMyPlanCheck::myplan-check-prompt"
}
},
"promptMyPlanCheck::myPlanCheckStart-result": {
"on": {
"": [
{
"target": "promptMyPlanCheck::myplan-check-yes"
},
{
"target": "promptMyPlanCheck::myPlanCheckEnd"
}
]
}
},
"promptMyPlanCheck::myplan-check-prompt": {
"on": {
"": "promptMyPlanCheck::start"
}
},
"promptMyPlanCheck::start": {
"meta": {
"ID": "promptMyPlanCheck::start",
"props": {
"text": [
"Did you use MyPlan since our last session?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myplan-check-input-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-input-store": {
"on": {
"": "promptMyPlanCheck::myplan-check-input"
}
},
"promptMyPlanCheck::myplan-check-input-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "myplan-check"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMyPlanCheck::myPlanCheckStart-result",
"onError": "ERROR"
}
},
"promptMyPlanCheck::myplan-check-input": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-input",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Yes",
"1": "No"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptMyPlanCheck::myplan-check-input-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMyPlanCheck::myplan-check-yes": {
"on": {
"": "promptMyPlanCheck::start-2"
}
},
"promptMyPlanCheck::start-2": {
"on": {
"": "promptMyPlanCheck::myplan-check-yes-prompt"
}
},
"promptMyPlanCheck::start-2-result": {
"on": {
"": [
{
"target": "promptMyPlanCheck::myplan-check-yes-crisis"
},
{
"target": "promptMyPlanCheck::myplan-check-yes-play"
},
{
"target": "promptMyPlanCheck::myplan-check-yes-change"
},
{
"target": "promptMyPlanCheck::myplan-check-yes-other"
},
{
"target": "promptMyPlanCheck::myPlanCheckEnd"
}
]
}
},
"promptMyPlanCheck::myplan-check-yes-prompt": {
"on": {
"": "promptMyPlanCheck::start-3"
}
},
"promptMyPlanCheck::start-3": {
"meta": {
"ID": "promptMyPlanCheck::start-3",
"props": {
"text": [
"Please share a little about why you used MyPlan."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myplan-check-yes-input-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-yes-input-store": {
"on": {
"": "promptMyPlanCheck::myplan-check-yes-input"
}
},
"promptMyPlanCheck::myplan-check-yes-input-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "myplan-check-yes"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMyPlanCheck::start-2-result",
"onError": "ERROR"
}
},
"promptMyPlanCheck::myplan-check-yes-input": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-yes-input",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "Wanted to kill myself",
"1": "Was just playing around with the app",
"2": "Wanted to make a change to MyPlan",
"3": "Other"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptMyPlanCheck::myplan-check-yes-input-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMyPlanCheck::myplan-check-yes-crisis": {
"on": {
"": "promptMyPlanCheck::myplan-check-yes-crisis-0"
}
},
"promptMyPlanCheck::myplan-check-yes-crisis-0": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-yes-crisis-0",
"props": {
"text": [
"Sorry to hear this."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myplan-check-yes-crisis-1"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-yes-crisis-1": {
"on": {
"": "promptMyPlanCheck::prompt-0"
}
},
"promptMyPlanCheck::prompt-0": {
"meta": {
"ID": "promptMyPlanCheck::prompt-0",
"props": {
"text": [
"Was there a particular event or trigger that made you want to kill yourself?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myplan-check-crisis-trigger-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-crisis-trigger-store": {
"on": {
"": "promptMyPlanCheck::myplan-check-crisis-trigger"
}
},
"promptMyPlanCheck::myplan-check-crisis-trigger-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "myplan-check-crisis-trigger"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMyPlanCheck::prompt-1",
"onError": "ERROR"
}
},
"promptMyPlanCheck::myplan-check-crisis-trigger": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-crisis-trigger",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "Issue with family member",
"1": "Issue with friend",
"2": "Work issue",
"3": "Financial stress",
"4": "General helplessness"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptMyPlanCheck::myplan-check-crisis-trigger-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMyPlanCheck::prompt-1": {
"meta": {
"ID": "promptMyPlanCheck::prompt-1",
"props": {
"text": [
"How long after the triggering event did you feel like killing yourself?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myplan-check-crisis-timing-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-crisis-timing-store": {
"on": {
"": "promptMyPlanCheck::myplan-check-crisis-timing"
}
},
"promptMyPlanCheck::myplan-check-crisis-timing-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "myplan-check-crisis-timing"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMyPlanCheck::prompt-2",
"onError": "ERROR"
}
},
"promptMyPlanCheck::myplan-check-crisis-timing": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-crisis-timing",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "Right away",
"1": "A few hours after",
"3": "A day after",
"4": "A few days after"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptMyPlanCheck::myplan-check-crisis-timing-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMyPlanCheck::prompt-2": {
"on": {
"": "promptMyPlanCheck::myplan-check-yes-prompt-2"
}
},
"promptMyPlanCheck::prompt-2-result": {
"on": {
"": [
{
"target": "promptMyPlanCheck::myplan-check-helpful-yes"
},
{
"target": "promptMyPlanCheck::myplan-check-helpful-no"
},
{
"target": "promptMyPlanCheck::myPlanCheckEnd"
}
]
}
},
"promptMyPlanCheck::myplan-check-yes-prompt-2": {
"on": {
"": "promptMyPlanCheck::start-4"
}
},
"promptMyPlanCheck::start-4": {
"meta": {
"ID": "promptMyPlanCheck::start-4",
"props": {
"text": [
"When you used MyPlan, did that help you turn away from the idea of killing yourself?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myplan-check-helpful-input-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-helpful-input-store": {
"on": {
"": "promptMyPlanCheck::myplan-check-helpful-input"
}
},
"promptMyPlanCheck::myplan-check-helpful-input-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "myplan-check-helpful"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMyPlanCheck::prompt-2-result",
"onError": "ERROR"
}
},
"promptMyPlanCheck::myplan-check-helpful-input": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-helpful-input",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Yes",
"1": "No"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptMyPlanCheck::myplan-check-helpful-input-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMyPlanCheck::myplan-check-helpful-yes": {
"on": {
"": "promptMyPlanCheck::prompt-3"
}
},
"promptMyPlanCheck::prompt-3": {
"meta": {
"ID": "promptMyPlanCheck::prompt-3",
"props": {
"text": [
"Which part of MyPlan did you find most helpful?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::input-0-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::input-0-store": {
"on": {
"": "promptMyPlanCheck::input-0"
}
},
"promptMyPlanCheck::input-0-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "myplan-check-helpful-which"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMyPlanCheck::myPlanCheckHelpfulYesEnd",
"onError": "ERROR"
}
},
"promptMyPlanCheck::input-0": {
"meta": {
"ID": "promptMyPlanCheck::input-0",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "My warning signs",
"1": "Self-management",
"3": "Supportive friends & family",
"4": "Crisis & professional services"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptMyPlanCheck::input-0-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMyPlanCheck::myPlanCheckHelpfulYesEnd": {
"meta": {
"ID": "promptMyPlanCheck::myPlanCheckHelpfulYesEnd",
"props": {
"text": [
"Glad it was helpful"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myPlanCheckEnd"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-helpful-no": {
"on": {
"": "promptMyPlanCheck::prompt-4"
}
},
"promptMyPlanCheck::prompt-4": {
"meta": {
"ID": "promptMyPlanCheck::prompt-4",
"props": {
"text": [
"Why didn't the plan help?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::input-1-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::input-1-store": {
"on": {
"": "promptMyPlanCheck::input-1"
}
},
"promptMyPlanCheck::input-1-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "myplan-check-feedback"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMyPlanCheck::myPlanCheckHelpfulNoEnd",
"onError": "ERROR"
}
},
"promptMyPlanCheck::input-1": {
"meta": {
"ID": "promptMyPlanCheck::input-1",
"props": {},
"kind": 101,
"from": 1
},
"on": {
"InputText": "promptMyPlanCheck::input-1-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMyPlanCheck::myPlanCheckHelpfulNoEnd": {
"meta": {
"ID": "promptMyPlanCheck::myPlanCheckHelpfulNoEnd",
"props": {
"text": [
"Thank you. I will keep this in mind."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myPlanCheckEnd"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-yes-play": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-yes-play",
"props": {
"text": [
"Ok, that's great. Good to know you're using the app!"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myPlanCheckEnd"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-yes-change": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-yes-change",
"props": {
"text": [
"Good. I hope you were able to make the changes you wanted."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myPlanCheckEnd"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-yes-other": {
"on": {
"": "promptMyPlanCheck::myplan-check-yes-other-prompt"
}
},
"promptMyPlanCheck::myplan-check-yes-other-prompt": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-yes-other-prompt",
"props": {
"text": [
"Please tell me more about why you used MyPlan."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myplan-check-other-input-store"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myplan-check-other-input-store": {
"on": {
"": "promptMyPlanCheck::myplan-check-other-input"
}
},
"promptMyPlanCheck::myplan-check-other-input-store-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "myplan-check-other"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "promptMyPlanCheck::myplan-check-yes-other-end",
"onError": "ERROR"
}
},
"promptMyPlanCheck::myplan-check-other-input": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-other-input",
"props": {},
"kind": 101,
"from": 1
},
"on": {
"InputText": "promptMyPlanCheck::myplan-check-other-input-store-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptMyPlanCheck::myplan-check-yes-other-end": {
"meta": {
"ID": "promptMyPlanCheck::myplan-check-yes-other-end",
"props": {
"text": [
"Thank you."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptMyPlanCheck::myPlanCheckEnd"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptMyPlanCheck::myPlanCheckEnd": {
"meta": {
"ID": "promptMyPlanCheck::myPlanCheckEnd",
"props": {
"text": [
"Ok. As a reminder, use MyPlan if you have thoughts of killing yourself."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "pre_review"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"pre_review": {
"meta": {
"ID": "pre_review",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Ok, let's move on"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "review_001"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"review_001": {
"meta": {
"ID": "review_001",
"props": {
"text": [
"In the last session, you made a survival kit.",
"This kit has various things to remind you why it's good to stay alive.",
"Ready to start today's session?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "review_002"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"review_002": {
"meta": {
"ID": "review_002",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Ready"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "Cognitive_intro"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"Cognitive_intro": {
"meta": {
"ID": "Cognitive_intro",
"props": {
"text": [
"Today, we're moving to a new phase.",
"In the phase before, we discussed ways to keep you safe by looking at the things you do.",
"Things like sleep, relaxing, removing harmful objects."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Cognitive_confirmation"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Cognitive_confirmation": {
"meta": {
"ID": "Cognitive_confirmation",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Yes, that's right"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "Cognitive_setup"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"Cognitive_setup": {
"meta": {
"ID": "Cognitive_setup",
"props": {
"text": [
"Today, we start the other phase of the treatment - changing how you think.",
"We'll discuss how the way you think affects how you feel and how you act.",
"Are you ready to keep going?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Cognitive_keepgoing"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Cognitive_keepgoing": {
"meta": {
"ID": "Cognitive_keepgoing",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Keep going"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "ABC_intro"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"ABC_intro": {
"meta": {
"ID": "ABC_intro",
"props": {
"text": [
"The first exercise we're doing in this phase is the ABC exercise.",
"Here is a video that explains what it is."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "ABC_VO_watchvideo"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"ABC_VO_watchvideo": {
"meta": {
"ID": "ABC_VO_watchvideo",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Watch video"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "ABC_VO"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"ABC_VO": {
"meta": {
"ID": "ABC_VO",
"props": {
"url": "https://storage.googleapis.com/asset.oui.dev/voiceover/ABCExercise.mp4",
"title": "ABC explanatory video",
"compulsory": true,
"visualState": 3
},
"kind": 202,
"from": 1
},
"on": {
"VisualVideo": "ABC_VO_stop"
},
"entry": [
"sendEnvelope"
]
},
"ABC_VO_stop": {
"meta": {
"ID": "ABC_VO_stop",
"props": {
"url": "https://storage.googleapis.com/asset.oui.dev/voiceover/ABCExercise.mp4",
"title": "ABC explanatory video",
"compulsory": true,
"visualState": 2
},
"kind": 202,
"from": 1
},
"on": {
"VisualVideo": "ABC_VO_asset"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "VisualVideo"
},
"id": "VisualVideo"
}
]
},
"ABC_VO_asset": {
"meta": {
"ID": "ABC_VO_asset",
"props": {
"uri": "https://storage.googleapis.com/asset.oui.dev/voiceover/ABCExercise.mp4",
"linkText": "ABC Exercise"
},
"kind": 2,
"from": 1
},
"on": {
"ADVANCE": "Vignette_intro"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Vignette_intro": {
"meta": {
"ID": "Vignette_intro",
"props": {
"text": [
"Now let's look at an example of Alex doing the ABC exercise.",
"What's most important are the **questions** he asks himself, and the **order** they are asked."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_intro2"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Vignette_intro2": {
"meta": {
"ID": "Vignette_intro2",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Watch video"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "Vignette_video"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"Vignette_video": {
"meta": {
"ID": "Vignette_video",
"props": {
"url": "https://storage.googleapis.com/asset.oui.dev/vignette/Vet_Vignette_ABC_Exercise_RC01.mp4",
"title": "ABC Vignette",
"compulsory": true,
"visualState": 3
},
"kind": 202,
"from": 1
},
"on": {
"VisualVideo": "Vignette_video_stop"
},
"entry": [
"sendEnvelope"
]
},
"Vignette_video_stop": {
"meta": {
"ID": "Vignette_video_stop",
"props": {
"url": "https://storage.googleapis.com/asset.oui.dev/vignette/Vet_Vignette_ABC_Exercise_RC01.mp4",
"title": "ABC Vignette",
"compulsory": true,
"visualState": 2
},
"kind": 202,
"from": 1
},
"on": {
"VisualVideo": "Vignette_video_asset"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "VisualVideo"
},
"id": "VisualVideo"
}
]
},
"Vignette_video_asset": {
"meta": {
"ID": "Vignette_video_asset",
"props": {
"uri": "https://storage.googleapis.com/asset.oui.dev/vignette/Vet_Vignette_ABC_Exercise_RC01.mp4",
"linkText": "Alex's ABC Exercise"
},
"kind": 2,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_A"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Vignette_review_A": {
"meta": {
"ID": "Vignette_review_A",
"props": {
"text": [
"From the video, I hope you got a better sense of how to do the ABC exercise.",
"Let's review how Alex did the ABC exercise.",
"First, let's look at 'A' - **activating events**. What was Alex's **activating** event (what happened?)"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "MUX$Vignette_review_A_MCQ"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"MUX$Vignette_review_A_MCQ": {
"on": {
"": "Vignette_review_A_MCQ"
}
},
"MUX$Vignette_review_A_MCQ-result": {
"on": {
"": [
{
"target": "SEQ$Vignette_review_A_MCQ_wrong"
},
{
"target": "SEQ$Vignette_review_A_MCQ_wrong_2"
},
{
"target": "SEQ$Vignette_review_A_MCQ_right"
},
{
"target": "SEQ$Vignette_review_A_MCQ_wrong_3"
},
{
"target": "Vignette_review_A_MCQ_continue"
}
]
}
},
"Vignette_review_A_MCQ": {
"meta": {
"ID": "Vignette_review_A_MCQ",
"props": {
"max": 1,
"min": 1,
"label": {
"0": "Fight with his parents",
"1": "Was tired and sad",
"2": "Fight with his wife",
"3": "Lost his job"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "MUX$Vignette_review_A_MCQ-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"SEQ$Vignette_review_A_MCQ_wrong": {
"on": {
"": "Vignette_review_A_MCQ_wrong"
}
},
"Vignette_review_A_MCQ_wrong": {
"meta": {
"ID": "Vignette_review_A_MCQ_wrong",
"props": {
"text": [
"Not quite. This could be an activating event for someone else.",
"But for Alex, the activating event was he had a fight with his wife."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_A_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_A_MCQ_wrong_2": {
"on": {
"": "Vignette_review_A_MCQ_wrong_2"
}
},
"Vignette_review_A_MCQ_wrong_2": {
"meta": {
"ID": "Vignette_review_A_MCQ_wrong_2",
"props": {
"text": [
"Not quite. Being tired and sad is more a feeling so is likely to fall in the C category - consequence.",
"For activating events, we're looking for events or things that happened.",
"In this case, Alex's activating event was he had a fight with his wife."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_A_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_A_MCQ_right": {
"on": {
"": "Vignette_review_A_MCQ_right"
}
},
"Vignette_review_A_MCQ_right": {
"meta": {
"ID": "Vignette_review_A_MCQ_right",
"props": {
"text": [
"That's right. Alex had a fight with his wife. This was the activating event that set Alex off."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_A_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_A_MCQ_wrong_3": {
"on": {
"": "Vignette_review_A_MCQ_wrong_3"
}
},
"Vignette_review_A_MCQ_wrong_3": {
"meta": {
"ID": "Vignette_review_A_MCQ_wrong_3",
"props": {
"text": [
"Not quite. This could be an activating event for someone else.",
"But for Alex, the activating event was he had a fight with his wife."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_A_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Vignette_review_A_MCQ_continue": {
"meta": {
"ID": "Vignette_review_A_MCQ_continue",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Got it - let's move on"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "Vignette_review_B"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"Vignette_review_B": {
"meta": {
"ID": "Vignette_review_B",
"props": {
"text": [
"Next let's look at 'B' - **beliefs**. What was Alex's **belief** (what does he tell himself?)"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "MUX$Vignette_review_B_MCQ"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"MUX$Vignette_review_B_MCQ": {
"on": {
"": "Vignette_review_B_MCQ"
}
},
"MUX$Vignette_review_B_MCQ-result": {
"on": {
"": [
{
"target": "SEQ$Vignette_review_B_MCQ_wrong"
},
{
"target": "SEQ$Vignette_review_B_MCQ_wrong_1"
},
{
"target": "SEQ$Vignette_review_B_MCQ_right"
},
{
"target": "SEQ$Vignette_review_B_MCQ_wrong_2"
},
{
"target": "Vignette_review_B_MCQ_continue"
}
]
}
},
"Vignette_review_B_MCQ": {
"meta": {
"ID": "Vignette_review_B_MCQ",
"props": {
"max": 1,
"min": 1,
"label": {
"0": "I'm lazy and useless",
"1": "I'm such a screwup",
"2": "I'm a bad husband & wife is better off without me",
"3": "Nobody loves me"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "MUX$Vignette_review_B_MCQ-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"SEQ$Vignette_review_B_MCQ_wrong": {
"on": {
"": "Vignette_review_B_MCQ_wrong"
}
},
"Vignette_review_B_MCQ_wrong": {
"meta": {
"ID": "Vignette_review_B_MCQ_wrong",
"props": {
"text": [
"That's not quite right. The belief Alex had was that he was a bad husband and his wife would be better off without him.",
"This is the thought Alex had after the activating event— the fight with his wife.",
"Keep going?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_B_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_B_MCQ_wrong_1": {
"on": {
"": "Vignette_review_B_MCQ_wrong_1"
}
},
"Vignette_review_B_MCQ_wrong_1": {
"meta": {
"ID": "Vignette_review_B_MCQ_wrong_1",
"props": {
"text": [
"That's not quite right. The belief Alex had was that he was a bad husband and his wife would be better off without him.",
"This is the thought Alex had after the activating event— the fight with his wife.",
"Keep going?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_B_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_B_MCQ_right": {
"on": {
"": "Vignette_review_B_MCQ_right"
}
},
"Vignette_review_B_MCQ_right": {
"meta": {
"ID": "Vignette_review_B_MCQ_right",
"props": {
"text": [
"That's right. This was the belief that Alex had followed the activating event.",
"It was his immediate thought after the fight with his wife.",
"Keep going?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_B_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_B_MCQ_wrong_2": {
"on": {
"": "Vignette_review_B_MCQ_wrong_2"
}
},
"Vignette_review_B_MCQ_wrong_2": {
"meta": {
"ID": "Vignette_review_B_MCQ_wrong_2",
"props": {
"text": [
"That's not quite right. The belief Alex had was that he was a bad husband and his wife would be better off without him.",
"This is the thought Alex had after the activating event— the fight with his wife.",
"Keep going?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_B_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Vignette_review_B_MCQ_continue": {
"meta": {
"ID": "Vignette_review_B_MCQ_continue",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Let's keep going"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "Vignette_review_C"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"Vignette_review_C": {
"meta": {
"ID": "Vignette_review_C",
"props": {
"text": [
"Next, let's look at 'C' - **consequences**. What was the **consequence** from the activating event and Alex's beliefs?",
"In other words, how does Alex end up feeling?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "MUX$Vignette_review_C_MCQ"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"MUX$Vignette_review_C_MCQ": {
"on": {
"": "Vignette_review_C_MCQ"
}
},
"MUX$Vignette_review_C_MCQ-result": {
"on": {
"": [
{
"target": "SEQ$Vignette_review_C_MCQ_wrong"
},
{
"target": "SEQ$Vignette_review_C_MCQ_wrong_1"
},
{
"target": "SEQ$Vignette_review_C_MCQ_right"
},
{
"target": "SEQ$Vignette_review_C_MCQ_wrong_2"
},
{
"target": "Vignette_review_C_MCQ_continue"
}
]
}
},
"Vignette_review_C_MCQ": {
"meta": {
"ID": "Vignette_review_C_MCQ",
"props": {
"max": 1,
"min": 1,
"label": {
"0": "Smashed his phone",
"1": "Depressed & ashamed",
"2": "Angry & embarrassed",
"3": "Resentful & bitter"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "MUX$Vignette_review_C_MCQ-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"SEQ$Vignette_review_C_MCQ_wrong": {
"on": {
"": "Vignette_review_C_MCQ_wrong"
}
},
"Vignette_review_C_MCQ_wrong": {
"meta": {
"ID": "Vignette_review_C_MCQ_wrong",
"props": {
"text": [
"That's not quite right. The fight he had with his wife, and thinking he was a bad husband, led to Alex feeling angry and embarrassed.",
"This is the consequence from the activating event and his beliefs.",
"Ready to move on?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_C_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_C_MCQ_wrong_1": {
"on": {
"": "Vignette_review_C_MCQ_wrong_1"
}
},
"Vignette_review_C_MCQ_wrong_1": {
"meta": {
"ID": "Vignette_review_C_MCQ_wrong_1",
"props": {
"text": [
"That's not quite right. The fight he had with his wife, and thinking he was a bad husband, led to Alex feeling angry and embarrassed.",
"This is the consequence from the activating event and his beliefs.",
"Ready to move on?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_C_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_C_MCQ_right": {
"on": {
"": "Vignette_review_C_MCQ_right"
}
},
"Vignette_review_C_MCQ_right": {
"meta": {
"ID": "Vignette_review_C_MCQ_right",
"props": {
"text": [
"That's right. The fight he had with his wife led to Alex feeling angry and embarrassed.",
"This is the consequence from the activating event and his beliefs.",
"Ready to continue?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_C_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_C_MCQ_wrong_2": {
"on": {
"": "Vignette_review_C_MCQ_wrong_2"
}
},
"Vignette_review_C_MCQ_wrong_2": {
"meta": {
"ID": "Vignette_review_C_MCQ_wrong_2",
"props": {
"text": [
"That's not quite right. The fight he had with his wife, and thinking he was a bad husband, led to Alex feeling angry and embarrassed.",
"This is the consequence from the activating event and his beliefs.",
"Ready to move on?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_C_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Vignette_review_C_MCQ_continue": {
"meta": {
"ID": "Vignette_review_C_MCQ_continue",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Sounds good"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "Vignette_review_helpful"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"Vignette_review_helpful": {
"meta": {
"ID": "Vignette_review_helpful",
"props": {
"text": [
"Now we want to ask: Are Alex's thoughts (that he is a bad husband and that his wife is better off without him) helpful?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "MUX$Vignette_review_helpful_MCQ"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"MUX$Vignette_review_helpful_MCQ": {
"on": {
"": "Vignette_review_helpful_MCQ"
}
},
"MUX$Vignette_review_helpful_MCQ-result": {
"on": {
"": [
{
"target": "SEQ$Vignette_review_helpful_MCQ_wrong"
},
{
"target": "SEQ$Vignette_review_helpful_MCQ_wrong_2"
},
{
"target": "SEQ$Vignette_review_helpful_MCQ_right"
},
{
"target": "Vignette_review_helpful_continue"
}
]
}
},
"Vignette_review_helpful_MCQ": {
"meta": {
"ID": "Vignette_review_helpful_MCQ",
"props": {
"max": 1,
"min": 1,
"label": {
"0": "Who cares if it's helpful if it's true?",
"1": "He thinks it is true so it is helpful",
"2": "It is not helpful as the thoughts just make things worse"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "MUX$Vignette_review_helpful_MCQ-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"SEQ$Vignette_review_helpful_MCQ_wrong": {
"on": {
"": "Vignette_review_helpful_MCQ_wrong"
}
},
"Vignette_review_helpful_MCQ_wrong": {
"meta": {
"ID": "Vignette_review_helpful_MCQ_wrong",
"props": {
"text": [
"Not quite right. First, apart from the fight, there isn't much evidence that Alex is a bad husband.",
"Second, even if he is a bad husband, things can be both truthful and unhelpful.",
"Truthful thoughts can be unhelpful if they're not constructive. These thoughts just make you feel bad about yourself.",
"Move onto the last question in this section?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_helpful_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_helpful_MCQ_wrong_2": {
"on": {
"": "Vignette_review_helpful_MCQ_wrong_2"
}
},
"Vignette_review_helpful_MCQ_wrong_2": {
"meta": {
"ID": "Vignette_review_helpful_MCQ_wrong_2",
"props": {
"text": [
"Not quite right. First, apart from the fight, there isn't much evidence that Alex is a bad husband.",
"Second, even if he is a bad husband, things can be both truthful and unhelpful.",
"Truthful thoughts can be unhelpful if they're not constructive. These thoughts just make you feel bad about yourself.",
"Move onto the last question in this section?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_helpful_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_helpful_MCQ_right": {
"on": {
"": "Vignette_review_helpful_MCQ_right"
}
},
"Vignette_review_helpful_MCQ_right": {
"meta": {
"ID": "Vignette_review_helpful_MCQ_right",
"props": {
"text": [
"That's right. It's not helpful for Alex to think such negative thoughts about himself.",
"Even if the thoughts were true, the thoughts are still unhelpful as they're not constructive.",
"Instead, all the thoughts do is to make him feel bad and go into a downward spiral.",
"Move onto the last question in this section?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_helpful_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Vignette_review_helpful_continue": {
"meta": {
"ID": "Vignette_review_helpful_continue",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Sounds good"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "Vignette_review_alternative"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"Vignette_review_alternative": {
"meta": {
"ID": "Vignette_review_alternative",
"props": {
"text": [
"What other thoughts or beliefs could Alex have had instead of his unhelpful thoughts?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "MUX$Vignette_review_alternative_MCQ"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"MUX$Vignette_review_alternative_MCQ": {
"on": {
"": "Vignette_review_alternative_MCQ"
}
},
"MUX$Vignette_review_alternative_MCQ-result": {
"on": {
"": [
{
"target": "SEQ$Vignette_review_alternative_MCQ_wrong"
},
{
"target": "SEQ$Vignette_review_alternative_MCQ_wrong_1"
},
{
"target": "SEQ$Vignette_review_alternative_MCQ_right"
},
{
"target": "SEQ$Vignette_review_alternative_MCQ_wrong_2"
},
{
"target": "Vignette_review_alternative_MCQ_continue"
}
]
}
},
"Vignette_review_alternative_MCQ": {
"meta": {
"ID": "Vignette_review_alternative_MCQ",
"props": {
"max": 1,
"min": 1,
"label": {
"0": "I'm a great guy and it's not my fault",
"1": "Everything's fine. There's nothing wrong",
"2": "An argument doesn't mean I'm a bad husband. Things will get better after we cool off",
"3": "I didn't do anything wrong. Why are other people so unreasonable?"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "MUX$Vignette_review_alternative_MCQ-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"SEQ$Vignette_review_alternative_MCQ_wrong": {
"on": {
"": "Vignette_review_alternative_MCQ_wrong"
}
},
"Vignette_review_alternative_MCQ_wrong": {
"meta": {
"ID": "Vignette_review_alternative_MCQ_wrong",
"props": {
"text": [
"Alternative thoughts aren't really about figuring out who is at fault or saying there's nothing wrong.",
"It's ok to agree that things are not perfect right now, but not to focus on who was in the wrong.",
"The most helpful alternative thoughts remind you that when things calm down, things will get better.",
"Let's have you do the ABC exercise now."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_alternative_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_alternative_MCQ_wrong_1": {
"on": {
"": "Vignette_review_alternative_MCQ_wrong_1"
}
},
"Vignette_review_alternative_MCQ_wrong_1": {
"meta": {
"ID": "Vignette_review_alternative_MCQ_wrong_1",
"props": {
"text": [
"Alternative thoughts aren't really about figuring out who is at fault or saying there's nothing wrong.",
"It's ok to agree that things are not perfect right now, but not to focus on who was in the wrong.",
"The most helpful alternative thoughts remind you that when things calm down, things will get better.",
"Let's have you do the ABC exercise now."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_alternative_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_alternative_MCQ_right": {
"on": {
"": "Vignette_review_alternative_MCQ_right"
}
},
"Vignette_review_alternative_MCQ_right": {
"meta": {
"ID": "Vignette_review_alternative_MCQ_right",
"props": {
"text": [
"That's right. It's ok to tell yourself that things are not perfect right now but can get better later.",
"It's also good you did not not focus on the blame game.",
"Let's have you do the ABC exercise now."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_alternative_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"SEQ$Vignette_review_alternative_MCQ_wrong_2": {
"on": {
"": "Vignette_review_alternative_MCQ_wrong_2"
}
},
"Vignette_review_alternative_MCQ_wrong_2": {
"meta": {
"ID": "Vignette_review_alternative_MCQ_wrong_2",
"props": {
"text": [
"Alternative thoughts aren't really about figuring out who is at fault or saying there's nothing wrong.",
"It's ok to agree that things are not perfect right now, but not to focus on who was in the wrong.",
"The most helpful alternative thoughts remind you that when things calm down, things will get better.",
"Let's have you do the ABC exercise now."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "Vignette_review_alternative_MCQ_continue"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"Vignette_review_alternative_MCQ_continue": {
"meta": {
"ID": "Vignette_review_alternative_MCQ_continue",
"props": {
"min": 1,
"max": 1,
"variant": "button",
"label": {
"0": "Sounds good - let's start"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "exerciseIntro"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"exerciseIntro": {
"meta": {
"ID": "exerciseIntro",
"props": {
"text": [
"When you shared your suicide story, there was a lot of stuff going on.",
"We are going to do the ABC exercise to see how your thoughts influenced how the crisis played out.",
"To get you started on this ABC exercise, we have a picture to help you."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptABC"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC": {
"on": {
"": "promptABC::promptABC"
}
},
"promptABC::promptABC": {
"on": {
"": "promptABC::abcDiagramExplain"
}
},
"promptABC::abcDiagramExplain": {
"meta": {
"ID": "promptABC::abcDiagramExplain",
"props": {
"text": [
"The picture above shows how each of the three parts are linked.",
"Ready to get started?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptABC::abcDiagram"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::abcDiagram": {
"meta": {
"ID": "promptABC::abcDiagram",
"props": {
"collapsed": false,
"currentStep": "",
"responses": {},
"visualState": 1
},
"kind": 205,
"from": 1
},
"on": {
"ADVANCE": "promptABC::abcStart"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::abcStart": {
"meta": {
"ID": "promptABC::abcStart",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "Yes"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptABC::activatingEventStart"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptABC::activatingEventStart": {
"meta": {
"ID": "promptABC::activatingEventStart",
"props": {
"collapsed": true,
"currentStep": "a",
"responses": {},
"visualState": 1
},
"kind": 205,
"from": 1
},
"on": {
"ADVANCE": "promptABC::activatingEvent"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::activatingEvent": {
"on": {
"": "abcActivatingEvent::abcActivatingEvent"
}
},
"abcActivatingEvent::abcActivatingEvent": {
"on": {
"": "abcActivatingEvent::activatingEvent"
}
},
"abcActivatingEvent::activatingEvent": {
"meta": {
"ID": "abcActivatingEvent::activatingEvent",
"props": {
"text": [
"The activating event is **the event** that caused the problem."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcActivatingEvent::activatingEventLoop"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcActivatingEvent::activatingEventLoop": {
"on": {
"": "abcActivatingEvent::activatingEventBody"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
"abcActivatingEvent::activatingEventLoop-handleIterationEnd": {
"on": {
"": "abcActivatingEvent::activatingEventCheck"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
"abcActivatingEvent::activatingEventLoop-handlePred": {
"on": {
"": [
{
"target": "abcActivatingEvent::activatingEventBody",
"actions": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
{
"target": "promptABC::activatingEventDiagram",
"actions": [
{
"type": "xstate.assign",
"assignment": {}
},
{
"type": "xstate.assign",
"assignment": {}
}
]
}
]
}
},
"abcActivatingEvent::activatingEventBody": {
"on": {
"": "abcActivatingEvent::activatingEventPrompt"
}
},
"abcActivatingEvent::activatingEventPrompt": {
"meta": {
"ID": "abcActivatingEvent::activatingEventPrompt",
"props": {
"text": [
"What was the **activating event** from your crisis?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcActivatingEvent::activatingEventInputStore"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcActivatingEvent::activatingEventInputStore": {
"on": {
"": "abcActivatingEvent::activatingEventInput"
}
},
"abcActivatingEvent::activatingEventInputStore-result": {
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
],
"on": {
"": "abcActivatingEvent::activatingEventLoop-handleIterationEnd"
}
},
"abcActivatingEvent::activatingEventInput": {
"meta": {
"ID": "abcActivatingEvent::activatingEventInput",
"props": {},
"kind": 101,
"from": 1
},
"on": {
"InputText": "abcActivatingEvent::activatingEventInputStore-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"abcActivatingEvent::activatingEventCheck": {
"on": {
"": "abcActivatingEvent::activatingEventCheckBody"
}
},
"abcActivatingEvent::activatingEventCheck-handleResult": {
"on": {
"ADVANCE": "abcActivatingEvent::activatingEventLoop-handlePred"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
},
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcActivatingEvent::activatingEventCheckBody": {
"on": {
"": "abcActivatingEvent::activatingEventCheckPrompt"
}
},
"abcActivatingEvent::activatingEventCheckPrompt": {
"meta": {
"ID": "abcActivatingEvent::activatingEventCheckPrompt",
"props": {
"text": [
"To confirm, your activating event was: \"{{activatingEvent}}\"?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcActivatingEvent::activatingEventCheckConfirm"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcActivatingEvent::activatingEventCheckConfirm": {
"meta": {
"ID": "abcActivatingEvent::activatingEventCheckConfirm",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "That's right",
"1": "No, let me try again"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "abcActivatingEvent::activatingEventCheck-handleResult"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptABC::activatingEventDiagram": {
"meta": {
"ID": "promptABC::activatingEventDiagram",
"props": {
"collapsed": false,
"currentStep": "a",
"responses": {
"a": "{{activatingEvent}}"
},
"visualState": 1
},
"kind": 205,
"from": 1
},
"on": {
"ADVANCE": "promptABC::activatingEventOutro"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::activatingEventOutro": {
"meta": {
"ID": "promptABC::activatingEventOutro",
"props": {
"text": [
"Ready to move to \"beliefs\"?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptABC::activatingEventEnd"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::activatingEventEnd": {
"meta": {
"ID": "promptABC::activatingEventEnd",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "Sure"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptABC::beliefDiagramHide"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptABC::beliefDiagramHide": {
"meta": {
"ID": "promptABC::beliefDiagramHide",
"props": {
"collapsed": true,
"currentStep": "b",
"responses": {
"a": "{{activatingEvent}}"
},
"visualState": 1
},
"kind": 205,
"from": 1
},
"on": {
"ADVANCE": "promptABC::belief"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::belief": {
"on": {
"": "abcBelief::abcBelief"
}
},
"abcBelief::abcBelief": {
"on": {
"": "abcBelief::belief"
}
},
"abcBelief::belief": {
"meta": {
"ID": "abcBelief::belief",
"props": {
"text": [
"Your **beliefs** are what you tell yourself in reaction to the activating event.",
"They are the thoughts that you use to describe yourself."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcBelief::beliefLoop"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcBelief::beliefLoop": {
"on": {
"": "abcBelief::beliefBody"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
"abcBelief::beliefLoop-handleIterationEnd": {
"on": {
"": "abcBelief::beliefCheck"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
"abcBelief::beliefLoop-handlePred": {
"on": {
"": [
{
"target": "abcBelief::beliefBody",
"actions": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
{
"target": "promptABC::beliefDiagram",
"actions": [
{
"type": "xstate.assign",
"assignment": {}
},
{
"type": "xstate.assign",
"assignment": {}
}
]
}
]
}
},
"abcBelief::beliefBody": {
"on": {
"": "abcBelief::beliefPrompt"
}
},
"abcBelief::beliefPrompt": {
"meta": {
"ID": "abcBelief::beliefPrompt",
"props": {
"text": [
"What belief do you tell yourself?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcBelief::beliefInputStore"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcBelief::beliefInputStore": {
"on": {
"": "abcBelief::beliefInput"
}
},
"abcBelief::beliefInputStore-result": {
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
],
"on": {
"": "abcBelief::beliefLoop-handleIterationEnd"
}
},
"abcBelief::beliefInput": {
"meta": {
"ID": "abcBelief::beliefInput",
"props": {},
"kind": 101,
"from": 1
},
"on": {
"InputText": "abcBelief::beliefInputStore-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"abcBelief::beliefCheck": {
"on": {
"": "abcBelief::beliefCheckBody"
}
},
"abcBelief::beliefCheck-handleResult": {
"on": {
"ADVANCE": "abcBelief::beliefLoop-handlePred"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
},
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcBelief::beliefCheckBody": {
"on": {
"": "abcBelief::beliefCheckPrompt"
}
},
"abcBelief::beliefCheckPrompt": {
"meta": {
"ID": "abcBelief::beliefCheckPrompt",
"props": {
"text": [
"To confirm, your belief was: \"{{belief}}\"?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcBelief::beliefCheckConfirm"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcBelief::beliefCheckConfirm": {
"meta": {
"ID": "abcBelief::beliefCheckConfirm",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "That's right",
"1": "No, let me try again"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "abcBelief::beliefCheck-handleResult"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptABC::beliefDiagram": {
"meta": {
"ID": "promptABC::beliefDiagram",
"props": {
"collapsed": false,
"currentStep": "b",
"responses": {
"a": "{{activatingEvent}}",
"b": "{{belief}}"
},
"visualState": 1
},
"kind": 205,
"from": 1
},
"on": {
"ADVANCE": "promptABC::beliefOutro"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::beliefOutro": {
"meta": {
"ID": "promptABC::beliefOutro",
"props": {
"text": [
"Ready to move to \"consequences\"?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptABC::beliefEnd"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::beliefEnd": {
"meta": {
"ID": "promptABC::beliefEnd",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "Sure"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptABC::consequenceDiagramHide"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptABC::consequenceDiagramHide": {
"meta": {
"ID": "promptABC::consequenceDiagramHide",
"props": {
"collapsed": true,
"currentStep": "c",
"responses": {
"a": "{{activatingEvent}}",
"b": "{{belief}}"
},
"visualState": 1
},
"kind": 205,
"from": 1
},
"on": {
"ADVANCE": "promptABC::consequence"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::consequence": {
"on": {
"": "abcConsequence::abcConsequence"
}
},
"abcConsequence::abcConsequence": {
"on": {
"": "abcConsequence::consequence"
}
},
"abcConsequence::consequence": {
"meta": {
"ID": "abcConsequence::consequence",
"props": {
"text": [
"The **consequences** are what you felt as a result of the event and your beliefs."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcConsequence::consequenceLoop"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcConsequence::consequenceLoop": {
"on": {
"": "abcConsequence::consequenceBody"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
"abcConsequence::consequenceLoop-handleIterationEnd": {
"on": {
"": "abcConsequence::consequenceCheck"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
"abcConsequence::consequenceLoop-handlePred": {
"on": {
"": [
{
"target": "abcConsequence::consequenceBody",
"actions": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
{
"target": "promptABC::consequenceOutro",
"actions": [
{
"type": "xstate.assign",
"assignment": {}
},
{
"type": "xstate.assign",
"assignment": {}
}
]
}
]
}
},
"abcConsequence::consequenceBody": {
"on": {
"": "abcConsequence::consequencePrompt"
}
},
"abcConsequence::consequencePrompt": {
"meta": {
"ID": "abcConsequence::consequencePrompt",
"props": {
"text": [
"How did you end up feeling?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcConsequence::consequenceInputStore"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcConsequence::consequenceInputStore": {
"on": {
"": "abcConsequence::consequenceInput"
}
},
"abcConsequence::consequenceInputStore-result": {
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
],
"on": {
"": "abcConsequence::consequenceLoop-handleIterationEnd"
}
},
"abcConsequence::consequenceInput": {
"meta": {
"ID": "abcConsequence::consequenceInput",
"props": {},
"kind": 101,
"from": 1
},
"on": {
"InputText": "abcConsequence::consequenceInputStore-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"abcConsequence::consequenceCheck": {
"on": {
"": "abcConsequence::consequenceCheckBody"
}
},
"abcConsequence::consequenceCheck-handleResult": {
"on": {
"ADVANCE": "abcConsequence::consequenceLoop-handlePred"
},
"entry": [
{
"type": "xstate.assign",
"assignment": {}
},
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcConsequence::consequenceCheckBody": {
"on": {
"": "abcConsequence::consequenceCheckPrompt"
}
},
"abcConsequence::consequenceCheckPrompt": {
"meta": {
"ID": "abcConsequence::consequenceCheckPrompt",
"props": {
"text": [
"To confirm, your belief was: \"{{consequence}}\"?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcConsequence::consequenceCheckConfirm"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcConsequence::consequenceCheckConfirm": {
"meta": {
"ID": "abcConsequence::consequenceCheckConfirm",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "That's right",
"1": "No, let me try again"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "abcConsequence::consequenceCheck-handleResult"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptABC::consequenceOutro": {
"meta": {
"ID": "promptABC::consequenceOutro",
"props": {
"text": [
"Above is your completed picture."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "promptABC::consequenceDiagram"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::consequenceDiagram": {
"meta": {
"ID": "promptABC::consequenceDiagram",
"props": {
"collapsed": false,
"currentStep": "c",
"responses": {
"a": "{{activatingEvent}}",
"b": "{{belief}}",
"c": "{{consequence}}"
},
"visualState": 1
},
"kind": 205,
"from": 1
},
"on": {
"ADVANCE": "promptABC::consequenceEnd"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"promptABC::consequenceEnd": {
"meta": {
"ID": "promptABC::consequenceEnd",
"props": {
"min": 1,
"max": 1,
"label": {
"0": "Looks good"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "promptABC::closeDiagram"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"promptABC::closeDiagram": {
"meta": {
"ID": "promptABC::closeDiagram",
"props": {
"collapsed": false,
"currentStep": "c",
"responses": {
"a": "{{activatingEvent}}",
"b": "{{belief}}",
"c": "{{consequence}}"
},
"visualState": 2
},
"kind": 205,
"from": 1
},
"on": {
"ADVANCE": "explainABC"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"explainABC": {
"meta": {
"ID": "explainABC",
"props": {
"text": [
"You've now linked your activating event to beliefs about yourself and how those beliefs made you feel."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcHelpful"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcHelpful": {
"on": {
"": "abcHelpfulBodyStore"
}
},
"abcHelpful-result": {
"on": {
"": [
{
"target": "abcNotHelpful"
},
{
"target": "abcIsHelpful"
},
{
"target": "abcAlternativePrompt"
}
]
}
},
"abcHelpfulBodyStore": {
"on": {
"": "abcHelpfulBody"
}
},
"abcHelpfulBodyStore-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "beliefHelpful"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "abcHelpful-result",
"onError": "ERROR"
}
},
"abcHelpfulBody": {
"on": {
"": "abcHelpfulPrompt"
}
},
"abcHelpfulPrompt": {
"meta": {
"ID": "abcHelpfulPrompt",
"props": {
"text": [
"Was your belief that \"{{belief}}\" helpful?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcHelpfulInput"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcHelpfulInput": {
"meta": {
"ID": "abcHelpfulInput",
"props": {
"max": 1,
"min": 1,
"label": {
"0": "No",
"1": "Yes"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "abcHelpfulBodyStore-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"abcNotHelpful": {
"on": {
"": "abcNotHelpfulPrompt"
}
},
"abcNotHelpfulPrompt": {
"meta": {
"ID": "abcNotHelpfulPrompt",
"props": {
"text": [
"Why do you think your belief was unhelpful?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "beliefNotHelpfulInputStore"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"beliefNotHelpfulInputStore": {
"on": {
"": "beliefNotHelpfulInput"
}
},
"beliefNotHelpfulInputStore-result": {
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
],
"on": {
"": "abcAlternativePrompt"
}
},
"beliefNotHelpfulInput": {
"meta": {
"ID": "beliefNotHelpfulInput",
"props": {},
"kind": 101,
"from": 1
},
"on": {
"InputText": "beliefNotHelpfulInputStore-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"abcIsHelpful": {
"meta": {
"ID": "abcIsHelpful",
"props": {
"text": [
"Although you may see this belief is helping you, it is not.",
"Unhelpful beliefs make you feel bad about yourself for no good reason."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcAlternativePrompt"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcAlternativePrompt": {
"meta": {
"ID": "abcAlternativePrompt",
"props": {
"text": [
"What is something else you can tell yourself in the future when in a similar situation?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcAlternativeInputStore"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcAlternativeInputStore": {
"on": {
"": "abcAlternativeInput"
}
},
"abcAlternativeInputStore-result": {
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
],
"on": {
"": "generateUUIDStore"
}
},
"abcAlternativeInput": {
"meta": {
"ID": "abcAlternativeInput",
"props": {},
"kind": 101,
"from": 1
},
"on": {
"InputText": "abcAlternativeInputStore-result"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"generateUUIDStore": {
"on": {
"": "generateUUID"
}
},
"generateUUIDStore-result": {
"entry": [
{
"type": "xstate.assign",
"assignment": {}
}
],
"on": {
"": "shapeUserArgsStore"
}
},
"generateUUID": {
"on": {
"": "generateUUIDStore-result"
},
"exit": [
{
"type": "xstate.assign",
"assignment": {}
}
]
},
"shapeUserArgsStore": {
"on": {
"": "shapeUserArgs"
}
},
"shapeUserArgsStore-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "abc"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "abcApplyOutro",
"onError": "ERROR"
}
},
"shapeUserArgs": {
"on": {
"": "shapeUserArgsStore-handleStore"
},
"entry": {
"type": "xstate.assign",
"assignment": {}
}
},
"abcApplyOutro": {
"meta": {
"ID": "abcApplyOutro",
"props": {
"text": [
"Thank you for being willing to share. That must have not been easy.",
"Ready to continue?"
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "abcApplyPause"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcApplyPause": {
"meta": {
"ID": "abcApplyPause",
"props": {
"max": 1,
"min": 1,
"label": {
"0": "No",
"1": "Yes"
},
"variant": "button"
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "abcReviewPrompt"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"abcReviewPrompt": {
"meta": {
"ID": "abcReviewPrompt",
"props": {
"text": [
"Let's take a look at what you've written."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "reviewABCArtifact"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"reviewABCArtifact": {
"meta": {
"ID": "reviewABCArtifact",
"props": {
"artifactName": "ABCWorksheet",
"linkText": "ABC Worksheet",
"params": {
"ID": "{{abcWorksheetID}}"
}
},
"kind": 3,
"from": 1
},
"on": {
"ADVANCE": "abcOutro"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"abcOutro": {
"meta": {
"ID": "abcOutro",
"props": {
"text": [
"We've learned a very useful framework today to help you see how your thoughts affect how you feel and act."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "lessonlearned"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"lessonlearned": {
"on": {
"": "lessonLearned::lessonLearned"
}
},
"lessonLearned::lessonLearned": {
"on": {
"": "lessonLearned::startStore"
}
},
"lessonLearned::startStore": {
"on": {
"": "lessonLearned::start"
}
},
"lessonLearned::startStore-handleStore": {
"entry": [
{
"type": "xstate.assign",
"assignment": {
"__STORE": {
"context": "{{sessionName}}",
"key": "lessonLearned"
}
}
}
],
"invoke": {
"src": "storeData",
"onDone": "exit",
"onError": "ERROR"
}
},
"lessonLearned::start": {
"on": {
"": "lessonLearned::prompt"
}
},
"lessonLearned::prompt": {
"meta": {
"ID": "lessonLearned::prompt",
"props": {
"text": [
"Type what you have learned today.",
"We will store it in 'Lessons Learned' in your profile section."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "lessonLearned::entry"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"lessonLearned::entry": {
"meta": {
"ID": "lessonLearned::entry",
"props": {},
"kind": 101,
"from": 1
},
"on": {
"InputText": "lessonLearned::startStore-handleStore"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"exit": {
"on": {
"": "exit::exit"
}
},
"exit::exit": {
"on": {
"": "exit::write-progress-end"
}
},
"exit::write-progress-end": {
"meta": {
"writeProgress": true,
"ID": "exit::write-progress-end",
"props": {
"content": "{{if .convoID}}{{.convoID}}{{end}}",
"progress": "Completed"
}
},
"on": {
"ADVANCE": "exit::start"
},
"entry": [
"writeProgress",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"exit::start": {
"meta": {
"ID": "exit::start",
"props": {
"text": [
"We'll now take you back to the homepage."
]
},
"kind": 1,
"from": 1
},
"on": {
"ADVANCE": "exit::prompt-ready"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"exit::prompt-ready": {
"meta": {
"ID": "exit::prompt-ready",
"props": {
"max": 1,
"min": 1,
"variant": "button",
"label": {
"0": "Ready!"
}
},
"kind": 102,
"from": 1
},
"on": {
"InputChoice": "exit::nav-home"
},
"entry": "sendEnvelope",
"exit": [
{
"type": "xstate.assign",
"assignment": {}
},
"echo"
]
},
"exit::nav-home": {
"meta": {
"ID": "exit::nav-home",
"props": {
"routeName": "home"
},
"kind": 400,
"from": 1
},
"on": {
"ADVANCE": "exit::END"
},
"entry": [
"sendEnvelope",
{
"type": "xstate.send",
"event": {
"type": "ADVANCE"
},
"id": "ADVANCE"
}
]
},
"exit::END": {
"type": "final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment