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

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

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

Flow.getGlobalTransition介绍

[英]Returns the transition that matches the event with the provided id.
[中]返回与提供id的事件匹配的转换。

代码示例

代码示例来源:origin: org.springframework.webflow/spring-webflow

TransitionDefinition getMatchingTransition(String eventId) {
  FlowSessionImpl session = getActiveSessionInternal();
  if (session == null) {
    return null;
  }
  TransitionableState currentState = (TransitionableState) session.getState();
  TransitionDefinition transition = currentState.getTransition(eventId);
  if (transition == null) {
    transition = session.getFlow().getGlobalTransition(eventId);
  }
  return transition;
}

代码示例来源:origin: org.springframework.webflow/spring-webflow

public TransitionDefinition getMatchingTransition(String eventId) throws IllegalStateException {
  TransitionableState state = (TransitionableState) getFlowExecutionContext().getActiveSession().getState();
  TransitionDefinition transition = state.getTransition(eventId);
  if (transition == null) {
    transition = getRootFlow().getGlobalTransition(eventId);
  }
  return transition;
}

代码示例来源:origin: org.springframework.webflow/org.springframework.webflow

TransitionDefinition getMatchingTransition(String eventId) {
  FlowSessionImpl session = getActiveSessionInternal();
  TransitionableState currentState = (TransitionableState) session.getState();
  TransitionDefinition transition = currentState.getTransition(eventId);
  if (transition == null) {
    transition = session.getFlow().getGlobalTransition(eventId);
  }
  return transition;
}

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

TransitionDefinition getMatchingTransition(String eventId) {
  FlowSessionImpl session = getActiveSessionInternal();
  if (session == null) {
    return null;
  }
  TransitionableState currentState = (TransitionableState) session.getState();
  TransitionDefinition transition = currentState.getTransition(eventId);
  if (transition == null) {
    transition = session.getFlow().getGlobalTransition(eventId);
  }
  return transition;
}

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

public TransitionDefinition getMatchingTransition(String eventId) throws IllegalStateException {
  TransitionableState state = (TransitionableState) getFlowExecutionContext().getActiveSession().getState();
  TransitionDefinition transition = state.getTransition(eventId);
  if (transition == null) {
    transition = getRootFlow().getGlobalTransition(eventId);
  }
  return transition;
}

代码示例来源:origin: org.springframework.webflow/org.springframework.webflow

public TransitionDefinition getMatchingTransition(String eventId) throws IllegalStateException {
  TransitionableState state = (TransitionableState) getFlowExecutionContext().getActiveSession().getState();
  TransitionDefinition transition = state.getTransition(eventId);
  if (transition == null) {
    transition = getRootFlow().getGlobalTransition(eventId);
  }
  return transition;
}

代码示例来源:origin: org.wicketstuff/spring-webflow-extras

@Override
public boolean isEnabled() {
  boolean transitionExistsForCurrentView = false;
  
  FlowDefinition flowDef = ((FlowExecutorImpl)PageFlowWebApplication.get().getFlowExecutor()).getDefinitionLocator().getFlowDefinition(PageFlowWebApplication.get().getFlowId());
  
  // Retrieve the flow instance for the input view state
  Flow flow = (Flow)flowDef;
  StateDefinition currState = flow.getState(PageFlowSession.get().getFlowState().getCurrentViewStateId());
  TransitionableState transitionState = null;
  if(currState instanceof TransitionableState){
    transitionState = (TransitionableState)currState;
  } else {
    //End states aren't transitional and so none of the links should be enabled
    return false;
  }
  
  if(transitionState.getTransition(getEventId()) != null || flow.getGlobalTransition(getEventId()) != null){
    transitionExistsForCurrentView = true;
  }
  
  return transitionExistsForCurrentView;
}

相关文章