IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
Shell shell = activeWorkbenchWindow.getShell();
shell.setActive();
Map<Class< ? extends State>, WorkflowWizardPageProvider> pageMapping=new HashMap<Class<? extends State>, WorkflowWizardPageProvider>();
ResourceSelectionPage resourceSelectionPage = new ResourceSelectionPage(Messages.AddToNewMap_resource_selection_page_title);
resourceSelectionPage.setCollapseCheckedInput(true);
pageMapping.put(ResourceSelectionState.class, new BasicWorkflowWizardPageFactory(resourceSelectionPage));
ResourceSelectionState resourceSelectionState = new ResourceSelectionState();
resourceSelectionState.setServices(services);
Workflow workflow=new Workflow(new State[]{resourceSelectionState});
workflow.setContext(resources);