flow.addNavigationCases(rule.getFromViewId(), NavigationUtils.convertNavigationCasesToAPI(rule));
}
for (FacesFlowSwitch flowSwitch : flowDefinition.getSwitchList())
{
SwitchNodeImpl node = new SwitchNodeImpl(flowSwitch.getId());
if (flowSwitch.getDefaultOutcome() != null &&
!isEmptyString(flowSwitch.getDefaultOutcome().getFromOutcome()))
{
if (ELText.isLiteral(flowSwitch.getDefaultOutcome().getFromOutcome()))
{
node.setDefaultOutcome(flowSwitch.getDefaultOutcome().getFromOutcome());
}
else
{
node.setDefaultOutcome(
application.getExpressionFactory().createValueExpression(
facesContext.getELContext(), flowSwitch.getDefaultOutcome().getFromOutcome(),
Object.class));
}
}
for (NavigationCase navCase : flowSwitch.getNavigationCaseList())
{
SwitchCaseImpl nodeCase = new SwitchCaseImpl();
nodeCase.setFromOutcome(navCase.getFromOutcome());
if (!isEmptyString(navCase.getIf()))
{
nodeCase.setCondition(
application.getExpressionFactory().createValueExpression(
facesContext.getELContext(), navCase.getIf(),
Object.class));
}
node.addCase(nodeCase);
}
flow.putSwitch(node.getId(), node);
}
for (FacesFlowView view : flowDefinition.getViewList())
{
ViewNodeImpl node = new ViewNodeImpl(view.getId(), view.getVdlDocument());
flow.addView(node);
}
for (FacesFlowReturn flowReturn : flowDefinition.getReturnList())
{
ReturnNodeImpl node = new ReturnNodeImpl(flowReturn.getId());
if (flowReturn.getNavigationCase() != null &&
!isEmptyString(flowReturn.getNavigationCase().getFromOutcome()))
{
if (ELText.isLiteral(flowReturn.getNavigationCase().getFromOutcome()))
{
node.setFromOutcome(flowReturn.getNavigationCase().getFromOutcome());
}
else
{
node.setFromOutcome(
application.getExpressionFactory().createValueExpression(
facesContext.getELContext(), flowReturn.getNavigationCase().getFromOutcome(),
Object.class));
}
}
flow.putReturn(node.getId(), node);
}
flow.freeze();
// Add the flow, so the config can be processed by the flow system and the