Last active
March 2, 2020 21:14
-
-
Save matthewlehner/49b0c5d3e3358f6dc03741f546cdc41a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const voteMachine = Machine({ | |
id: "Phone Voting", | |
initial: "idle", | |
context: {}, | |
states: { | |
idle: { | |
on: { | |
CALL_ANSWERED: "greetingMsg" | |
} | |
}, | |
greetingMsg: { | |
on: { | |
GREETING_FINISHED: "pinPromptMsg" | |
} | |
}, | |
pinPromptMsg: { | |
on: { | |
PIN_PROMPT_MSG_FINISHED: "pinPrompt" | |
} | |
}, | |
pinPrompt: { | |
on: { | |
PIN_SUCCESS: "registrationNumberPromptMsg" | |
} | |
}, | |
registrationNumberPromptMsg: { | |
on: { | |
REGISTRATION_PROMPT_MSG_FINISHED: "registrationNumberPrompt" | |
} | |
}, | |
registrationNumberPrompt: { | |
on: { | |
REGISTRATION_NO_SUCCESS: "dobPromptMsg" | |
} | |
}, | |
dobPromptMsg: { | |
on: { | |
DOB_PROMPT_MSG_FINISHED: "dobPrompt" | |
} | |
}, | |
dobPrompt: { | |
on: { | |
DOB_SUCCESS: "voteDisclaimerMessage" | |
} | |
}, | |
voteDisclaimerMessage: { | |
on: { | |
VOTE_DISCLAIMER_MESSAGE_COMPLETE: "ballotFlow" | |
} | |
}, | |
ballotFlow: { | |
on: { | |
CAPTURE_ALL_BALLOT_OPTIONS: "recordBallot" | |
} | |
}, | |
recordBallot: { | |
on: { | |
SERVER_RECORDED_BALLOT: "success" | |
} | |
}, | |
success: {} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment