当前位置: 首页>>代码示例>>Java>>正文


Java StateMachineStateConfigurer类代码示例

本文整理汇总了Java中org.springframework.statemachine.config.builders.StateMachineStateConfigurer的典型用法代码示例。如果您正苦于以下问题:Java StateMachineStateConfigurer类的具体用法?Java StateMachineStateConfigurer怎么用?Java StateMachineStateConfigurer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StateMachineStateConfigurer类属于org.springframework.statemachine.config.builders包,在下文中一共展示了StateMachineStateConfigurer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; //导入依赖的package包/类
@Override
public void configure(StateMachineStateConfigurer<States2, Events> states)
        throws Exception {
    states
            .withStates()
            .initial(States2.S1)
            .fork(States2.S2)
            .state(States2.S3)
            .join(States2.S4)
            .state(States2.S5)
            .state(States2.S6)
            .and()
            .withStates()
            .parent(States2.S3)
            .initial(States2.S2I)
            .state(States2.S21)
            .state(States2.S22)
            .end(States2.S2F)
            .and()
            .withStates()
            .parent(States2.S3)
            .initial(States2.S3I)
            .state(States2.S31)
            .state(States2.S32)
            .end(States2.S3F);
}
 
开发者ID:WorkingDevelopers,项目名称:spring-state-machine-chart-dumper,代码行数:27,代码来源:JoinSM.java

示例2: configure

import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; //导入依赖的package包/类
private void configure(StateMachineStateConfigurer<S, E> stateConfig, StateMachineTransitionConfigurer<S, E> transitionConfig,
        FlowEdgeConfig<S, E> flowEdgeConfig, List<Transition<S, E>> transitions) throws Exception {
    StateConfigurer<S, E> stateConfigurer = stateConfig.withStates().initial(flowEdgeConfig.initState).end(flowEdgeConfig.finalState);
    ExternalTransitionConfigurer<S, E> transitionConfigurer = null;
    Set<S> failHandled = new HashSet<>();
    for (Transition<S, E> transition : transitions) {
        transitionConfigurer = transitionConfigurer == null ? transitionConfig.withExternal() : transitionConfigurer.and().withExternal();
        AbstractAction<S, E, ?, ?> action = getAction(transition.source);
        if (action != null) {
            stateConfigurer.state(transition.source, action, null);
        }
        transitionConfigurer.source(transition.source).target(transition.target).event(transition.event);
        if (action != null && transition.getFailureEvent() != null && transition.target != flowEdgeConfig.defaultFailureState) {
            action.setFailureEvent(transition.getFailureEvent());
            S failureState = Optional.ofNullable(transition.getFailureState()).orElse(flowEdgeConfig.defaultFailureState);
            stateConfigurer.state(failureState, getAction(failureState), null);
            transitionConfigurer.and().withExternal().source(transition.source).target(failureState).event(transition.getFailureEvent());
            if (!failHandled.contains(failureState)) {
                failHandled.add(failureState);
                transitionConfigurer.and().withExternal().source(failureState).target(flowEdgeConfig.finalState).event(flowEdgeConfig.failureHandled);
            }
        }
    }
    stateConfigurer.state(flowEdgeConfig.finalState, getAction(FlowFinalizeAction.class), null);
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:26,代码来源:AbstractFlowConfiguration.java

示例3: configure

import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; //导入依赖的package包/类
@Override
public void configure(StateMachineStateConfigurer<States, Events> states)
        throws Exception {
    states
            .withStates()
            .initial(States.UNPAID)
            .states(EnumSet.allOf(States.class));
}
 
开发者ID:nellochen,项目名称:springboot-start,代码行数:9,代码来源:StateMachineConfig.java

示例4: configure

import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; //导入依赖的package包/类
@Override
public void configure(StateMachineStateConfigurer<States, Events> states)
		throws Exception {
	states
			.withStates()
			.initial(States.STATE1)
			.states(EnumSet.allOf(States.class));
}
 
开发者ID:AgainstWind,项目名称:spring-cloud-demos,代码行数:9,代码来源:ServiceAApplication.java

示例5: configure

import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; //导入依赖的package包/类
@Override
public void configure(StateMachineStateConfigurer<States, Events> states)
		throws Exception {
	states
			.withStates()
			.initial(States.STARTING)
			.states(EnumSet.allOf(States.class));
}
 
开发者ID:deib-polimi,项目名称:diceH2020-space4cloudsWS,代码行数:9,代码来源:StateMachineConfig.java

示例6: configure

import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; //导入依赖的package包/类
@Override
public void configure(StateMachineStateConfigurer<States, Events> states) throws Exception {
    states
            .withStates()
            .initial(States.SI)
            .choice(States.S1)
            .end(States.SF)
            .states(EnumSet.allOf(States.class));
}
 
开发者ID:WorkingDevelopers,项目名称:spring-state-machine-chart-dumper,代码行数:10,代码来源:ChoiceJunctionSSM.java

示例7: configure

import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; //导入依赖的package包/类
@Override
public void configure(StateMachineStateConfigurer<SkipperStates, SkipperEvents> states) throws Exception {
	states
		// there's no need to explicitly define supported states
		// as every state id used in below config, adds it as supported state
		.withStates()
			// define main states
			.initial(SkipperStates.INITIAL)
			.stateEntry(SkipperStates.ERROR, errorAction())
			// clear memory for stored variables
			.stateExit(SkipperStates.INITIAL, resetVariablesAction())
			.state(SkipperStates.INSTALL)
			.state(SkipperStates.DELETE)
			.state(SkipperStates.UPGRADE)
			.state(SkipperStates.ROLLBACK)
			.junction(SkipperStates.ERROR_JUNCTION)
			.and()
			.withStates()
				// substates for install
				.parent(SkipperStates.INSTALL)
				.initial(SkipperStates.INSTALL_INSTALL)
				.stateEntry(SkipperStates.INSTALL_INSTALL, installInstallAction())
				.exit(SkipperStates.INSTALL_EXIT)
				.and()
			.withStates()
				// substates for upgrade
				.parent(SkipperStates.UPGRADE)
				.initial(SkipperStates.UPGRADE_START)
				.stateEntry(SkipperStates.UPGRADE_START, upgradeStartAction())
				.stateEntry(SkipperStates.UPGRADE_DEPLOY_TARGET_APPS, upgradeDeployTargetAppsAction())
				.state(SkipperStates.UPGRADE_WAIT_TARGET_APPS)
				.state(SkipperStates.UPGRADE_CHECK_TARGET_APPS, SkipperEvents.UPGRADE_CANCEL)
				.stateEntry(SkipperStates.UPGRADE_CHECK_TARGET_APPS, upgradeCheckTargetAppsAction())
				.stateEntry(SkipperStates.UPGRADE_DEPLOY_TARGET_APPS_SUCCEED, upgradeDeployTargetAppsSucceedAction())
				.stateEntry(SkipperStates.UPGRADE_DEPLOY_TARGET_APPS_FAILED, upgradeDeployTargetAppsFailedAction())
				.stateEntry(SkipperStates.UPGRADE_CANCEL, upgradeCancelAction())
				.stateEntry(SkipperStates.UPGRADE_DELETE_SOURCE_APPS, upgradeDeleteSourceAppsAction())
				.choice(SkipperStates.UPGRADE_CHECK_CHOICE)
				.exit(SkipperStates.UPGRADE_EXIT)
				.and()
			.withStates()
				// substates for delete
				.parent(SkipperStates.DELETE)
				.initial(SkipperStates.DELETE_DELETE)
				.stateEntry(SkipperStates.DELETE_DELETE, deleteDeleteAction())
				.exit(SkipperStates.DELETE_EXIT)
				.and()
			.withStates()
				// substates for rollback
				.parent(SkipperStates.ROLLBACK)
				.initial(SkipperStates.ROLLBACK_START)
				.stateEntry(SkipperStates.ROLLBACK_START, rollbackStartAction())
				.choice(SkipperStates.ROLLBACK_CHOICE)
				.exit(SkipperStates.ROLLBACK_EXIT_UPGRADE)
				.exit(SkipperStates.ROLLBACK_EXIT_INSTALL)
				.exit(SkipperStates.ROLLBACK_EXIT);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:58,代码来源:StateMachineConfiguration.java


注:本文中的org.springframework.statemachine.config.builders.StateMachineStateConfigurer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。