public static void main(String[] args) { try { StateMachineFactory f = StateMachineFactory.load("sample.xstate"); StateMachine sm = f.create("vip flow"); System.out.println("Start state: " + sm.getCurrentState().getId()); notify(sm, "pass"); notify(sm, "pass"); notify(sm, "pass"); notify(sm, "pass"); notify(sm, "pass"); System.out.println("End state: " + sm.getCurrentState().getId()); } catch (Exception e) { e.printStackTrace(); } }
public static void main(String[] args) { try { StateMachineFactory f = StateMachineFactory.load("sample.xstate"); StateMachine sm = f.create("DB Health Lifecycle"); System.out.println("Start state: " + sm.getCurrentState().getId()); notify(sm, "initialize"); notify(sm, "markdown"); notify(sm, "markup"); notify(sm, "shutdown"); System.out.println("End state: " + sm.getCurrentState().getId()); showSourceAndTargetEvent(sm); } catch (Exception e) { e.printStackTrace(); } }