You have the option of building the Vending Machine
sample yourself.
To build this sample yourself, complete the tasks that
are listed below in order.
It should take roughly 60 minutes to build the sample yourself.
Lessons in this module
Creating the business artifacts
Before you can begin to assemble your state machine in
the graphical editor, you will have to create the artifacts that will
support the state machine.
Creating the state machine
With the necessary artifacts in place, you can now create
the state machine, and configure it appropriately.
Configuring the Idle state
When it is in the Idle state, the state machine is quite
simply waiting for an event, in the form of a coin, to arrive.
Creating the Depositing state
The Depositing state is the state where a user has started
depositing money and has not yet made a selection or canceled. This
state keeps track of how much money has been deposited into the vending
machine.
Linking the two states together
There are four transitions that link both of your states, and each
one provides a different function. The first one registers a coin event, the
second one manages dispensing, the third monitors a timeout, and the fourth
provides a cancellation option.
Creating the state machine component
In this step, you will create a state machine component
in the assembly diagram in order to be able to test it.