本文整理了Java中org.springframework.webflow.engine.Flow.end()
方法的一些代码示例,展示了Flow.end()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flow.end()
方法的具体详情如下:
包路径:org.springframework.webflow.engine.Flow
类名称:Flow
方法名:end
[英]Inform this flow definition that an execution session of itself has ended. As a result, the flow will do the following:
代码示例来源:origin: org.springframework.webflow/spring-webflow
void endActiveFlowSession(String outcome, MutableAttributeMap<Object> output, RequestControlContext context) {
FlowSessionImpl session = getActiveSessionInternal();
listeners.fireSessionEnding(context, session, outcome, output);
session.getFlow().end(context, outcome, output);
flowSessions.removeLast();
boolean executionEnded = flowSessions.isEmpty();
if (executionEnded) {
// set the root flow execution outcome for external clients to use
this.outcome = new FlowExecutionOutcome(outcome, output);
status = FlowExecutionStatus.ENDED;
}
listeners.fireSessionEnded(context, session, outcome, output);
if (!executionEnded) {
// restore any variables that may have transient references
getActiveSessionInternal().getFlow().restoreVariables(context);
// treat the outcome as an event against the current state of the new active flow
context.handleEvent(new Event(session.getState(), outcome, output));
}
}
代码示例来源:origin: org.springframework.webflow/spring-webflow
public void endActiveFlowSession(String outcome, MutableAttributeMap<Object> output) throws IllegalStateException {
MockFlowSession endingSession = getMockFlowExecutionContext().getMockActiveSession();
endingSession.getDefinitionInternal().end(this, outcome, output);
getMockFlowExecutionContext().setActiveSession(endingSession.getParent());
if (!getMockFlowExecutionContext().hasEnded()) {
handleEvent(new Event(endingSession.getState(), outcome, output));
}
}
代码示例来源:origin: org.springframework/spring-webflow
public FlowSession endActiveFlowSession(MutableAttributeMap output) throws IllegalStateException {
FlowSession session = getFlowExecutionContext().getActiveSession();
getExecutionListeners().fireSessionEnding(this, session, output);
getActiveFlowInternal().end(this, output);
if (logger.isDebugEnabled()) {
logger.debug("Ending active session " + session + "; exposed session output is " + output);
}
session = flowExecution.endActiveFlowSession();
getExecutionListeners().fireSessionEnded(this, session, output);
return session;
}
代码示例来源:origin: org.springframework/spring-webflow
public FlowSession endActiveFlowSession(MutableAttributeMap output) throws IllegalStateException {
MockFlowSession endingSession = getMockFlowExecutionContext().getMockActiveSession();
endingSession.getDefinitionInternal().end(this, output);
endingSession.setStatus(FlowSessionStatus.ENDED);
getMockFlowExecutionContext().setActiveSession(null);
return endingSession;
}
代码示例来源:origin: spring-projects/spring-webflow
void endActiveFlowSession(String outcome, MutableAttributeMap<Object> output, RequestControlContext context) {
FlowSessionImpl session = getActiveSessionInternal();
listeners.fireSessionEnding(context, session, outcome, output);
session.getFlow().end(context, outcome, output);
flowSessions.removeLast();
boolean executionEnded = flowSessions.isEmpty();
if (executionEnded) {
// set the root flow execution outcome for external clients to use
this.outcome = new FlowExecutionOutcome(outcome, output);
status = FlowExecutionStatus.ENDED;
}
listeners.fireSessionEnded(context, session, outcome, output);
if (!executionEnded) {
// restore any variables that may have transient references
getActiveSessionInternal().getFlow().restoreVariables(context);
// treat the outcome as an event against the current state of the new active flow
context.handleEvent(new Event(session.getState(), outcome, output));
}
}
代码示例来源:origin: org.springframework.webflow/org.springframework.webflow
void endActiveFlowSession(String outcome, MutableAttributeMap output, RequestControlContext context) {
FlowSessionImpl session = getActiveSessionInternal();
listeners.fireSessionEnding(context, session, outcome, output);
session.getFlow().end(context, outcome, output);
flowSessions.removeLast();
boolean executionEnded = hasEnded();
if (executionEnded) {
// set the root flow execution outcome for external clients to use
this.outcome = new FlowExecutionOutcome(outcome, output);
}
listeners.fireSessionEnded(context, session, outcome, output);
if (!executionEnded) {
// restore any variables that may have transient references
getActiveSessionInternal().getFlow().restoreVariables(context);
// treat the outcome as an event against the current state of the new active flow
context.handleEvent(new Event(session.getState(), outcome, output));
}
}
代码示例来源:origin: spring-projects/spring-webflow
public void endActiveFlowSession(String outcome, MutableAttributeMap<Object> output) throws IllegalStateException {
MockFlowSession endingSession = getMockFlowExecutionContext().getMockActiveSession();
endingSession.getDefinitionInternal().end(this, outcome, output);
getMockFlowExecutionContext().setActiveSession(endingSession.getParent());
if (!getMockFlowExecutionContext().hasEnded()) {
handleEvent(new Event(endingSession.getState(), outcome, output));
}
}
代码示例来源:origin: org.springframework.webflow/org.springframework.webflow
public void endActiveFlowSession(String outcome, MutableAttributeMap output) throws IllegalStateException {
MockFlowSession endingSession = getMockFlowExecutionContext().getMockActiveSession();
endingSession.getDefinitionInternal().end(this, outcome, output);
getMockFlowExecutionContext().setActiveSession(endingSession.getParent());
if (!getMockFlowExecutionContext().hasEnded()) {
handleEvent(new Event(endingSession.getState(), outcome, output));
}
}
代码示例来源:origin: spring-projects/spring-webflow
public void testEnd() {
TestAction action = new TestAction();
flow.getEndActionList().add(action);
MockRequestControlContext context = new MockRequestControlContext(flow);
LocalAttributeMap<Object> sessionOutput = new LocalAttributeMap<>();
flow.end(context, "finish", sessionOutput);
assertEquals(1, action.getExecutionCount());
}
代码示例来源:origin: spring-projects/spring-webflow
public void testEndWithOutputMapper() {
DefaultMapper attributeMapper = new DefaultMapper();
ExpressionParser parser = new WebFlowSpringELExpressionParser(new SpelExpressionParser());
Expression x = parser.parseExpression("flowScope.attr",
new FluentParserContext().evaluate(RequestContext.class));
Expression y = parser.parseExpression("attr", new FluentParserContext().evaluate(MutableAttributeMap.class));
attributeMapper.addMapping(new DefaultMapping(x, y));
flow.setOutputMapper(attributeMapper);
MockRequestControlContext context = new MockRequestControlContext(flow);
context.getFlowScope().put("attr", "foo");
LocalAttributeMap<Object> sessionOutput = new LocalAttributeMap<>();
flow.end(context, "finish", sessionOutput);
assertEquals("foo", sessionOutput.get("attr"));
}
内容来源于网络,如有侵权,请联系作者删除!