catch up with branch daily

Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/jenkins.build.config.xml b/jenkins.build.config.xml
index ba4702f..130185a 100644
--- a/jenkins.build.config.xml
+++ b/jenkins.build.config.xml
@@ -46,7 +46,9 @@
                 <jenkins.build.dependency>org.eclipse.osbp.vaaclipse</jenkins.build.dependency>
                 <jenkins.build.dependency>org.eclipse.osbp.vaaclipse.addons</jenkins.build.dependency>
                 <jenkins.build.dependency>org.eclipse.osbp.vaaclipse.addons.common.api</jenkins.build.dependency>
+                <jenkins.build.dependency>org.eclipse.osbp.vaaclipse.common.ecview</jenkins.build.dependency>
                 <jenkins.build.dependency>org.eclipse.osbp.vaadin.emf</jenkins.build.dependency>
+                <jenkins.build.dependency>org.eclipse.osbp.webserver.messagequeue</jenkins.build.dependency>
                 <jenkins.build.dependency>org.eclipse.osbp.xtext.datainterchange</jenkins.build.dependency>
                 <jenkins.build.dependency>org.eclipse.osbp.xtext.i18n</jenkins.build.dependency>
                 <jenkins.build.dependency>org.eclipse.osbp.xtext.menu</jenkins.build.dependency>
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/META-INF/MANIFEST.MF b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/META-INF/MANIFEST.MF
index 6bdc7ef..a059916 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/META-INF/MANIFEST.MF
@@ -63,36 +63,33 @@
  org.eclipse.osbp.ecview.dsl;bundle-version="0.9.0",
  org.eclipse.osbp.vaaclipse.addons.common.api;bundle-version="0.9.0",
  mondrian.osgi,
- org.eclipse.osbp.xtext.datainterchange;bundle-version="0.9.0"
+ org.eclipse.osbp.xtext.datainterchange;bundle-version="0.9.0",
+ org.eclipse.osbp.ecview.core.util.emf;bundle-version="0.9.0",
+ org.eclipse.osbp.ecview.extension.model;bundle-version="0.9.0",
+ org.eclipse.osbp.ecview.extension.presentation.vaadin;bundle-version="0.9.0",
+ org.eclipse.osbp.ui.api;bundle-version="0.9.0",
+ org.eclipse.osbp.runtime.web.vaadin.components;bundle-version="0.9.0",
+ org.eclipse.osbp.vaaclipse.common.ecview.api;bundle-version="0.9.0",
+ org.eclipse.osbp.runtime.web.ecview.presentation.vaadin;bundle-version="0.9.0",
+ org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="0.9.0",
+ org.eclipse.osbp.webserver.messagequeue;bundle-version="0.9.0",
+ org.eclipse.osbp.vaaclipse.common.ecview;bundle-version="0.9.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Import-Package: javax.annotation,
+ javax.jms;version="1.1.0",
  javax.validation,
- org.apache.commons.lang,
+ org.apache.commons.lang3,
+ org.eclipse.emf.common.notify,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.util,
  org.eclipse.osbp.authentication.account.dtos;version="0.9.0",
  org.eclipse.osbp.authentication.account.dtos.mapper;version="0.9.0",
  org.eclipse.osbp.authentication.account.dtos.service;version="0.9.0",
  org.eclipse.osbp.authentication.account.entities;version="0.9.0",
- org.eclipse.osbp.bpm.api;version="0.9.0",
  org.eclipse.osbp.core.api.persistence;version="0.9.0",
  org.eclipse.osbp.dsl.common.datatypes;version="0.9.0",
  org.eclipse.osbp.dsl.xtext.builder.participant;version="0.9.0",
- org.eclipse.osbp.ecview.extension.strategy.util;version="0.9.0",
- org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common;version="0.9.0",
- org.eclipse.osbp.runtime.web.vaadin.common.data;version="0.9.0",
- org.eclipse.osbp.ui.api.contextfunction;version="0.9.0",
- org.eclipse.osbp.ui.api.customfields;version="0.9.0",
- org.eclipse.osbp.ui.api.e4;version="0.9.0",
- org.eclipse.osbp.ui.api.message;version="0.9.0",
- org.eclipse.osbp.ui.api.metadata;version="0.9.0",
- org.eclipse.osbp.ui.api.organization;version="0.9.0",
- org.eclipse.osbp.ui.api.perspective;version="0.9.0",
- org.eclipse.osbp.ui.api.report;version="0.9.0",
- org.eclipse.osbp.ui.api.themes;version="0.9.0",
- org.eclipse.osbp.ui.api.user;version="0.9.0",
- org.eclipse.osbp.ui.api.useraccess;version="0.9.0",
- org.eclipse.osbp.ui.api.userfilter;version="0.9.0",
  org.eclipse.osbp.utils.common;version="0.9.0",
- org.eclipse.osbp.vaaclipse.common.ecview.api;version="0.9.0",
  org.eclipse.osbp.vaadin.emf.api;version="0.9.0",
  org.eclipse.osbp.vaadin.emf.data.fields;version="0.9.0",
  org.eclipse.osbp.vaadin.optiondialog;version="0.9.0",
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N.properties b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N.properties
index 386f7f5..1fd132c 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N.properties
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N.properties
@@ -39,10 +39,6 @@
 
 clean = clean
 
-created_by = created by
-
-created_on = created on
-
 ctrl = ctrl
 
 data = data
@@ -221,10 +217,6 @@
 
 user_menu_tooltip = user_menu_tooltip
 
-username = Username
-
-username_tip = Enter the user name for locking or unlocking of the data.
-
 users = users
 
 valid = valid
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_de.properties b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_de.properties
index 27687b5..d0774e2 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_de.properties
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_de.properties
@@ -39,10 +39,6 @@
 
 clean = Daten unver\u00E4ndert
 
-created_by = Erzeugt von
-
-created_on = Erzeugt am
-
 ctrl = Strg
 
 data = Daten der Entit\u00E4t
@@ -221,10 +217,6 @@
 
 user_menu_tooltip = Aufklappmen\u00FC
 
-username = Benutzername
-
-username_tip = Geben Sie den Benutzernamen ein f\u00FCr den eine Sperrung oder Freigabe der Daten erfolgen soll.
-
 users = Benutzer
 
 valid = Daten sind g\u00FCltig
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_en.properties b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_en.properties
index ae52f55..ef9bfc8 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_en.properties
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_en.properties
@@ -39,10 +39,6 @@
 
 clean = Data unmodified
 
-created_by = Created by
-
-created_on = Created on
-
 ctrl = Ctrl
 
 data = data
@@ -221,10 +217,6 @@
 
 user_menu_tooltip = Drop-down menu
 
-username = Username
-
-username_tip = Enter the user name for locking or unlocking of the data.
-
 users = Users
 
 valid = Data valid
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_fr.properties b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_fr.properties
index cb2a02a..8bc5d95 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_fr.properties
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/i18n/I18N_fr.properties
@@ -33,10 +33,6 @@
 
 clean = Donn\u00E9es inchang\u00E9es
 
-created_by = Cr\u00E9e par
-
-created_on = Cr\u00E9\u00E9 sur\n
-
 ctrl = Ctrl
 
 data = Les donn\u00E9es de l'entit\u00E9
@@ -215,10 +211,6 @@
 
 user_menu_tooltip = Menu d\u00E9roulant
 
-username = Utilisateur
-
-username_tip = Entrez le nom d'utilisateur pour une activation ou la d\u00E9sactivation des donn\u00E9es \u00E0 effectuer.
-
 users = Utilisateur
 
 valid = Les donn\u00E9es sont valides
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/administration/ReportPrinterDialogProvider.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/administration/ReportPrinterDialogProvider.java
index b70fe97..f53013c 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/administration/ReportPrinterDialogProvider.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/administration/ReportPrinterDialogProvider.java
@@ -22,7 +22,6 @@
 import javax.inject.Inject;
 
 import org.eclipse.emf.ecore.EObject;
-import org.eclipse.osbp.ecview.extension.strategy.util.PdfPrintService;
 import org.eclipse.osbp.preferences.ProductConfiguration;
 import org.eclipse.osbp.ui.api.contextfunction.IVaadinDialogProvider;
 import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
@@ -30,6 +29,7 @@
 import org.eclipse.osbp.vaadin.emf.api.IModelingContext;
 import org.eclipse.osbp.xtext.reportdsl.Report;
 import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
+import org.eclipse.osbp.xtext.reportdsl.common.PdfPrintService;
 import org.osgi.service.prefs.BackingStoreException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/handler/StrategyHandler.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/handler/StrategyHandler.java
deleted file mode 100644
index e4df186..0000000
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/handler/StrategyHandler.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- *                                                                            
- * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
- *                                                                            
- * All rights reserved. This program and the accompanying materials           
- * are made available under the terms of the Eclipse Public License 2.0        
- * which accompanies this distribution, and is available at                  
- * https://www.eclipse.org/legal/epl-2.0/                                 
- *                                 
- * SPDX-License-Identifier: EPL-2.0                                 
- *                                                                            
- * Contributors:   
- * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation 
- */
-package org.eclipse.osbp.vaaclipse.addons.softwarefactory.handler;
-
-import java.util.Locale;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-
-import org.eclipse.e4.core.services.events.IEventBroker;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.osbp.eventbroker.EventBrokerMsg;
-import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
-import org.eclipse.osbp.ui.api.user.IUser;
-import org.eclipse.osbp.vaaclipse.api.ResourceInfoProvider;
-import org.eclipse.osbp.xtext.dialogdsl.common.StrategyProvider;
-import org.eclipse.osbp.xtext.strategy.FocusingEnhancer;
-import org.eclipse.osbp.xtext.strategy.LayoutingStrategy;
-import org.eclipse.osbp.xtext.strategy.StrategyDSLPackage;
-import org.eclipse.osbp.xtext.strategy.StrategyDefault;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.ComponentContainer;
-import com.vaadin.ui.FormLayout;
-
-@SuppressWarnings("all")
-public class StrategyHandler implements IUser.UserLocaleListener {
-	private final static Logger log = LoggerFactory.getLogger("change strategy");
-
-	@Inject
-	private IEventBroker eventBroker;
-
-	@Inject
-	private ResourceInfoProvider resourceInfoProvider;
-
-	private ComboBox strategyCombo;
-
-	@Inject
-	private IUser user;
-
-	/** The metadata service. */
-	@Inject
-	private IDSLMetadataService dslMetadataService;
-	
-	private StrategyProvider stdProvider;
-
-	@PostConstruct
-	public void init(final ComponentContainer container) {
-		FormLayout form = new FormLayout();
-		form.addStyleName("ToolControlCombo");
-		form.setMargin(false);
-		form.setSpacing(false);
-		strategyCombo = new ComboBox();
-		strategyCombo.setNullSelectionAllowed(false);
-		strategyCombo.setWidth("200px");
-		strategyCombo.setTextInputAllowed(false);
-
-		for (EObject obj : dslMetadataService.getAll(StrategyDSLPackage.Literals.STRATEGY_DEFAULT)) {
-			StrategyDefault stdStrategy = ((StrategyDefault) obj);
-			stdProvider = new StrategyProvider(stdStrategy.getDefaultLayouting().getName()+"LayoutingStrategy",
-					stdStrategy.getDefaultFocusing().getName()+"FocusingEnhancer");
-			strategyCombo.addItem(stdProvider);
-			strategyCombo.setItemCaption(stdProvider, "Standard");
-		}
-		for (EObject strategyObj : dslMetadataService.getAll(StrategyDSLPackage.Literals.LAYOUTING_STRATEGY)) {
-			LayoutingStrategy strategy = (LayoutingStrategy) strategyObj;
-			for (EObject enhancerObj : dslMetadataService.getAll(StrategyDSLPackage.Literals.FOCUSING_ENHANCER)) {
-				FocusingEnhancer enhancer = (FocusingEnhancer) enhancerObj; 
-				StrategyProvider verticalProvider = new StrategyProvider(strategy.getName()+"LayoutingStrategy", enhancer.getName()+"FocusingEnhancer");
-				strategyCombo.addItem(verticalProvider);
-				strategyCombo.setItemCaption(verticalProvider, strategy.getName());
-			}
-		}
-		form.addComponent(strategyCombo);
-		container.addComponent(form);
-		strategyCombo.select(stdProvider);
-		strategyCombo.addValueChangeListener(new ValueChangeListener() {
-			@Override
-			public void valueChange(ValueChangeEvent event) {
-				if (log.isDebugEnabled())
-					log.debug("will set theme to:"
-							+ event.getProperty().getValue());
-				StrategyProvider provider = ((StrategyProvider) event
-						.getProperty().getValue());
-				if ((provider != null) && (provider.getLayoutingId() != null)) {
-					eventBroker.send(EventBrokerMsg.DIALOG_STRATEGY_CHANGED, provider);
-				}
-			}
-		});
-		user.addUserLocaleListener(this);
-	}
-
-	@Override
-	public void localeChanged(Locale locale) {
-		strategyCombo.setDescription(dslMetadataService.translate(locale.toLanguageTag(), "strategyTooltip"));
-	}
-}
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/handler/UserHandler.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/handler/UserHandler.java
index 573e2fb..1ae2f49 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/handler/UserHandler.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/handler/UserHandler.java
@@ -25,6 +25,7 @@
 import org.eclipse.e4.ui.model.application.MApplication;
 import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
 import org.eclipse.osbp.blob.component.BlobComponent;
+import org.eclipse.osbp.preferences.ProductConfiguration;
 import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent;
 import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherCommand;
 import org.eclipse.osbp.runtime.common.event.IEventDispatcher;
@@ -123,11 +124,13 @@
 			}
 		});
 		buttons.addComponent(logout);
-		popup = new PopupButton();
-		popup.addStyleName("os-usermenubutton");
-		popup.setContent(userMenu.getMenu(popup));
 
-		buttons.addComponent(popup);
+		if(!ProductConfiguration.hideUserMenu()){
+			popup = new PopupButton();
+			popup.addStyleName("os-usermenubutton");
+			popup.setContent(userMenu.getMenu(popup));
+			buttons.addComponent(popup);
+		}
 
 		container.addComponent(form);
 		user.addUserLocaleListener(this);
@@ -150,7 +153,9 @@
 		name.setDescription(dslMetadataService.translate(locale.toLanguageTag(), "userLabelTooltip"));
 		position.setDescription(dslMetadataService.translate(locale.toLanguageTag(), "positionLabelTooltip"));
 		logout.setDescription(dslMetadataService.translate(locale.toLanguageTag(), "logoutButtonTooltip"));
-		popup.setDescription(dslMetadataService.translate(locale.toLanguageTag(), "userMenuTooltip"));
+		if(!ProductConfiguration.hideUserMenu()){		
+			popup.setDescription(dslMetadataService.translate(locale.toLanguageTag(), "userMenuTooltip"));
+		}
 	}
 
 	@Override
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/maintoolbar/MainToolbarProvider.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/maintoolbar/MainToolbarProvider.java
index 49919a0..08b413b 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/maintoolbar/MainToolbarProvider.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/maintoolbar/MainToolbarProvider.java
@@ -20,11 +20,9 @@
 import org.eclipse.e4.core.contexts.IEclipseContext;
 import org.eclipse.e4.ui.model.application.MApplication;
 import org.eclipse.e4.ui.model.application.commands.MCommand;
-import org.eclipse.e4.ui.model.application.ui.SideValue;
 import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
 import org.eclipse.e4.ui.model.application.ui.basic.MTrimElement;
 import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow;
-import org.eclipse.e4.ui.model.application.ui.basic.impl.BasicFactoryImpl;
 import org.eclipse.e4.ui.model.application.ui.menu.ItemType;
 import org.eclipse.e4.ui.model.application.ui.menu.MHandledToolItem;
 import org.eclipse.e4.ui.model.application.ui.menu.MToolBar;
