本文整理了Java中org.springframework.webflow.engine.Flow.setStartState()
方法的一些代码示例,展示了Flow.setStartState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flow.setStartState()
方法的具体详情如下:
包路径:org.springframework.webflow.engine.Flow
类名称:Flow
方法名:setStartState
[英]Set the start state for this flow to the state with the provided stateId
; a state must exist by the provided stateId
.
[中]将此流的开始状态设置为具有提供的stateId
的状态;状态必须由提供的stateId
存在。
代码示例来源:origin: org.springframework.webflow/spring-webflow
/**
* Set the start state for this flow to the state with the provided <code>stateId</code>; a state must exist by the
* provided <code>stateId</code>.
* @param stateId the id of the new start state
* @throws IllegalArgumentException when no state exists with the id you provided
*/
public void setStartState(String stateId) throws IllegalArgumentException {
setStartState(getStateInstance(stateId));
}
代码示例来源:origin: org.springframework.webflow/spring-webflow
/**
* Add given state definition to this flow definition. Marked protected, as this method is to be called by the
* (privileged) state definition classes themselves during state construction as part of a FlowBuilder invocation.
* @param state the state to add
* @throws IllegalArgumentException when the state cannot be added to the flow; for instance if another state shares
* the same id as the one provided or if given state already belongs to another flow
*/
protected void add(State state) throws IllegalArgumentException {
if (this != state.getFlow() && state.getFlow() != null) {
throw new IllegalArgumentException("State " + state + " cannot be added to this flow '" + getId()
+ "' -- it already belongs to a different flow: '" + state.getFlow().getId() + "'");
}
if (this.states.contains(state) || this.containsState(state.getId())) {
throw new IllegalArgumentException("This flow '" + getId() + "' already contains a state with id '"
+ state.getId() + "' -- state ids must be locally unique to the flow definition; "
+ "existing state-ids of this flow include: " + StylerUtils.style(getStateIds()));
}
boolean firstAdd = states.isEmpty();
states.add(state);
if (firstAdd) {
setStartState(state);
}
}
代码示例来源:origin: org.springframework/spring-webflow
/**
* Set the start state for this flow to the state with the provided <code>stateId</code>; a state must exist by
* the provided <code>stateId</code>.
* @param stateId the id of the new start state
* @throws IllegalArgumentException when no state exists with the id you provided
*/
public void setStartState(String stateId) throws IllegalArgumentException {
setStartState(getStateInstance(stateId));
}
代码示例来源:origin: org.springframework.webflow/org.springframework.webflow
/**
* Set the start state for this flow to the state with the provided <code>stateId</code>; a state must exist by the
* provided <code>stateId</code>.
* @param stateId the id of the new start state
* @throws IllegalArgumentException when no state exists with the id you provided
*/
public void setStartState(String stateId) throws IllegalArgumentException {
setStartState(getStateInstance(stateId));
}
代码示例来源:origin: spring-projects/spring-webflow
/**
* Set the start state for this flow to the state with the provided <code>stateId</code>; a state must exist by the
* provided <code>stateId</code>.
* @param stateId the id of the new start state
* @throws IllegalArgumentException when no state exists with the id you provided
*/
public void setStartState(String stateId) throws IllegalArgumentException {
setStartState(getStateInstance(stateId));
}
代码示例来源:origin: org.springframework/spring-webflow
private void parseAndSetStartState(Element element, Flow flow) {
String startStateId = getStartStateId(element);
flow.setStartState(startStateId);
}
代码示例来源:origin: org.springframework.webflow/spring-webflow
/**
* Builds the states of the flow.
* @throws FlowBuilderException an exception occurred building the flow
*/
public void buildStates() throws FlowBuilderException {
if (flowModel.getStates() == null) {
throw new FlowBuilderException("At least one state is required to build a Flow");
}
for (AbstractStateModel state : flowModel.getStates()) {
if (state instanceof ActionStateModel) {
parseAndAddActionState((ActionStateModel) state, getFlow());
} else if (state instanceof ViewStateModel) {
parseAndAddViewState((ViewStateModel) state, getFlow());
} else if (state instanceof DecisionStateModel) {
parseAndAddDecisionState((DecisionStateModel) state, getFlow());
} else if (state instanceof SubflowStateModel) {
parseAndAddSubflowState((SubflowStateModel) state, getFlow());
} else if (state instanceof EndStateModel) {
parseAndAddEndState((EndStateModel) state, getFlow());
}
}
if (flowModel.getStartStateId() != null) {
getFlow().setStartState(flowModel.getStartStateId());
}
}
代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-api
@Override
public void setStartState(final Flow flow, final String state) {
flow.setStartState(state);
val startState = getStartState(flow);
LOGGER.trace("Start state is now set to [{}]", startState.getId());
}
代码示例来源:origin: org.jasig.cas/cas-server-core-webflow
/**
* Sets start state.
*
* @param flow the flow
* @param state the state
*/
protected void setStartState(final Flow flow, final String state) {
flow.setStartState(state);
final TransitionableState startState = getStartState(flow);
logger.debug("Start state is now set to {}", startState.getId());
}
代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-api
private static void configureFlowStartState(final Flow flow, final ActionState terminateSessionActionState) {
LOGGER.trace("Setting the start state of the logout webflow identified by [{}] to [{}]", flow.getId(), terminateSessionActionState.getId());
flow.setStartState(terminateSessionActionState);
}
代码示例来源:origin: spring-projects/spring-webflow
/**
* Add given state definition to this flow definition. Marked protected, as this method is to be called by the
* (privileged) state definition classes themselves during state construction as part of a FlowBuilder invocation.
* @param state the state to add
* @throws IllegalArgumentException when the state cannot be added to the flow; for instance if another state shares
* the same id as the one provided or if given state already belongs to another flow
*/
protected void add(State state) throws IllegalArgumentException {
if (this != state.getFlow() && state.getFlow() != null) {
throw new IllegalArgumentException("State " + state + " cannot be added to this flow '" + getId()
+ "' -- it already belongs to a different flow: '" + state.getFlow().getId() + "'");
}
if (this.states.contains(state) || this.containsState(state.getId())) {
throw new IllegalArgumentException("This flow '" + getId() + "' already contains a state with id '"
+ state.getId() + "' -- state ids must be locally unique to the flow definition; "
+ "existing state-ids of this flow include: " + StylerUtils.style(getStateIds()));
}
boolean firstAdd = states.isEmpty();
states.add(state);
if (firstAdd) {
setStartState(state);
}
}
代码示例来源:origin: org.springframework.webflow/org.springframework.webflow
/**
* Add given state definition to this flow definition. Marked protected, as this method is to be called by the
* (privileged) state definition classes themselves during state construction as part of a FlowBuilder invocation.
* @param state the state to add
* @throws IllegalArgumentException when the state cannot be added to the flow; for instance if another state shares
* the same id as the one provided or if given state already belongs to another flow
*/
protected void add(State state) throws IllegalArgumentException {
if (this != state.getFlow() && state.getFlow() != null) {
throw new IllegalArgumentException("State " + state + " cannot be added to this flow '" + getId()
+ "' -- it already belongs to a different flow: '" + state.getFlow().getId() + "'");
}
if (this.states.contains(state) || this.containsState(state.getId())) {
throw new IllegalArgumentException("This flow '" + getId() + "' already contains a state with id '"
+ state.getId() + "' -- state ids must be locally unique to the flow definition; "
+ "existing state-ids of this flow include: " + StylerUtils.style(getStateIds()));
}
boolean firstAdd = states.isEmpty();
states.add(state);
if (firstAdd) {
setStartState(state);
}
}
代码示例来源:origin: org.springframework/spring-webflow
/**
* Add given state definition to this flow definition. Marked protected, as this method is to be called by the
* (privileged) state definition classes themselves during state construction as part of a FlowBuilder invocation.
* @param state the state to add
* @throws IllegalArgumentException when the state cannot be added to the flow; for instance if another state shares
* the same id as the one provided or if given state already belongs to another flow
*/
protected void add(State state) throws IllegalArgumentException {
if (this != state.getFlow() && state.getFlow() != null) {
throw new IllegalArgumentException("State " + state + " cannot be added to this flow '" + getId()
+ "' -- it already belongs to a different flow: '" + state.getFlow().getId() + "'");
}
if (this.states.contains(state) || this.containsState(state.getId())) {
throw new IllegalArgumentException("This flow '" + getId() + "' already contains a state with id '"
+ state.getId() + "' -- state ids must be locally unique to the flow definition; "
+ "existing state-ids of this flow include: " + StylerUtils.style(getStateIds()));
}
boolean firstAdd = states.isEmpty();
states.add(state);
if (firstAdd) {
setStartState(state);
}
}
代码示例来源:origin: net.unicon/cas-mfa-java
flow.setStartState(actionState);
LOGGER.debug("Replaced flow {} start state with {}", flow.getId(), flow.getStartState().getId());
} catch (final Exception e) {
代码示例来源:origin: org.springframework.webflow/org.springframework.webflow
/**
* Builds the states of the flow.
* @throws FlowBuilderException an exception occurred building the flow
*/
public void buildStates() throws FlowBuilderException {
if (flowModel.getStates() == null) {
throw new FlowBuilderException("At least one state is required to build a Flow");
}
for (Iterator it = flowModel.getStates().iterator(); it.hasNext();) {
AbstractStateModel state = (AbstractStateModel) it.next();
if (state instanceof ActionStateModel) {
parseAndAddActionState((ActionStateModel) state, getFlow());
} else if (state instanceof ViewStateModel) {
parseAndAddViewState((ViewStateModel) state, getFlow());
} else if (state instanceof DecisionStateModel) {
parseAndAddDecisionState((DecisionStateModel) state, getFlow());
} else if (state instanceof SubflowStateModel) {
parseAndAddSubflowState((SubflowStateModel) state, getFlow());
} else if (state instanceof EndStateModel) {
parseAndAddEndState((EndStateModel) state, getFlow());
}
}
if (flowModel.getStartStateId() != null) {
getFlow().setStartState(flowModel.getStartStateId());
}
}
代码示例来源:origin: spring-projects/spring-webflow
/**
* Builds the states of the flow.
* @throws FlowBuilderException an exception occurred building the flow
*/
public void buildStates() throws FlowBuilderException {
if (flowModel.getStates() == null) {
throw new FlowBuilderException("At least one state is required to build a Flow");
}
for (AbstractStateModel state : flowModel.getStates()) {
if (state instanceof ActionStateModel) {
parseAndAddActionState((ActionStateModel) state, getFlow());
} else if (state instanceof ViewStateModel) {
parseAndAddViewState((ViewStateModel) state, getFlow());
} else if (state instanceof DecisionStateModel) {
parseAndAddDecisionState((DecisionStateModel) state, getFlow());
} else if (state instanceof SubflowStateModel) {
parseAndAddSubflowState((SubflowStateModel) state, getFlow());
} else if (state instanceof EndStateModel) {
parseAndAddEndState((EndStateModel) state, getFlow());
}
}
if (flowModel.getStartStateId() != null) {
getFlow().setStartState(flowModel.getStartStateId());
}
}
代码示例来源:origin: spring-projects/spring-webflow
public void testCreateWithExecutionKeyFactory() {
State state = new State(flowDefinition, "state") {
protected void doEnter(RequestControlContext context) throws FlowExecutionException {
context.assignFlowExecutionKey();
context.updateCurrentFlowExecutionSnapshot();
context.removeCurrentFlowExecutionSnapshot();
context.removeAllFlowExecutionSnapshots();
}
};
flowDefinition.setStartState(state);
factory.setExecutionKeyFactory(new MockFlowExecutionKeyFactory());
FlowExecution execution = factory.createFlowExecution(flowDefinition);
execution.start(null, new MockExternalContext());
assertTrue(getKeyCalled);
assertTrue(removeAllSnapshotsCalled);
assertTrue(removeSnapshotCalled);
assertTrue(updateSnapshotCalled);
assertNull(execution.getKey());
}
内容来源于网络,如有侵权,请联系作者删除!