public class MockFlowSession extends java.lang.Object implements FlowSession
FlowSession interface.FlowSession| Constructor and Description |
|---|
MockFlowSession()
Creates a new mock flow session that sets a flow with id "mockFlow" as the 'active flow' in state "mockState".
|
MockFlowSession(Flow flow)
Creates a new mock session in a created state for the specified flow definition.
|
MockFlowSession(Flow flow,
AttributeMap<?> input)
Creates a new mock session for the specified flow definition.
|
| Modifier and Type | Method and Description |
|---|---|
FlowDefinition |
getDefinition()
Returns the flow definition backing this session.
|
Flow |
getDefinitionInternal()
Returns the flow definition of this session.
|
FlowSession |
getParent()
Returns the parent flow session in the current flow execution, or
null if there is no parent flow
session. |
MutableAttributeMap<java.lang.Object> |
getScope()
Return this session's local attributes; the basis for "flow scope" (flow session scope).
|
StateDefinition |
getState()
Returns the current state of this flow session.
|
State |
getStateInternal()
Returns the current state of this session.
|
MutableAttributeMap<java.lang.Object> |
getViewScope()
Returns a mutable map for data held in "view scope".
|
boolean |
isEmbeddedMode()
Returns true if the flow session was started in embedded page mode.
|
boolean |
isRoot()
Returns whether this flow session is the root flow session in the ongoing flow execution.
|
void |
setDefinition(Flow flow)
Set the flow associated with this flow session.
|
void |
setParent(FlowSession parent)
Set the parent flow session of this flow session in the ongoing flow execution.
|
void |
setScope(MutableAttributeMap<java.lang.Object> scope)
Set the scope data maintained by this flow session.
|
void |
setState(State state)
Set the currently active state.
|
public MockFlowSession()
public MockFlowSession(Flow flow)
public MockFlowSession(Flow flow, AttributeMap<?> input)
flow - the flow definition for the sessioninput - initial contents of 'flow scope'public FlowDefinition getDefinition()
FlowSessiongetDefinition in interface FlowSessionpublic StateDefinition getState()
FlowSessiongetState in interface FlowSessionpublic MutableAttributeMap<java.lang.Object> getScope()
FlowSessiongetScope in interface FlowSessionpublic MutableAttributeMap<java.lang.Object> getViewScope() throws java.lang.IllegalStateException
FlowSessiongetViewScope in interface FlowSessionjava.lang.IllegalStateException - if this flow session is not currently in a view statepublic boolean isEmbeddedMode()
FlowSessionisEmbeddedMode in interface FlowSessionpublic FlowSession getParent()
FlowSessionnull if there is no parent flow
session.getParent in interface FlowSessionpublic boolean isRoot()
FlowSessionisRoot in interface FlowSessionpublic void setDefinition(Flow flow)
public void setState(State state)
public void setScope(MutableAttributeMap<java.lang.Object> scope)
public void setParent(FlowSession parent)
public Flow getDefinitionInternal()
public State getStateInternal()