Examples of newStateMachine()


Examples of org.squirrelframework.foundation.fsm.UntypedStateMachineBuilder.newStateMachine()

        // to A...
        fsmAtoB_builder.externalTransition().from("A").to("B").on(FSMEvent.ToB)
                .perform(storeEventAndFire(fsmBtoA, ctxBtoA, FSMEvent.ToA));
        fsmAtoB_builder.externalTransition().from("B").to("A").on(FSMEvent.ToA).perform(storeState());

        fsmAtoB = fsmAtoB_builder.newStateMachine("A");
    }

    private void createFsmBtoA() {
        UntypedStateMachineBuilder fsmBtoA_builder = StateMachineBuilderFactory.create(StateMachineSample.class);
        fsmBtoA_builder.externalTransition().from("A").to("B").on(FSMEvent.ToB).perform(storeState());
View Full Code Here

Examples of org.squirrelframework.foundation.fsm.UntypedStateMachineBuilder.newStateMachine()

    private void createFsmBtoA() {
        UntypedStateMachineBuilder fsmBtoA_builder = StateMachineBuilderFactory.create(StateMachineSample.class);
        fsmBtoA_builder.externalTransition().from("A").to("B").on(FSMEvent.ToB).perform(storeState());
        fsmBtoA_builder.externalTransition().from("B").to("A").on(FSMEvent.ToA).perform(storeState());

        fsmBtoA = fsmBtoA_builder.newStateMachine("B");
    }

    private static UntypedAnonymousAction storeEventAndFire(final UntypedStateMachine otherFsm, final Context otherCtx,
            final FSMEvent otherEvent) {
        return new UntypedAnonymousAction() {
View Full Code Here

Examples of org.squirrelframework.foundation.fsm.UntypedStateMachineBuilder.newStateMachine()

        UntypedStateMachineBuilder builder = StateMachineBuilderFactory.create(StateMachineSample.class);
        builder.externalTransition().from("A").to("B").on(FSMEvent.ToB).callMethod("fromAToB");
        builder.onEntry("B").callMethod("ontoB");
       
        // 4. Use State Machine
        UntypedStateMachine fsm = builder.newStateMachine("A");
        fsm.fire(FSMEvent.ToB, 10);
       
        System.out.println("Current state is "+fsm.getCurrentState());
    }
}
View Full Code Here

Examples of org.squirrelframework.foundation.fsm.UntypedStateMachineBuilder.newStateMachine()

            }
        });
       
        final UntypedStateMachine fsm1 = builder1.newStateMachine("A");
        fsm1.start();
        final UntypedStateMachine fsm2 = builder2.newStateMachine("C");
        fsm2.start();
       
        return new UntypedStateMachine[]{fsm1, fsm2};
    }
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.