@@ -96,31 +94,8 @@
 	public void init() {
 		log.debug("init MainToolbarProvider");
 		menuFactory = MenuFactoryImpl.init();
-		BasicFactoryImpl basicFactory = BasicFactoryImpl.init();
 		presentationEngine = eclipseContext.get(GenericPresentationEngine.class);
-		if (appModel != null) {
-			MTrimmedWindow trimmedWindow = null;
-			if (appModel.getChildren().isEmpty()) {
-				trimmedWindow = BasicFactoryImpl.eINSTANCE.createTrimmedWindow();
-				trimmedWindow.setToBeRendered(true);
-				trimmedWindow.setVisible(true);
-				appModel.getChildren().add(trimmedWindow);
-			} else {
-				trimmedWindow = (MTrimmedWindow) appModel.getChildren().get(0);
-			}
-			trimBar = null;
-			if (trimmedWindow.getTrimBars().isEmpty()) {
-				// create trimBar
-				trimBar = basicFactory.createTrimBar();
-				trimBar.setElementId(IPerspectiveProvider.E4Constants.TRIMBAR);
-				trimBar.setToBeRendered(true);
-				trimBar.setVisible(true);
-				trimBar.setSide(SideValue.TOP);
-				trimmedWindow.getTrimBars().add(trimBar);
-			} else {
-				trimBar = trimmedWindow.getTrimBars().get(0);
-			}
-		}
+		trimBar = ((MTrimmedWindow) appModel.getChildren().get(0)).getTrimBars().get(1);
 	}
 
 	/*
@@ -146,8 +121,6 @@
 	void createToolbarArea(MToolBar toolBar) {
 		// set os style
 		CssLayout toolBarArea = (CssLayout) trimBar.getWidget();
-		toolBarArea.setStyleName(EnumCssClass.MPARTTOOLBARAREA.toString());
-
 		Component toolBarWidget = null;
 		for (int idx = 0; idx < toolBarArea.getComponentCount(); idx++) {
 			Component test = toolBarArea.getComponent(idx);
@@ -162,8 +135,8 @@
 			toolBarWidget = (Component) presentationEngine.createGui(toolBar);
 			((AbstractLayout) toolBarWidget).setSizeUndefined();
 		}
-		toolBarWidget.setStyleName(EnumCssClass.MPARTTOOLBAR.toString());
-		toolBarArea.addComponent(toolBarWidget);
+		toolBarWidget.addStyleName(EnumCssClass.MPARTTOOLBAR.toString());
+		toolBarArea.addComponentAsFirst(toolBarWidget);
 	}
 
 	/**
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/DialogProvider.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/DialogProvider.java
new file mode 100644
index 0000000..9e25743
--- /dev/null
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/DialogProvider.java
@@ -0,0 +1,1473 @@
+/**
+ *                                                                            
+ * Copyright (c) 2011, 2019 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *                                                                            
+ * All rights reserved. This program and the accompanying materials           
+ * are made available under the terms of the Eclipse Public License 2.0        
+ * which accompanies this distribution, and is available at                  
+ * https://www.eclipse.org/legal/epl-2.0/                                 
+ *                                 
+ * SPDX-License-Identifier: EPL-2.0                                 
+ *                                                                            
+ * Contributors:   
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation 
+ */
+package org.eclipse.osbp.vaaclipse.addons.softwarefactory.perspective;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.function.Consumer;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import javax.swing.Timer;
+
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.core.services.events.IEventBroker;
+import org.eclipse.e4.ui.di.Focus;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl;
+import org.eclipse.e4.ui.model.application.ui.impl.UiPackageImpl;
+import org.eclipse.e4.ui.workbench.IPresentationEngine;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.osbp.blob.component.BlobConverter;
+import org.eclipse.osbp.core.api.persistence.IPersistenceService;
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.dsl.dto.lib.impl.DtoServiceAccess;
+import org.eclipse.osbp.dsl.semantic.entity.LEntity;
+import org.eclipse.osbp.ecview.core.common.beans.ISlot;
+import org.eclipse.osbp.ecview.core.common.context.IConfiguration;
+import org.eclipse.osbp.ecview.core.common.context.IContext;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IFieldEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableEvent;
+import org.eclipse.osbp.ecview.core.common.model.core.YField;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.common.model.core.util.BindingIdUtil;
+import org.eclipse.osbp.ecview.core.common.notification.AbstractReloadRequestService;
+import org.eclipse.osbp.ecview.core.common.notification.IReloadRequestService;
+import org.eclipse.osbp.ecview.core.common.services.IWidgetAssocationsService;
+import org.eclipse.osbp.ecview.core.common.store.IViewStore;
+import org.eclipse.osbp.ecview.core.common.validation.IFieldValidationManager;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.dsl.extensions.SuperTypeCollector;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.common.ECViewComponent;
+import org.eclipse.osbp.ecview.semantic.uimodel.UiBeanSlot;
+import org.eclipse.osbp.osgi.hybrid.api.AbstractHybridVaaclipseView;
+import org.eclipse.osbp.runtime.common.annotations.DirtyStateAdapter;
+import org.eclipse.osbp.runtime.common.annotations.DtoUtils;
+import org.eclipse.osbp.runtime.common.annotations.IsDirty;
+import org.eclipse.osbp.runtime.common.annotations.IsNew;
+import org.eclipse.osbp.runtime.common.annotations.IsPositioned;
+import org.eclipse.osbp.runtime.common.annotations.IsValid;
+import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent;
+import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherDataTag;
+import org.eclipse.osbp.runtime.common.event.IEventDispatcher;
+import org.eclipse.osbp.runtime.common.event.SelectionStore;
+import org.eclipse.osbp.runtime.common.filter.IDTOService;
+import org.eclipse.osbp.runtime.common.filter.IDTOServiceWithMutablePersistence;
+import org.eclipse.osbp.runtime.common.validation.IStatus;
+import org.eclipse.osbp.runtime.common.validation.ValidationKind;
+import org.eclipse.osbp.runtime.web.vaadin.components.dialogs.AcceptDeleteDialog;
+import org.eclipse.osbp.runtime.web.vaadin.components.dialogs.AcceptLoosingDataDialog;
+import org.eclipse.osbp.runtime.web.vaadin.components.dialogs.AcceptSaveDialog;
+import org.eclipse.osbp.runtime.web.vaadin.components.dialogs.QueryDeleteDialog;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
+import org.eclipse.osbp.ui.api.contextfunction.IViewEmbeddedProvider;
+import org.eclipse.osbp.ui.api.customfields.IBlobConverter;
+import org.eclipse.osbp.ui.api.customfields.IBlobService;
+import org.eclipse.osbp.ui.api.e4.IE4Dialog;
+import org.eclipse.osbp.ui.api.functionlibrary.IFunctionLibraryService;
+import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
+import org.eclipse.osbp.ui.api.perspective.IPerspectiveProvider;
+import org.eclipse.osbp.ui.api.report.IReportProvider;
+import org.eclipse.osbp.ui.api.statemachine.IDataProvider;
+import org.eclipse.osbp.ui.api.statemachine.IPeripheral;
+import org.eclipse.osbp.ui.api.statemachine.IStateMachine;
+import org.eclipse.osbp.ui.api.statemachine.IStateMachineParticipant;
+import org.eclipse.osbp.ui.api.themes.EnumCssClass;
+import org.eclipse.osbp.ui.api.themes.IThemeResourceService;
+import org.eclipse.osbp.ui.api.themes.IThemeResourceService.ThemeResourceType;
+import org.eclipse.osbp.ui.api.user.IUser;
+import org.eclipse.osbp.utils.common.EntityUtils;
+import org.eclipse.osbp.utils.vaadin.DTOInfoDialog;
+import org.eclipse.osbp.utils.vaadin.SelectDialog;
+import org.eclipse.osbp.utils.vaadin.ViewLayoutManager;
+import org.eclipse.osbp.vaaclipse.addons.common.api.IE4Topics;
+import org.eclipse.osbp.vaaclipse.addons.common.api.status.IStatusManager;
+import org.eclipse.osbp.vaaclipse.addons.common.api.status.IStatusScope;
+import org.eclipse.osbp.vaaclipse.common.ecview.E4EventBrokerAdapter;
+import org.eclipse.osbp.vaaclipse.common.ecview.ECViewToE4ServiceBridge;
+import org.eclipse.osbp.vaaclipse.common.ecview.api.IECViewContainer;
+import org.eclipse.osbp.xtext.action.ActionDSLPackage;
+import org.eclipse.osbp.xtext.action.ActionToolbar;
+import org.eclipse.osbp.xtext.action.DialogActionEnum;
+import org.eclipse.osbp.xtext.action.UIActionEnum;
+import org.eclipse.osbp.xtext.action.common.IToolbarAction;
+import org.eclipse.osbp.xtext.dialogdsl.Dialog;
+import org.eclipse.osbp.xtext.dialogdsl.DialogFieldHook;
+import org.eclipse.xtext.common.types.JvmTypeReference;
+import org.eclipse.xtext.xbase.lib.Pair;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.event.LayoutEvents.LayoutClickEvent;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Notification.Type;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+import com.vaadin.ui.Button.ClickEvent;
+
+/**
+ * The Class ECViewDialog.
+ *
+ * @param <DTO>
+ *            the generic type
+ */
+@SuppressWarnings("all")
+public class DialogProvider<DTO> extends AbstractHybridVaaclipseView implements 
+	IUser.UserLocaleListener, IEventDispatcher.Receiver, IFieldValidationManager.Listener , IE4Dialog, IViewEmbeddedProvider{
+
+	/** The Constant log. */
+	protected final static Logger log = LoggerFactory.getLogger("vaaclipseDialog");
+
+	/** The Constant BEAN_SLOT__VALIDATION_ERROR. */
+	protected static final String BEAN_SLOT__VALIDATION_ERROR = "validationError";
+
+	/** The dialog label. */
+	protected String dialogLabel;
+
+	/** The event broker. */
+	@Inject
+	protected IECViewContainer ecviewContainer;
+
+	/** The event broker. */
+	@Inject
+	protected IEventBroker eventBroker;
+
+	/** The theme resource service. */
+	@Inject
+	protected IThemeResourceService themeResourceService;
+
+	/** The translator class service. */
+	@Inject
+	protected IDSLMetadataService dslMetadataService;
+
+	/** The report provider. */
+	@Inject IReportProvider reportProvider;
+
+	/** The blob service. */
+	@Inject IBlobService blobService;
+
+	/** The view store. */
+	@Inject
+	protected IViewStore viewStore;
+
+	/** The currently active part. */
+	@Inject
+	@Optional
+	protected MPart mPart;
+
+	/** The persistence service. */
+	@Inject
+	protected IPersistenceService persistenceService;
+
+	/** The event dispatcher. */
+	@Inject
+	protected IEventDispatcher eventDispatcher;
+
+	/** The status manager. */
+	@Inject
+	protected IStatusManager statusManager;
+
+	/** The eclipse context. */
+	@Inject
+	protected IEclipseContext eclipseContext;
+
+	/** The rendering engine. */
+	@Inject
+	protected IPresentationEngine renderingEngine;
+
+	/** The function library service. */
+	@Inject
+	protected IFunctionLibraryService functionLibraryService;
+
+	/** The user. */
+	@Inject
+	protected IUser user;
+
+	/** The view context. */
+	protected IViewContext viewContext;
+
+	/** The ecview component. */
+	protected ECViewComponent ecviewComponent;
+
+	/** The rendering params. */
+	protected Map<String, Object> renderingParams;
+
+	/** The uuid. */
+	protected String uuid = UUID.randomUUID().toString();
+
+	/** The layout manager. */
+	protected ViewLayoutManager layoutManager;
+
+	/** The dto service. */
+	private IDTOServiceWithMutablePersistence<DTO> dtoService;
+
+	/** The toolbar helper. */
+	private IToolbarAction toolbar;
+
+	/** Flag whether the dto is newly created */
+	private boolean newCreatedDto = false;
+
+	/** The select dialog to get the desired base- or sub-class. */
+	private SelectDialog selectDialog;
+
+	/** The select window for the dialog. */
+	private Window selectWindow;
+
+	/** The dirty state adapter. */
+	private DirtyStateAdapter dirtyStateAdapter;
+
+	/** The ecview field validation manager. */
+	private IFieldValidationManager ecviewFieldValidationManager;
+
+	/** The validation result. */
+	private Set<IStatus> validationResult;
+
+	/** The info window for last update etc. */
+	private DTOInfoDialog infoWindow;
+	
+	/** The last used base dto. */
+	private Class<?> lastBaseDto;
+	
+	/** The field that gets focus. */
+	private EventHandler onFocusField;
+	
+	/** The underlying xtext dialog model. */
+	private Dialog dialogModel = null; 
+	
+	/** The reload request service for suggesttext fields. */
+	private IReloadRequestService reloadRequestService = new AbstractReloadRequestService() {
+		@Override
+		public void requestReload(YEmbeddable component, Object newDto) {
+			updateBindings(newDto);
+		}
+	};
+
+	/** The widget association service. */
+	private IWidgetAssocationsService<Component, EObject>  associationService;
+
+	private ArrayList<Button> taskButtons;
+
+	private List<Consumer<DTO>> saveListeners;
+
+	private boolean manualInput = false;
+
+	private Timer timer;
+
+	private boolean oldDirty = false;
+
+	private String dtoName;
+	
+	private Map<String, Object> subTypes;
+
+	private String viewId;
+
+	private String entityName;
+
+	private String primaryKey;
+
+	private Class<?> dto;
+
+	private Object numColumns;
+
+	private Class<?> dialogFunctionGroup;
+
+	private Method initializationMethod;
+	private Method preSaveMethod;
+	private Method postSaveMethod;
+	private Map<YField, Pair<Method, Method>> fieldHooks = new HashMap<>();
+
+	private VerticalLayout parent;
+
+	/**
+	 * Instantiates a new abstract ec view dialog.
+	 *
+	 * @param parent
+	 *            the parent
+	 * @param context
+	 *            the context
+	 * @param app
+	 *            the app
+	 */
+	@Inject
+	public DialogProvider(final VerticalLayout parent, final IEclipseContext context, final MApplication app) {
+		super(parent, context, app);
+		uuid = UUID.randomUUID().toString();
+	}
+
+	public DialogProvider() {
+		uuid = UUID.randomUUID().toString();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.osbp.osgi.hybrid.api.AbstractHybridVaaclipseView#createView
+	 * (com.vaadin.ui.VerticalLayout)
+	 */
+	@Override
+	public void createView(final VerticalLayout externalParent) {
+		if(externalParent != null) {
+			parent = externalParent;
+		} else {
+			parent = new VerticalLayout();
+		}
+		parent.addStyleName(EnumCssClass.DIALOG_VIEW.toString());
+		layoutManager = new ViewLayoutManager();
+		layoutManager.init(parent);
+		ecviewComponent.setSizeFull();
+		layoutManager.getDataArea().addComponent(ecviewComponent);
+		selectDialog = new SelectDialog();
+		// create toolbar
+		if(dialogModel.getToolbar() != null) {
+			String toolBarId = dslMetadataService.getFullyQualifiedName(dialogModel.getToolbar());
+			ActionToolbar toolBarModel = (ActionToolbar) dslMetadataService.getMetadata(toolBarId, ActionDSLPackage.Literals.ACTION_TOOLBAR);
+			toolbar = (IToolbarAction) dslMetadataService.getClassInstance(toolBarModel, "action");
+			toolbar.createToolbar(eclipseContext, renderingEngine, themeResourceService, uuid);
+		} 
+		if(dialogModel.isEmbedded()) {
+			createEmbeddedToolbar();
+		}
+	}
+
+	private void initDialog() {
+		if(mPart != null) {
+	    	dialogModel = (Dialog) mPart.getTransientData().get("dialogModel");
+	    } else {
+	    	dialogModel = (Dialog) eclipseContext.get("embeddedDialogModel");
+	    }
+		viewId = dslMetadataService.getECViewId(dialogModel);
+		dtoName = dslMetadataService.getFullyQualifiedName(dialogModel.getDto());
+		if(dtoName != null) {
+			LEntity entity = EntityUtils.getEntityFromDto(dialogModel.getDto());
+			entityName = EntityUtils.getFQNForLEntity(entity);
+			primaryKey = dslMetadataService.getFullyQualifiedName(entity)+"."+entity.getIdAttributeName();
+			dto = dslMetadataService.getClass(dialogModel.getDto(), "dto");
+			dtoService = (IDTOServiceWithMutablePersistence<DTO>) DtoServiceAccess.getService(dto);
+			subTypes = dslMetadataService.getAllSubtypes(user.getLocale().toLanguageTag(), dto);
+		}
+		dialogLabel = dialogModel.getName();
+		numColumns = dialogModel.getNumColumns();
+
+		dirtyStateAdapter = new DirtyStateAdapter();
+		eclipseContext.set(IE4Dialog.class, this);
+		if (viewStore != null) {
+			ecviewComponent = new ECViewComponent(new ECViewComponent.ViewProviderCallback() {
+				@Override
+				public YView getView(String viewId, Map<String, Object> properties) {
+					// use the view store to find a user saved view
+					return viewStore.getMostRecentView(user.getUserName(), viewId);
+				}
+			});
+		} else {
+			ecviewComponent = new ECViewComponent();
+		}
+		renderingParams = createRenderingParams();
+		viewContext = ecviewComponent.setValue(viewId, null, renderingParams);
+		if (viewContext == null) {
+			String message = "ViewContext could not be set for '" + viewId + "'";
+			log.error("{}", message);
+			Notification.show(message, Type.ERROR_MESSAGE);
+		} else {
+			viewContext.setLocale(user.getLocale());
+			viewContext.createBeanSlot(BEAN_SLOT__VALIDATION_ERROR, Boolean.class);
+			viewContext.setBean(BEAN_SLOT__VALIDATION_ERROR, Boolean.FALSE);
+			if(mPart != null) {
+				mPart.getContext().set(IViewContext.class, viewContext);
+			}
+			associationService = viewContext.getService(IWidgetAssocationsService.ID);
+			// bridges the validation from ECView core to Vaaclipse
+			setupValidationBridge();
+			YView yView = (YView) viewContext.getViewEditpart().getModel();
+			if (yView == null) {
+				Notification.show("Dialog could not be found!", Type.ERROR_MESSAGE);
+				return;
+			}
+		}
+
+		if(dialogModel.getGroup() != null) {
+			dialogFunctionGroup = functionLibraryService.getFunctionLibraryClass(dslMetadataService.getFullyQualifiedName(dialogModel.getGroup()));
+			if(dialogModel.getInitialization() != null) {
+				initializationMethod = functionLibraryService.getMethod(dialogFunctionGroup, dialogModel.getInitialization().getName());
+			}
+			if(dialogModel.getPreSave() != null) {
+				preSaveMethod = functionLibraryService.getMethod(dialogFunctionGroup, dialogModel.getPreSave().getName());
+			}
+			if(dialogModel.getPostSave() != null) {
+				postSaveMethod = functionLibraryService.getMethod(dialogFunctionGroup, dialogModel.getPostSave().getName());
+			}
+			for(DialogFieldHook fieldHook:dialogModel.getFieldHooks()) {
+				Method preFocus = null;
+				Method postFocus = null;
+				if(fieldHook.getPreFocus() != null) {
+					preFocus = functionLibraryService.getMethod(dialogFunctionGroup, fieldHook.getPreFocus().getName());
+				}
+				if(fieldHook.getPostFocus() != null) {
+					postFocus = functionLibraryService.getMethod(dialogFunctionGroup, fieldHook.getPostFocus().getName());
+				}
+				Pair functions = new Pair(preFocus, postFocus);
+				YField fld = (YField)associationService.getModelElement(viewId+"."+dtoName+"."+fieldHook.getAttribute().getName());
+				if(fld != null) {
+					fieldHooks.put(fld, functions);
+					fld.eAdapters().add(new AdapterImpl() {
+						@Override
+						public void notifyChanged(org.eclipse.emf.common.notify.Notification notification) {
+							if (notification.getEventType() == org.eclipse.emf.common.notify.Notification.SET) {
+								if(notification.getFeatureID(ExtensionModelPackage.class) == ExtensionModelPackage.YTEXT_FIELD__LAST_FOCUS_EVENT) {
+									YField fld = (YField)((YEmbeddableEvent)notification.getNewValue()).getEmbeddable();
+									if(fieldHooks.containsKey(fld) && fieldHooks.get(fld) != null) {
+										executeDialogFunction("pre field "+fld.getName(), fieldHooks.get(fld).getKey(), fld);
+									}
+								}
+								if(notification.getFeatureID(ExtensionModelPackage.class) == ExtensionModelPackage.YTEXT_FIELD__LAST_BLUR_EVENT) {
+									YField fld = (YField)((YEmbeddableEvent)notification.getNewValue()).getEmbeddable();
+									if(fieldHooks.containsKey(fld) && fieldHooks.get(fld) != null) {
+										executeDialogFunction("post field "+fld.getName(), fieldHooks.get(fld).getValue(), fld);
+									}
+								}
+							}
+						}
+					});
+				}
+			}
+		}
+	}
+	
+	public Component getContent() {
+		return parent;
+	}
+
+	@Override
+	public void validationChanged(IFieldValidationManager.Event event) {
+		// add them to the Vaaclipse status manager
+		IStatusScope scope = statusManager.getScopeFor(mPart);
+		scope.modifyStatus(event.getOldStatus(), event.getNewStatus());
+		applyValidationResult();
+	}
+
+	/**
+	 * Apply the validation result to the view.
+	 */
+	protected void applyValidationResult() {
+		// set the validation result
+		viewContext.setBean(BEAN_SLOT__VALIDATION_ERROR, Boolean.FALSE);
+		log.debug("applyValidationResult {}", ((Boolean)viewContext.getBean(BEAN_SLOT__VALIDATION_ERROR)).booleanValue());
+	}
+
+	@IsValid
+	public boolean isDataValid() {
+		if(viewContext == null) {
+			return true;
+		}
+		Boolean result = (Boolean) viewContext.getBean(BEAN_SLOT__VALIDATION_ERROR);
+		if(result == null || !result) {
+			eventBroker.send(IE4Topics.ToolBarEvents.NOTIFY_TOOLBAR_DIALOG_STATE, createStateLabelEvent(IE4Topics.ToolBarEvents.Labels.VALIDITY, IE4Topics.ToolBarEvents.States.VALID, getStateLabelUUID()));
+		} else {
+			eventBroker.send(IE4Topics.ToolBarEvents.NOTIFY_TOOLBAR_DIALOG_STATE, createStateLabelEvent(IE4Topics.ToolBarEvents.Labels.VALIDITY, IE4Topics.ToolBarEvents.States.INVALID, getStateLabelUUID()));
+		}
+		if(result == null) {
+			return true;
+		}
+		return !result;
+	}
+
+	/**
+	 * Focus a field either by YField or by id.
+	 *
+	 * @param field the field
+	 * @param fieldId the field id
+	 */
+	private void focusField(YField field, String fieldId) {
+		YView yView = null;
+		YField yField = null;
+		Iterator<EObject> iter = ((EObject) viewContext.getViewEditpart().getModel()).eAllContents();
+		while (iter.hasNext()) {
+			EObject eObject = iter.next();
+			if(eObject instanceof YStrategyLayout) {
+				YStrategyLayout yLayout = (YStrategyLayout)eObject;
+				yView = yLayout.getView();
+			}
+			if (eObject instanceof YField) {
+				if(eObject instanceof YFocusable && ((YField) eObject).isVisible() && ((YField) eObject).isEditable() && ((YField) eObject).isEnabled()) {
+					yField = (YField) eObject;
+					// find field by id
+					if(fieldId != null) {
+						if(yField.getId().equals(fieldId)) {
+							break;
+						}
+					} else {
+						// either find first field focusable or the clicked field if not null
+						if(field == null || field.equals(yField)) {
+							break;
+						}
+					}
+				}
+			}
+		}
+		if(yView != null && yField != null) {
+			yView.setCurrentFocus(yField);
+		}
+		
+	}
+	
+	@Focus
+	public void setFocus() {
+		if(viewContext != null && mPart != null) {
+			YField clickedField = null;
+			LayoutClickEvent event = mPart.getContext().get(LayoutClickEvent.class);
+			if(event != null) {
+				EObject element = associationService.getModelElement(event.getClickedComponent());
+				if(element instanceof YField) {
+					clickedField = (YField)element;
+				}
+			}
+			focusField(clickedField, null);
+		}
+	}
+	
+	@IsDirty
+	public boolean isDirty() {
+		Object currentDto = viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+		return isDirtyDto(currentDto);
+	}
+	
+	private boolean isDirtyDto(Object dto) {
+		boolean dirty = false;
+		if (dto != null) {
+			// check if any dto in the dto tree is dirty
+			DirtyStateAdapter adapter = DtoUtils.getAdapter(DirtyStateAdapter.class, dto);
+			if (adapter != null) {
+				dirty = adapter.isDirty();
+				if(dirty != oldDirty ) {
+					log.debug("dirty state adapter returned {} for dto {}", dirty, dto.getClass().getName());
+					oldDirty = dirty;
+				}
+			}
+		}
+		if(dirty) {
+			eventBroker.send(IE4Topics.ToolBarEvents.NOTIFY_TOOLBAR_DIALOG_STATE, createStateLabelEvent(IE4Topics.ToolBarEvents.Labels.STATE, IE4Topics.ToolBarEvents.States.DIRTY, getStateLabelUUID()));
+		} else {
+			eventBroker.send(IE4Topics.ToolBarEvents.NOTIFY_TOOLBAR_DIALOG_STATE, createStateLabelEvent(IE4Topics.ToolBarEvents.Labels.STATE, IE4Topics.ToolBarEvents.States.CLEAN, getStateLabelUUID()));
+		}
+		return dirty;
+	}
+	
+	@IsPositioned
+	public boolean isDtoPositioned() {
+		boolean isPositioned = false;
+		DTO currentDto = (DTO)viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+		if (currentDto != null) {
+			if(DtoUtils.getIdValue(currentDto) != null) {
+				isPositioned = true;
+			}
+		}
+		return isPositioned;
+	}
+
+	@IsNew
+	public boolean isNewDto() {
+		return newCreatedDto;
+	}
+	
+	/**
+	 * Deletes the current dto entry.
+	 */
+	protected void doDelete() {
+		DTO deletedDto = (DTO) viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+		dtoService.delete(deletedDto);
+	    Notification.show(dslMetadataService.translate(user.getLocale().toLanguageTag(), "deleted"),Notification.Type.HUMANIZED_MESSAGE);
+		// initial state of the dialog has to be NEW. This
+		// fills
+		// the view context with a initial blank bean.
+		createNew(dto);
+	}
+
+	private void prefillOwners(Object newDto) {
+		if(mPart != null) {
+			MPerspective mPersp = mPart.getContext().get(MPerspective.class);
+			for (Field field : DtoUtils.getOwnerDomainReferences(newDto.getClass())) {
+				if (mPersp != null) {
+					boolean found = false;
+					// look in dialog's contexts
+					List<IViewContext> contexts = ecviewContainer.getECViews(mPersp);
+					for (IViewContext context : contexts) {
+						if (this.viewContext == context) {
+							continue;
+						}
+						Object bean = context.getBean(IViewContext.MAIN_BEAN_SLOT);
+						if (bean instanceof IDto) {
+							// must reload owner cause else will set owner to dirty on perspective
+							IDTOService<? extends Object> ownerService = DtoServiceAccess.getService(bean.getClass());
+							Object idVal=DtoUtils.getIdValue(bean);
+							if(idVal != null) {
+								Object beanCopy = ownerService.get(idVal);
+								if(beanCopy != null) {
+									DtoUtils.setValue(newDto, field.getName(), beanCopy);
+									found = true;
+								}
+							}
+						}
+					}
+					// look in context for selection
+					if(!found) {
+						String key = EntityUtils.getQualifiedEntityNameForQualifiedDtoName(field.getType().getName())+"."+DtoUtils.getIdField(field.getType()).getName();
+						Object idObj = SelectionStore.getSelectionFromPerspectiveContext(mPart, key);
+						if(idObj != null) {
+							IDTOService<? extends Object> ownerService = DtoServiceAccess.getService(field.getType());
+							Object beanCopy = ownerService.get(idObj);
+							if(beanCopy != null) {
+								DtoUtils.setValue(newDto, field.getName(), beanCopy);
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.osbp.osgi.hybrid.api.AbstractHybridVaaclipseView#
+	 * createComponents ()
+	 */
+	@Override
+	public void createComponents() {
+		if(!dialogModel.isStateful()) {
+			// initial state of the dialog has to be NEW. This fills the view
+			// context with a initial blank bean.
+			createNew(dto);
+		}
+		if(dialogModel.isEmbedded()) {
+			// OSBP UI Code
+			viewContext = ecviewComponent.setValue(viewId, null, renderingParams);
+			viewContext.setLocale(user.getLocale());
+			YView yView = (YView) viewContext.getViewEditpart().getModel();
+
+			if (yView == null) {
+				Notification.show("Dialog could not be found!", Type.ERROR_MESSAGE);
+				return;
+			}
+		}
+	}
+	
+	/**
+	 * Setup validation bridge.
+	 */
+	protected void setupValidationBridge() {
+		// create a validation enhancer. If an error message is added to the
+		// field validation manager. The enhancer will set the id of the mpart
+		// to the status.
+		ecviewFieldValidationManager = viewContext.getService(IFieldValidationManager.class.getName());
+		ecviewFieldValidationManager.setEnhancer(new IFieldValidationManager.Enhancer() {
+			@Override
+			public void enhance(IStatus status) {
+				if(mPart != null) {
+					status.putProperty(IStatus.PROP_UI_APPLICATION_ID, mPart.getElementId());
+				} else {
+					status.putProperty(IStatus.PROP_UI_APPLICATION_ID, dialogModel.getName());
+				}
+			}
+		});
+
+		ecviewFieldValidationManager.addListener(this);
+	}
+
+	protected boolean validate(DTO mainDto) {
+		if(mainDto == null) {
+			return true;
+		}
+		log.debug("{}", "validation start");
+		Set<IStatus> oldValidationResult = validationResult != null ? new HashSet<>(validationResult)
+				: new HashSet<>();
+
+		validationResult = dtoService.validate(mainDto, ValidationKind.OTHER, renderingParams);
+
+		for (IStatus status : validationResult) {
+			// set the application id to the status
+			if(mPart != null) {
+				status.putProperty(IStatus.PROP_UI_APPLICATION_ID, mPart.getElementId());
+			} else {
+				status.putProperty(IStatus.PROP_UI_APPLICATION_ID, dialogModel.getName());
+			}
+
+			if (status.containsProperty(IStatus.PROP_FIELD_ID)
+					&& status.containsProperty(IStatus.PROP_FIELD_I18N_KEY)) {
+				continue;
+			}
+
+			// fix the field id. Therefore we try to find the yField that is
+			// bound to the property path of javax.validation result.
+			if (!status.containsProperty(IStatus.PROP_FIELD_ID)) {
+				if (status.containsProperty(IStatus.PROP_JAVAX_PROPERTY_PATH)) {
+					String path = (String) status.getProperty(IStatus.PROP_JAVAX_PROPERTY_PATH);
+
+					// if path points to a collection, then remove all the
+					// collection stuff, since Vaadin can not focus rows
+					if (path.matches(".*\\[\\d*\\].*")) {
+						path = path.substring(0, path.indexOf("["));
+					}
+
+					// using a regex to find the yElement:
+					// "beanslot/.*/{propertyPath}"
+					YEmbeddable yElement = (YEmbeddable) viewContext
+							.findBoundField(String.format("%s.*/%s", BindingIdUtil.BEANSLOT, path));
+					if (yElement != null) {
+						status.putProperty(IStatus.PROP_FIELD_ID, yElement.getId());
+						status.putProperty(IStatus.PROP_FIELD_I18N_KEY, yElement.getLabelI18nKey());
+					}
+				}
+			}
+		}
+
+		// now update the field with the new Status instances
+		//
+		for (IStatus status : oldValidationResult) {
+			String fieldId = (String) status.getProperty(IStatus.PROP_FIELD_ID);
+			if (fieldId != null && !fieldId.trim().equals("")) {
+				YEmbeddable yElement = (YEmbeddable) viewContext.findYEmbeddableElement(fieldId);
+				IFieldEditpart editpart = ModelUtil.findEditpart(yElement);
+				if (editpart != null) {
+					editpart.removeExternalStatus(status);
+				}
+			}
+			log.debug("remove old status {}", status.getMessage());
+		}
+
+		for (IStatus status : validationResult) {
+			String fieldId = (String) status.getProperty(IStatus.PROP_FIELD_ID);
+			if (fieldId != null && !fieldId.trim().equals("")) {
+				YEmbeddable yElement = (YEmbeddable) viewContext.findYEmbeddableElement(fieldId);
+				IFieldEditpart editpart = ModelUtil.findEditpart(yElement);
+				if (editpart != null) {
+					editpart.addExternalStatus(status);
+				}
+			}
+			log.debug("add new status {}", status.getMessage());
+		}
+		if(!validationResult.isEmpty()) {
+			log.debug("{}", "get scope for statusManager");
+			statusManager.getScopeFor(mPart).modifyStatus(oldValidationResult, validationResult);
+		}
+		return validationResult.isEmpty();
+	}
+
+	/**
+	 * Removes the old view.
+	 */
+	private void removeOldView() {
+		if (viewContext != null) {
+			viewContext.dispose();
+		}
+		if (layoutManager.getDataArea().getComponentCount() > 0) {
+			layoutManager.getDataArea().removeAllComponents();
+		}
+
+	}
+
+	private boolean hasSupertype(UiBeanSlot slot, Class<?> clz) {
+		SuperTypeCollector collector = new SuperTypeCollector();
+		Set<String> result = new LinkedHashSet<>();
+		collector.collectSuperTypes(slot.getJvmType(), new SuperTypeCollector.SuperTypeAcceptor() {
+			@Override
+			public boolean accept(JvmTypeReference superType, int distance) {
+				if(superType.getQualifiedName().equals(clz.getName())) {
+					result.add(superType.getQualifiedName());
+				}
+				return true;
+			}
+		});
+		return !result.isEmpty();
+	}
+	
+	/**
+	 * Creates the rendering parameters.
+	 *
+	 * @return the map
+	 */
+	protected Map<String, Object> createRenderingParams() {
+		Map<String, Object> params = new HashMap<>();
+		Map<String, Object> services = new HashMap<>();
+		params.put(IViewContext.PARAM_SERVICES, services);
+		params.put(IViewContext.PROP_SLOT, IViewContext.MAIN_BEAN_SLOT);
+		params.put(IViewContext.PARAM_THIRDPARTY_SERVICE_PROVIDER, new ECViewToE4ServiceBridge(eclipseContext));
+		services.put(org.eclipse.osbp.runtime.common.event.IEventBroker.class.getName(),
+				new E4EventBrokerAdapter(eventBroker));
+		services.put(IUser.class.getName(), user);
+		// this service will handle reload requests from YSuggestTextField
+		services.put(IReloadRequestService.class.getName(), reloadRequestService);
+		
+		if(dialogModel.isStateful()) {
+		    IConfiguration config = new IConfiguration() {
+		    	@Override
+		    	public void beforeUiRendering(IContext viewContext) {
+		    		for(UiBeanSlot slot : dialogModel.getUiView().getBeanSlots()) {
+		    			if(hasSupertype(slot, IDto.class)) {
+		    				Class<?> dtoClass = dslMetadataService.getClass(slot.getJvmType().getQualifiedName(), "dto");
+		    				viewContext.createBeanSlot(slot.getName(), dtoClass).setValue(dslMetadataService.getClassInstance(dtoClass, "dto"));
+		    			} else if(hasSupertype(slot, IStateMachineParticipant.class) || hasSupertype(slot, IPeripheral.class)) {
+		    				Class<?> participantClass = dslMetadataService.getClass(slot.getJvmType().getQualifiedName(), "statemachine");
+		    				IStateMachineParticipant participantInstance = (IStateMachineParticipant)dslMetadataService.getClassInstance(participantClass, "statemachine");
+		    				participantInstance.setLocale(user.getLocale());
+		    				viewContext.createBeanSlot(slot.getName(), participantClass).setValue(participantInstance);
+		    			} else if(hasSupertype(slot, IStateMachine.class)) {
+		    				Class<?> statemachineClass = dslMetadataService.getClass(slot.getJvmType().getQualifiedName(), "statemachine");
+		    				IStateMachine statemachineInstance = (IStateMachine)dslMetadataService.getClassInstance(statemachineClass, "statemachine");
+		    				statemachineInstance.setLocale(user.getLocale());
+		    				statemachineInstance.setUser(user);
+		    				statemachineInstance.setEclipseContext(eclipseContext);
+		    				viewContext.createBeanSlot(slot.getName(), statemachineClass).setValue(statemachineInstance);
+		    			} else if(hasSupertype(slot, IBlobConverter.class)) {
+				    		viewContext.createBeanSlot(slot.getName(), BlobConverter.class).setValue(new BlobConverter(blobService));
+		    			}
+		    		}
+		    		viewContext.setLocale(user.getLocale());
+		    	}
+		    	@Override
+		    	public void afterUiRendering(IContext context) {
+		    	}
+		    	@Override
+		    	public void beforeBind(IContext context) {
+		    	}
+		    	@Override
+		    	public void afterBind(IContext context) {
+		    		for(UiBeanSlot slot : dialogModel.getUiView().getBeanSlots()) {
+		    			if(hasSupertype(slot, IStateMachineParticipant.class)) {
+		    				((IStateMachineParticipant)context.getBeanSlot(slot.getName()).getValue()).init();
+		    			}
+		    			if(hasSupertype(slot, IDataProvider.class)) {
+				    		for(UiBeanSlot innerslot : dialogModel.getUiView().getBeanSlots()) {
+				    			if(hasSupertype(innerslot, IDto.class)) {
+						    		if (context.getBeanSlot(innerslot.getName()) != null) {
+						    			((IDataProvider)context.getBeanSlot(slot.getName()).getValue()).addDatasource(innerslot.getName(), context.getBeanSlot(innerslot.getName()).getValueType());
+						    		}
+				    			}
+				    		}
+		    			}
+		    		}
+		    		// at the very end - start the statemachines
+		    		for(UiBeanSlot slot : dialogModel.getUiView().getBeanSlots()) {
+		    			if(hasSupertype(slot, IStateMachine.class)) {
+		    				((IStateMachine)context.getBeanSlot(slot.getName()).getValue()).start();
+		    			}
+		    		}
+		    	}
+		    };
+		    params.put(IViewContext.PARAM_CONFIGURATION, config);
+		}
+		return params;
+	}
+
+	/**
+	 * Shows a dialog which warns about loosing data.
+	 *
+	 * @param context
+	 *            the context
+	 * @param currentDto
+	 *            the current dto
+	 * @param newDto
+	 *            the new dto
+	 */
+	protected void showLoosingDataDialog(Object newDto, Object currentDto) {
+		if (isDirtyDto(currentDto)) {
+			AcceptLoosingDataDialog.showDialog(dslMetadataService, themeResourceService, new Runnable() {
+				@Override
+				public void run() {
+					viewContext = ecviewComponent.setValue(viewId, newDto, renderingParams);
+					setNewCreatedDto(false);
+					updateBindings(newDto);
+				}
+			}, null);
+		} else if(newDto == null) {
+			createNew(dto);
+		} else {
+			setNewCreatedDto(false);
+			updateBindings(newDto);
+		}
+	}
+
+	protected void showSaveDialog(Object newDto) {
+		final Object dto = newDto;
+		AcceptSaveDialog.showDialog(dslMetadataService, themeResourceService, new Runnable() {
+			@Override
+			public void run() {
+				viewContext = ecviewComponent.setValue(viewId, dto, renderingParams);
+			}
+		}, null);
+	}
+
+	protected void showDeleteDialog(Object currentDto) {
+		if(isDirtyDto(currentDto)) {
+			AcceptDeleteDialog.showDialog(dslMetadataService, themeResourceService, new Runnable() {
+				@Override
+				public void run() {
+					createNew(dto);
+				}
+			}, null);
+		} else {
+			createNew(dto);
+		}
+	}
+	
+	protected void showQueryDeleteDialog() {
+		QueryDeleteDialog.showDialog(dslMetadataService, themeResourceService, new Runnable() {
+			@Override
+			public void run() {
+				doDelete();
+			}
+		}, null);
+	}
+
+	@Override
+	public void localeChanged(final Locale locale) {
+		if(viewContext != null) {
+			viewContext.setLocale(locale);
+		}
+		if (layoutManager != null && dialogLabel != null) {
+			layoutManager.setLabelValue(
+					dslMetadataService.translate(user.getLocale().toLanguageTag(), dialogLabel));
+		}
+		if(infoWindow != null) {
+			infoWindow.setLocale(locale);
+		}
+		// set locale to all statemachine beans
+		if(getViewContext() != null && getViewContext().getValueBeans() != null) {
+			for(Entry<String, ISlot> slotEntry:getViewContext().getValueBeans().entrySet()) {
+				if(slotEntry.getValue() instanceof IStateMachineParticipant) {
+					((IStateMachineParticipant)slotEntry.getValue().getValue()).setLocale(locale);
+				}
+			}
+		}
+	}
+
+	@Override
+	public void receiveEvent(final EventDispatcherEvent event) {
+		switch (event.getCommand()) {
+		case OK:		// comes from SelectionDialog of subtypes
+			if (viewContext != null && event.getSender().equals(viewId)
+				&& event.getData().containsKey(EventDispatcherDataTag.OBJECT)) {
+				if (selectWindow != null) {
+					selectWindow.close();
+					UI.getCurrent().removeWindow(selectWindow);
+					selectWindow = null;
+					createNew((Class<?>)event.getData().get(EventDispatcherDataTag.OBJECT));
+				}
+			}
+			break;
+		case CLOSE:
+			if(viewContext != null && event.getSender().equals(viewId) && event.getTopic().equals("DTOInfoDialog")) {
+				if(infoWindow != null) {
+					infoWindow.close();
+					UI.getCurrent().removeWindow(infoWindow);
+					infoWindow = null;
+				}
+			}
+			break;
+		case SELECT:
+			if (manualInput) {
+				return;
+			}
+			MPerspective perspective = null;
+			ArrayList<String> allowedSenderParts = null;
+			if(mPart != null) {
+				perspective = eclipseContext.get(MPerspective.class);
+				allowedSenderParts = (ArrayList<String>) eclipseContext.getActive(MPart.class).getTransientData().get(IPerspectiveProvider.EventDispatcherConstants.ACCEPTED_SENDERS);
+			}
+			if((event.getPerspective() == null || (perspective != null && event.getPerspective().equals(perspective))) && ((allowedSenderParts != null && allowedSenderParts.contains(event.getSender())) || allowedSenderParts == null)){
+				if (dtoService != null && viewContext != null && !event.getSender().equals(viewId) && (event.getTopic().equals(dtoName) || event.getTopic().equals(primaryKey))) {
+	    			handleSelectEvent(event);	    				
+	    		}
+			}
+			break;
+		case REFRESH:
+			if (!event.getSender().equals(viewId) && event.getTopic().equals(entityName)) {
+				if (!newCreatedDto) {
+					DTO currentDto = (DTO) viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+					IDto newDto = (IDto) dtoService.get(DtoUtils.getIdValue(currentDto));
+					showLoosingDataDialog(newDto, currentDto);
+				}
+			}
+			break;
+		case SAVE:
+			if (!event.getSender().equals(viewId) && event.getTopic().equals(entityName)) {
+				if (event.getData().containsKey(EventDispatcherDataTag.ID)) {
+					Object eventDataId = event.getData().get(EventDispatcherDataTag.ID);
+					DTO currentDto = (DTO) viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+					Object currentDtoId = DtoUtils.getIdValue(currentDto);
+					IDto newDto = (IDto) dtoService.get(eventDataId);
+					if (eventDataId != null && idEquals(eventDataId, currentDtoId)) {
+						showLoosingDataDialog(newDto, currentDto);
+					}
+				}
+			}
+			break;
+		case DELETE:
+			if (!event.getSender().equals(viewId) && event.getTopic().equals(entityName)) {
+				if (event.getData().containsKey(EventDispatcherDataTag.ID)) {
+					Object eventDataId = event.getData().get(EventDispatcherDataTag.ID);
+					DTO currentDto = (DTO) viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+					Object currentDtoId = DtoUtils.getIdValue(currentDto);
+					if (eventDataId != null && idEquals(eventDataId, currentDtoId)) {
+						showDeleteDialog(currentDto);
+					}
+				}
+			}
+			break;
+		case ACTION:
+			if (uuid.equals(event.getTopic()) && event.getData().containsKey(EventDispatcherDataTag.BUTTON_ID)) {
+				Object id = event.getData().get(EventDispatcherDataTag.BUTTON_ID);
+				if (id instanceof DialogActionEnum) {
+					DialogActionEnum enumId = (DialogActionEnum) id;
+					switch (enumId) {
+					case DIALOG_ACTION_NEW:
+						makeNew();
+						break;
+					case DIALOG_ACTION_SAVE_AS_NEW:
+						DTO newDto = (DTO) DtoUtils.copyDto(viewContext.getBean(IViewContext.MAIN_BEAN_SLOT));
+						if(validate(newDto)) {
+							executeDialogFunction("pre save", preSaveMethod, newDto);
+							dtoService.update(newDto);
+							newDto = dtoService.reload(newDto);
+							executeDialogFunction("post save", postSaveMethod, newDto);
+							updateBindings(newDto);
+							setNewCreatedDto(false);
+						    Notification.show(dslMetadataService.translate(user.getLocale().toLanguageTag(), "savedas"),Notification.Type.HUMANIZED_MESSAGE);
+						}
+					    break;
+					case DIALOG_ACTION_SAVE_AND_NEW:
+					case DIALOG_ACTION_SAVE:
+						DTO savedDto = (DTO) viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+						if(validate(savedDto)) {
+							executeDialogFunction("pre save", preSaveMethod, savedDto);
+							dtoService.update(savedDto);
+							newDto = dtoService.reload(savedDto);
+							executeDialogFunction("post save", postSaveMethod, newDto);
+						    if(enumId == DialogActionEnum.DIALOG_ACTION_SAVE_AND_NEW) {
+						    	if(lastBaseDto != null) {
+									createNew(lastBaseDto);
+						    	} else {
+						    		makeNew();
+						    	}
+							    Notification.show(dslMetadataService.translate(user.getLocale().toLanguageTag(), "savedandnew"),Notification.Type.HUMANIZED_MESSAGE);
+						    } else {
+						    	updateBindings(newDto);
+						    	setNewCreatedDto(false);
+							    Notification.show(dslMetadataService.translate(user.getLocale().toLanguageTag(), "saved"),Notification.Type.HUMANIZED_MESSAGE);
+						    }
+						}
+						break;
+					case DIALOG_ACTION_DELETE:
+						showQueryDeleteDialog();
+						break;
+					case DIALOG_ACTION_CANCEL:
+						DTO reloadedDto = dtoService.reload((DTO) viewContext.getBean(IViewContext.MAIN_BEAN_SLOT));
+				    	setNewCreatedDto(reloadedDto != null);
+						updateBindings(reloadedDto);
+						break;
+					}
+				} else if (id instanceof UIActionEnum) {
+					UIActionEnum uiEnumId = (UIActionEnum) id;
+					switch (uiEnumId) {
+					case DATABASE_INFO:
+						if(infoWindow == null) {
+							infoWindow = new DTOInfoDialog(eclipseContext, user.getLocale(), viewId, "DTOInfoDialog");
+							infoWindow.setDto(viewContext.getBean(IViewContext.MAIN_BEAN_SLOT));
+							UI.getCurrent().addWindow(infoWindow);
+						}
+						break;
+					}
+				}
+				// force focus on me for validation report
+				eclipseContext.activate();
+			}
+			break;
+		}
+	}
+
+	private void executeDialogFunction(String what, Method method, Object dto) {
+		if(method != null) {
+			Boolean retVal = false;
+			Exception ex = null;
+			try {
+				retVal = (Boolean) method.invoke(dialogFunctionGroup, dto, renderingParams);
+			} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+				ex = e;
+			}
+			if(!retVal) {
+				String message = what+" "+dialogModel.getPostSave().getName()+" failed";
+				if(ex != null) {
+					message += " due to exception " + ex.getCause();
+				}
+				Notification.show(message, Type.ERROR_MESSAGE);
+			}
+		}
+	}
+
+	private void handleSelectEvent(EventDispatcherEvent event) {
+		log.debug("buffer select. Class:{} ObjectID:{}", getClass().getName(), System.identityHashCode(this));
+		final UI currentUi = eclipseContext.get(UI.class); 
+		if(timer != null && timer.isRunning()) {
+			log.debug("{}", "buffered select restarted.");
+			timer.restart();
+		} else {
+			timer = new Timer(50, new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					currentUi.accessSynchronously(new Runnable() {
+						@Override
+						public void run() {
+							VaadinObservables.activateRealm(currentUi);
+							Object newDto = getDtoFromEvent(event);
+							Object currentDto = viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+							showLoosingDataDialog(newDto, currentDto);
+						}
+					});
+				}
+			});
+			timer.setRepeats(false);
+			timer.start();
+		}
+	}
+
+	private Object getDtoFromEvent(EventDispatcherEvent event) {
+		Object dto = null;
+		if (event.getData().containsKey(EventDispatcherDataTag.ID)) {
+			Object id = event.getData().get(EventDispatcherDataTag.ID);
+			if (id != null) {
+				dto = dtoService.get(id);
+			}
+		} else if (event.getData().containsKey(EventDispatcherDataTag.DTO)) {
+			dto = event.getData().get(EventDispatcherDataTag.DTO);
+		}
+		return dto;
+	}
+
+	private void makeNew() {
+		if (subTypes.size() > 1) {
+			selectWindow = selectDialog.init(eventDispatcher, viewId, uuid, subTypes, dto, dslMetadataService.translate(user.getLocale().toLanguageTag(), "Select SubType"), dslMetadataService.translate(user.getLocale().toLanguageTag(), "Ok"));
+			UI.getCurrent().addWindow(selectWindow);
+		} else {
+			createNew(dto);
+			lastBaseDto = dto;
+		}
+	}
+
+	/**
+	 * Creates a new dto.
+	 *
+	 * @param type
+	 *            the type for the dto, could be a sub-type
+	 */
+	protected Object createNew(Class<?> type) {
+		log.debug("create new");
+		Object newDto = null;
+		try {
+			newDto = type.newInstance();
+		} catch (InstantiationException | IllegalAccessException e) {
+			log.error("{}", e);
+			return newDto;
+		}
+		setNewCreatedDto(true);
+		prefillOwners(newDto);
+		initializeDto(newDto);
+		if(DtoUtils.getAdapter(DirtyStateAdapter.class, newDto) == null) {
+			log.debug("register dirty adapter {}", newDto.getClass().getName());
+			DtoUtils.registerAdapter(dirtyStateAdapter, newDto);
+		}
+		DtoUtils.getAdapter(DirtyStateAdapter.class, newDto).resetDirty();
+		DtoUtils.getAdapter(DirtyStateAdapter.class, newDto).setActive(true);
+		updateBindings(newDto);
+		viewContext.setBean(BEAN_SLOT__VALIDATION_ERROR, Boolean.FALSE);
+		return newDto;
+	}
+
+	private void initializeDto(Object newDto) {
+		if(initializationMethod != null) {
+			executeDialogFunction("initializing", initializationMethod, newDto);
+		}
+	}
+
+	@PostConstruct
+	public void activate() {
+	    initDialog();
+		user.addUserLocaleListener(this);
+		eventDispatcher.addEventReceiver(this);
+		if(!dialogModel.isEmbedded()) {
+			super.initView();
+			onFocusField = new EventHandler() {
+				@Override
+				public void handleEvent(Event event) {
+					String[] names = event.getPropertyNames();
+					String partId = (String) event.getProperty(IE4Topics.PartEvents.PROP_MPART_ID);
+					String fieldId = (String) event.getProperty(IE4Topics.PartEvents.PROP_FIELD_ID);
+					if(mPart.getElementId().equals(partId)) {
+						focusField(null, fieldId);
+					}
+				}
+			};
+			eventBroker.subscribe(IE4Topics.PartEvents.FOCUS_FIELD_TOPIC, onFocusField);
+			if(dialogModel.isStateful()) {
+				if(getViewContext() != null && getViewContext().getValueBeans() != null) {
+					for(String selector:getViewContext().getValueBeans().keySet()) {
+						ISlot slot = getViewContext().getBeanSlot(selector);
+						if(IPeripheral.class.isAssignableFrom(slot.getValueType())) {
+							((IPeripheral)slot.getValue()).initDevices(getBeeper(), getAudio(), getVideo());
+						} else if(IStateMachine.class.isAssignableFrom(slot.getValueType())) {
+							((IStateMachine)slot.getValue()).installKeyEventConsumer(getParent());
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	@PreDestroy
+	public void deactivate() {
+		if(dialogModel.isStateful()) {
+			if(getViewContext() != null && getViewContext().getValueBeans() != null) {
+				for(String selector:getViewContext().getValueBeans().keySet()) {
+					ISlot slot = getViewContext().getBeanSlot(selector);
+					if(IPeripheral.class.isAssignableFrom(slot.getValueType())) {
+						((IPeripheral)slot.getValue()).releaseDevices();
+					} else if(IStateMachine.class.isAssignableFrom(slot.getValueType())) {
+						((IStateMachine)slot.getValue()).uninstallKeyEventConsumer();
+					}
+				}
+			}
+		}
+		user.removeUserLocaleListener(this);
+		eventDispatcher.removeEventReceiver(this);
+		if(!dialogModel.isEmbedded()) {
+			eventBroker.unsubscribe(onFocusField);
+			if(infoWindow != null) {
+				infoWindow.close();
+				UI.getCurrent().removeWindow(infoWindow);
+				infoWindow = null;
+			}
+			super.destroyView();
+		}
+	}
+
+	protected Map<String, Object> createStateLabelEvent(IE4Topics.ToolBarEvents.Labels labelType, IE4Topics.ToolBarEvents.States state, String uuid) {
+		Map<String, Object> properties = new HashMap<>();
+		properties.put(IE4Topics.ToolBarEvents.STATE_LABEL, labelType.name());
+		properties.put(IE4Topics.ToolBarEvents.STATE_STATE, state.name());
+		properties.put(IE4Topics.ToolBarEvents.STATE_UUID, uuid);
+		return properties;
+	}
+	
+	private boolean idEquals(Object id, Object id2) {
+		if (id2.getClass().isAssignableFrom(id.getClass())) {
+			if (id instanceof String) {
+				return ((String) id).equals(id2);
+			} else if (id instanceof Integer) {
+				return ((Integer) id).intValue() == ((Integer) id2).intValue();
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Update data with a new dto
+	 *
+	 * @param newDto
+	 *            the new dto
+	 */
+	private void updateBindings(Object newDto) {
+		viewContext = ecviewComponent.setValue(viewId, newDto, renderingParams);
+		if(newDto != null) {
+			log.debug("update bindings for dto:{}", newDto.getClass().getName());
+			if(infoWindow != null) {
+				infoWindow.setDto(newDto);
+			}
+			DtoUtils.getAdapter(DirtyStateAdapter.class, newDto).setActive(true);
+		}
+	}
+
+	protected void setNewCreatedDto(boolean state) {
+		newCreatedDto = state;
+		reloadRequestService.setMode(!state);
+		if(newCreatedDto) {
+			eventBroker.send(IE4Topics.ToolBarEvents.NOTIFY_TOOLBAR_DIALOG_STATE, createStateLabelEvent(IE4Topics.ToolBarEvents.Labels.MODE, IE4Topics.ToolBarEvents.States.ADD_ENTRY, getStateLabelUUID()));
+		} else {
+			eventBroker.send(IE4Topics.ToolBarEvents.NOTIFY_TOOLBAR_DIALOG_STATE, createStateLabelEvent(IE4Topics.ToolBarEvents.Labels.MODE, IE4Topics.ToolBarEvents.States.MODIFY_ENTRY, getStateLabelUUID()));
+		}
+	}
+	
+	@Override
+	public String getStateLabelUUID() {
+		if(toolbar != null) {
+			return toolbar.getStateLabelUUID();
+		}
+		return null;
+	}
+	
+	/**
+	 * Sets the input to the dialog.
+	 * 
+	 * @param dto
+	 */
+	@Override
+	public void setInput(Object dto) {
+		this.dto = (Class<?>) dto;
+		if (dto != null && viewContext != null) {
+			dtoService = (IDTOServiceWithMutablePersistence<DTO>) DtoServiceAccess.getService(this.dto);
+			DTO persistentDto = dtoService.get(DtoUtils.getIdValue(dto));
+			viewContext.setBean(IViewContext.MAIN_BEAN_SLOT, persistentDto);
+		}
+	}
+
+	/**
+	 * If true, then EventDispatcherEvents are being ignored.
+	 * 
+	 * @param manualInput
+	 */
+	@Override
+	public void setEnableManualInput(boolean manualInput) {
+		this.manualInput = manualInput;
+	}
+
+	/**
+	 * Creates the embedded toolbar for embedded dialogs.
+	 */
+	private void createEmbeddedToolbar() {
+		taskButtons = new ArrayList<Button>();
+		HorizontalLayout tools = new HorizontalLayout();
+		tools.addStyleName("os-embedded-toolbar");
+		tools.setSpacing(false);
+
+		Button b = new Button(null, new Button.ClickListener() {
+			public void buttonClick(ClickEvent event) {
+				DTO savedDto = (DTO) viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
+				if(validate(savedDto)) {
+					dtoService.update(savedDto);
+					DTO newDto = dtoService.reload(savedDto);
+			    	updateBindings(newDto);
+			    	setNewCreatedDto(false);
+				    Notification.show(dslMetadataService.translate(user.getLocale().toLanguageTag(), "saved"),Notification.Type.HUMANIZED_MESSAGE);
+				    notifySaveListeners(newDto);
+				}
+			}
+		});
+		b.setIcon(themeResourceService.getThemeResource("dssave", ThemeResourceType.ICON));
+		b.setDescription(null);
+		b.setEnabled(true);
+		b.addStyleName("v-button-small");
+		tools.addComponent(b);
+		taskButtons.add(b);
+		layoutManager.getDataArea().addComponentAsFirst(tools);
+	}
+
+	/**
+	 * Adds a new save listener.
+	 * 
+	 * @param listener
+	 */
+	public void addSaveListener(Consumer<DTO> listener) {
+		if (saveListeners == null) {
+			saveListeners = new ArrayList<>();
+		}
+		saveListeners.add(listener);
+	}
+
+	/**
+	 * Removes the given save listener.
+	 * 
+	 * @param listener
+	 */
+	public void removeSaveListener(Consumer<DTO> listener) {
+		if (saveListeners == null) {
+			return;
+		}
+		saveListeners.remove(listener);
+	}
+
+	protected void notifySaveListeners(DTO dto) {
+		if (saveListeners == null) {
+			return;
+		}
+
+		for (Consumer<DTO> listener : saveListeners.toArray(new Consumer[saveListeners.size()])) {
+			listener.accept(dto);
+		}
+	}
+
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	protected String getUUID() {
+		return uuid;
+	}
+
+	public IEclipseContext getEclipseContext() {
+		return eclipseContext;
+	}
+
+	public IViewContext getViewContext() {
+		return viewContext;
+	}
+
+	public IUser getUser() {
+		return user;
+	}
+
+	public IDSLMetadataService getDslMetadataService() {
+		return dslMetadataService;
+	}
+
+	public IThemeResourceService getThemeResourceService() {
+		return themeResourceService;
+	}
+
+	public IReportProvider getReportProvider() {
+		return reportProvider;
+	}
+
+	public IBlobService getBlobService() {
+		return blobService;
+	}
+}
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/KanbanView.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/KanbanView.java
index 79ae946..4087f5b 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/KanbanView.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/KanbanView.java
@@ -15,12 +15,12 @@
 import org.eclipse.osbp.ecview.core.extension.model.extension.YKanbanEvent;
 import org.eclipse.osbp.runtime.common.event.IEventDispatcher;
 import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.KanbanBoardEmbeddable;
+import org.eclipse.osbp.ui.api.contextfunction.IViewEmbeddedProvider;
 import org.eclipse.osbp.ui.api.e4.IE4Dialog;
 import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
 import org.eclipse.osbp.ui.api.perspective.IPerspectiveProvider;
 import org.eclipse.osbp.ui.api.user.IUser;
 import org.eclipse.osbp.xtext.dialogdsl.Dialog;
-import org.eclipse.osbp.xtext.dialogdsl.common.AbstractEmbeddedDialog;
 
 import com.vaadin.ui.Component;
 import com.vaadin.ui.Panel;
@@ -84,24 +84,21 @@
 	}
 
 	private void showDialog(YKanbanEvent event) {
-		Class<?> dialogViewClass = dslMetadataService.getClass(dialog, "dialog");
-
 		Window dialogWindow = new Window();
 		parent.getUI().addWindow(dialogWindow);
 		VerticalLayout dialogParent = new VerticalLayout();
 		dialogParent.setSizeFull();
 		dialogWindow.setContent(dialogParent);
 
-		// TODO ask Riegel
 		dialogWindow.setWidth("650px");
 		dialogWindow.setHeight("300px");
 
 		IEclipseContext childContext = context.createChild();
 		childContext.set(VerticalLayout.class, dialogParent);
 
-		AbstractEmbeddedDialog<?> content = (AbstractEmbeddedDialog<?>) ContextInjectionFactory.make(dialogViewClass,
-				childContext);
-		content.addSaveListener(this::refreshCard);
+		childContext.set("embeddedDialogModel", dialog);
+	    IViewEmbeddedProvider content = ContextInjectionFactory.make(DialogProvider.class, childContext);
+//		content.addSaveListener(this::refreshCard);
 		content.setEnableManualInput(true);
 		content.createView(dialogParent);
 		content.createComponents();
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/PerspectiveProvider.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/PerspectiveProvider.java
index ecc097c..7e9dbf2 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/PerspectiveProvider.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/PerspectiveProvider.java
@@ -68,7 +68,6 @@
 import org.eclipse.osbp.bpm.api.IBlipBPMWorkloadModifiableItem;
 import org.eclipse.osbp.dsl.common.datatypes.IDto;
 import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
-import org.eclipse.osbp.ecview.semantic.uimodel.UiModel;
 import org.eclipse.osbp.eventbroker.EventBrokerMsg;
 import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent;
 import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherCommand;
@@ -99,7 +98,6 @@
 import org.eclipse.osbp.xtext.dialogdsl.Dialog;
 import org.eclipse.osbp.xtext.dialogdsl.DialogDSLPackage;
 import org.eclipse.osbp.xtext.dialogdsl.DialogPackage;
-import org.eclipse.osbp.xtext.dialogdsl.mapper.AutowireUiFactory;
 import org.eclipse.osbp.xtext.organizationdsl.Organization;
 import org.eclipse.osbp.xtext.organizationdsl.OrganizationDSLPackage;
 import org.eclipse.osbp.xtext.organizationdsl.OrganizationPackage;
@@ -115,6 +113,7 @@
 import org.eclipse.osbp.xtext.perspective.PerspectiveGrid;
 import org.eclipse.osbp.xtext.perspective.PerspectiveKanban;
 import org.eclipse.osbp.xtext.perspective.PerspectiveOrganization;
+import org.eclipse.osbp.xtext.perspective.PerspectivePackage;
 import org.eclipse.osbp.xtext.perspective.PerspectivePart;
 import org.eclipse.osbp.xtext.perspective.PerspectivePartStack;
 import org.eclipse.osbp.xtext.perspective.PerspectiveReport;
@@ -216,7 +215,7 @@
 	private Map<String, MPerspective> perspectives = new HashMap<>();
 
 	/** The perspective tasks. */
-	private Map<Long, String> perspectiveTasks = new HashMap<>();
+	private Map<BPMTaskSummary, String> perspectiveTasks = new HashMap<>();
 
 	/**
 	 * Inits the PerspectiveSupport.
@@ -236,7 +235,7 @@
 	 * @return the current perspective stack or null
 	 */
 	private MPerspectiveStack initPerspectiveStack() {
-		log.debug("analyze app model");
+		log.trace("{}","analyze app model");
 		trimmedWindow = (MTrimmedWindow) appModel.getChildren().get(0);
 		for (MWindowElement element : trimmedWindow.getChildren()) {
 			if (element instanceof MPerspectiveStack) {
@@ -253,7 +252,7 @@
 			public void notifyChanged(Notification notification) {
 				if (notification.getEventType() == Notification.SET && notification.getFeatureID(
 						MElementContainer.class) == AdvancedPackageImpl.PERSPECTIVE_STACK__SELECTED_ELEMENT) {
-					log.debug("perspective stack changed selection");
+					log.trace("{}","perspective stack changed selection");
 					if (notification.getNewValue() == null && notification.getOldValue() != null && PerspectiveProvider
 							.isPerspectiveElementId(((MPerspective) notification.getOldValue()).getElementId())) {
 						closePerspective(PerspectiveProvider
@@ -417,24 +416,25 @@
 	 */
 	private void traverseModel(MElementContainer<?> parent, EObject modelElement) {
 		if (modelElement instanceof Perspective) {
-			log.debug("traverse model perspective");
+			log.trace("{}","traverse model perspective");
 			Perspective perspectiveModel = (Perspective) modelElement;
 			for (PerspectiveElement element : perspectiveModel.getElements()) {
 				addElement(parent, element);
 			}
 		} else if (modelElement instanceof PerspectiveSashContainer) {
-			log.debug("traverse model sashcontainer");
+			log.trace("{}","traverse model sashcontainer");
 			PerspectiveSashContainer sashModel = (PerspectiveSashContainer) modelElement;
 			for (PerspectiveElement element : sashModel.getElements()) {
 				addElement(parent, element);
 			}
 		} else if (modelElement instanceof PerspectivePartStack) {
-			log.debug("traverse model perspectivestack");
+			log.trace("{}","traverse model perspectivestack");
 			PerspectivePartStack stackModel = (PerspectivePartStack) modelElement;
 			for (PerspectiveElement element : stackModel.getElements()) {
 				addElement(parent, element);
 			}
 		}
+		log.trace("{}","traverse finished");
 	}
 
 	/**
@@ -453,11 +453,7 @@
 		addAdapter(sashContainer);
 		sashContainer.setElementId(sashModel.getElementId());
 
-		if ("HORIZONTAL".equals(sashModel.getOrientation().getName())) {
-			sashContainer.setHorizontal(true);
-		} else {
-			sashContainer.setHorizontal(false);
-		}
+		sashContainer.setHorizontal("HORIZONTAL".equals(sashModel.getOrientation().getName()));
 		sashContainer.setVisible(true);
 		sashContainer.setParent((MElementContainer<MUIElement>) parent);
 		if (parent instanceof MPerspective) {
@@ -509,6 +505,9 @@
 		stack.setElementId(stackModel.getElementId());
 		stack.setVisible(true);
 		stack.setParent((MElementContainer<MUIElement>) parent);
+		if(stackModel.getSynchronize() != null) {
+			stack.getTransientData().put(IPerspectiveProvider.EventDispatcherConstants.SYNCHRONIZE_WITH, stackModel.getSynchronize().getElementId());
+		}
 		if (parent instanceof MPerspective) {
 			((MPerspective) parent).getChildren().add(stack);
 		} else if (parent instanceof MPartSashContainer) {
@@ -573,20 +572,7 @@
 			container = container.eContainer();
 		}
 		Perspective perspective = (Perspective) container;
-		if (perspective.getEventmanager() != null && perspective.getEventmanager().getEvents() != null
-				&& !perspective.getEventmanager().getEvents().isEmpty()) {
-			for (PerspectiveEvent event : perspective.getEventmanager().getEvents()) {
-				if (event.getTarget().getElementId().equals(partModel.getElementId())) {
-					ArrayList<String> senders = new ArrayList<>();
-					senders.add(getViewPartID(partModel.getView()));
-					for(PerspectivePart source : event.getAllowedsources()){
-						senders.add(getViewPartID(source.getView()));
-					}
-					part.getTransientData().put(IPerspectiveProvider.EventDispatcherConstants.ACCEPTED_SENDERS,senders);
-					break;
-				}
-			}
-		}
+		supplyAcceptedSenders(partModel, part, perspective);
 
 		String flavor = getFlavor(partModel.getView());
 		if (flavor != null) {
@@ -602,7 +588,7 @@
 			((MPartStack) parent).getChildren().add(part);
 		}
 		if (partModel.getView() != null) {
-			log.debug("set contribution URI for part {} to {} ", part.getElementId(),
+			log.trace("set contribution URI for part {} to {} ", part.getElementId(),
 					getContributionURI(part, partModel));
 			part.setContributionURI(getContributionURI(part, partModel));
 		}
@@ -622,6 +608,23 @@
 
 	}
 
+	private void supplyAcceptedSenders(PerspectivePart partModel, MPart part, Perspective perspective) {
+		if (perspective.getEventmanager() != null && perspective.getEventmanager().getEvents() != null
+				&& !perspective.getEventmanager().getEvents().isEmpty()) {
+			for (PerspectiveEvent event : perspective.getEventmanager().getEvents()) {
+				if (event.getTarget().getElementId().equals(partModel.getElementId())) {
+					ArrayList<String> senders = new ArrayList<>();
+					senders.add(getViewPartID(partModel.getView()));
+					for(PerspectivePart source : event.getAllowedsources()){
+						senders.add(getViewPartID(source.getView()));
+					}
+					part.getTransientData().put(IPerspectiveProvider.EventDispatcherConstants.ACCEPTED_SENDERS,senders);
+					break;
+				}
+			}
+		}
+	}
+
 	/**
 	 * Returns the corresponding viewid or fully qualified name of a PerspectivePart, which is needed
 	 * for EventDispatcherEvent's recognition within a perspective.
@@ -629,18 +632,9 @@
 	 * @return {@link String} the view id or fully qualified name
 	 */
 	private String getViewPartID(PerspectiveView viewModel) {
+		log.trace("{}","get viewpart id");
 		if (viewModel instanceof PerspectiveDialog) {
-			Dialog dialog = ((PerspectiveDialog) viewModel).getRef();
-			if (dialog.isAutowire()) {
-				return AutowireUiFactory.getECViewPackage(dialog) +"."+ AutowireUiFactory.getECViewName(dialog);
-			} else {
-				EObject parent = dialog.getUiView().eContainer();
-				while (!(parent instanceof UiModel)) {
-					parent = parent.eContainer();
-				}
-				UiModel uiModel = (UiModel) parent;
-				return uiModel.getPackageName() +"."+ dialog.getUiView().getName();
-			}
+			return dslMetadataService.getECViewId(((PerspectiveDialog) viewModel).getRef());
 		}
 		else if (viewModel instanceof PerspectiveTable) {
 			return dslMetadataService.getFullyQualifiedName(((PerspectiveTable) viewModel).getRef());
@@ -694,10 +688,13 @@
 	 */
 	private void addElement(MElementContainer<?> parent, EObject element) {
 		if (element instanceof PerspectiveSashContainer) {
+			log.trace("{}","add sashcontainer");
 			addElementPerspectiveSashContainer(parent, element);
 		} else if (element instanceof PerspectivePartStack) {
+			log.trace("{}","add partstack");
 			addElementPerspectivePartStack(parent, element);
 		} else if (element instanceof PerspectivePart) {
+			log.trace("{}","add part");
 			addElementPerspectivePart(parent, element);
 		}
 	}
@@ -710,6 +707,7 @@
 	 * @return null or the classURI
 	 */
 	private String getContributionURI(MPart part, PerspectivePart partModel) { // NOSONAR
+		log.trace("{}","get contributionURI");
 		PerspectiveView viewModel = partModel.getView();
 		if (viewModel instanceof PerspectiveTable) {
 			String className = getFQN(viewModel)+"Table";
@@ -736,8 +734,8 @@
 			String className = getFQN(viewModel)+"Topology";
 			return dslMetadataService.getClassURI(className, IPerspectiveProvider.PerspectiveViewType.TOPOLOGY);
 		} else if (viewModel instanceof PerspectiveDialog) {
-			String className = getFQN(viewModel)+"Dialog";
-			return dslMetadataService.getClassURI(className, IPerspectiveProvider.PerspectiveViewType.DIALOG);
+			part.getTransientData().put("dialogModel", ((PerspectiveDialog) viewModel).getRef());
+			return dslMetadataService.getClassURI(DialogProvider.class.getCanonicalName(), IPerspectiveProvider.PerspectiveViewType.DIALOG);
 		} else if (viewModel instanceof PerspectiveDataInterchange) {
 			String className = getFQN(viewModel)+"TriggerView";
 			return dslMetadataService.getClassURI(className, IPerspectiveProvider.PerspectiveViewType.DATAINTERCHANGE);
@@ -786,6 +784,7 @@
 	 * @return null or the FQN
 	 */
 	private String getFQN(PerspectiveView viewModel) { // NOSONAR
+		log.trace("{}","get FQN");
 		if (viewModel instanceof PerspectiveTable) {
 			Table object = ((PerspectiveTable) viewModel).getRef();
 			TablePackage pkg = (TablePackage) object.eContainer();
@@ -821,7 +820,7 @@
 		} else if (viewModel instanceof PerspectiveDataInterchange) {
 			DataInterchangeGroup group = ((PerspectiveDataInterchange) viewModel).getRef();
 			DataInterchangePackage pkg = (DataInterchangePackage) group.eContainer();
-			return group == null ? "" : toFQN(pkg.getName(), group.getName());
+			return toFQN(pkg.getName(), group.getName());
 		}
 		return null;
 	}
@@ -835,6 +834,7 @@
 	 * @return the ns uri
 	 */
 	private String getNsURI(PerspectiveView viewModel) { // NOSONAR
+		log.trace("{}","get NsURI");
 		if (viewModel instanceof PerspectiveTable) {
 			return TableDSLPackage.eNS_URI;
 		} else if (viewModel instanceof PerspectiveSelection) {
@@ -912,7 +912,7 @@
 	 */
 	private void createEventHandlers() {
 		doLogout = (Event event) -> {
-			log.debug("logout pending");
+			log.trace("{}","logout pending");
 			suspendAllTasks();
 		};
 	}
@@ -922,11 +922,9 @@
 	 * 
 	 */
 	private void suspendAllTasks() {
-		for (Long taskId : perspectiveTasks.keySet()) {
-			if(taskId != -1) {
-				log.debug("suspend task {}", taskId);
-				taskClient.operations(taskId, user, null, BPMOperation.Suspend);
-			}
+		for (BPMTaskSummary summary : perspectiveTasks.keySet()) {
+			log.debug("suspend task {}", summary.getId());
+			taskClient.operations(summary.getId(), user, null, BPMOperation.Suspend);
 		}
 	}
 
@@ -939,10 +937,10 @@
 	 * @return the perspective
 	 */
 	protected PerspectiveFound findPerspective(String perspectiveId) {
-		log.debug("find perspective model by id");
+		log.trace("{}","find perspective model by id");
 		return new PerspectiveFound(null,
 				(Perspective) dslMetadataService.getMetadata(perspectiveId, PerspectiveDslPackage.Literals.PERSPECTIVE),
-				null, null);
+				null, null, perspectiveId);
 	}
 
 	private final class PerspectiveFound {
@@ -950,13 +948,15 @@
 		public final Perspective perspective;
 		public final BlipItem blipTask;
 		public final Task bpmTask;
+		public final String fqn;
 
 		protected PerspectiveFound(BPMTaskSummary taskSummary, Perspective perspective, BlipItem blipTask,
-				Task bpmTask) {
+				Task bpmTask, String fqn) {
 			this.taskSummary = taskSummary;
 			this.perspective = perspective;
 			this.blipTask = blipTask;
 			this.bpmTask = bpmTask;
+			this.fqn = fqn;
 		}
 	}
 
@@ -969,7 +969,7 @@
 	 * @return the perspective
 	 */
 	protected PerspectiveFound findPerspective(BPMTaskSummary taskSummary) {
-		log.debug("find perspective model by task");
+		log.trace("{}","find perspective model by task");
 		for (EObject eObj : dslMetadataService.getAll(PerspectiveDslPackage.Literals.PERSPECTIVE)) {
 			if ((((Perspective) eObj).getProcess() != null) && (((Perspective) eObj).getUserTask() != null)) {
 				Process process = ((Perspective) eObj).getProcess().getProcess();
@@ -977,7 +977,7 @@
 				if ((process != null) && (process.getId().equals(taskSummary.getProcessId()))) {
 					Task bpmTask = blipTask.getTask();
 					if ((bpmTask != null) && bpmTask.getName().equals(taskSummary.getName())) {
-						return new PerspectiveFound(taskSummary, (Perspective) eObj, blipTask, bpmTask);
+						return new PerspectiveFound(taskSummary, (Perspective) eObj, blipTask, bpmTask, ((PerspectivePackage) eObj.eContainer()).getName()+"."+((Perspective) eObj).getName());
 					}
 				}
 			}
@@ -993,7 +993,7 @@
 	 * @return the action toolbar
 	 */
 	protected ActionToolbar findToolbar(String toolbarId) {
-		log.debug("find toolbar model");
+		log.trace("{}","find toolbar model");
 		return (ActionToolbar) dslMetadataService.getMetadata(toolbarId, ActionDSLPackage.Literals.ACTION_TOOLBAR);
 	}
 
@@ -1026,12 +1026,28 @@
 			TaskActionEnum enumId = (TaskActionEnum) buttonId;
 			Long taskId = (Long) event.getData().get(EventDispatcherDataTag.TASK_ID);
 			if (enumId == TaskActionEnum.TASK_ACTION_DELEGATE) {
-				log.debug("dispatch action received in PerspectiveSupport for "
-						+ TaskActionEnum.TASK_ACTION_DELEGATE.getLiteral());
+				log.debug("dispatch action received in PerspectiveSupport for {}", TaskActionEnum.TASK_ACTION_DELEGATE.getLiteral());
 			} else {
 				taskClient.operations(taskId, user, null, BPMOperation.valueOf(enumId.getLiteral()));
 			}
 		}
+		if (event.getCommand() == EventDispatcherCommand.REFRESH &&
+			event.getTopic().equals("reloadModel.perspective")) {
+			Map<BPMTaskSummary,String> taskToReload = new HashMap<>(perspectiveTasks);
+			for(BPMTaskSummary summary:taskToReload.keySet()) {
+				closePerspective(summary);
+			}
+			Map<String,MPerspective> toReload = new HashMap<>(perspectives);
+			for(String p:toReload.keySet()) {
+				closePerspective(p);
+			}
+			for(BPMTaskSummary summary:taskToReload.keySet()) {
+				openPerspective(summary);
+			}
+			for(String perspectiveId:toReload.keySet()) {
+				openPerspective(perspectiveId);
+			}
+		}
 	}
 
 	/*
@@ -1087,7 +1103,7 @@
 		if (perspectiveFound != null) {
 			// notify orgachart with current user's position
 			eventBroker.post(EventBrokerMsg.ORGCHART_SELECT, user.getPosition());
-			openPerspective(perspectiveFound, taskSummary.getId());
+			openPerspective(perspectiveFound, taskSummary);
 		} else {
 			log.error("perspective for taskid {} not found", taskSummary.getId());
 		}
@@ -1103,7 +1119,9 @@
 	public void openPerspective(String perspectiveId) {
 		PerspectiveFound perspectiveFound = findPerspective(perspectiveId);
 		if (perspectiveFound != null) {
-			openPerspective(perspectiveFound, -1L);
+			log.debug("{}", "openPerspective starts");
+			openPerspective(perspectiveFound, null);
+			log.debug("{}", "openPerspective finished");
 		} else {
 			log.error("perspective id {} not found", perspectiveId);
 		}
@@ -1117,15 +1135,15 @@
 	 * @param humanTask
 	 * @param taskSummary
 	 */
-	private void openPerspective(PerspectiveFound perspectiveFound, Long taskId) {
+	private void openPerspective(PerspectiveFound perspectiveFound, BPMTaskSummary summary) {
 		MPerspectiveStack stack = initPerspectiveStack();
 		if (stack != null && perspectiveFound.perspective != null) {
 			// bring to top if already contained in model
 			// lo wants multiple manually opened perspectives of same type by
 			// 02/28/2018
-			if (taskId > 0L) {
+			if (summary != null) {
 				for (MPerspective perspective : stack.getChildren()) {
-					if ((PerspectiveProvider.toPerspectiveElementId(perspectiveFound.perspective.getName()))
+					if ((PerspectiveProvider.toPerspectiveElementId(perspectiveFound.fqn))
 							.equals(perspective.getElementId())) {
 						modelService.bringToTop(perspective);
 						return;
@@ -1133,25 +1151,26 @@
 				}
 			}
 
-			log.debug("open perspective {}", perspectiveFound.perspective.getName());
-			log.debug("add perspective");
+			log.debug("open perspective {}", perspectiveFound.fqn);
+			log.trace("{}","add perspective");
 			MPerspective perspective = createPerspective(stack, perspectiveFound.perspective,
-					perspectiveFound.perspective.getName());
-			if (taskId != -1L) {
+					perspectiveFound.fqn);
+			if (summary != null) {
 				registerContext(perspective.getTransientData(), perspectiveFound);
 				// create the toolbar
-				if (perspectiveFound.perspective.getToolbarTypeJvm() != null) {
-					String toolBarId = perspectiveFound.perspective.getToolbarTypeJvm().getQualifiedName()
-							.replace("Toolbar", "");
-					toolbarProvider.addToolbar(perspectiveFound.perspective.getName(), findToolbar(toolBarId));
+				if (perspectiveFound.perspective.getToolbar() != null) {
+					String toolBarId = dslMetadataService.getFullyQualifiedName(perspectiveFound.perspective.getToolbar());
+					toolbarProvider.addToolbar(perspectiveFound.fqn, findToolbar(toolBarId));
 				}
 			}
 			stack.getChildren().add(perspective);
 			stack.setSelectedElement(perspective);
 			modelService.bringToTop(perspective);
 
-			perspectives.put(perspectiveFound.perspective.getName(), perspective);
-			perspectiveTasks.put(taskId, perspectiveFound.perspective.getName());
+			perspectives.put(perspectiveFound.fqn, perspective);
+			if(summary != null) {
+				perspectiveTasks.put(summary, perspectiveFound.fqn);
+			}
 			// get notified from bpm
 			if (taskClient != null) {
 				taskClient.subscribeProcessCompletedEventNotification(this);
@@ -1177,12 +1196,18 @@
 	 */
 	private void closePerspective(String perspectiveId) {
 		if (perspectiveTasks.containsValue(perspectiveId)) {
-			for (Map.Entry<Long, String> perspective : perspectiveTasks.entrySet()) {
+			for (Map.Entry<BPMTaskSummary, String> perspective : perspectiveTasks.entrySet()) {
 				if (perspective.getValue().equals(perspectiveId)) {
 					closePerspective(perspective.getKey());
 					break;
 				}
 			}
+		} else {
+			if(perspectives.containsKey(perspectiveId)) {
+				modelService.resetPerspectiveModel(perspectives.get(perspectiveId), trimmedWindow);
+				modelService.removePerspectiveModel(perspectives.get(perspectiveId), trimmedWindow);
+				perspectives.remove(perspectiveId);
+			}
 		}
 	}
 
@@ -1191,35 +1216,49 @@
 	 *
 	 * @param taskId
 	 *            of the perspective to close
-	 * @param suspendTask
-	 *            is true if task should be set to susupended
 	 */
 	private void closePerspective(long taskId) {
-		if (perspectiveTasks.containsKey(taskId)) {
-			modelService.resetPerspectiveModel(perspectives.get(perspectiveTasks.get(taskId)), trimmedWindow);
-			modelService.removePerspectiveModel(perspectives.get(perspectiveTasks.get(taskId)), trimmedWindow);
-			toolbarProvider.removeToolbar(perspectiveTasks.get(taskId));
-			perspectives.remove(taskId);
-			perspectiveTasks.remove(taskId);
+		for(BPMTaskSummary summary:perspectiveTasks.keySet()) {
+			if(summary.getId() == taskId) {
+				closePerspective(summary);
+				break;
+			}
 		}
 	}
 
 	@Override
-	public void closePerspective(BPMTaskSummary taskSummary) {
-		if(taskSummary != null) {
-			log.debug("close perspective {}", taskSummary.getId());
-			// awaits a Long object as taskId
-			closePerspective(taskSummary.getId());
+	public void closePerspective(BPMTaskSummary summary) {
+		if (perspectiveTasks.containsKey(summary)) {
+			modelService.resetPerspectiveModel(perspectives.get(perspectiveTasks.get(summary)), trimmedWindow);
+			modelService.removePerspectiveModel(perspectives.get(perspectiveTasks.get(summary)), trimmedWindow);
+			toolbarProvider.removeToolbar(perspectiveTasks.get(summary));
+			perspectives.remove(perspectiveTasks.get(summary));
+			perspectiveTasks.remove(summary);
 		}
 	}
 
 	private void addAdapter(MUIElement element) {
 		((EObject) element).eAdapters().add(new AdapterImpl() {
+			@Override
 			public void notifyChanged(Notification notification) {
-				if (notification.getEventType() == Notification.SET
-						&& notification.getFeatureID(UIElementImpl.class) == UiPackageImpl.UI_ELEMENT__CONTAINER_DATA
-						&& element.getElementId() != null) {
-					user.addToProperties(getFQNKey(element), element.getContainerData());
+				if (notification.getEventType() == Notification.SET) {
+					switch(notification.getFeatureID(UIElementImpl.class)) {
+						case UiPackageImpl.UI_ELEMENT__CONTAINER_DATA:
+							if(element.getElementId() != null) {
+								user.addToProperties(getFQNKey(element), element.getContainerData());
+							}
+							break;
+						case UiPackageImpl.ELEMENT_CONTAINER__SELECTED_ELEMENT:
+							if(element.getTransientData().containsKey(IPerspectiveProvider.EventDispatcherConstants.SYNCHRONIZE_WITH)) {
+								String elementId = (String) element.getTransientData().get(IPerspectiveProvider.EventDispatcherConstants.SYNCHRONIZE_WITH);
+								MPartStack partStack = (MPartStack) modelService.find(elementId, element.getParent());
+								int index = ((MPartStack)element).getChildren().indexOf(((MPartStack)element).getSelectedElement());
+								if(index <= partStack.getChildren().size() && (partStack.getSelectedElement() == null || !partStack.getSelectedElement().equals(partStack.getChildren().get(index)))) {
+									partStack.setSelectedElement(partStack.getChildren().get(index));
+								}
+							}
+							break;
+					}
 				}
 			}
 		});
@@ -1228,7 +1267,7 @@
 	private String getFQNKey(MUIElement element) {
 		MUIElement muiElement = element;
 		List<String> elementIds = new LinkedList<>();
-		StringBuffer strBuffer = new StringBuffer();
+		StringBuilder key = new StringBuilder();
 		while (muiElement != null) {
 			if (muiElement.getElementId() != null) {
 				elementIds.add(muiElement.getElementId());
@@ -1239,11 +1278,11 @@
 			}
 		}
 		for (int i = elementIds.size(); i > 0; i--) {
-			if (strBuffer.length() != 0) {
-				strBuffer.append(".");
+			if (key.length() != 0) {
+				key.append(".");
 			}
-			strBuffer.append(elementIds.get(i - 1));
+			key.append(elementIds.get(i - 1));
 		}
-		return strBuffer.toString();
+		return key.toString();
 	}
 }
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/problems/ProblemsPopup.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/problems/ProblemsPopup.java
new file mode 100644
index 0000000..ecb1a6f
--- /dev/null
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/problems/ProblemsPopup.java
@@ -0,0 +1,46 @@
+package org.eclipse.osbp.vaaclipse.addons.softwarefactory.problems;
+
+import java.util.Locale;
+
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
+import org.eclipse.osbp.ui.api.user.IUser;
+
+import com.vaadin.server.ClientConnector.DetachListener;
+import com.vaadin.ui.Window;
+
+public class ProblemsPopup extends Window implements DetachListener, IUser.UserLocaleListener {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -1106131179854247707L;
+	private ProblemsViewContent problemsViewContent;
+	private transient IDSLMetadataService dslMetadataService;
+
+	public ProblemsPopup(IEclipseContext eclipseContext, IUser user) {
+		super();
+		dslMetadataService = eclipseContext.get(IDSLMetadataService.class);
+		super.setLocale(user.getLocale());
+		this.addDetachListener(this);
+		setClosable(true);
+		setModal(false);
+		setCaption(dslMetadataService.translate(user.getLocale().toLanguageTag(), "validationReport"));
+		problemsViewContent = new ProblemsViewContent();
+		setContent(problemsViewContent.createComponents(eclipseContext, user.getLocale(), this));
+		user.addUserLocaleListener(this);
+	}
+
+	@Override
+	public void detach(DetachEvent event) {
+		problemsViewContent.setVisible(false);
+	}
+
+	@Override
+	public void localeChanged(Locale locale) {
+		super.setLocale(locale);
+		setCaption(dslMetadataService.translate(locale.toLanguageTag(), "validationReport"));
+		if(problemsViewContent != null) {
+			problemsViewContent.setLocale(locale);
+		}
+	}
+}
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/problems/ProblemsViewContent.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/problems/ProblemsViewContent.java
new file mode 100644
index 0000000..e4cf9dd
--- /dev/null
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/problems/ProblemsViewContent.java
@@ -0,0 +1,699 @@
+package org.eclipse.osbp.vaaclipse.addons.softwarefactory.problems;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import javax.annotation.PreDestroy;
+
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.services.events.IEventBroker;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.osbp.runtime.common.validation.IStatus;
+import org.eclipse.osbp.runtime.common.validation.IStatus.Severity;
+import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
+import org.eclipse.osbp.vaaclipse.addons.common.api.IE4Topics;
+import org.eclipse.osbp.vaaclipse.addons.common.api.ResourceUtil;
+import org.eclipse.osbp.vaaclipse.addons.common.api.status.IStatusManager;
+import org.eclipse.osbp.vaaclipse.addons.common.api.status.IStatusScope;
+import org.osgi.service.event.EventHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.event.ItemClickEvent;
+import com.vaadin.server.Resource;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.ColumnHeaderMode;
+import com.vaadin.ui.Table.RowHeaderMode;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class ProblemsViewContent extends VerticalLayout {	// NOSONAR
+	private static final String MESSAGE_CODE = "messageCode";
+
+	private static final String CREATOR_CLASS = "creatorClass";
+
+	private static final String MESSAGE_PATH = "messagePath";
+
+	private static final String SEVERITY = "severity";
+
+	private static final String BUNDLE_SYMBOLIC_NAME = "bundleSymbolicName";
+
+	private static final String PART_NAME = "partName";
+
+	private static final String FIELD_NAME = "fieldName";
+
+	private static final String MESSAGE = "message";
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -8512352376339527845L;
+
+	/** The Constant LOGGER. */
+	private static final Logger LOGGER = LoggerFactory.getLogger(ProblemsViewContent.class);
+
+	/** The status manager. */
+	private transient IStatusManager statusManager;
+
+	/** The part service. */
+	private transient EPartService partService;
+
+	/** The event broker. */
+	private transient IEventBroker eventBroker;
+
+	/** The table. */
+	private Table table;
+
+	/** The container. */
+	private BeanItemContainer<StatusBean> container;
+
+	/** The current timer. */
+	private transient Timer currentTimer;
+
+	/** The changed validations handler. */
+	private transient EventHandler changedValidationsHandler;
+
+	/** The changed scope handler. */
+	private transient EventHandler changedScopeHandler;
+
+	/** The detail label. */
+	private Label detailLabel;
+
+	private Locale locale;
+
+	private transient IDSLMetadataService dslMetadataService;
+
+	private Window window;
+	
+	private boolean isVisible = false;
+	
+	/**
+	 * Inits the view content.
+	 *
+	 * @param locale
+	 *            the locale
+	 * @return the vertical layout
+	 */
+	@SuppressWarnings("serial")
+	public Component createComponents(IEclipseContext eclipseContext, Locale locale, Window window) {
+		dslMetadataService = eclipseContext.get(IDSLMetadataService.class);
+		statusManager = eclipseContext.get(IStatusManager.class);
+		partService = eclipseContext.get(EPartService.class);
+		eventBroker = eclipseContext.get(IEventBroker.class);
+		this.setWidth("650px");
+		this.locale = locale;
+		this.window = window;
+		VerticalLayout parent = new VerticalLayout();
+		table = new Table();
+		table.setSelectable(true);
+		table.setSizeFull();
+		table.setPageLength(5);
+		parent.addComponent(table);
+
+		container = new BeanItemContainer<>(StatusBean.class);
+		table.setContainerDataSource(container);
+
+		table.setVisibleColumns(MESSAGE, FIELD_NAME, PART_NAME, BUNDLE_SYMBOLIC_NAME, SEVERITY, MESSAGE_PATH,
+				CREATOR_CLASS, MESSAGE_CODE);
+		table.setColumnCollapsingAllowed(true);
+		table.setColumnCollapsed(SEVERITY, true);
+		table.setColumnCollapsed(BUNDLE_SYMBOLIC_NAME, true);
+		table.setColumnCollapsed(MESSAGE_PATH, true);
+		table.setColumnCollapsed(CREATOR_CLASS, true);
+		table.setColumnCollapsed(MESSAGE_CODE, true);
+
+		table.setRowHeaderMode(RowHeaderMode.ICON_ONLY);
+		table.setItemIconPropertyId("severityImage");
+
+		table.setColumnHeaderMode(ColumnHeaderMode.EXPLICIT_DEFAULTS_ID);
+		table.setColumnHeader(MESSAGE, dslMetadataService.translate(locale.toLanguageTag(), MESSAGE));
+		table.setColumnHeader(FIELD_NAME, dslMetadataService.translate(locale.toLanguageTag(), FIELD_NAME));
+		table.setColumnHeader(PART_NAME, dslMetadataService.translate(locale.toLanguageTag(), PART_NAME));
+		table.setColumnHeader(BUNDLE_SYMBOLIC_NAME,
+				dslMetadataService.translate(locale.toLanguageTag(), BUNDLE_SYMBOLIC_NAME));
+		table.setColumnHeader(SEVERITY, dslMetadataService.translate(locale.toLanguageTag(), SEVERITY));
+		table.setColumnHeader(MESSAGE_PATH, dslMetadataService.translate(locale.toLanguageTag(), MESSAGE_PATH));
+		table.setColumnHeader(CREATOR_CLASS, dslMetadataService.translate(locale.toLanguageTag(), CREATOR_CLASS));
+		table.setColumnHeader(MESSAGE_CODE, dslMetadataService.translate(locale.toLanguageTag(), MESSAGE_CODE));
+
+		table.addItemClickListener(new ItemClickEvent.ItemClickListener() {
+			@Override
+			public void itemClick(ItemClickEvent event) {
+				focusStatus(event);
+			}
+		});
+
+		table.addValueChangeListener(e -> showDetailMessage((StatusBean) e.getProperty().getValue()));
+
+		detailLabel = new Label();
+		detailLabel.setPrimaryStyleName("detailmessage");
+		detailLabel.setContentMode(ContentMode.HTML);
+		detailLabel.setSizeFull();
+		parent.addComponent(detailLabel);
+		table.focus();
+
+		parent.setExpandRatio(table, 0.85f);
+		parent.setExpandRatio(detailLabel, 0.15f);
+
+		// handle changed validation scopes
+		//
+		changedScopeHandler = new EventHandler() { 		// e -> refreshContent();
+			public void handleEvent(org.osgi.service.event.Event e) {
+				LOGGER.debug("{}", "ACTIVE_SCOPE_CHANGED:"+e.getTopic());
+				refreshContent();
+			}
+		};
+
+		// handle changes in validation results
+		//
+		changedValidationsHandler = new EventHandler() {
+			@Override
+			public void handleEvent(org.osgi.service.event.Event e) {
+				LOGGER.debug("{}", "VALIDATIONS_CHANGED:"+e.getTopic());
+				refreshContent();
+			}
+		};
+
+		eventBroker.subscribe(IE4Topics.StatusManagerEvents.ACTIVE_SCOPE_CHANGED_TOPIC, changedScopeHandler);
+		eventBroker.subscribe(IE4Topics.StatusManagerEvents.VALIDATIONS_CHANGED_TOPIC, changedValidationsHandler);
+		return parent;
+	}
+
+	/**
+	 * Shows the detail message.
+	 *
+	 * @param statusBean
+	 *            the status bean
+	 */
+	protected void showDetailMessage(StatusBean statusBean) {
+		if (statusBean != null) {
+			detailLabel.setValue(statusBean.getMessage().getValue());
+		} else {
+			detailLabel.setValue(null);
+		}
+	}
+
+	/**
+	 * Tries to put the focus to the field involved in the problem.
+	 *
+	 * @param event
+	 *            the event
+	 */
+	protected void focusStatus(ItemClickEvent event) {
+		StatusBean status = (StatusBean) event.getItemId();
+
+		String mPartId = status.getPartId();
+		if (mPartId != null && !mPartId.equals("")) {
+			MPart mPart = partService.findPart(mPartId);
+			if (mPart != null) {
+				partService.bringToTop(mPart);
+				partService.activate(mPart);
+
+				String fieldId = status.getFieldId();
+				if (fieldId != null && !fieldId.equals("")) {
+					// send a focus field event to the mpart
+					eventBroker.post(IE4Topics.PartEvents.FOCUS_FIELD_TOPIC, createFocusFieldEvent(mPartId, fieldId));
+				}
+			}
+		}
+	}
+
+	/**
+	 * Creates an event to focus a field in a MPart.
+	 *
+	 * @param mPartId
+	 *            the m part id
+	 * @param fieldId
+	 *            the field id
+	 * @return the map
+	 */
+	protected Map<String, Object> createFocusFieldEvent(String mPartId, String fieldId) {
+		Map<String, Object> properties = new HashMap<>();
+		properties.put(IE4Topics.PartEvents.PROP_MPART_ID, mPartId);
+		properties.put(IE4Topics.PartEvents.PROP_FIELD_ID, fieldId);
+		return properties;
+	}
+
+	/**
+	 * Refreshes the content of the active MPart.
+	 */
+	protected void refreshContent() {
+		synchronized (this) {
+			// Wait for 250ms before refreshing the table. Most probably several
+			// validation events will
+			// arrive in the next milliseconds
+			if (currentTimer == null) {
+				currentTimer = new Timer();
+				currentTimer.schedule(new TimerTask() {
+					@Override
+					public void run() {
+						UI.getCurrent().accessSynchronously(() -> {
+							resetTimer();
+							container.removeAllItems();
+							IStatusScope scope = statusManager.getActiveScope();
+							if (scope != null) {
+								LOGGER.debug("scope part:{}", scope.getMPart().getElementId());
+								container.addAll(mapStatus(scope));
+								detailLabel.setValue("");
+								LOGGER.debug("{}", "Table refreshed.");
+								if (container.size() == 0) {
+									LOGGER.debug("{}", "Container size==0. Close again");
+									setVisible(false);
+								} else {
+									LOGGER.debug("{}", "select table");
+									setVisible(true);
+									table.select(container.getIdByIndex(0));
+								}
+							}							
+						});
+					}
+				}, 250);
+				LOGGER.debug("{}", "Scheduled Table-Refresh-Timer.");
+			} else {
+				LOGGER.debug("{}", "Timer already active.");
+			}
+		}
+	}
+
+	/**
+	 * Reset timer.
+	 */
+	protected void resetTimer() {
+		synchronized (this) {
+			currentTimer = null;
+		}
+	}
+
+	public void setVisible(boolean visible) {
+		if(isVisible && !visible) {
+			UI.getCurrent().removeWindow(window);
+		}
+		if(!isVisible && visible) {
+			UI.getCurrent().addWindow(window);
+		}
+		isVisible = visible;
+	}
+	
+	/**
+	 * Map status.
+	 *
+	 * @param scope
+	 *            the scope
+	 * @return the list
+	 */
+	protected List<StatusBean> mapStatus(IStatusScope scope) {
+		List<StatusBean> result = new ArrayList<>();
+		for (IStatus status : scope.getAllStatus()) {
+			result.add(StatusBean.create(status, dslMetadataService, locale));
+		}
+		return result;
+	}
+
+	/**
+	 * Map status.
+	 *
+	 * @param manager
+	 *            the manager
+	 * @return the list
+	 */
+	protected List<StatusBean> mapStatus(IStatusManager manager) {
+		List<StatusBean> result = new ArrayList<>();
+		for (IStatus status : manager.getAllScopeStatus()) {
+			result.add(StatusBean.create(status, dslMetadataService, locale));
+		}
+		return result;
+	}
+
+	/**
+	 * Dispose.
+	 */
+	@PreDestroy
+	protected void dispose() {
+		eventBroker.unsubscribe(changedScopeHandler);
+		eventBroker.unsubscribe(changedValidationsHandler);
+
+		changedScopeHandler = null;
+		changedValidationsHandler = null;
+		table = null;
+		container = null;
+	}
+
+	/**
+	 * The Class StatusBean.
+	 */
+	public static class StatusBean {
+
+		/** The severity image. */
+		@SuppressWarnings("unused")
+		private Resource severityImage;
+
+		/** The severity. */
+		private Severity severity;
+
+		/** The bundle symbolic name. */
+		private String bundleSymbolicName;
+
+		/** The message code. */
+		private String messageCode;
+
+		/** The message. */
+		private Label message;
+
+		/** The exception. */
+		private Exception exception;
+
+		/** The part id. */
+		private String partId;
+
+		/** The field id. */
+		private String fieldId;
+
+		/** The part name. */
+		private String partName;
+
+		/** The field name. */
+		private String fieldName;
+
+		/** The message path. */
+		private String messagePath;
+
+		/** The creator class. */
+		private String creatorClass;
+		
+		/** The field value. */
+		private String fieldValue;
+
+		/**
+		 * Creates the.
+		 *
+		 * @param status
+		 *            the status
+		 * @param i18nService
+		 *            the i18n service
+		 * @param locale
+		 *            the locale
+		 * @return the status bean
+		 */
+		public static StatusBean create(IStatus status, IDSLMetadataService dslMetadataService, Locale locale) {
+			StatusBean bean = new StatusBean();
+			bean.severity = status.getSeverity();
+			bean.bundleSymbolicName = status.getBundleSymblicName();
+			bean.messageCode = status.getCode();
+			bean.fieldValue = (String) status.getProperty(IStatus.PROP_FIELD_VALUE);
+			String errorMessage = dslMetadataService.translate(locale.toLanguageTag(), status.getMessage());
+			if(bean.fieldValue != null) {
+				errorMessage = errorMessage.replace("{0}", bean.fieldValue);
+			}
+			bean.message = new Label(errorMessage,
+					ContentMode.HTML);
+			bean.exception = status.getException();
+
+			bean.partId = (String) status.getProperty(IStatus.PROP_UI_APPLICATION_ID);
+			bean.fieldId = (String) status.getProperty(IStatus.PROP_FIELD_ID);
+			String fieldI18nKey = (String) status.getProperty(IStatus.PROP_FIELD_I18N_KEY);
+
+			bean.partName = dslMetadataService.translate(locale.toLanguageTag(), bean.partId);
+			if (fieldI18nKey != null && !fieldI18nKey.equals("")) {
+				bean.fieldName = dslMetadataService.translate(locale.toLanguageTag(), fieldI18nKey);
+			} else {
+				bean.fieldName = dslMetadataService.translate(locale.toLanguageTag(), bean.fieldId);
+			}
+
+			bean.creatorClass = (String) status.getProperty(IStatus.PROP_CREATOR);
+			bean.messagePath = (String) status.getProperty(IStatus.PROP_JAVAX_PROPERTY_PATH);
+			return bean;
+		}
+
+		/**
+		 * Gets the severity image.
+		 *
+		 * @return the severityImage
+		 */
+		public Resource getSeverityImage() {
+			switch (severity) {
+			case OK:
+			case INFO:
+				return ResourceUtil.getResource(
+						"platform:/plugin/org.eclipse.osbp.utils.ui/images/info_tsk.png");
+			case WARNING:
+				return ResourceUtil.getResource(
+						"platform:/plugin/org.eclipse.osbp.utils.ui/images/warn_tsk.png");
+			case ERROR:
+			case CRITICAL:
+			case SYSTEMERROR:
+				return ResourceUtil.getResource(
+						"platform:/plugin/org.eclipse.osbp.utils.ui/images/error_tsk.png");
+			default:
+				return null;
+			}
+		}
+
+		/**
+		 * Sets the severity image.
+		 *
+		 * @param severityImage
+		 *            the severityImage to set
+		 */
+		public void setSeverityImage(Resource severityImage) {
+			this.severityImage = severityImage;
+		}
+
+		/**
+		 * Gets the severity.
+		 *
+		 * @return the severity
+		 */
+		public Severity getSeverity() {
+			return severity;
+		}
+
+		/**
+		 * Sets the severity.
+		 *
+		 * @param severity
+		 *            the severity to set
+		 */
+		public void setSeverity(Severity severity) {
+			this.severity = severity;
+		}
+
+		/**
+		 * Gets the bundle symbolic name.
+		 *
+		 * @return the bundleSymbolicName
+		 */
+		public String getBundleSymbolicName() {
+			return bundleSymbolicName;
+		}
+
+		/**
+		 * Sets the bundle symbolic name.
+		 *
+		 * @param bundleSymbolicName
+		 *            the bundleSymbolicName to set
+		 */
+		public void setBundleSymbolicName(String bundleSymbolicName) {
+			this.bundleSymbolicName = bundleSymbolicName;
+		}
+
+		/**
+		 * Gets the message.
+		 *
+		 * @return the message
+		 */
+		public Label getMessage() {
+			return message;
+		}
+
+		/**
+		 * Sets the message.
+		 *
+		 * @param message
+		 *            the message to set
+		 */
+		public void setMessage(Label message) {
+			this.message = message;
+		}
+
+		/**
+		 * Gets the exception.
+		 *
+		 * @return the exception
+		 */
+		public Exception getException() {
+			return exception;
+		}
+
+		/**
+		 * Sets the exception.
+		 *
+		 * @param exception
+		 *            the exception to set
+		 */
+		public void setException(Exception exception) {
+			this.exception = exception;
+		}
+
+		/**
+		 * Gets the part id.
+		 *
+		 * @return the partId
+		 */
+		public String getPartId() {
+			return partId;
+		}
+
+		/**
+		 * Sets the part id.
+		 *
+		 * @param partId
+		 *            the partId to set
+		 */
+		public void setPartId(String partId) {
+			this.partId = partId;
+		}
+
+		/**
+		 * Gets the field id.
+		 *
+		 * @return the fieldId
+		 */
+		public String getFieldId() {
+			return fieldId;
+		}
+
+		/**
+		 * Sets the field id.
+		 *
+		 * @param fieldId
+		 *            the fieldId to set
+		 */
+		public void setFieldId(String fieldId) {
+			this.fieldId = fieldId;
+		}
+
+		/**
+		 * Gets the part name.
+		 *
+		 * @return the partName
+		 */
+		public String getPartName() {
+			return partName;
+		}
+
+		/**
+		 * Sets the part name.
+		 *
+		 * @param partName
+		 *            the partName to set
+		 */
+		public void setPartName(String partName) {
+			this.partName = partName;
+		}
+
+		/**
+		 * Gets the field name.
+		 *
+		 * @return the fieldName
+		 */
+		public String getFieldName() {
+			return fieldName;
+		}
+
+		/**
+		 * Sets the field name.
+		 *
+		 * @param fieldName
+		 *            the fieldName to set
+		 */
+		public void setFieldName(String fieldName) {
+			this.fieldName = fieldName;
+		}
+
+		/**
+		 * Gets the message path.
+		 *
+		 * @return the messagePath
+		 */
+		public String getMessagePath() {
+			return messagePath;
+		}
+
+		/**
+		 * Sets the message path.
+		 *
+		 * @param messagePath
+		 *            the messagePath to set
+		 */
+		public void setMessagePath(String messagePath) {
+			this.messagePath = messagePath;
+		}
+
+		/**
+		 * Gets the message code.
+		 *
+		 * @return the messageCode
+		 */
+		public String getMessageCode() {
+			return messageCode;
+		}
+
+		/**
+		 * Sets the message code.
+		 *
+		 * @param messageCode
+		 *            the messageCode to set
+		 */
+		public void setMessageCode(String messageCode) {
+			this.messageCode = messageCode;
+		}
+
+		/**
+		 * Gets the creator class.
+		 *
+		 * @return the creatorClass
+		 */
+		public String getCreatorClass() {
+			return creatorClass;
+		}
+
+		/**
+		 * Sets the creator class.
+		 *
+		 * @param creatorClass
+		 *            the creatorClass to set
+		 */
+		public void setCreatorClass(String creatorClass) {
+			this.creatorClass = creatorClass;
+		}
+
+	}
+
+	@Override
+	public void setLocale(Locale locale) {
+		this.locale = locale;
+		if (table != null) {
+			table.setColumnHeader(MESSAGE, dslMetadataService.translate(locale.toLanguageTag(), MESSAGE));
+			table.setColumnHeader(FIELD_NAME, dslMetadataService.translate(locale.toLanguageTag(), FIELD_NAME));
+			table.setColumnHeader(PART_NAME, dslMetadataService.translate(locale.toLanguageTag(), PART_NAME));
+			table.setColumnHeader(BUNDLE_SYMBOLIC_NAME,
+					dslMetadataService.translate(locale.toLanguageTag(), BUNDLE_SYMBOLIC_NAME));
+			table.setColumnHeader(SEVERITY, dslMetadataService.translate(locale.toLanguageTag(), SEVERITY));
+			table.setColumnHeader(MESSAGE_PATH, dslMetadataService.translate(locale.toLanguageTag(), MESSAGE_PATH));
+			table.setColumnHeader(CREATOR_CLASS, dslMetadataService.translate(locale.toLanguageTag(), CREATOR_CLASS));
+			table.setColumnHeader(MESSAGE_CODE, dslMetadataService.translate(locale.toLanguageTag(), MESSAGE_CODE));
+			refreshContent();
+		}
+	}
+}
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/userfilter/UserFilterDialogProvider.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/userfilter/UserFilterDialogProvider.java
index 0787a49..6e88a83 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/userfilter/UserFilterDialogProvider.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/userfilter/UserFilterDialogProvider.java
@@ -230,14 +230,6 @@
 			try {
 				@SuppressWarnings("unchecked")
 				Class<IDto> dtoClass = (Class<IDto>) bundleSpace.forName(fqnDto);
-				// IMPORTANT!!!! DO NOT REMOVE!!!!
-				// Required to avoid NullPointerException trying to read data
-				// from BeanServiceLazyLoadingContainer<Object> datasource.
-				// Without this registration the
-				// IDTOServiceWithMutablePersistence<Object> service (being
-				// instance of AbstractDTOService) has 'null' as
-				// EntityManagerFactory.
-				persistenceService.registerPersistenceUnit(entity.getPersistenceUnit(), dtoClass);
 				IDTOServiceWithMutablePersistence<IDto> service = (IDTOServiceWithMutablePersistence<IDto>) DtoServiceAccess
 						.getService(dtoClass);
 				StatefulDelegatingDtoSearchService<IDto> loadingService = new StatefulDelegatingDtoSearchService<>(
@@ -594,8 +586,6 @@
 	 */
 	@PostConstruct
 	public void init() {
-		// Registration of class loader as required for the persistence service.
-		persistenceService.registerPersistenceUnit(persistenceId, UserAccountFilter.class);
 		emf = persistenceService.getEntityManagerFactory(persistenceId);
 	}