state machine diagram generation