org.springframework.webflow.engine.Flow.getTransitionableState()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中org.springframework.webflow.engine.Flow.getTransitionableState()方法的一些代码示例,展示了Flow.getTransitionableState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flow.getTransitionableState()方法的具体详情如下:
包路径:org.springframework.webflow.engine.Flow
类名称:Flow
方法名:getTransitionableState

Flow.getTransitionableState介绍

[英]Return the TransitionableState with given stateId.
[中]返回带有给定stateIdTransitionableState

代码示例

代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-api

/**
 * Gets transitionable state.
 *
 * @param flow    the flow
 * @param stateId the state id
 * @return the transitionable state
 */
public TransitionableState getTransitionableState(final Flow flow, final String stateId) {
  if (containsFlowState(flow, stateId)) {
    return (TransitionableState) flow.getTransitionableState(stateId);
  }
  return null;
}

代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-api

/**
 * Gets transitionable state.
 *
 * @param <T>     the type parameter
 * @param flow    the flow
 * @param stateId the state id
 * @param clazz   the clazz
 * @return the transitionable state
 */
public <T extends TransitionableState> T getTransitionableState(final Flow flow, final String stateId, final Class<T> clazz) {
  if (containsFlowState(flow, stateId)) {
    val state = flow.getTransitionableState(stateId);
    return clazz.cast(state);
  }
  return null;
}

代码示例来源:origin: spring-projects/spring-webflow

public void testGetStateNoSuchTransitionableState() {
  try {
    flow.getTransitionableState("myState2");
    fail("End states aren't transtionable");
  } catch (ClassCastException e) {
    // expected
  }
  try {
    flow.getTransitionableState("doesNotExist");
  } catch (IllegalArgumentException e) {
    // expected
  }
}

代码示例来源:origin: spring-projects/spring-webflow

public void testGetTransitionableState() {
  assertEquals("Wrong state:", "myState1", flow.getTransitionableState("myState1").getId());
  assertEquals("Wrong state:", "myState1", flow.getState("myState1").getId());
}

代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-mfa-api

val startState = flow.getTransitionableState(flow.getStartState().getId());
  createTransitionForState(startState, subflowId, subflowId);
});

相关文章