}
@Override
public NavigationResult next(UINavigationContext context) throws Exception
{
ScaffoldProvider selectedProvider = provider.getValue();
UIContext uiContext = context.getUIContext();
Map<Object, Object> attributeMap = uiContext.getAttributeMap();
attributeMap.put(ScaffoldProvider.class, selectedProvider);
ScaffoldGenerationContext generationContext = populateGenerationContext(uiContext);
attributeMap.put(ScaffoldGenerationContext.class, generationContext);
NavigationResult setupFlow = null;
Project project = getSelectedProject(uiContext);
// Verify if the selected provider is installed
// If not, add the setup flow and inform the generation step to setup the scaffold.
ScaffoldSetupContext setupContext = populateSetupContext(uiContext);
if (!selectedProvider.isSetup(setupContext))
{
setupFlow = selectedProvider.getSetupFlow(setupContext);
attributeMap.put(REQUIRES_SCAFFOLD_SETUP, true);
attributeMap.put(ScaffoldSetupContext.class, setupContext);
}
// Get the step sequence from the selected scaffold provider
NavigationResult generationFlow = selectedProvider.getGenerationFlow(generationContext);
// Add the execution logic step in the end so that the scaffold generation step is executed last after all other
// steps
NavigationResultBuilder builder = NavigationResultBuilder.create(setupFlow);
NavigationResult navigationResult = builder.add(generationFlow).add(ScaffoldExecuteGenerationStep.class).build();