stateDiagram

state ORDER_MENU {

        %% Initial state name as "." so that it fits in black circle shape.
        %% See https://github.com/StateSmith/StateSmith/issues/404
        state "." as ORDER_MENU.(InitialState)

        state BEVERAGE {

                %% Initial state name as "." so that it fits in black circle shape.
                %% See https://github.com/StateSmith/StateSmith/issues/404
                state "." as BEVERAGE.(InitialState)

                WATER

                WATER : WATER

                WATER : enter / #123; log("water entered")#59; #125;

                WATER : exit / #123; log("water exited")#59; #125;

        }

        state FOOD {

                %% Initial state name as "." so that it fits in black circle shape.
                %% See https://github.com/StateSmith/StateSmith/issues/404
                state "." as FOOD.(InitialState)

                SANDWICH

                SANDWICH : SANDWICH

                SANDWICH : enter / #123; log("sandwich entered")#59; #125;

                SANDWICH : exit / #123; log("sandwich exited")#59; #125;

        }

}

%% Initial state name as "." so that it fits in black circle shape.
%% See https://github.com/StateSmith/StateSmith/issues/404
state "." as ROOT.(InitialState)

ORDER_MENU.(InitialState) --> BEVERAGE

BEVERAGE --> FOOD : EV1 / #123; log("tran action 1")#59; #125;

BEVERAGE.(InitialState) --> WATER

FOOD.(InitialState) --> SANDWICH : / #123; log("tran action 2")#59; #125;

ROOT.(InitialState) --> ORDER_MENU