480107: Merging branch 'ceclipseMerging' to master

Bug: 480107

Change-Id: I7aa585c8dc79b41243e1a96362940ce7848011a9
Signed-off-by: Nicholas Loulloudes <loulloudes.n@cs.ucy.ac.cy>
diff --git a/plugins/org.eclipse.camf.connectors.openstack/src/org/eclipse/camf/connectors/openstack/operation/OpenStackOpDeployApplication.java b/plugins/org.eclipse.camf.connectors.openstack/src/org/eclipse/camf/connectors/openstack/operation/OpenStackOpDeployApplication.java
index 1eca0a7..ac4219f 100644
--- a/plugins/org.eclipse.camf.connectors.openstack/src/org/eclipse/camf/connectors/openstack/operation/OpenStackOpDeployApplication.java
+++ b/plugins/org.eclipse.camf.connectors.openstack/src/org/eclipse/camf/connectors/openstack/operation/OpenStackOpDeployApplication.java
@@ -213,8 +213,11 @@
 								String artifactType = artifact
 										.getArtifactType().toString();
 
-								if (artifactType.equals("VMI")) { //$NON-NLS-1$
+								
+								if (artifactType.equals("{http://www.example.org/NewXMLSchema}ImageArtifactPropertiesType")) { //$NON-NLS-1$
 									amiID = artifact.getName();
+//								if (artifactType.equals("VMI")) { //$NON-NLS-1$
+//									amiID = artifact.getName();
 								} else if (artifactType.equals("KeyPair")) { //$NON-NLS-1$
 									keyPairArtifact = artifact.getName();
 								} else if (artifactType.equals("Network")) {
diff --git a/plugins/org.eclipse.camf.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.camf.core/META-INF/MANIFEST.MF
index cdf4e3e..07cad32 100644
--- a/plugins/org.eclipse.camf.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.camf.core/META-INF/MANIFEST.MF
@@ -22,3 +22,4 @@
  org.eclipse.camf.core.project,
  org.eclipse.camf.core.security,
  org.eclipse.camf.core.util
+Import-Package: org.json
diff --git a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/Preferences.java b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/Preferences.java
index bec5995..1fb2475 100644
--- a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/Preferences.java
+++ b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/Preferences.java
@@ -404,4 +404,4 @@
 	//  
 
 
-}
\ No newline at end of file
+}
diff --git a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/PreferencesInitializer.java b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/PreferencesInitializer.java
new file mode 100644
index 0000000..166f545
--- /dev/null
+++ b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/PreferencesInitializer.java
@@ -0,0 +1,25 @@
+package org.eclipse.camf.core;

+

+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;

+

+import org.eclipse.camf.core.internal.Activator;

+

+

+public class PreferencesInitializer extends AbstractPreferenceInitializer {

+

+  /**

+   * Initializes the eu.celar.core.prefs file with the registered Cloud providers' details.

+   */

+  @Override

+  public void initializeDefaultPreferences() {

+    org.eclipse.core.runtime.Preferences preferenceStore = null;

+    Activator activator = Activator.getDefault();

+    if ( activator != null ) {

+      preferenceStore = activator.getPluginPreferences();

+    }

+    

+    String providerString = "[{\"port\":\"8080\",\"name\":\"Okeanos\",\"uri\":\"http://83.212.122.157\"} ]";

+    preferenceStore.setValue( PreferenceConstants.DEFINED_CPS_ID, providerString);

+    //preferenceStore.setDefault( PreferenceConstants.DEFINED_CPS_ID, providerString);

+  }

+}

diff --git a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/internal/model/CloudProviderManager.java b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/internal/model/CloudProviderManager.java
index c6fa510..e0fdb74 100644
--- a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/internal/model/CloudProviderManager.java
+++ b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/internal/model/CloudProviderManager.java
@@ -34,7 +34,7 @@
 
 
 /**
- * @author Nicholas Loulloudes
+ * @author Nicholas Loulloudes, Stalo Sofokleous
  *
  */
 public class CloudProviderManager extends AbstractDefaultCloudElementManager
diff --git a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/internal/model/HiddenProject.java b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/internal/model/HiddenProject.java
index 5fb1d6d..faffc40 100644
--- a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/internal/model/HiddenProject.java
+++ b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/internal/model/HiddenProject.java
@@ -199,7 +199,7 @@
       try {
         project.open( null );
       } catch( CoreException exception ) {
-        throw new ProblemException( "eu.cerlar.core.problem.io.openProjectFailed", exception, Activator.PLUGIN_ID ); //$NON-NLS-1$
+        throw new ProblemException( "org.eclipse.camf.core.problem.io.openProjectFailed", exception, Activator.PLUGIN_ID ); //$NON-NLS-1$
       }
     }
     return project;
diff --git a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/model/impl/GenericCloudProvider.java b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/model/impl/GenericCloudProvider.java
index f0a9cd5..65d3fb5 100644
--- a/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/model/impl/GenericCloudProvider.java
+++ b/plugins/org.eclipse.camf.core/src/org/eclipse/camf/core/model/impl/GenericCloudProvider.java
@@ -134,6 +134,18 @@
     return this.port;
   }
   
+  public void setName(String name) {
+    this.name = name;
+  }
+  
+  public void setUri(String uri) {
+    this.uri = uri;
+  }
+  
+  public void setPort(String port) {
+    this.port = port;
+  }
+  
   @Override
   public void serialize() throws ProblemException {
     ICloudElement[] children = getChildren( null );
diff --git a/plugins/org.eclipse.camf.infosystem.mockup/META-INF/MANIFEST.MF b/plugins/org.eclipse.camf.infosystem.mockup/META-INF/MANIFEST.MF
index cb89ec1..869a100 100644
--- a/plugins/org.eclipse.camf.infosystem.mockup/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.camf.infosystem.mockup/META-INF/MANIFEST.MF
@@ -36,5 +36,7 @@
 Import-Package: 
  org.apache.commons.logging,
  org.apache.http;version="4.1.4",
+ org.eclipse.camf.infosystem.jobs,
  org.jclouds.compute;version="1.8.0",
- org.jclouds.compute.domain;version="1.8.0"
+ org.jclouds.compute.domain;version="1.8.0",
+ org.json
diff --git a/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/CelarizedFetch.java b/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/CelarizedFetch.java
new file mode 100644
index 0000000..c817f15
--- /dev/null
+++ b/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/CelarizedFetch.java
@@ -0,0 +1,508 @@
+package org.eclipse.camf.infosystem.mockup.info;

+/*******************************************************************************

+ * Copyright (c) 2014 Laboratory for Internet Computing, University of Cyprus.

+ * All rights reserved. This program and the accompanying materials

+ * are made available under the terms of the Eclipse Public License v1.0

+ * which accompanies this distribution, and is available at

+ * http://www.eclipse.org/legal/epl-v10.html

+ *

+ * Initial development of the original code was made for the 

+ * CELAR project founded by European Union

+ * project number: FP7-317790  http://www.celarcloud.eu

+ *

+ * Contributors:

+ * 	Stalo Sofokleous - initial API and implementation

+ *******************************************************************************/

+import java.io.BufferedReader;

+import java.io.IOException;

+import java.io.InputStreamReader;

+import java.io.Reader;

+import java.net.MalformedURLException;

+import java.net.URL;

+import java.net.URLConnection;

+import java.sql.Connection;

+import java.sql.SQLException;

+import java.util.ArrayList;

+import java.util.HashMap;

+import java.util.Iterator;

+import java.util.Map;

+import java.util.Set;

+

+import org.eclipse.core.resources.IFile;

+import org.eclipse.core.runtime.IProgressMonitor;

+import org.eclipse.core.runtime.IStatus;

+import org.eclipse.core.runtime.NullProgressMonitor;

+import org.eclipse.core.runtime.Status;

+import org.eclipse.core.runtime.jobs.Job;

+import org.eclipse.ui.IEditorInput;

+import org.eclipse.ui.IWorkbenchPage;

+import org.eclipse.ui.PlatformUI;

+import org.eclipse.camf.core.Preferences;

+import org.eclipse.camf.core.model.CloudModel;

+import org.eclipse.camf.core.model.ICloudElement;

+import org.eclipse.camf.core.model.ICloudProvider;

+import org.eclipse.camf.core.model.impl.GenericCloudProvider;

+import org.eclipse.camf.infosystem.model.base.InfoSystemFactory;

+import org.eclipse.camf.infosystem.model.base.MonitoringProbe;

+import org.eclipse.camf.infosystem.model.base.ResizingAction;

+import org.eclipse.camf.infosystem.model.base.VirtualMachineImage;

+import org.eclipse.camf.infosystem.model.base.VirtualMachineImageFlavor;

+import org.eclipse.camf.infosystem.model.base.VirtualMachineImageType;

+

+

+

+import org.json.JSONArray;

+import org.json.JSONException;

+import org.json.JSONObject;

+

+import java.security.KeyManagementException;

+import java.security.NoSuchAlgorithmException;

+import java.security.cert.X509Certificate;

+

+import javax.net.ssl.HttpsURLConnection;

+import javax.net.ssl.SSLContext;

+import javax.net.ssl.TrustManager;

+import javax.net.ssl.X509TrustManager;

+import javax.net.ssl.HostnameVerifier;

+import javax.net.ssl.SSLSession;

+

+public class CelarizedFetch extends Job {

+

+	  private Connection con = null;

+

+	  private static CelarizedFetch instance = null;

+	  

+	  private ArrayList<ICloudProvider> selectedProviders = new ArrayList<ICloudProvider>();

+	  

+	  private ArrayList<VirtualMachineImage> base_images = new ArrayList<VirtualMachineImage>();

+	  private ArrayList<MonitoringProbe> monitor_probes = new ArrayList<MonitoringProbe>();

+	  private ArrayList<ResizingAction> resize_actions = new ArrayList<ResizingAction>();

+	  private ArrayList<VirtualMachineImageFlavor> vm_flavors = new ArrayList<VirtualMachineImageFlavor>();

+

+

+	  /**

+	   * @param name

+	   */

+	  private CelarizedFetch( final String name ) {

+	    super( name );

+	  }

+	 

+	  /**

+	   * Get a singleton instance of FetchJob

+	   * @param name the name that will be displayed in the progress view

+	   * @return a FetchJob

+	   */

+	  public static CelarizedFetch getInstance (final String name) {

+	    if (instance == null) {

+	      instance = new CelarizedFetch( name );

+	    }

+	    return instance;

+	  }

+	  

+	  @Override

+	  protected IStatus run( final IProgressMonitor monitor ) {

+	           

+	    IProgressMonitor localMonitor

+	    = ( monitor != null )

+	      ? monitor

+	      : new NullProgressMonitor();

+	   

+	    localMonitor.beginTask( "Retrieving information", 6 * 10 ); //$NON-NLS-1$

+

+	      ICloudElement[] providers = Preferences.getDefinedCloudProviders();

+	      GenericCloudProvider provider = (GenericCloudProvider) providers[0];

+	      

+	      String uri = provider.getUri();

+	      if (uri!=null){

+	        if (uri.endsWith( "/" )){

+	          uri = uri.substring( 0, uri.length()-1 );

+	        }

+	      }

+	      else{

+	        localMonitor.done();

+	        Status status = new Status( IStatus.ERROR,

+	                             "eu.celar.infosystem", //$NON-NLS-1$

+	                             "Cannot fetch data. URI is null" ); //$NON-NLS-1$

+	        return status;

+	      }

+	      

+	      String port = provider.getPort();

+	      if ( port!=null){

+	        if (port.endsWith( "/" )){

+	          port = port.substring( 0, port.length()-1 );

+	        }

+	        uri = uri + ":" + port;

+	      }

+	      uri = uri + "/resources/";

+

+	      try {

+	        try {

+	          fetchBaseMachineImages( uri, localMonitor );

+	          //fetchMonitorProbes( localMonitor );

+	          fetchJCatascopiaMonitorProbes( localMonitor );

+	          //fetchResizingActions (localMonitor );

+	          fetchFlavors ( uri, localMonitor );

+	        } catch( JSONException e ) {

+	          // TODO Auto-generated catch block

+	          e.printStackTrace();

+	        }

+

+	      } catch( SQLException e ) {     

+	        e.printStackTrace();

+	      } finally {

+	        if (this.con != null) {

+	          try {

+	            this.con.close();

+	          } catch( SQLException e ) {

+	            e.printStackTrace();

+	          }  

+	        }      

+

+	    }

+

+	    localMonitor.done();

+	    Status status = new Status( IStatus.OK,

+	                         "eu.celar.infosystem", //$NON-NLS-1$

+	                         "Information data fetched successfully." ); //$NON-NLS-1$

+	    return status;

+	  }

+	   

+	  private void fetchBaseMachineImages (String uri, final IProgressMonitor monitor) throws SQLException, JSONException {

+	    

+	    //CELAR Manager call : Get VM Images

+	    String images = getFromCelarDB(uri, "images");

+

+	    if ( images.equals( "" ) == false ) {

+

+	      images = "{\"images\":" + images + "}";

+	      String output_json = images;

+	      JSONObject obj = new JSONObject( output_json );

+	      JSONArray images_array = obj.getJSONArray( "images" ); //$NON-NLS-1$

+

+	      if ( images_array != null ){

+	        for (int i=0; i < images_array.length(); i++){

+	          VirtualMachineImage vmi = InfoSystemFactory.eINSTANCE.createVirtualMachineImage();

+	          /*

+	           * get the necessary vmi fields

+	           */

+	  

+	          vmi.setDescription( "h" );

+	          vmi.setURL( "h" );

+

+	          vmi.setUID( images_array.getJSONObject( i ).getString( "name" ) );

+	          vmi.setName( images_array.getJSONObject( i ).getString( "name" )); //$NON-NLS-1$ );

+	          

+	          vmi.setType( VirtualMachineImageType.BASE_IMAGE );

+	         

+	          //add new vmi to images list

+	         instance.base_images.add( vmi ); 

+	        }

+	      }

+	    }

+	  }

+

+	  

+	  private void fetchFlavors (String uri, final IProgressMonitor monitor) throws SQLException, JSONException {

+	    

+	    //CELAR Manager call : Get Flavors

+	    String flavors = getFromCelarDB(uri, "flavors");

+

+	    if ( flavors.equals( "" ) == false ) {

+

+	      flavors = "{\"flavors\":" + flavors + "}";

+	      String output_json = flavors;

+	      JSONObject obj = new JSONObject( output_json );

+	      JSONArray images_array = obj.getJSONArray( "flavors" ); //$NON-NLS-1$

+

+	      if ( images_array != null ){

+	        for (int i=0; i < images_array.length(); i++){

+	          VirtualMachineImageFlavor vmif = InfoSystemFactory.eINSTANCE.createVirtualMachineImageFlavor();

+	          /*

+	           * get the necessary vmif fields

+	           */

+	 

+	          vmif.setUID( images_array.getJSONObject( i ).getString( "id" ) );

+	          vmif.setName( images_array.getJSONObject( i ).getString( "name" )); //$NON-NLS-1$ );

+	         //System.out.println(vmif.getName()+" "+vmif.getUID());

+	          //add new vmi to images list

+	         instance.vm_flavors.add( vmif ); 

+	        }

+	      }

+	    }

+	  }

+	  

+	  //fetch probes from JCatascopia Probe Library

+	  private void fetchJCatascopiaMonitorProbes (final IProgressMonitor monitor) throws SQLException, JSONException {

+	    

+	    //CELAR Manager call : Get Monitoring Probes

+	    String probes = getJCatascopiaProbes();

+	    

+	    if ( probes.equals( "" ) == false ) {

+	      

+	      probes = "{\"probes\":" + probes + "}";

+	      String output_json = probes;

+	      JSONObject obj = new JSONObject( output_json );

+	      JSONArray probes_array = obj.getJSONArray( "probes" ); //$NON-NLS-1$

+	      

+	      if ( probes_array != null ){

+	        for (int i=0; i < probes_array.length(); i++){

+	          MonitoringProbe mp = InfoSystemFactory.eINSTANCE.createMonitoringProbe();

+	          /*

+	           * get the necessary mp fields

+	           */

+	          mp.setName( probes_array.getJSONObject( i ).getString( "probe" )); //$NON-NLS-1$ );

+	          mp.setMetrics( probes_array.getJSONObject( i ).getString( "metrics" ) );

+	          mp.setDescription( probes_array.getJSONObject( i ).getString( "desc" ) );

+	                    

+	          //add new monitor probe to probes list

+	          instance.monitor_probes.add( mp ); 

+	        }

+	        

+	      }

+	    }    

+	  }

+	  

+	  //fetch probes from CELAR DB

+	  private void fetchMonitorProbes (String uri, final IProgressMonitor monitor) throws SQLException, JSONException {

+	    

+	    //CELAR Manager call : Get Monitoring Probes

+	    String probes = getFromCelarDB(uri, "probes");

+	    

+	    if ( probes.equals( "" ) == false ) {

+	      

+	      probes = "{\"probes\":" + probes + "}";

+	      String output_json = probes;

+	      JSONObject obj = new JSONObject( output_json );

+	      JSONArray probes_array = obj.getJSONArray( "probes" ); //$NON-NLS-1$

+	      

+	      if ( probes_array != null ){

+	        for (int i=0; i < probes_array.length(); i++){

+	          MonitoringProbe mp = InfoSystemFactory.eINSTANCE.createMonitoringProbe();

+	          /*

+	           * get the necessary mp fields

+	           */

+	          mp.setName( probes_array.getJSONObject( i ).getString( "name" )); //$NON-NLS-1$ );

+	          mp.setDescription( probes_array.getJSONObject( i ).getString( "metrics" ) );

+	          

+	          System.out.println(mp.getName());

+	          System.out.println(mp.getDescription());

+	          

+	          //add new monitor probe to probes list

+	          instance.monitor_probes.add( mp ); 

+	        }

+	        

+	      }

+	    }    

+	  }

+	  

+	  private void fetchResizingActions (String uri, final IProgressMonitor monitor) throws SQLException, JSONException {

+	    

+	    //CELAR Manager call : Get Resizing Actions

+	    String actions = getFromCelarDB(uri, "actions"); 

+	    

+	    if ( actions.equals( "" ) == false ) {

+	      

+	      actions = "{\"actions\":" + actions + "}";

+	      String output_json = actions;

+	      JSONObject obj = new JSONObject( output_json );

+	      JSONArray actions_array = obj.getJSONArray( "actions" ); //$NON-NLS-1$

+	     

+	      if ( actions_array != null ){

+	        for (int i=0; i < actions_array.length(); i++){

+	          ResizingAction ra = InfoSystemFactory.eINSTANCE.createResizingAction();

+	          /*

+	           * get the necessary ra fields

+	           */

+	          ra.setName( actions_array.getJSONObject( i ).getString( "name" )); //$NON-NLS-1$ );

+	         

+	          //add new ra to resizing_actions list

+	          instance.resize_actions.add( ra ); 

+	        }

+	      }

+	    }

+	  }

+	  

+	  /**

+	   * @return A list with the available Base Machine Images

+	   */

+	  public ArrayList<VirtualMachineImage> getBaseMachineImages () {

+	    return instance.base_images;

+	  }

+	    

+	  /**

+	   * @return A list with available Monitoring Probes

+	   */

+	  public ArrayList<MonitoringProbe> getMonitoringProbes () {

+	    return instance.monitor_probes;

+	  }

+	  

+	  /**

+	   * @return A list with available Resizing Actions

+	   */

+	  public ArrayList<ResizingAction> getResizingActions () {

+	    return instance.resize_actions;

+	  }

+	  

+	  /**

+	   * @return A list with available flavors

+	   */

+	  public ArrayList<VirtualMachineImageFlavor> getInstanceTypes () {

+	    return instance.vm_flavors;

+	  }

+	  

+	  String getJCatascopiaProbes(){

+	    JCatascopiaProbeRepo repo = new JCatascopiaProbeRepo();

+	    String probes = null;

+	    try {

+	      probes = repo.getProbes();

+

+	    } catch( JCatascopiaProbeRepoException e ) {

+	      // TODO Auto-generated catch block

+	      e.printStackTrace();

+	    }

+	    //System.out.println(probes);

+	    return probes;

+	  }

+

+	  String getFromCelarDB(String uri, String categoryName){

+	    URL url = null;

+	    URLConnection connection = null;    

+	    String categoryString = "";

+

+	    // Create a trust manager that does not validate certificate chains

+	    TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {

+	        public java.security.cert.X509Certificate[] getAcceptedIssuers() {

+	            return null;

+	        }

+	        public void checkClientTrusted(X509Certificate[] certs, String authType) {

+	        }

+	        public void checkServerTrusted(X509Certificate[] certs, String authType) {

+	        }

+	    } };

+	    // Install the all-trusting trust manager

+	    SSLContext sc = null;

+	    try {

+	      sc = SSLContext.getInstance("SSL");

+	    } catch( NoSuchAlgorithmException e ) {

+	      // TODO Auto-generated catch block

+	      e.printStackTrace();

+	    }

+	    try {

+	      sc.init(null, trustAllCerts, new java.security.SecureRandom());

+	    } catch( KeyManagementException e ) {

+	      // TODO Auto-generated catch block

+	      e.printStackTrace();

+	    }

+	    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());

+	    // Create all-trusting host name verifier

+	    HostnameVerifier allHostsValid = new HostnameVerifier() {

+	        public boolean verify(String hostname, SSLSession session) {

+	            return true;

+	        }

+	    };

+

+	    // Install the all-trusting host verifier

+	    HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);

+

+	    String celarManagerURL = uri;

+	    try {

+	      url = new URL (celarManagerURL + categoryName + "/");

+	    } catch( MalformedURLException e ) {

+	      // TODO Auto-generated catch block

+	      e.printStackTrace();

+	    }

+	 

+	    Reader reader = null;

+	    BufferedReader br = null;

+	    try {

+	      connection = url.openConnection();

+	      connection.setRequestProperty("Accept", "application/json");

+	      reader = new InputStreamReader(connection.getInputStream());

+	      br = new BufferedReader(reader); 

+	      String line = "";

+	      while ((line = br.readLine()) != null) {

+	        categoryString = categoryString + line;

+	      }        

+	      br.close();

+	    } catch( IOException e ) {

+	      // TODO Auto-generated catch block

+	      e.printStackTrace();

+	    }

+	     

+	    return categoryString;

+	  }

+	     

+

+	  

+	  //Add JCatascopiaProbes

+	  private void addJCatascopiaProbes (final IProgressMonitor monitor) throws SQLException, JSONException {

+

+	      //JCatascopia metrics

+	      String probes = "{\"probes\":[{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:bytesSent\",\"name\":\"proxyBytesOUT\",\"units\":\"ms\",\"type\":\"LONG\",\"group\":\"HAProxy\"}, {\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:bytesSent\",\"name\":\"proxyBytesIN\",\"units\":\"ms\",\"type\":\"LONG\",\"group\":\"HAProxy\"}, {\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:bytesSent\",\"name\":\"errorRate\",\"units\":\"ms\",\"type\":\"LONG\",\"group\":\"HAProxy\"}, {\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:bytesSent\",\"name\":\"servers\",\"units\":\"ms\",\"type\":\"LONG\",\"group\":\"HAProxy\"}, {\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:bytesSent\",\"name\":\"requestRate\",\"units\":\"ms\",\"type\":\"LONG\",\"group\":\"HAProxy\"}, {\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:bytesSent\",\"name\":\"avgResponseTime\",\"units\":\"ms\",\"type\":\"LONG\",\"group\":\"HAProxy\"}, {\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:bytesSent\",\"name\":\"bytesSent\",\"units\":\"Bytes\",\"type\":\"LONG\",\"group\":\"Tomcat\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:memFree\",\"name\":\"memFree\",\"units\":\"KB\",\"type\":\"INTEGER\",\"group\":\"Memory\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:arch\",\"name\":\"arch\",\"units\":\"\",\"type\":\"STRING\",\"group\":\"StaticInfo\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:memTotal\",\"name\":\"memTotal\",\"units\":\"KB\",\"type\":\"INTEGER\",\"group\":\"Memory\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:cpuTotal\",\"name\":\"cpuTotal\",\"units\":\"%\",\"type\":\"DOUBLE\",\"group\":\"CPU\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:memCache\",\"name\":\"memCache\",\"units\":\"KB\",\"type\":\"INTEGER\",\"group\":\"Memory\"},{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:requestThroughput\",\"name\":\"requestThroughput\",\"units\":\"req/s\",\"type\":\"DOUBLE\",\"group\":\"Tomcat\"},{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:maxThreads\",\"name\":\"maxThreads\",\"units\":\"\",\"type\":\"LONG\",\"group\":\"Tomcat\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:netPacketsOut\",\"name\":\"netPacketsOut\",\"units\":\"packets/s\",\"type\":\"DOUBLE\",\"group\":\"Network\"},{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:errorCount\",\"name\":\"errorCount\",\"units\":\"\",\"type\":\"LONG\",\"group\":\"Tomcat\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:netBytesIN\",\"name\":\"netBytesIN\",\"units\":\"bytes/s\",\"type\":\"DOUBLE\",\"group\":\"Network\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:diskUsed\",\"name\":\"diskUsed\",\"units\":\"%\",\"type\":\"DOUBLE\",\"group\":\"Disk\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:cpuIdle\",\"name\":\"cpuIdle\",\"units\":\"%\",\"type\":\"DOUBLE\",\"group\":\"CPU\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:cpuIOwait\",\"name\":\"cpuIOwait\",\"units\":\"%\",\"type\":\"DOUBLE\",\"group\":\"CPU\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:memSwapFree\",\"name\":\"memSwapFree\",\"units\":\"KB\",\"type\":\"INTEGER\",\"group\":\"Memory\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:cpuUser\",\"name\":\"cpuUser\",\"units\":\"%\",\"type\":\"DOUBLE\",\"group\":\"CPU\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:diskTotal\",\"name\":\"diskTotal\",\"units\":\"MB\",\"type\":\"LONG\",\"group\":\"Disk\"},{\"metricID\":\"b9ba52a9826e4c48b1976fdecdc592ab:servers\",\"name\":\"servers\",\"units\":\"\",\"type\":\"INTEGER\",\"group\":\"HAProxy\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:iotime\",\"name\":\"iotime\",\"units\":\"%\",\"type\":\"DOUBLE\",\"group\":\"DiskStats\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:memUsed\",\"name\":\"memUsed\",\"units\":\"KB\",\"type\":\"INTEGER\",\"group\":\"Memory\"},{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:requestCount\",\"name\":\"requestCount\",\"units\":\"\",\"type\":\"LONG\",\"group\":\"Tomcat\"},{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:currentThreadCount\",\"name\":\"currentThreadCount\",\"units\":\"\",\"type\":\"LONG\",\"group\":\"Tomcat\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:memUsedPercent\",\"name\":\"memUsedPercent\",\"units\":\"%\",\"type\":\"DOUBLE\",\"group\":\"Memory\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:os\",\"name\":\"os\",\"units\":\"\",\"type\":\"STRING\",\"group\":\"StaticInfo\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:netPacketsIN\",\"name\":\"netPacketsIN\",\"units\":\"packets/s\",\"type\":\"DOUBLE\",\"group\":\"Network\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:cpuNum\",\"name\":\"cpuNum\",\"units\":\"\",\"type\":\"STRING\",\"group\":\"StaticInfo\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:cpuSystem\",\"name\":\"cpuSystem\",\"units\":\"%\",\"type\":\"DOUBLE\",\"group\":\"CPU\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:btime\",\"name\":\"btime\",\"units\":\"\",\"type\":\"STRING\",\"group\":\"StaticInfo\"},{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:processingTime\",\"name\":\"processingTime\",\"units\":\"\",\"type\":\"LONG\",\"group\":\"Tomcat\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:memSwapTotal\",\"name\":\"memSwapTotal\",\"units\":\"KB\",\"type\":\"INTEGER\",\"group\":\"Memory\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:readkbps\",\"name\":\"readkbps\",\"units\":\"KB/s\",\"type\":\"DOUBLE\",\"group\":\"DiskStats\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:diskFree\",\"name\":\"diskFree\",\"units\":\"MB\",\"type\":\"LONG\",\"group\":\"Disk\"},{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:currentThreadsBusy\",\"name\":\"currentThreadsBusy\",\"units\":\"\",\"type\":\"LONG\",\"group\":\"Tomcat\"},{\"metricID\":\"286cc7eff6df400f8121f3b16a8dd884:bytesReceived\",\"name\":\"bytesReceived\",\"units\":\"Bytes\",\"type\":\"LONG\",\"group\":\"Tomcat\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:writekbps\",\"name\":\"writekbps\",\"units\":\"KB/s\",\"type\":\"DOUBLE\",\"group\":\"DiskStats\"},{\"metricID\":\"912a98a72d0f47bc8768779a182ece60:netBytesOUT\",\"name\":\"netBytesOUT\",\"units\":\"bytes/s\",\"type\":\"DOUBLE\",\"group\":\"Network\"}]}";

+	      String output_json = probes;

+	      JSONObject obj = new JSONObject( output_json );

+	      JSONArray probes_array = obj.getJSONArray( "probes" ); //$NON-NLS-1$

+	      

+	      String probeGroup = null;

+	      String metricName;

+	      HashMap<String, String> hm = new HashMap<String, String>();

+	      

+	      for (int i=0; i < probes_array.length(); i++){

+	        probeGroup = probes_array.getJSONObject( i ).getString( "group" );

+	        metricName = probes_array.getJSONObject(i).getString( "name" );

+	          

+	        String value = hm.get( probeGroup );

+	        

+	        if (value != null)

+	          metricName = value + ", \"" + metricName + "\"";

+	        else

+	          metricName = "\"" + metricName + "\"";

+	        

+	        hm.put( probeGroup, metricName );

+	      }

+	      

+	      // Get a set of the entries

+	      Set set = hm.entrySet();

+	      // Get an iterator

+	      Iterator i = set.iterator();

+	      // Display elements

+	      while(i.hasNext()) {

+	         Map.Entry me = (Map.Entry)i.next();

+	         String key = me.getKey().toString();

+	         String value = me.getValue().toString().replace( "\"null,", "" );

+	         

+	         hm.put( key, value );

+	         System.out.print(me.getKey() + ": ");

+	         System.out.println(me.getValue());

+	      }

+	      

+	      // Get a set of the entries

+	      set = hm.entrySet();

+	      // Get an iterator

+	      i = set.iterator();

+	      // Display elements

+	      while(i.hasNext()) {

+	         Map.Entry me = (Map.Entry)i.next();

+	         String key = me.getKey().toString();

+	         String value = me.getValue().toString();

+	         

+	         MonitoringProbe mp = InfoSystemFactory.eINSTANCE.createMonitoringProbe();

+	 

+	         mp.setName( key ); //$NON-NLS-1$ );

+	         mp.setDescription( "[" + value + "]" );

+

+	         

+	         //add new monitor probe to probes list

+	         instance.monitor_probes.add( mp ); 

+	      }

+	      

+	  }

+	  

+	}

+

+

+

+

+

+

+

diff --git a/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/FetchJob.java b/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/FetchJob.java
index 973c1ab..fd6cc75 100644
--- a/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/FetchJob.java
+++ b/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/FetchJob.java
@@ -13,6 +13,11 @@
  * Contributors:
  * 	Nicholas Loulloudes - initial API and implementation
  *******************************************************************************/
+
+
+
+
+
 //package org.eclipse.camf.infosystem.mockup.info;
 //
 //import java.io.BufferedReader;
diff --git a/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/MockUpInfoSystem.java b/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/MockUpInfoSystem.java
index f92b24c..e05a14f 100644
--- a/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/MockUpInfoSystem.java
+++ b/plugins/org.eclipse.camf.infosystem.mockup/src/org/eclipse/camf/infosystem/mockup/info/MockUpInfoSystem.java
@@ -33,7 +33,7 @@
 //	 private AmazonAWSFetch resourceFetcher;
 	private OpenStackFetch resourceFetcher;
 
-	// private FetchJob resourceFetcher;
+	//private FetchJob resourceFetcher;
 
 	/**
 	 * @return The Mockup Information System
@@ -46,8 +46,10 @@
 	}
 
 	private MockUpInfoSystem() {
-		//    this.resourceFetcher = FetchJob.getInstance( "Mockup Resource Fetcher" ); //$NON-NLS-1$
-//		    this.resourceFetcher = AmazonAWSFetch.getInstance( "AWS Resource Fetcher" ); //$NON-NLS-1$
+//		this.resourceFetcher = FetchJob
+//				.getInstance( "Mockup Resource Fetcher" ); //$NON-NLS-1$
+//		this.resourceFetcher = AmazonAWSFetch
+//				.getInstance( "AWS Resource Fetcher" ); //$NON-NLS-1$
 		this.resourceFetcher = OpenStackFetch
 				.getInstance("OpenStack Resource Fetcher"); //$NON-NLS-1$
 		this.resourceFetcher.schedule();
@@ -61,8 +63,8 @@
 	}
 
 	private MockUpInfoSystem(IFile toscaFile) {
-		//    this.resourceFetcher = FetchJob.getInstance( "Mockup Resource Fetcher" ); //$NON-NLS-1$
-//		    this.resourceFetcher = AmazonAWSFetch.getInstance( "AWS Resource Fetcher" ); //$NON-NLS-1$
+//    	this.resourceFetcher = FetchJob.getInstance( "Mockup Resource Fetcher" ); //$NON-NLS-1$
+//		this.resourceFetcher = AmazonAWSFetch.getInstance( "AWS Resource Fetcher" ); //$NON-NLS-1$
 		this.resourceFetcher = OpenStackFetch
 				.getInstance("OpenStack Resource Fetcher"); //$NON-NLS-1$
 		this.resourceFetcher.schedule();
diff --git a/plugins/org.eclipse.camf.infosystem.model/model/InfoSystem.genmodel b/plugins/org.eclipse.camf.infosystem.model/model/InfoSystem.genmodel
index 83c982e..48dcc10 100644
--- a/plugins/org.eclipse.camf.infosystem.model/model/InfoSystem.genmodel
+++ b/plugins/org.eclipse.camf.infosystem.model/model/InfoSystem.genmodel
@@ -4,8 +4,8 @@
     modelName="InfoSystem" importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0"

     copyrightFields="false" classNamePattern="">

   <foreignModel>infosystem.ecore</foreignModel>

-  <genPackages prefix="InfoSystem" basePackage="org.eclipse.camf.infosystem.model" resource="XML"

-      disposableProviderFactory="true" ecorePackage="infosystem.ecore#/">

+  <genPackages prefix="InfoSystem" basePackage="org.eclipse.camf.infosystem.model"

+      resource="XML" disposableProviderFactory="true" ecorePackage="infosystem.ecore#/">

     <genEnums typeSafeEnumCompatible="false" ecoreEnum="infosystem.ecore#//VirtualMachineImageType">

       <genEnumLiterals ecoreEnumLiteral="infosystem.ecore#//VirtualMachineImageType/BaseImage"/>

       <genEnumLiterals ecoreEnumLiteral="infosystem.ecore#//VirtualMachineImageType/CustomImage"/>

@@ -15,7 +15,7 @@
       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//MonitoringProbe/uID"/>

       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//MonitoringProbe/name"/>

       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//MonitoringProbe/description"/>

-      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//MonitoringProbe/uRL"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//MonitoringProbe/metrics"/>

     </genClasses>

     <genClasses ecoreClass="infosystem.ecore#//ResizingAction">

       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//ResizingAction/uID"/>

@@ -44,5 +44,47 @@
       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//UserApplication/uRL"/>

       <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//UserApplication/type"/>

     </genClasses>

+    <genClasses ecoreClass="infosystem.ecore#//KeyPair">

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//KeyPair/uID"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//KeyPair/name"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//KeyPair/publicKey"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//KeyPair/Description"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//KeyPair/URL"/>

+    </genClasses>

+    <genClasses ecoreClass="infosystem.ecore#//VirtualMachineImageFlavor">

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualMachineImageFlavor/name"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualMachineImageFlavor/uID"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualMachineImageFlavor/ram"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualMachineImageFlavor/hdd"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualMachineImageFlavor/vCPU"/>

+    </genClasses>

+    <genClasses ecoreClass="infosystem.ecore#//VirtualNetwork">

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualNetwork/uID"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualNetwork/name"/>

+    </genClasses>

+    <genClasses ecoreClass="infosystem.ecore#//VirtualInstance">

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualInstance/uID"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualInstance/name"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualInstance/status"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualInstance/IPs"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//VirtualInstance/URI"/>

+    </genClasses>

+    <genClasses ecoreClass="infosystem.ecore#//SecurityGroup">

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//SecurityGroup/uID"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//SecurityGroup/name"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//SecurityGroup/description"/>

+    </genClasses>

+    <genClasses ecoreClass="infosystem.ecore#//Deployment">

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//Deployment/depID"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//Deployment/deploymentName"/>

+      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference infosystem.ecore#//Deployment/modules"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//Deployment/Status"/>

+    </genClasses>

+    <genClasses ecoreClass="infosystem.ecore#//Module">

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//Module/modID"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//Module/moduleName"/>

+      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference infosystem.ecore#//Module/instances"/>

+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute infosystem.ecore#//Module/initInstances"/>

+    </genClasses>

   </genPackages>

 </genmodel:GenModel>

diff --git a/plugins/org.eclipse.camf.infosystem.model/model/infosystem.ecore b/plugins/org.eclipse.camf.infosystem.model/model/infosystem.ecore
index 1062aab..3225367 100644
--- a/plugins/org.eclipse.camf.infosystem.model/model/infosystem.ecore
+++ b/plugins/org.eclipse.camf.infosystem.model/model/infosystem.ecore
@@ -28,14 +28,14 @@
         <details key="namespace" value="##targetNamespace"/>

       </eAnnotations>

     </eStructuralFeatures>

-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="uRL" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">

+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="metrics" lowerBound="1"

+        eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">

       <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">

         <details key="kind" value="element"/>

         <details key="name" value="URL"/>

         <details key="namespace" value="##targetNamespace"/>

       </eAnnotations>

     </eStructuralFeatures>

-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="metrics" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>

   </eClassifiers>

   <eClassifiers xsi:type="ecore:EClass" name="ResizingAction">

     <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">

diff --git a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/InfoSystemPackage.java b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/InfoSystemPackage.java
index 959f334..af0c0db 100644
--- a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/InfoSystemPackage.java
+++ b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/InfoSystemPackage.java
@@ -1,21 +1,6 @@
-/*******************************************************************************
- * Copyright (c) 2014 Laboratory for Internet Computing, University of Cyprus.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial development of the original code was made for the 
- * CELAR project founded by European Union
- * project number: FP7-317790  http://www.celarcloud.eu
- *
- * Contributors:
- * 	Nicholas Loulloudes - initial API and implementation
- *******************************************************************************/
-/**
- */
 package org.eclipse.camf.infosystem.model.base;
 
+
 import org.eclipse.emf.ecore.EAttribute;
 import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EDataType;
@@ -110,22 +95,13 @@
   int MONITORING_PROBE__DESCRIPTION = 2;
 
   /**
-   * The feature id for the '<em><b>URL</b></em>' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  int MONITORING_PROBE__URL = 3;
-
-  /**
    * The feature id for the '<em><b>Metrics</b></em>' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    * @ordered
    */
-  int MONITORING_PROBE__METRICS = 4;
+  int MONITORING_PROBE__METRICS = 3;
 
   /**
    * The number of structural features of the '<em>Monitoring Probe</em>' class.
@@ -134,7 +110,7 @@
    * @generated
    * @ordered
    */
-  int MONITORING_PROBE_FEATURE_COUNT = 5;
+  int MONITORING_PROBE_FEATURE_COUNT = 4;
 
   /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.ResizingActionImpl <em>Resizing Action</em>}' class.
@@ -256,16 +232,6 @@
   int SOFTWARE_DEPENDENCY_FEATURE_COUNT = 5;
 
   /**
-   * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageImpl <em>Virtual Machine Image</em>}' class.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @see org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageImpl
-   * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getVirtualMachineImage()
-   * @generated
-   */
-  int VIRTUAL_MACHINE_IMAGE = 8;
-
-  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.UserApplicationImpl <em>User Application</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -360,31 +326,31 @@
   /**
    * The feature id for the '<em><b>Public Key</b></em>' attribute.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    * @ordered
    */
-	int KEY_PAIR__PUBLIC_KEY = 2;
+  int KEY_PAIR__PUBLIC_KEY = 2;
 
-		/**
+  /**
    * The feature id for the '<em><b>Description</b></em>' attribute.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    * @ordered
    */
-	int KEY_PAIR__DESCRIPTION = 3;
+  int KEY_PAIR__DESCRIPTION = 3;
 
-		/**
+  /**
    * The feature id for the '<em><b>URL</b></em>' attribute.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    * @ordered
    */
-	int KEY_PAIR__URL = 4;
+  int KEY_PAIR__URL = 4;
 
-		/**
+  /**
    * The number of structural features of the '<em>Key Pair</em>' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -424,31 +390,31 @@
   /**
    * The feature id for the '<em><b>Ram</b></em>' attribute.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    * @ordered
    */
-	int VIRTUAL_MACHINE_IMAGE_FLAVOR__RAM = 2;
+  int VIRTUAL_MACHINE_IMAGE_FLAVOR__RAM = 2;
 
-		/**
+  /**
    * The feature id for the '<em><b>Hdd</b></em>' attribute.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    * @ordered
    */
-	int VIRTUAL_MACHINE_IMAGE_FLAVOR__HDD = 3;
+  int VIRTUAL_MACHINE_IMAGE_FLAVOR__HDD = 3;
 
-		/**
+  /**
    * The feature id for the '<em><b>VCPU</b></em>' attribute.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    * @ordered
    */
-	int VIRTUAL_MACHINE_IMAGE_FLAVOR__VCPU = 4;
+  int VIRTUAL_MACHINE_IMAGE_FLAVOR__VCPU = 4;
 
-		/**
+  /**
    * The number of structural features of the '<em>Virtual Machine Image Flavor</em>' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -595,6 +561,16 @@
   int CLOUD_PROVIDER_FEATURE_COUNT = 7;
 
   /**
+   * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageImpl <em>Virtual Machine Image</em>}' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageImpl
+   * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getVirtualMachineImage()
+   * @generated
+   */
+  int VIRTUAL_MACHINE_IMAGE = 8;
+
+  /**
    * The feature id for the '<em><b>UID</b></em>' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -649,26 +625,226 @@
   int VIRTUAL_MACHINE_IMAGE_FEATURE_COUNT = 5;
 
   /**
+   * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.DeploymentImpl <em>Deployment</em>}' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see org.eclipse.camf.infosystem.model.base.impl.DeploymentImpl
+   * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getDeployment()
+   * @generated
+   */
+  int DEPLOYMENT = 9;
+
+  /**
+   * The feature id for the '<em><b>Dep ID</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int DEPLOYMENT__DEP_ID = 0;
+
+  /**
+   * The feature id for the '<em><b>Deployment Name</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int DEPLOYMENT__DEPLOYMENT_NAME = 1;
+
+  /**
+   * The feature id for the '<em><b>Modules</b></em>' reference list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int DEPLOYMENT__MODULES = 2;
+
+  /**
+   * The feature id for the '<em><b>Status</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int DEPLOYMENT__STATUS = 3;
+
+  /**
+   * The number of structural features of the '<em>Deployment</em>' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int DEPLOYMENT_FEATURE_COUNT = 4;
+
+  /**
+   * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.ModuleImpl <em>Module</em>}' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see org.eclipse.camf.infosystem.model.base.impl.ModuleImpl
+   * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getModule()
+   * @generated
+   */
+  int MODULE = 10;
+
+  /**
+   * The feature id for the '<em><b>Mod ID</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int MODULE__MOD_ID = 0;
+
+  /**
+   * The feature id for the '<em><b>Module Name</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int MODULE__MODULE_NAME = 1;
+
+  /**
+   * The feature id for the '<em><b>Instances</b></em>' reference list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int MODULE__INSTANCES = 2;
+
+  /**
+   * The feature id for the '<em><b>Init Instances</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int MODULE__INIT_INSTANCES = 3;
+
+  /**
+   * The number of structural features of the '<em>Module</em>' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int MODULE_FEATURE_COUNT = 4;
+
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.VirtualInstanceImpl <em>Virtual Instance</em>}' class.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @see org.eclipse.camf.infosystem.model.base.impl.VirtualInstanceImpl
    * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getVirtualInstance()
    * @generated
    */
-	int VIRTUAL_INSTANCE = 11;
+  int VIRTUAL_INSTANCE = 11;
 
-		/**
+  /**
+   * The feature id for the '<em><b>UID</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int VIRTUAL_INSTANCE__UID = 0;
+
+  /**
+   * The feature id for the '<em><b>Name</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int VIRTUAL_INSTANCE__NAME = 1;
+
+  /**
+   * The feature id for the '<em><b>Status</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int VIRTUAL_INSTANCE__STATUS = 2;
+
+  /**
+   * The feature id for the '<em><b>IPs</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int VIRTUAL_INSTANCE__IPS = 3;
+
+  /**
+   * The feature id for the '<em><b>URI</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int VIRTUAL_INSTANCE__URI = 4;
+
+  /**
+   * The number of structural features of the '<em>Virtual Instance</em>' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int VIRTUAL_INSTANCE_FEATURE_COUNT = 5;
+
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.SecurityGroupImpl <em>Security Group</em>}' class.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @see org.eclipse.camf.infosystem.model.base.impl.SecurityGroupImpl
    * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getSecurityGroup()
    * @generated
    */
-	int SECURITY_GROUP = 12;
+  int SECURITY_GROUP = 12;
 
-		/**
+  /**
+   * The feature id for the '<em><b>UID</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int SECURITY_GROUP__UID = 0;
+
+  /**
+   * The feature id for the '<em><b>Name</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int SECURITY_GROUP__NAME = 1;
+
+  /**
+   * The feature id for the '<em><b>Description</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int SECURITY_GROUP__DESCRIPTION = 2;
+
+  /**
+   * The number of structural features of the '<em>Security Group</em>' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int SECURITY_GROUP_FEATURE_COUNT = 3;
+
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.RootImpl <em>Root</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -678,7 +854,25 @@
    */
   int ROOT = 13;
 
-    /**
+  /**
+   * The feature id for the '<em><b>Cloud Providers</b></em>' containment reference list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int ROOT__CLOUD_PROVIDERS = 0;
+
+  /**
+   * The number of structural features of the '<em>Root</em>' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int ROOT_FEATURE_COUNT = 1;
+
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.ImagesImpl <em>Images</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -688,7 +882,25 @@
    */
   int IMAGES = 14;
 
-    /**
+  /**
+   * The feature id for the '<em><b>Vms</b></em>' containment reference list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int IMAGES__VMS = 0;
+
+  /**
+   * The number of structural features of the '<em>Images</em>' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int IMAGES_FEATURE_COUNT = 1;
+
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.NetworksImpl <em>Networks</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -698,7 +910,25 @@
    */
   int NETWORKS = 15;
 
-    /**
+  /**
+   * The feature id for the '<em><b>Nets</b></em>' containment reference list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int NETWORKS__NETS = 0;
+
+  /**
+   * The number of structural features of the '<em>Networks</em>' class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  int NETWORKS_FEATURE_COUNT = 1;
+
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.SecurityImpl <em>Security</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -708,261 +938,7 @@
    */
   int SECURITY = 16;
 
-    /**
-   * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.DeploymentImpl <em>Deployment</em>}' class.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @see org.eclipse.camf.infosystem.model.base.impl.DeploymentImpl
-   * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getDeployment()
-   * @generated
-   */
-	int DEPLOYMENT = 9;
-
-		/**
-   * The feature id for the '<em><b>Dep ID</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int DEPLOYMENT__DEP_ID = 0;
-
-		/**
-   * The feature id for the '<em><b>Deployment Name</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int DEPLOYMENT__DEPLOYMENT_NAME = 1;
-
-		/**
-   * The feature id for the '<em><b>Modules</b></em>' reference list.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int DEPLOYMENT__MODULES = 2;
-
-		/**
-   * The feature id for the '<em><b>Status</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int DEPLOYMENT__STATUS = 3;
-
-		/**
-   * The number of structural features of the '<em>Deployment</em>' class.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int DEPLOYMENT_FEATURE_COUNT = 4;
-
-		/**
-   * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.ModuleImpl <em>Module</em>}' class.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @see org.eclipse.camf.infosystem.model.base.impl.ModuleImpl
-   * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getModule()
-   * @generated
-   */
-	int MODULE = 10;
-
-		/**
-   * The feature id for the '<em><b>Mod ID</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int MODULE__MOD_ID = 0;
-
-		/**
-   * The feature id for the '<em><b>Module Name</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int MODULE__MODULE_NAME = 1;
-
-		/**
-   * The feature id for the '<em><b>Instances</b></em>' reference list.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int MODULE__INSTANCES = 2;
-
-		/**
-   * The feature id for the '<em><b>Init Instances</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int MODULE__INIT_INSTANCES = 3;
-
-		/**
-   * The number of structural features of the '<em>Module</em>' class.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int MODULE_FEATURE_COUNT = 4;
-
-    /**
-   * The feature id for the '<em><b>UID</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int VIRTUAL_INSTANCE__UID = 0;
-
-    /**
-   * The feature id for the '<em><b>Name</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int VIRTUAL_INSTANCE__NAME = 1;
-
-    /**
-   * The feature id for the '<em><b>Status</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int VIRTUAL_INSTANCE__STATUS = 2;
-
-    /**
-   * The feature id for the '<em><b>IPs</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int VIRTUAL_INSTANCE__IPS = 3;
-
-    /**
-   * The feature id for the '<em><b>URI</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int VIRTUAL_INSTANCE__URI = 4;
-
-    /**
-   * The number of structural features of the '<em>Virtual Instance</em>' class.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int VIRTUAL_INSTANCE_FEATURE_COUNT = 5;
-
-    /**
-   * The feature id for the '<em><b>UID</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int SECURITY_GROUP__UID = 0;
-
-    /**
-   * The feature id for the '<em><b>Name</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int SECURITY_GROUP__NAME = 1;
-
-    /**
-   * The feature id for the '<em><b>Description</b></em>' attribute.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int SECURITY_GROUP__DESCRIPTION = 2;
-
-    /**
-   * The number of structural features of the '<em>Security Group</em>' class.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-	int SECURITY_GROUP_FEATURE_COUNT = 3;
-
-    /**
-   * The feature id for the '<em><b>Cloud Providers</b></em>' containment reference list.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  int ROOT__CLOUD_PROVIDERS = 0;
-
-    /**
-   * The number of structural features of the '<em>Root</em>' class.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  int ROOT_FEATURE_COUNT = 1;
-
-    /**
-   * The feature id for the '<em><b>Vms</b></em>' containment reference list.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  int IMAGES__VMS = 0;
-
-    /**
-   * The number of structural features of the '<em>Images</em>' class.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  int IMAGES_FEATURE_COUNT = 1;
-
-    /**
-   * The feature id for the '<em><b>Nets</b></em>' containment reference list.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  int NETWORKS__NETS = 0;
-
-    /**
-   * The number of structural features of the '<em>Networks</em>' class.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   * @ordered
-   */
-  int NETWORKS_FEATURE_COUNT = 1;
-
-    /**
+  /**
    * The feature id for the '<em><b>Keys</b></em>' containment reference.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -971,7 +947,7 @@
    */
   int SECURITY__KEYS = 0;
 
-    /**
+  /**
    * The feature id for the '<em><b>Groups</b></em>' containment reference.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -980,7 +956,7 @@
    */
   int SECURITY__GROUPS = 1;
 
-    /**
+  /**
    * The number of structural features of the '<em>Security</em>' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -989,7 +965,7 @@
    */
   int SECURITY_FEATURE_COUNT = 2;
 
-		/**
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.KeysImpl <em>Keys</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -999,7 +975,7 @@
    */
   int KEYS = 17;
 
-    /**
+  /**
    * The feature id for the '<em><b>Keypairs</b></em>' containment reference list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1008,7 +984,7 @@
    */
   int KEYS__KEYPAIRS = 0;
 
-    /**
+  /**
    * The number of structural features of the '<em>Keys</em>' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1017,7 +993,7 @@
    */
   int KEYS_FEATURE_COUNT = 1;
 
-    /**
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.GroupsImpl <em>Groups</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1027,7 +1003,7 @@
    */
   int GROUPS = 18;
 
-    /**
+  /**
    * The feature id for the '<em><b>Security Groups</b></em>' containment reference list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1036,7 +1012,7 @@
    */
   int GROUPS__SECURITY_GROUPS = 0;
 
-    /**
+  /**
    * The number of structural features of the '<em>Groups</em>' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1045,7 +1021,7 @@
    */
   int GROUPS_FEATURE_COUNT = 1;
 
-    /**
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.FlavorsImpl <em>Flavors</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1055,7 +1031,7 @@
    */
   int FLAVORS = 19;
 
-    /**
+  /**
    * The feature id for the '<em><b>Flavors</b></em>' containment reference list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1064,7 +1040,7 @@
    */
   int FLAVORS__FLAVORS = 0;
 
-    /**
+  /**
    * The number of structural features of the '<em>Flavors</em>' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1073,7 +1049,7 @@
    */
   int FLAVORS_FEATURE_COUNT = 1;
 
-    /**
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringImpl <em>Monitoring</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1083,7 +1059,7 @@
    */
   int MONITORING = 20;
 
-    /**
+  /**
    * The feature id for the '<em><b>Monitoring Service</b></em>' containment reference list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1092,7 +1068,7 @@
    */
   int MONITORING__MONITORING_SERVICE = 0;
 
-    /**
+  /**
    * The number of structural features of the '<em>Monitoring</em>' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1101,7 +1077,7 @@
    */
   int MONITORING_FEATURE_COUNT = 1;
 
-    /**
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringServiceImpl <em>Monitoring Service</em>}' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1111,7 +1087,7 @@
    */
   int MONITORING_SERVICE = 21;
 
-    /**
+  /**
    * The feature id for the '<em><b>Name</b></em>' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1120,7 +1096,7 @@
    */
   int MONITORING_SERVICE__NAME = 0;
 
-    /**
+  /**
    * The feature id for the '<em><b>Probes</b></em>' containment reference list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1129,7 +1105,7 @@
    */
   int MONITORING_SERVICE__PROBES = 1;
 
-    /**
+  /**
    * The number of structural features of the '<em>Monitoring Service</em>' class.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1138,7 +1114,7 @@
    */
   int MONITORING_SERVICE_FEATURE_COUNT = 2;
 
-    /**
+  /**
    * The meta object id for the '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImageType <em>Virtual Machine Image Type</em>}' enum.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1203,17 +1179,6 @@
   EAttribute getMonitoringProbe_Description();
 
   /**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.MonitoringProbe#getURL <em>URL</em>}'.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>URL</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.MonitoringProbe#getURL()
-   * @see #getMonitoringProbe()
-   * @generated
-   */
-  EAttribute getMonitoringProbe_URL();
-
-  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.MonitoringProbe#getMetrics <em>Metrics</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1344,71 +1309,6 @@
   EAttribute getSoftwareDependency_Type();
 
   /**
-   * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage <em>Virtual Machine Image</em>}'.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return the meta object for class '<em>Virtual Machine Image</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage
-   * @generated
-   */
-  EClass getVirtualMachineImage();
-
-  /**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getUID <em>UID</em>}'.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>UID</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getUID()
-   * @see #getVirtualMachineImage()
-   * @generated
-   */
-  EAttribute getVirtualMachineImage_UID();
-
-  /**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getName <em>Name</em>}'.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Name</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getName()
-   * @see #getVirtualMachineImage()
-   * @generated
-   */
-  EAttribute getVirtualMachineImage_Name();
-
-  /**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getDescription <em>Description</em>}'.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Description</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getDescription()
-   * @see #getVirtualMachineImage()
-   * @generated
-   */
-  EAttribute getVirtualMachineImage_Description();
-
-  /**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getType <em>Type</em>}'.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Type</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getType()
-   * @see #getVirtualMachineImage()
-   * @generated
-   */
-  EAttribute getVirtualMachineImage_Type();
-
-  /**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getURL <em>URL</em>}'.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>URL</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getURL()
-   * @see #getVirtualMachineImage()
-   * @generated
-   */
-  EAttribute getVirtualMachineImage_URL();
-
-  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.UserApplication <em>User Application</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1508,37 +1408,37 @@
   /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.KeyPair#getPublicKey <em>Public Key</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>Public Key</em>'.
    * @see org.eclipse.camf.infosystem.model.base.KeyPair#getPublicKey()
    * @see #getKeyPair()
    * @generated
    */
-	EAttribute getKeyPair_PublicKey();
+  EAttribute getKeyPair_PublicKey();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.KeyPair#getDescription <em>Description</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>Description</em>'.
    * @see org.eclipse.camf.infosystem.model.base.KeyPair#getDescription()
    * @see #getKeyPair()
    * @generated
    */
-	EAttribute getKeyPair_Description();
+  EAttribute getKeyPair_Description();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.KeyPair#getURL <em>URL</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>URL</em>'.
    * @see org.eclipse.camf.infosystem.model.base.KeyPair#getURL()
    * @see #getKeyPair()
    * @generated
    */
-	EAttribute getKeyPair_URL();
+  EAttribute getKeyPair_URL();
 
-		/**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImageFlavor <em>Virtual Machine Image Flavor</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1573,37 +1473,37 @@
   /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImageFlavor#getRam <em>Ram</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>Ram</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImageFlavor#getRam()
    * @see #getVirtualMachineImageFlavor()
    * @generated
    */
-	EAttribute getVirtualMachineImageFlavor_Ram();
+  EAttribute getVirtualMachineImageFlavor_Ram();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImageFlavor#getHdd <em>Hdd</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>Hdd</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImageFlavor#getHdd()
    * @see #getVirtualMachineImageFlavor()
    * @generated
    */
-	EAttribute getVirtualMachineImageFlavor_Hdd();
+  EAttribute getVirtualMachineImageFlavor_Hdd();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImageFlavor#getVCPU <em>VCPU</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>VCPU</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImageFlavor#getVCPU()
    * @see #getVirtualMachineImageFlavor()
    * @generated
    */
-	EAttribute getVirtualMachineImageFlavor_VCPU();
+  EAttribute getVirtualMachineImageFlavor_VCPU();
 
-		/**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.VirtualNetwork <em>Virtual Network</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1745,114 +1645,287 @@
   EReference getCloudProvider_Monitoring();
 
   /**
+   * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage <em>Virtual Machine Image</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for class '<em>Virtual Machine Image</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage
+   * @generated
+   */
+  EClass getVirtualMachineImage();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getUID <em>UID</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>UID</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getUID()
+   * @see #getVirtualMachineImage()
+   * @generated
+   */
+  EAttribute getVirtualMachineImage_UID();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getName <em>Name</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Name</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getName()
+   * @see #getVirtualMachineImage()
+   * @generated
+   */
+  EAttribute getVirtualMachineImage_Name();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getDescription <em>Description</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Description</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getDescription()
+   * @see #getVirtualMachineImage()
+   * @generated
+   */
+  EAttribute getVirtualMachineImage_Description();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getType <em>Type</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Type</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getType()
+   * @see #getVirtualMachineImage()
+   * @generated
+   */
+  EAttribute getVirtualMachineImage_Type();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getURL <em>URL</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>URL</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.VirtualMachineImage#getURL()
+   * @see #getVirtualMachineImage()
+   * @generated
+   */
+  EAttribute getVirtualMachineImage_URL();
+
+  /**
+   * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Deployment <em>Deployment</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for class '<em>Deployment</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Deployment
+   * @generated
+   */
+  EClass getDeployment();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Deployment#getDepID <em>Dep ID</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Dep ID</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Deployment#getDepID()
+   * @see #getDeployment()
+   * @generated
+   */
+  EAttribute getDeployment_DepID();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Deployment#getDeploymentName <em>Deployment Name</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Deployment Name</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Deployment#getDeploymentName()
+   * @see #getDeployment()
+   * @generated
+   */
+  EAttribute getDeployment_DeploymentName();
+
+  /**
+   * Returns the meta object for the reference list '{@link org.eclipse.camf.infosystem.model.base.Deployment#getModules <em>Modules</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the reference list '<em>Modules</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Deployment#getModules()
+   * @see #getDeployment()
+   * @generated
+   */
+  EReference getDeployment_Modules();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Deployment#getStatus <em>Status</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Status</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Deployment#getStatus()
+   * @see #getDeployment()
+   * @generated
+   */
+  EAttribute getDeployment_Status();
+
+  /**
+   * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Module <em>Module</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for class '<em>Module</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Module
+   * @generated
+   */
+  EClass getModule();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Module#getModID <em>Mod ID</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Mod ID</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Module#getModID()
+   * @see #getModule()
+   * @generated
+   */
+  EAttribute getModule_ModID();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Module#getModuleName <em>Module Name</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Module Name</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Module#getModuleName()
+   * @see #getModule()
+   * @generated
+   */
+  EAttribute getModule_ModuleName();
+
+  /**
+   * Returns the meta object for the reference list '{@link org.eclipse.camf.infosystem.model.base.Module#getInstances <em>Instances</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the reference list '<em>Instances</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Module#getInstances()
+   * @see #getModule()
+   * @generated
+   */
+  EReference getModule_Instances();
+
+  /**
+   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Module#getInitInstances <em>Init Instances</em>}'.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return the meta object for the attribute '<em>Init Instances</em>'.
+   * @see org.eclipse.camf.infosystem.model.base.Module#getInitInstances()
+   * @see #getModule()
+   * @generated
+   */
+  EAttribute getModule_InitInstances();
+
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance <em>Virtual Instance</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for class '<em>Virtual Instance</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualInstance
    * @generated
    */
-	EClass getVirtualInstance();
+  EClass getVirtualInstance();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getUID <em>UID</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>UID</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualInstance#getUID()
    * @see #getVirtualInstance()
    * @generated
    */
-	EAttribute getVirtualInstance_UID();
+  EAttribute getVirtualInstance_UID();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getName <em>Name</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>Name</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualInstance#getName()
    * @see #getVirtualInstance()
    * @generated
    */
-	EAttribute getVirtualInstance_Name();
+  EAttribute getVirtualInstance_Name();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getStatus <em>Status</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>Status</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualInstance#getStatus()
    * @see #getVirtualInstance()
    * @generated
    */
-	EAttribute getVirtualInstance_Status();
+  EAttribute getVirtualInstance_Status();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getIPs <em>IPs</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>IPs</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualInstance#getIPs()
    * @see #getVirtualInstance()
    * @generated
    */
-	EAttribute getVirtualInstance_IPs();
+  EAttribute getVirtualInstance_IPs();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getURI <em>URI</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>URI</em>'.
    * @see org.eclipse.camf.infosystem.model.base.VirtualInstance#getURI()
    * @see #getVirtualInstance()
    * @generated
    */
-	EAttribute getVirtualInstance_URI();
+  EAttribute getVirtualInstance_URI();
 
-		/**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.SecurityGroup <em>Security Group</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for class '<em>Security Group</em>'.
    * @see org.eclipse.camf.infosystem.model.base.SecurityGroup
    * @generated
    */
-	EClass getSecurityGroup();
+  EClass getSecurityGroup();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.SecurityGroup#getUID <em>UID</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>UID</em>'.
    * @see org.eclipse.camf.infosystem.model.base.SecurityGroup#getUID()
    * @see #getSecurityGroup()
    * @generated
    */
-	EAttribute getSecurityGroup_UID();
+  EAttribute getSecurityGroup_UID();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.SecurityGroup#getName <em>Name</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>Name</em>'.
    * @see org.eclipse.camf.infosystem.model.base.SecurityGroup#getName()
    * @see #getSecurityGroup()
    * @generated
    */
-	EAttribute getSecurityGroup_Name();
+  EAttribute getSecurityGroup_Name();
 
-		/**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.SecurityGroup#getDescription <em>Description</em>}'.
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @return the meta object for the attribute '<em>Description</em>'.
    * @see org.eclipse.camf.infosystem.model.base.SecurityGroup#getDescription()
    * @see #getSecurityGroup()
    * @generated
    */
-	EAttribute getSecurityGroup_Description();
+  EAttribute getSecurityGroup_Description();
 
-		/**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Root <em>Root</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1862,7 +1935,7 @@
    */
   EClass getRoot();
 
-    /**
+  /**
    * Returns the meta object for the containment reference list '{@link org.eclipse.camf.infosystem.model.base.Root#getCloudProviders <em>Cloud Providers</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1873,7 +1946,7 @@
    */
   EReference getRoot_CloudProviders();
 
-    /**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Images <em>Images</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1883,7 +1956,7 @@
    */
   EClass getImages();
 
-    /**
+  /**
    * Returns the meta object for the containment reference list '{@link org.eclipse.camf.infosystem.model.base.Images#getVms <em>Vms</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1894,7 +1967,7 @@
    */
   EReference getImages_Vms();
 
-    /**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Networks <em>Networks</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1904,7 +1977,7 @@
    */
   EClass getNetworks();
 
-    /**
+  /**
    * Returns the meta object for the containment reference list '{@link org.eclipse.camf.infosystem.model.base.Networks#getNets <em>Nets</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1915,7 +1988,7 @@
    */
   EReference getNetworks_Nets();
 
-    /**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Security <em>Security</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1925,7 +1998,7 @@
    */
   EClass getSecurity();
 
-    /**
+  /**
    * Returns the meta object for the containment reference '{@link org.eclipse.camf.infosystem.model.base.Security#getKeys <em>Keys</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1936,7 +2009,7 @@
    */
   EReference getSecurity_Keys();
 
-    /**
+  /**
    * Returns the meta object for the containment reference '{@link org.eclipse.camf.infosystem.model.base.Security#getGroups <em>Groups</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1947,7 +2020,7 @@
    */
   EReference getSecurity_Groups();
 
-    /**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Keys <em>Keys</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1957,7 +2030,7 @@
    */
   EClass getKeys();
 
-    /**
+  /**
    * Returns the meta object for the containment reference list '{@link org.eclipse.camf.infosystem.model.base.Keys#getKeypairs <em>Keypairs</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1968,7 +2041,7 @@
    */
   EReference getKeys_Keypairs();
 
-    /**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Groups <em>Groups</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1978,7 +2051,7 @@
    */
   EClass getGroups();
 
-    /**
+  /**
    * Returns the meta object for the containment reference list '{@link org.eclipse.camf.infosystem.model.base.Groups#getSecurityGroups <em>Security Groups</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1989,7 +2062,7 @@
    */
   EReference getGroups_SecurityGroups();
 
-    /**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Flavors <em>Flavors</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -1999,7 +2072,7 @@
    */
   EClass getFlavors();
 
-    /**
+  /**
    * Returns the meta object for the containment reference list '{@link org.eclipse.camf.infosystem.model.base.Flavors#getFlavors <em>Flavors</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -2010,7 +2083,7 @@
    */
   EReference getFlavors_Flavors();
 
-    /**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Monitoring <em>Monitoring</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -2020,7 +2093,7 @@
    */
   EClass getMonitoring();
 
-    /**
+  /**
    * Returns the meta object for the containment reference list '{@link org.eclipse.camf.infosystem.model.base.Monitoring#getMonitoringService <em>Monitoring Service</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -2031,7 +2104,7 @@
    */
   EReference getMonitoring_MonitoringService();
 
-    /**
+  /**
    * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.MonitoringService <em>Monitoring Service</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -2041,7 +2114,7 @@
    */
   EClass getMonitoringService();
 
-    /**
+  /**
    * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.MonitoringService#getName <em>Name</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -2052,7 +2125,7 @@
    */
   EAttribute getMonitoringService_Name();
 
-    /**
+  /**
    * Returns the meta object for the containment reference list '{@link org.eclipse.camf.infosystem.model.base.MonitoringService#getProbes <em>Probes</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -2063,115 +2136,7 @@
    */
   EReference getMonitoringService_Probes();
 
-    /**
-   * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Deployment <em>Deployment</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for class '<em>Deployment</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Deployment
-   * @generated
-   */
-	EClass getDeployment();
-
-		/**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Deployment#getDepID <em>Dep ID</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Dep ID</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Deployment#getDepID()
-   * @see #getDeployment()
-   * @generated
-   */
-	EAttribute getDeployment_DepID();
-
-		/**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Deployment#getDeploymentName <em>Deployment Name</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Deployment Name</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Deployment#getDeploymentName()
-   * @see #getDeployment()
-   * @generated
-   */
-	EAttribute getDeployment_DeploymentName();
-
-		/**
-   * Returns the meta object for the reference list '{@link org.eclipse.camf.infosystem.model.base.Deployment#getModules <em>Modules</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for the reference list '<em>Modules</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Deployment#getModules()
-   * @see #getDeployment()
-   * @generated
-   */
-	EReference getDeployment_Modules();
-
-		/**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Deployment#getStatus <em>Status</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Status</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Deployment#getStatus()
-   * @see #getDeployment()
-   * @generated
-   */
-	EAttribute getDeployment_Status();
-
-		/**
-   * Returns the meta object for class '{@link org.eclipse.camf.infosystem.model.base.Module <em>Module</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for class '<em>Module</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Module
-   * @generated
-   */
-	EClass getModule();
-
-		/**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Module#getModID <em>Mod ID</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Mod ID</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Module#getModID()
-   * @see #getModule()
-   * @generated
-   */
-	EAttribute getModule_ModID();
-
-		/**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Module#getModuleName <em>Module Name</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Module Name</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Module#getModuleName()
-   * @see #getModule()
-   * @generated
-   */
-	EAttribute getModule_ModuleName();
-
-		/**
-   * Returns the meta object for the reference list '{@link org.eclipse.camf.infosystem.model.base.Module#getInstances <em>Instances</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for the reference list '<em>Instances</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Module#getInstances()
-   * @see #getModule()
-   * @generated
-   */
-	EReference getModule_Instances();
-
-		/**
-   * Returns the meta object for the attribute '{@link org.eclipse.camf.infosystem.model.base.Module#getInitInstances <em>Init Instances</em>}'.
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @return the meta object for the attribute '<em>Init Instances</em>'.
-   * @see org.eclipse.camf.infosystem.model.base.Module#getInitInstances()
-   * @see #getModule()
-   * @generated
-   */
-	EAttribute getModule_InitInstances();
-
-		/**
+  /**
    * Returns the meta object for enum '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImageType <em>Virtual Machine Image Type</em>}'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -2251,14 +2216,6 @@
     EAttribute MONITORING_PROBE__DESCRIPTION = eINSTANCE.getMonitoringProbe_Description();
 
     /**
-     * The meta object literal for the '<em><b>URL</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    EAttribute MONITORING_PROBE__URL = eINSTANCE.getMonitoringProbe_URL();
-
-    /**
      * The meta object literal for the '<em><b>Metrics</b></em>' attribute feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2359,56 +2316,6 @@
     EAttribute SOFTWARE_DEPENDENCY__TYPE = eINSTANCE.getSoftwareDependency_Type();
 
     /**
-     * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageImpl <em>Virtual Machine Image</em>}' class.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @see org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageImpl
-     * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getVirtualMachineImage()
-     * @generated
-     */
-    EClass VIRTUAL_MACHINE_IMAGE = eINSTANCE.getVirtualMachineImage();
-
-    /**
-     * The meta object literal for the '<em><b>UID</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    EAttribute VIRTUAL_MACHINE_IMAGE__UID = eINSTANCE.getVirtualMachineImage_UID();
-
-    /**
-     * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    EAttribute VIRTUAL_MACHINE_IMAGE__NAME = eINSTANCE.getVirtualMachineImage_Name();
-
-    /**
-     * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    EAttribute VIRTUAL_MACHINE_IMAGE__DESCRIPTION = eINSTANCE.getVirtualMachineImage_Description();
-
-    /**
-     * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    EAttribute VIRTUAL_MACHINE_IMAGE__TYPE = eINSTANCE.getVirtualMachineImage_Type();
-
-    /**
-     * The meta object literal for the '<em><b>URL</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    EAttribute VIRTUAL_MACHINE_IMAGE__URL = eINSTANCE.getVirtualMachineImage_URL();
-
-    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.UserApplicationImpl <em>User Application</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2487,28 +2394,28 @@
     /**
      * The meta object literal for the '<em><b>Public Key</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute KEY_PAIR__PUBLIC_KEY = eINSTANCE.getKeyPair_PublicKey();
+    EAttribute KEY_PAIR__PUBLIC_KEY = eINSTANCE.getKeyPair_PublicKey();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute KEY_PAIR__DESCRIPTION = eINSTANCE.getKeyPair_Description();
+    EAttribute KEY_PAIR__DESCRIPTION = eINSTANCE.getKeyPair_Description();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>URL</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute KEY_PAIR__URL = eINSTANCE.getKeyPair_URL();
+    EAttribute KEY_PAIR__URL = eINSTANCE.getKeyPair_URL();
 
-				/**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageFlavorImpl <em>Virtual Machine Image Flavor</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2537,28 +2444,28 @@
     /**
      * The meta object literal for the '<em><b>Ram</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute VIRTUAL_MACHINE_IMAGE_FLAVOR__RAM = eINSTANCE.getVirtualMachineImageFlavor_Ram();
+    EAttribute VIRTUAL_MACHINE_IMAGE_FLAVOR__RAM = eINSTANCE.getVirtualMachineImageFlavor_Ram();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>Hdd</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute VIRTUAL_MACHINE_IMAGE_FLAVOR__HDD = eINSTANCE.getVirtualMachineImageFlavor_Hdd();
+    EAttribute VIRTUAL_MACHINE_IMAGE_FLAVOR__HDD = eINSTANCE.getVirtualMachineImageFlavor_Hdd();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>VCPU</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute VIRTUAL_MACHINE_IMAGE_FLAVOR__VCPU = eINSTANCE.getVirtualMachineImageFlavor_VCPU();
+    EAttribute VIRTUAL_MACHINE_IMAGE_FLAVOR__VCPU = eINSTANCE.getVirtualMachineImageFlavor_VCPU();
 
-				/**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.VirtualNetworkImpl <em>Virtual Network</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2667,90 +2574,224 @@
     EReference CLOUD_PROVIDER__MONITORING = eINSTANCE.getCloudProvider_Monitoring();
 
     /**
+     * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageImpl <em>Virtual Machine Image</em>}' class.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @see org.eclipse.camf.infosystem.model.base.impl.VirtualMachineImageImpl
+     * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getVirtualMachineImage()
+     * @generated
+     */
+    EClass VIRTUAL_MACHINE_IMAGE = eINSTANCE.getVirtualMachineImage();
+
+    /**
+     * The meta object literal for the '<em><b>UID</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute VIRTUAL_MACHINE_IMAGE__UID = eINSTANCE.getVirtualMachineImage_UID();
+
+    /**
+     * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute VIRTUAL_MACHINE_IMAGE__NAME = eINSTANCE.getVirtualMachineImage_Name();
+
+    /**
+     * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute VIRTUAL_MACHINE_IMAGE__DESCRIPTION = eINSTANCE.getVirtualMachineImage_Description();
+
+    /**
+     * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute VIRTUAL_MACHINE_IMAGE__TYPE = eINSTANCE.getVirtualMachineImage_Type();
+
+    /**
+     * The meta object literal for the '<em><b>URL</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute VIRTUAL_MACHINE_IMAGE__URL = eINSTANCE.getVirtualMachineImage_URL();
+
+    /**
+     * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.DeploymentImpl <em>Deployment</em>}' class.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @see org.eclipse.camf.infosystem.model.base.impl.DeploymentImpl
+     * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getDeployment()
+     * @generated
+     */
+    EClass DEPLOYMENT = eINSTANCE.getDeployment();
+
+    /**
+     * The meta object literal for the '<em><b>Dep ID</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute DEPLOYMENT__DEP_ID = eINSTANCE.getDeployment_DepID();
+
+    /**
+     * The meta object literal for the '<em><b>Deployment Name</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute DEPLOYMENT__DEPLOYMENT_NAME = eINSTANCE.getDeployment_DeploymentName();
+
+    /**
+     * The meta object literal for the '<em><b>Modules</b></em>' reference list feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EReference DEPLOYMENT__MODULES = eINSTANCE.getDeployment_Modules();
+
+    /**
+     * The meta object literal for the '<em><b>Status</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute DEPLOYMENT__STATUS = eINSTANCE.getDeployment_Status();
+
+    /**
+     * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.ModuleImpl <em>Module</em>}' class.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @see org.eclipse.camf.infosystem.model.base.impl.ModuleImpl
+     * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getModule()
+     * @generated
+     */
+    EClass MODULE = eINSTANCE.getModule();
+
+    /**
+     * The meta object literal for the '<em><b>Mod ID</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute MODULE__MOD_ID = eINSTANCE.getModule_ModID();
+
+    /**
+     * The meta object literal for the '<em><b>Module Name</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute MODULE__MODULE_NAME = eINSTANCE.getModule_ModuleName();
+
+    /**
+     * The meta object literal for the '<em><b>Instances</b></em>' reference list feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EReference MODULE__INSTANCES = eINSTANCE.getModule_Instances();
+
+    /**
+     * The meta object literal for the '<em><b>Init Instances</b></em>' attribute feature.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    EAttribute MODULE__INIT_INSTANCES = eINSTANCE.getModule_InitInstances();
+
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.VirtualInstanceImpl <em>Virtual Instance</em>}' class.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @see org.eclipse.camf.infosystem.model.base.impl.VirtualInstanceImpl
      * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getVirtualInstance()
      * @generated
      */
-		EClass VIRTUAL_INSTANCE = eINSTANCE.getVirtualInstance();
+    EClass VIRTUAL_INSTANCE = eINSTANCE.getVirtualInstance();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>UID</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute VIRTUAL_INSTANCE__UID = eINSTANCE.getVirtualInstance_UID();
+    EAttribute VIRTUAL_INSTANCE__UID = eINSTANCE.getVirtualInstance_UID();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute VIRTUAL_INSTANCE__NAME = eINSTANCE.getVirtualInstance_Name();
+    EAttribute VIRTUAL_INSTANCE__NAME = eINSTANCE.getVirtualInstance_Name();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>Status</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute VIRTUAL_INSTANCE__STATUS = eINSTANCE.getVirtualInstance_Status();
+    EAttribute VIRTUAL_INSTANCE__STATUS = eINSTANCE.getVirtualInstance_Status();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>IPs</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute VIRTUAL_INSTANCE__IPS = eINSTANCE.getVirtualInstance_IPs();
+    EAttribute VIRTUAL_INSTANCE__IPS = eINSTANCE.getVirtualInstance_IPs();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>URI</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute VIRTUAL_INSTANCE__URI = eINSTANCE.getVirtualInstance_URI();
+    EAttribute VIRTUAL_INSTANCE__URI = eINSTANCE.getVirtualInstance_URI();
 
-				/**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.SecurityGroupImpl <em>Security Group</em>}' class.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @see org.eclipse.camf.infosystem.model.base.impl.SecurityGroupImpl
      * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getSecurityGroup()
      * @generated
      */
-		EClass SECURITY_GROUP = eINSTANCE.getSecurityGroup();
+    EClass SECURITY_GROUP = eINSTANCE.getSecurityGroup();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>UID</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute SECURITY_GROUP__UID = eINSTANCE.getSecurityGroup_UID();
+    EAttribute SECURITY_GROUP__UID = eINSTANCE.getSecurityGroup_UID();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute SECURITY_GROUP__NAME = eINSTANCE.getSecurityGroup_Name();
+    EAttribute SECURITY_GROUP__NAME = eINSTANCE.getSecurityGroup_Name();
 
-				/**
+    /**
      * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
      * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
+     * <!-- end-user-doc -->
      * @generated
      */
-		EAttribute SECURITY_GROUP__DESCRIPTION = eINSTANCE.getSecurityGroup_Description();
+    EAttribute SECURITY_GROUP__DESCRIPTION = eINSTANCE.getSecurityGroup_Description();
 
-				/**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.RootImpl <em>Root</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2760,7 +2801,7 @@
      */
     EClass ROOT = eINSTANCE.getRoot();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Cloud Providers</b></em>' containment reference list feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2768,7 +2809,7 @@
      */
     EReference ROOT__CLOUD_PROVIDERS = eINSTANCE.getRoot_CloudProviders();
 
-        /**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.ImagesImpl <em>Images</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2778,7 +2819,7 @@
      */
     EClass IMAGES = eINSTANCE.getImages();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Vms</b></em>' containment reference list feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2786,7 +2827,7 @@
      */
     EReference IMAGES__VMS = eINSTANCE.getImages_Vms();
 
-        /**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.NetworksImpl <em>Networks</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2796,7 +2837,7 @@
      */
     EClass NETWORKS = eINSTANCE.getNetworks();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Nets</b></em>' containment reference list feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2804,7 +2845,7 @@
      */
     EReference NETWORKS__NETS = eINSTANCE.getNetworks_Nets();
 
-        /**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.SecurityImpl <em>Security</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2814,7 +2855,7 @@
      */
     EClass SECURITY = eINSTANCE.getSecurity();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Keys</b></em>' containment reference feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2822,7 +2863,7 @@
      */
     EReference SECURITY__KEYS = eINSTANCE.getSecurity_Keys();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Groups</b></em>' containment reference feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2830,7 +2871,7 @@
      */
     EReference SECURITY__GROUPS = eINSTANCE.getSecurity_Groups();
 
-        /**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.KeysImpl <em>Keys</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2840,7 +2881,7 @@
      */
     EClass KEYS = eINSTANCE.getKeys();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Keypairs</b></em>' containment reference list feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2848,7 +2889,7 @@
      */
     EReference KEYS__KEYPAIRS = eINSTANCE.getKeys_Keypairs();
 
-        /**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.GroupsImpl <em>Groups</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2858,7 +2899,7 @@
      */
     EClass GROUPS = eINSTANCE.getGroups();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Security Groups</b></em>' containment reference list feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2866,7 +2907,7 @@
      */
     EReference GROUPS__SECURITY_GROUPS = eINSTANCE.getGroups_SecurityGroups();
 
-        /**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.FlavorsImpl <em>Flavors</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2876,7 +2917,7 @@
      */
     EClass FLAVORS = eINSTANCE.getFlavors();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Flavors</b></em>' containment reference list feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2884,7 +2925,7 @@
      */
     EReference FLAVORS__FLAVORS = eINSTANCE.getFlavors_Flavors();
 
-        /**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringImpl <em>Monitoring</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2894,7 +2935,7 @@
      */
     EClass MONITORING = eINSTANCE.getMonitoring();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Monitoring Service</b></em>' containment reference list feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2902,7 +2943,7 @@
      */
     EReference MONITORING__MONITORING_SERVICE = eINSTANCE.getMonitoring_MonitoringService();
 
-        /**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringServiceImpl <em>Monitoring Service</em>}' class.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2912,7 +2953,7 @@
      */
     EClass MONITORING_SERVICE = eINSTANCE.getMonitoringService();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2920,7 +2961,7 @@
      */
     EAttribute MONITORING_SERVICE__NAME = eINSTANCE.getMonitoringService_Name();
 
-        /**
+    /**
      * The meta object literal for the '<em><b>Probes</b></em>' containment reference list feature.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -2928,91 +2969,7 @@
      */
     EReference MONITORING_SERVICE__PROBES = eINSTANCE.getMonitoringService_Probes();
 
-        /**
-     * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.DeploymentImpl <em>Deployment</em>}' class.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @see org.eclipse.camf.infosystem.model.base.impl.DeploymentImpl
-     * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getDeployment()
-     * @generated
-     */
-		EClass DEPLOYMENT = eINSTANCE.getDeployment();
-
-				/**
-     * The meta object literal for the '<em><b>Dep ID</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @generated
-     */
-		EAttribute DEPLOYMENT__DEP_ID = eINSTANCE.getDeployment_DepID();
-
-				/**
-     * The meta object literal for the '<em><b>Deployment Name</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @generated
-     */
-		EAttribute DEPLOYMENT__DEPLOYMENT_NAME = eINSTANCE.getDeployment_DeploymentName();
-
-				/**
-     * The meta object literal for the '<em><b>Modules</b></em>' reference list feature.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @generated
-     */
-		EReference DEPLOYMENT__MODULES = eINSTANCE.getDeployment_Modules();
-
-				/**
-     * The meta object literal for the '<em><b>Status</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @generated
-     */
-		EAttribute DEPLOYMENT__STATUS = eINSTANCE.getDeployment_Status();
-
-				/**
-     * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.impl.ModuleImpl <em>Module</em>}' class.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @see org.eclipse.camf.infosystem.model.base.impl.ModuleImpl
-     * @see org.eclipse.camf.infosystem.model.base.impl.InfoSystemPackageImpl#getModule()
-     * @generated
-     */
-		EClass MODULE = eINSTANCE.getModule();
-
-				/**
-     * The meta object literal for the '<em><b>Mod ID</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @generated
-     */
-		EAttribute MODULE__MOD_ID = eINSTANCE.getModule_ModID();
-
-				/**
-     * The meta object literal for the '<em><b>Module Name</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @generated
-     */
-		EAttribute MODULE__MODULE_NAME = eINSTANCE.getModule_ModuleName();
-
-				/**
-     * The meta object literal for the '<em><b>Instances</b></em>' reference list feature.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @generated
-     */
-		EReference MODULE__INSTANCES = eINSTANCE.getModule_Instances();
-
-				/**
-     * The meta object literal for the '<em><b>Init Instances</b></em>' attribute feature.
-     * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-     * @generated
-     */
-		EAttribute MODULE__INIT_INSTANCES = eINSTANCE.getModule_InitInstances();
-
-				/**
+    /**
      * The meta object literal for the '{@link org.eclipse.camf.infosystem.model.base.VirtualMachineImageType <em>Virtual Machine Image Type</em>}' enum.
      * <!-- begin-user-doc -->
      * <!-- end-user-doc -->
@@ -3034,4 +2991,4 @@
 
   }
 
-} //InfoSystemPackage
+} //InfoSystemPackage
\ No newline at end of file
diff --git a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/MonitoringProbe.java b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/MonitoringProbe.java
index 885d0e7..0af7d42 100644
--- a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/MonitoringProbe.java
+++ b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/MonitoringProbe.java
@@ -1,21 +1,6 @@
-/*******************************************************************************
- * Copyright (c) 2014 Laboratory for Internet Computing, University of Cyprus.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial development of the original code was made for the 
- * CELAR project founded by European Union
- * project number: FP7-317790  http://www.celarcloud.eu
- *
- * Contributors:
- * 	Nicholas Loulloudes - initial API and implementation
- *******************************************************************************/
-/**
- */
 package org.eclipse.camf.infosystem.model.base;
 
+
 import org.eclipse.emf.ecore.EObject;
 
 /**
@@ -29,7 +14,6 @@
  *   <li>{@link org.eclipse.camf.infosystem.model.base.MonitoringProbe#getUID <em>UID</em>}</li>
  *   <li>{@link org.eclipse.camf.infosystem.model.base.MonitoringProbe#getName <em>Name</em>}</li>
  *   <li>{@link org.eclipse.camf.infosystem.model.base.MonitoringProbe#getDescription <em>Description</em>}</li>
- *   <li>{@link org.eclipse.camf.infosystem.model.base.MonitoringProbe#getURL <em>URL</em>}</li>
  *   <li>{@link org.eclipse.camf.infosystem.model.base.MonitoringProbe#getMetrics <em>Metrics</em>}</li>
  * </ul>
  * </p>
@@ -122,33 +106,6 @@
   void setDescription(String value);
 
   /**
-   * Returns the value of the '<em><b>URL</b></em>' attribute.
-   * <!-- begin-user-doc -->
-   * <p>
-   * If the meaning of the '<em>URL</em>' attribute isn't clear,
-   * there really should be more of a description here...
-   * </p>
-   * <!-- end-user-doc -->
-   * @return the value of the '<em>URL</em>' attribute.
-   * @see #setURL(String)
-   * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getMonitoringProbe_URL()
-   * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
-   *        extendedMetaData="kind='element' name='URL' namespace='##targetNamespace'"
-   * @generated
-   */
-  String getURL();
-
-  /**
-   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.MonitoringProbe#getURL <em>URL</em>}' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @param value the new value of the '<em>URL</em>' attribute.
-   * @see #getURL()
-   * @generated
-   */
-  void setURL(String value);
-
-  /**
    * Returns the value of the '<em><b>Metrics</b></em>' attribute.
    * <!-- begin-user-doc -->
    * <p>
@@ -159,7 +116,8 @@
    * @return the value of the '<em>Metrics</em>' attribute.
    * @see #setMetrics(String)
    * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getMonitoringProbe_Metrics()
-   * @model dataType="org.eclipse.emf.ecore.xml.type.String"
+   * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+   *        extendedMetaData="kind='element' name='URL' namespace='##targetNamespace'"
    * @generated
    */
   String getMetrics();
@@ -174,4 +132,4 @@
    */
   void setMetrics(String value);
 
-} // MonitoringProbe
+} // MonitoringProbe
\ No newline at end of file
diff --git a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/VirtualInstance.java b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/VirtualInstance.java
index a495c20..35c9761 100644
--- a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/VirtualInstance.java
+++ b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/VirtualInstance.java
@@ -1,173 +1,158 @@
-/*******************************************************************************

- * Copyright (c) 2014 Laboratory for Internet Computing, University of Cyprus.

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Initial development of the original code was made for the 

- * CELAR project founded by European Union

- * project number: FP7-317790  http://www.celarcloud.eu

- *

- * Contributors:

- * 	Andreas Kastanas- initial API and implementation

- *******************************************************************************/

-package org.eclipse.camf.infosystem.model.base;

-

-import org.eclipse.emf.ecore.EObject;

-

-/**

- * <!-- begin-user-doc --> A representation of the model object '

- * <em><b>Virtual Instance</b></em>'. <!-- end-user-doc -->

- *

- * <p>

- * The following features are supported:

- * <ul>

- *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getUID <em>UID</em>}</li>

- *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getName <em>Name</em>}</li>

- *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getStatus <em>Status</em>}</li>

- *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getIPs <em>IPs</em>}</li>

- *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getURI <em>URI</em>}</li>

- * </ul>

- * </p>

- *

- * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance()

- * @model

- * @generated

- */

-public interface VirtualInstance extends EObject {

-	/**

-	 * Returns the value of the '<em><b>UID</b></em>' attribute. <!--

-	 * begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>UID</em>' attribute isn't clear, there really

-	 * should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * 

-	 * @return the value of the '<em>UID</em>' attribute.

-	 * @see #setUID(String)

-	 * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_UID()

-	 * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"

-	 * @generated

-	 */

-	String getUID();

-

-	/**

-   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getUID <em>UID</em>}' attribute.

-   * <!-- begin-user-doc --> <!-- end-user-doc -->

-   * @param value the new value of the '<em>UID</em>' attribute.

-   * @see #getUID()

-   * @generated

-   */

-	void setUID(String value);

-

-	/**

-	 * Returns the value of the '<em><b>Name</b></em>' attribute. <!--

-	 * begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>Name</em>' attribute isn't clear, there really

-	 * should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * 

-	 * @return the value of the '<em>Name</em>' attribute.

-	 * @see #setName(String)

-	 * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_Name()

-	 * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"

-	 * @generated

-	 */

-	String getName();

-

-	/**

-   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getName <em>Name</em>}' attribute.

-   * <!-- begin-user-doc --> <!-- end-user-doc -->

-   * @param value the new value of the '<em>Name</em>' attribute.

-   * @see #getName()

-   * @generated

-   */

-	void setName(String value);

-

-	/**

-	 * Returns the value of the '<em><b>Status</b></em>' attribute. <!--

-	 * begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>Status</em>' attribute isn't clear, there

-	 * really should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * 

-	 * @return the value of the '<em>Status</em>' attribute.

-	 * @see #setStatus(String)

-	 * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_Status()

-	 * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"

-	 * @generated

-	 */

-	String getStatus();

-

-	/**

-	 * Sets the value of the '

-	 * {@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getStatus

-	 * <em>Status</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc

-	 * -->

-	 * 

-	 * @param value

-	 *            the new value of the '<em>Status</em>' attribute.

-	 * @see #getStatus()

-	 * @generated

-	 */

-	void setStatus(String value);

-

-	/**

-	 * Returns the value of the '<em><b>IPs</b></em>' attribute. <!--

-	 * begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>IPs</em>' attribute isn't clear, there really

-	 * should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * 

-	 * @return the value of the '<em>IPs</em>' attribute.

-	 * @see #setIPs(String)

-	 * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_IPs()

-	 * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"

-	 * @generated

-	 */

-	String getIPs();

-

-	/**

-   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getIPs <em>IPs</em>}' attribute.

-   * <!-- begin-user-doc --> <!-- end-user-doc -->

-   * @param value the new value of the '<em>IPs</em>' attribute.

-   * @see #getIPs()

-   * @generated

-   */

-	void setIPs(String value);

-

-	/**

-	 * Returns the value of the '<em><b>URI</b></em>' attribute. <!--

-	 * begin-user-doc -->

-	 * <p>

-	 * If the meaning of the '<em>URI</em>' attribute isn't clear, there really

-	 * should be more of a description here...

-	 * </p>

-	 * <!-- end-user-doc -->

-	 * 

-	 * @return the value of the '<em>URI</em>' attribute.

-	 * @see #setURI(String)

-	 * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_URI()

-	 * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"

-	 * @generated

-	 */

-	String getURI();

-

-	/**

-   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getURI <em>URI</em>}' attribute.

-   * <!-- begin-user-doc --> <!-- end-user-doc -->

-   * @param value the new value of the '<em>URI</em>' attribute.

-   * @see #getURI()

-   * @generated

-   */

-	void setURI(String value);

-

-} // VirtualInstance

+package org.eclipse.camf.infosystem.model.base;
+
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Virtual Instance</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getUID <em>UID</em>}</li>
+ *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getName <em>Name</em>}</li>
+ *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getStatus <em>Status</em>}</li>
+ *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getIPs <em>IPs</em>}</li>
+ *   <li>{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getURI <em>URI</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance()
+ * @model
+ * @generated
+ */
+public interface VirtualInstance extends EObject
+{
+  /**
+   * Returns the value of the '<em><b>UID</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>UID</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>UID</em>' attribute.
+   * @see #setUID(String)
+   * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_UID()
+   * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+   * @generated
+   */
+  String getUID();
+
+  /**
+   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getUID <em>UID</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>UID</em>' attribute.
+   * @see #getUID()
+   * @generated
+   */
+  void setUID(String value);
+
+  /**
+   * Returns the value of the '<em><b>Name</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Name</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Name</em>' attribute.
+   * @see #setName(String)
+   * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_Name()
+   * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+   * @generated
+   */
+  String getName();
+
+  /**
+   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getName <em>Name</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Name</em>' attribute.
+   * @see #getName()
+   * @generated
+   */
+  void setName(String value);
+
+  /**
+   * Returns the value of the '<em><b>Status</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Status</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Status</em>' attribute.
+   * @see #setStatus(String)
+   * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_Status()
+   * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+   * @generated
+   */
+  String getStatus();
+
+  /**
+   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getStatus <em>Status</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Status</em>' attribute.
+   * @see #getStatus()
+   * @generated
+   */
+  void setStatus(String value);
+
+  /**
+   * Returns the value of the '<em><b>IPs</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>IPs</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>IPs</em>' attribute.
+   * @see #setIPs(String)
+   * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_IPs()
+   * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+   * @generated
+   */
+  String getIPs();
+
+  /**
+   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getIPs <em>IPs</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>IPs</em>' attribute.
+   * @see #getIPs()
+   * @generated
+   */
+  void setIPs(String value);
+
+  /**
+   * Returns the value of the '<em><b>URI</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>URI</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>URI</em>' attribute.
+   * @see #setURI(String)
+   * @see org.eclipse.camf.infosystem.model.base.InfoSystemPackage#getVirtualInstance_URI()
+   * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
+   * @generated
+   */
+  String getURI();
+
+  /**
+   * Sets the value of the '{@link org.eclipse.camf.infosystem.model.base.VirtualInstance#getURI <em>URI</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>URI</em>' attribute.
+   * @see #getURI()
+   * @generated
+   */
+  void setURI(String value);
+
+} // VirtualInstance
\ No newline at end of file
diff --git a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/InfoSystemFactoryImpl.java b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/InfoSystemFactoryImpl.java
index 5066a03..ccadc27 100644
--- a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/InfoSystemFactoryImpl.java
+++ b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/InfoSystemFactoryImpl.java
@@ -1,21 +1,6 @@
-/*******************************************************************************
- * Copyright (c) 2014 Laboratory for Internet Computing, University of Cyprus.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial development of the original code was made for the 
- * CELAR project founded by European Union
- * project number: FP7-317790  http://www.celarcloud.eu
- *
- * Contributors:
- * 	Nicholas Loulloudes - initial API and implementation
- *******************************************************************************/
-/**
- */
 package org.eclipse.camf.infosystem.model.base.impl;
 
+
 import org.eclipse.camf.infosystem.model.base.*;
 import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EDataType;
@@ -179,17 +164,6 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public VirtualMachineImage createVirtualMachineImage()
-  {
-    VirtualMachineImageImpl virtualMachineImage = new VirtualMachineImageImpl();
-    return virtualMachineImage;
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
   public UserApplication createUserApplication()
   {
     UserApplicationImpl userApplication = new UserApplicationImpl();
@@ -242,25 +216,60 @@
 
   /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public VirtualInstance createVirtualInstance() {
+  public VirtualMachineImage createVirtualMachineImage()
+  {
+    VirtualMachineImageImpl virtualMachineImage = new VirtualMachineImageImpl();
+    return virtualMachineImage;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Deployment createDeployment()
+  {
+    DeploymentImpl deployment = new DeploymentImpl();
+    return deployment;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public Module createModule()
+  {
+    ModuleImpl module = new ModuleImpl();
+    return module;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public VirtualInstance createVirtualInstance()
+  {
     VirtualInstanceImpl virtualInstance = new VirtualInstanceImpl();
     return virtualInstance;
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public SecurityGroup createSecurityGroup() {
+  public SecurityGroup createSecurityGroup()
+  {
     SecurityGroupImpl securityGroup = new SecurityGroupImpl();
     return securityGroup;
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -271,7 +280,7 @@
     return root;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -282,7 +291,7 @@
     return images;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -293,7 +302,7 @@
     return networks;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -304,7 +313,7 @@
     return security;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -315,7 +324,7 @@
     return keys;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -326,7 +335,7 @@
     return groups;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -337,7 +346,7 @@
     return flavors;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -348,7 +357,7 @@
     return monitoring;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -359,27 +368,7 @@
     return monitoringService;
   }
 
-    /**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public Deployment createDeployment() {
-    DeploymentImpl deployment = new DeploymentImpl();
-    return deployment;
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public Module createModule() {
-    ModuleImpl module = new ModuleImpl();
-    return module;
-  }
-
-		/**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -443,4 +432,4 @@
     return InfoSystemPackage.eINSTANCE;
   }
 
-} //InfoSystemFactoryImpl
+} //InfoSystemFactoryImpl
\ No newline at end of file
diff --git a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/InfoSystemPackageImpl.java b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/InfoSystemPackageImpl.java
index 09f1fdb..2f7edd6 100644
--- a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/InfoSystemPackageImpl.java
+++ b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/InfoSystemPackageImpl.java
@@ -1,21 +1,6 @@
-/*******************************************************************************
- * Copyright (c) 2014 Laboratory for Internet Computing, University of Cyprus.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial development of the original code was made for the 
- * CELAR project founded by European Union
- * project number: FP7-317790  http://www.celarcloud.eu
- *
- * Contributors:
- * 	Nicholas Loulloudes - initial API and implementation
- *******************************************************************************/
-/**
- */
 package org.eclipse.camf.infosystem.model.base.impl;
 
+
 import org.eclipse.camf.infosystem.model.base.CloudProvider;
 import org.eclipse.camf.infosystem.model.base.Deployment;
 import org.eclipse.camf.infosystem.model.base.Flavors;
@@ -84,13 +69,6 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  private EClass virtualMachineImageEClass = null;
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
   private EClass userApplicationEClass = null;
 
   /**
@@ -123,96 +101,103 @@
 
   /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	private EClass virtualInstanceEClass = null;
+  private EClass virtualMachineImageEClass = null;
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	private EClass securityGroupEClass = null;
+  private EClass deploymentEClass = null;
 
-		/**
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  private EClass moduleEClass = null;
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  private EClass virtualInstanceEClass = null;
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  private EClass securityGroupEClass = null;
+
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass rootEClass = null;
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass imagesEClass = null;
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass networksEClass = null;
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass securityEClass = null;
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass keysEClass = null;
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass groupsEClass = null;
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass flavorsEClass = null;
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass monitoringEClass = null;
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
   private EClass monitoringServiceEClass = null;
 
-    /**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	private EClass deploymentEClass = null;
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	private EClass moduleEClass = null;
-
-		/**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -337,19 +322,9 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public EAttribute getMonitoringProbe_URL()
-  {
-    return (EAttribute)monitoringProbeEClass.getEStructuralFeatures().get(3);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
   public EAttribute getMonitoringProbe_Metrics()
   {
-    return (EAttribute)monitoringProbeEClass.getEStructuralFeatures().get(4);
+    return (EAttribute)monitoringProbeEClass.getEStructuralFeatures().get(3);
   }
 
   /**
@@ -467,66 +442,6 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public EClass getVirtualMachineImage()
-  {
-    return virtualMachineImageEClass;
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public EAttribute getVirtualMachineImage_UID()
-  {
-    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(0);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public EAttribute getVirtualMachineImage_Name()
-  {
-    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(1);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public EAttribute getVirtualMachineImage_Description()
-  {
-    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(2);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public EAttribute getVirtualMachineImage_Type()
-  {
-    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(3);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public EAttribute getVirtualMachineImage_URL()
-  {
-    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(4);
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
   public EClass getUserApplication()
   {
     return userApplicationEClass;
@@ -614,32 +529,35 @@
 
   /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getKeyPair_PublicKey() {
+  public EAttribute getKeyPair_PublicKey()
+  {
     return (EAttribute)keyPairEClass.getEStructuralFeatures().get(2);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getKeyPair_Description() {
+  public EAttribute getKeyPair_Description()
+  {
     return (EAttribute)keyPairEClass.getEStructuralFeatures().get(3);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getKeyPair_URL() {
+  public EAttribute getKeyPair_URL()
+  {
     return (EAttribute)keyPairEClass.getEStructuralFeatures().get(4);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -671,32 +589,35 @@
 
   /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getVirtualMachineImageFlavor_Ram() {
+  public EAttribute getVirtualMachineImageFlavor_Ram()
+  {
     return (EAttribute)virtualMachineImageFlavorEClass.getEStructuralFeatures().get(2);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getVirtualMachineImageFlavor_Hdd() {
+  public EAttribute getVirtualMachineImageFlavor_Hdd()
+  {
     return (EAttribute)virtualMachineImageFlavorEClass.getEStructuralFeatures().get(3);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getVirtualMachineImageFlavor_VCPU() {
+  public EAttribute getVirtualMachineImageFlavor_VCPU()
+  {
     return (EAttribute)virtualMachineImageFlavorEClass.getEStructuralFeatures().get(4);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -828,95 +749,265 @@
 
   /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EClass getVirtualInstance() {
+  public EClass getVirtualMachineImage()
+  {
+    return virtualMachineImageEClass;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getVirtualMachineImage_UID()
+  {
+    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(0);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getVirtualMachineImage_Name()
+  {
+    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(1);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getVirtualMachineImage_Description()
+  {
+    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(2);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getVirtualMachineImage_Type()
+  {
+    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(3);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getVirtualMachineImage_URL()
+  {
+    return (EAttribute)virtualMachineImageEClass.getEStructuralFeatures().get(4);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EClass getDeployment()
+  {
+    return deploymentEClass;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getDeployment_DepID()
+  {
+    return (EAttribute)deploymentEClass.getEStructuralFeatures().get(0);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getDeployment_DeploymentName()
+  {
+    return (EAttribute)deploymentEClass.getEStructuralFeatures().get(1);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EReference getDeployment_Modules()
+  {
+    return (EReference)deploymentEClass.getEStructuralFeatures().get(2);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getDeployment_Status()
+  {
+    return (EAttribute)deploymentEClass.getEStructuralFeatures().get(3);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EClass getModule()
+  {
+    return moduleEClass;
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getModule_ModID()
+  {
+    return (EAttribute)moduleEClass.getEStructuralFeatures().get(0);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getModule_ModuleName()
+  {
+    return (EAttribute)moduleEClass.getEStructuralFeatures().get(1);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EReference getModule_Instances()
+  {
+    return (EReference)moduleEClass.getEStructuralFeatures().get(2);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EAttribute getModule_InitInstances()
+  {
+    return (EAttribute)moduleEClass.getEStructuralFeatures().get(3);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public EClass getVirtualInstance()
+  {
     return virtualInstanceEClass;
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getVirtualInstance_UID() {
+  public EAttribute getVirtualInstance_UID()
+  {
     return (EAttribute)virtualInstanceEClass.getEStructuralFeatures().get(0);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getVirtualInstance_Name() {
+  public EAttribute getVirtualInstance_Name()
+  {
     return (EAttribute)virtualInstanceEClass.getEStructuralFeatures().get(1);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getVirtualInstance_Status() {
+  public EAttribute getVirtualInstance_Status()
+  {
     return (EAttribute)virtualInstanceEClass.getEStructuralFeatures().get(2);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getVirtualInstance_IPs() {
+  public EAttribute getVirtualInstance_IPs()
+  {
     return (EAttribute)virtualInstanceEClass.getEStructuralFeatures().get(3);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getVirtualInstance_URI() {
+  public EAttribute getVirtualInstance_URI()
+  {
     return (EAttribute)virtualInstanceEClass.getEStructuralFeatures().get(4);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EClass getSecurityGroup() {
+  public EClass getSecurityGroup()
+  {
     return securityGroupEClass;
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getSecurityGroup_UID() {
+  public EAttribute getSecurityGroup_UID()
+  {
     return (EAttribute)securityGroupEClass.getEStructuralFeatures().get(0);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getSecurityGroup_Name() {
+  public EAttribute getSecurityGroup_Name()
+  {
     return (EAttribute)securityGroupEClass.getEStructuralFeatures().get(1);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+   * <!-- end-user-doc -->
    * @generated
    */
-	public EAttribute getSecurityGroup_Description() {
+  public EAttribute getSecurityGroup_Description()
+  {
     return (EAttribute)securityGroupEClass.getEStructuralFeatures().get(2);
   }
 
-		/**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -926,7 +1017,7 @@
     return rootEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -936,7 +1027,7 @@
     return (EReference)rootEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -946,7 +1037,7 @@
     return imagesEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -956,7 +1047,7 @@
     return (EReference)imagesEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -966,7 +1057,7 @@
     return networksEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -976,7 +1067,7 @@
     return (EReference)networksEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -986,7 +1077,7 @@
     return securityEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -996,7 +1087,7 @@
     return (EReference)securityEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1006,7 +1097,7 @@
     return (EReference)securityEClass.getEStructuralFeatures().get(1);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1016,7 +1107,7 @@
     return keysEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1026,7 +1117,7 @@
     return (EReference)keysEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1036,7 +1127,7 @@
     return groupsEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1046,7 +1137,7 @@
     return (EReference)groupsEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1056,7 +1147,7 @@
     return flavorsEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1066,7 +1157,7 @@
     return (EReference)flavorsEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1076,7 +1167,7 @@
     return monitoringEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1086,7 +1177,7 @@
     return (EReference)monitoringEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1096,7 +1187,7 @@
     return monitoringServiceEClass;
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1106,7 +1197,7 @@
     return (EAttribute)monitoringServiceEClass.getEStructuralFeatures().get(0);
   }
 
-    /**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1116,97 +1207,7 @@
     return (EReference)monitoringServiceEClass.getEStructuralFeatures().get(1);
   }
 
-    /**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EClass getDeployment() {
-    return deploymentEClass;
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EAttribute getDeployment_DepID() {
-    return (EAttribute)deploymentEClass.getEStructuralFeatures().get(0);
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EAttribute getDeployment_DeploymentName() {
-    return (EAttribute)deploymentEClass.getEStructuralFeatures().get(1);
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EReference getDeployment_Modules() {
-    return (EReference)deploymentEClass.getEStructuralFeatures().get(2);
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EAttribute getDeployment_Status() {
-    return (EAttribute)deploymentEClass.getEStructuralFeatures().get(3);
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EClass getModule() {
-    return moduleEClass;
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EAttribute getModule_ModID() {
-    return (EAttribute)moduleEClass.getEStructuralFeatures().get(0);
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EAttribute getModule_ModuleName() {
-    return (EAttribute)moduleEClass.getEStructuralFeatures().get(1);
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EReference getModule_Instances() {
-    return (EReference)moduleEClass.getEStructuralFeatures().get(2);
-  }
-
-		/**
-   * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-   * @generated
-   */
-	public EAttribute getModule_InitInstances() {
-    return (EAttribute)moduleEClass.getEStructuralFeatures().get(3);
-  }
-
-		/**
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
@@ -1260,7 +1261,6 @@
     createEAttribute(monitoringProbeEClass, MONITORING_PROBE__UID);
     createEAttribute(monitoringProbeEClass, MONITORING_PROBE__NAME);
     createEAttribute(monitoringProbeEClass, MONITORING_PROBE__DESCRIPTION);
-    createEAttribute(monitoringProbeEClass, MONITORING_PROBE__URL);
     createEAttribute(monitoringProbeEClass, MONITORING_PROBE__METRICS);
 
     resizingActionEClass = createEClass(RESIZING_ACTION);
@@ -1417,8 +1417,7 @@
     initEAttribute(getMonitoringProbe_UID(), theXMLTypePackage.getString(), "uID", null, 1, 1, MonitoringProbe.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
     initEAttribute(getMonitoringProbe_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, MonitoringProbe.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
     initEAttribute(getMonitoringProbe_Description(), theXMLTypePackage.getString(), "description", null, 1, 1, MonitoringProbe.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-    initEAttribute(getMonitoringProbe_URL(), theXMLTypePackage.getString(), "uRL", null, 1, 1, MonitoringProbe.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-    initEAttribute(getMonitoringProbe_Metrics(), theXMLTypePackage.getString(), "metrics", null, 0, 1, MonitoringProbe.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+    initEAttribute(getMonitoringProbe_Metrics(), theXMLTypePackage.getString(), "metrics", null, 1, 1, MonitoringProbe.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
     initEClass(resizingActionEClass, ResizingAction.class, "ResizingAction", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
     initEAttribute(getResizingAction_UID(), theXMLTypePackage.getString(), "uID", null, 1, 1, ResizingAction.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -1590,7 +1589,7 @@
        "namespace", "##targetNamespace"
        });	
     addAnnotation
-      (getMonitoringProbe_URL(), 
+      (getMonitoringProbe_Metrics(), 
        source, 
        new String[] 
        {
@@ -1897,4 +1896,4 @@
        });
   }
 
-} //InfoSystemPackageImpl
+} //InfoSystemPackageImpl
\ No newline at end of file
diff --git a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/MonitoringProbeImpl.java b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/MonitoringProbeImpl.java
index 53214d8..391eeb9 100644
--- a/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/MonitoringProbeImpl.java
+++ b/plugins/org.eclipse.camf.infosystem.model/src/org/eclipse/camf/infosystem/model/base/impl/MonitoringProbeImpl.java
@@ -1,21 +1,6 @@
-/*******************************************************************************
- * Copyright (c) 2014 Laboratory for Internet Computing, University of Cyprus.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial development of the original code was made for the 
- * CELAR project founded by European Union
- * project number: FP7-317790  http://www.celarcloud.eu
- *
- * Contributors:
- * 	Nicholas Loulloudes - initial API and implementation
- *******************************************************************************/
-/**
- */
 package org.eclipse.camf.infosystem.model.base.impl;
 
+
 import org.eclipse.camf.infosystem.model.base.InfoSystemPackage;
 import org.eclipse.camf.infosystem.model.base.MonitoringProbe;
 import org.eclipse.emf.common.notify.Notification;
@@ -33,7 +18,6 @@
  *   <li>{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringProbeImpl#getUID <em>UID</em>}</li>
  *   <li>{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringProbeImpl#getName <em>Name</em>}</li>
  *   <li>{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringProbeImpl#getDescription <em>Description</em>}</li>
- *   <li>{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringProbeImpl#getURL <em>URL</em>}</li>
  *   <li>{@link org.eclipse.camf.infosystem.model.base.impl.MonitoringProbeImpl#getMetrics <em>Metrics</em>}</li>
  * </ul>
  * </p>
@@ -103,26 +87,6 @@
   protected String description = DESCRIPTION_EDEFAULT;
 
   /**
-   * The default value of the '{@link #getURL() <em>URL</em>}' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @see #getURL()
-   * @generated
-   * @ordered
-   */
-  protected static final String URL_EDEFAULT = null;
-
-  /**
-   * The cached value of the '{@link #getURL() <em>URL</em>}' attribute.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @see #getURL()
-   * @generated
-   * @ordered
-   */
-  protected String uRL = URL_EDEFAULT;
-
-  /**
    * The default value of the '{@link #getMetrics() <em>Metrics</em>}' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -237,29 +201,6 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public String getURL()
-  {
-    return uRL;
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
-  public void setURL(String newURL)
-  {
-    String oldURL = uRL;
-    uRL = newURL;
-    if (eNotificationRequired())
-      eNotify(new ENotificationImpl(this, Notification.SET, InfoSystemPackage.MONITORING_PROBE__URL, oldURL, uRL));
-  }
-
-  /**
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @generated
-   */
   public String getMetrics()
   {
     return metrics;
@@ -294,8 +235,6 @@
         return getName();
       case InfoSystemPackage.MONITORING_PROBE__DESCRIPTION:
         return getDescription();
-      case InfoSystemPackage.MONITORING_PROBE__URL:
-        return getURL();
       case InfoSystemPackage.MONITORING_PROBE__METRICS:
         return getMetrics();
     }
@@ -321,9 +260,6 @@
       case InfoSystemPackage.MONITORING_PROBE__DESCRIPTION:
         setDescription((String)newValue);
         return;
-      case InfoSystemPackage.MONITORING_PROBE__URL:
-        setURL((String)newValue);
-        return;
       case InfoSystemPackage.MONITORING_PROBE__METRICS:
         setMetrics((String)newValue);
         return;
@@ -350,9 +286,6 @@
       case InfoSystemPackage.MONITORING_PROBE__DESCRIPTION:
         setDescription(DESCRIPTION_EDEFAULT);
         return;
-      case InfoSystemPackage.MONITORING_PROBE__URL:
-        setURL(URL_EDEFAULT);
-        return;
       case InfoSystemPackage.MONITORING_PROBE__METRICS:
         setMetrics(METRICS_EDEFAULT);
         return;
@@ -376,8 +309,6 @@
         return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
       case InfoSystemPackage.MONITORING_PROBE__DESCRIPTION:
         return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
-      case InfoSystemPackage.MONITORING_PROBE__URL:
-        return URL_EDEFAULT == null ? uRL != null : !URL_EDEFAULT.equals(uRL);
       case InfoSystemPackage.MONITORING_PROBE__METRICS:
         return METRICS_EDEFAULT == null ? metrics != null : !METRICS_EDEFAULT.equals(metrics);
     }
@@ -401,12 +332,10 @@
     result.append(name);
     result.append(", description: ");
     result.append(description);
-    result.append(", uRL: ");
-    result.append(uRL);
     result.append(", metrics: ");
     result.append(metrics);
     result.append(')');
     return result.toString();
   }
 
-} //MonitoringProbeImpl
+} //MonitoringProbeImpl
\ No newline at end of file
diff --git a/plugins/org.eclipse.camf.tosca.editor/META-INF/MANIFEST.MF b/plugins/org.eclipse.camf.tosca.editor/META-INF/MANIFEST.MF
index 0ccbe4f..5127b5d 100644
--- a/plugins/org.eclipse.camf.tosca.editor/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.camf.tosca.editor/META-INF/MANIFEST.MF
@@ -4,14 +4,13 @@
 Bundle-SymbolicName: org.eclipse.camf.tosca.editor;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-ClassPath: .
-Bundle-Activator: org.eclipse.camf.tosca.editor.Activator
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.graphiti;bundle-version="0.11.1",
  org.eclipse.graphiti.ui;bundle-version="0.11.1",
- org.eclipse.core.resources;bundle-version="3.8.1",
+ org.eclipse.core.resources;bundle-version="3.8.1";visibility:=reexport,
  org.eclipse.emf.ecore.xmi;visibility:=reexport,
  org.eclipse.emf.edit.ui;visibility:=reexport,
  org.eclipse.camf.core;bundle-version="1.0.0",
@@ -23,7 +22,7 @@
  org.eclipse.emf.transaction;bundle-version="1.4.0",
  org.eclipse.emf.ecore.edit;bundle-version="2.8.0",
  org.eclipse.gef;bundle-version="3.9.0",
- org.eclipse.ui.ide;bundle-version="3.8.2",
+ org.eclipse.ui.ide;bundle-version="3.8.2";visibility:=reexport,
  org.eclipse.jdt.core;bundle-version="3.9.2",
  org.eclipse.jdt.ui;bundle-version="3.9.2",
  org.eclipse.jdt.launching;bundle-version="3.7.1",
@@ -35,7 +34,8 @@
  org.eclipse.camf.infosystem.mockup.info,
  org.eclipse.core.filesystem,
  org.eclipse.core.internal.filesystem.local,
- org.eclipse.ui.part
+ org.eclipse.ui.part,
+ org.json
 Export-Package: org.eclipse.camf.tosca.editor,
  org.eclipse.camf.tosca.editor.diagram,
  org.eclipse.camf.tosca.editor.dialog,
diff --git a/plugins/org.eclipse.camf.tosca.editor/icons/full/obj16/SyblModelFile.gif b/plugins/org.eclipse.camf.tosca.editor/icons/full/obj16/SyblModelFile.gif
new file mode 100644
index 0000000..689b728
--- /dev/null
+++ b/plugins/org.eclipse.camf.tosca.editor/icons/full/obj16/SyblModelFile.gif
Binary files differ
diff --git a/plugins/org.eclipse.camf.tosca.editor/icons/full/wizban/NewSybl.gif b/plugins/org.eclipse.camf.tosca.editor/icons/full/wizban/NewSybl.gif
new file mode 100644
index 0000000..e976e07
--- /dev/null
+++ b/plugins/org.eclipse.camf.tosca.editor/icons/full/wizban/NewSybl.gif
Binary files differ
diff --git a/plugins/org.eclipse.camf.tosca.editor/plugin.properties b/plugins/org.eclipse.camf.tosca.editor/plugin.properties
index 16aec18..5210419 100644
--- a/plugins/org.eclipse.camf.tosca.editor/plugin.properties
+++ b/plugins/org.eclipse.camf.tosca.editor/plugin.properties
@@ -73,4 +73,11 @@
 
_UI_ToscaEditor_label = Tosca Model Editor

 
_UI_ToscaEditorFilenameDefaultBase = My

 _UI_ToscaEditorFilenameExtensions = tosca

-

\ No newline at end of file
+


+_UI_SyblEditor_menu = &Sybl Editor

+_UI_SyblModelWizard_label = Sybl Model

+_UI_SyblModelWizard_description = Create a new Sybl model

+
_UI_SyblEditor_label = Sybl Model Editor

+
_UI_SyblEditorFilenameDefaultBase = My

+_UI_SyblEditorFilenameExtensions = sybl

+


diff --git a/plugins/org.eclipse.camf.tosca.editor/plugin.xml b/plugins/org.eclipse.camf.tosca.editor/plugin.xml
index 913a2a5..84ec741 100644
--- a/plugins/org.eclipse.camf.tosca.editor/plugin.xml
+++ b/plugins/org.eclipse.camf.tosca.editor/plugin.xml
@@ -296,6 +296,24 @@
             name="%_UI_Wizard_category"/>
    </extension>
 
+   <extension point="org.eclipse.ui.editors">
+      <!-- @generated elasticity -->
+      <editor
+            id="org.example.sybl.presentation.SyblEditorID"
+            name="%_UI_SyblEditor_label"
+            icon="icons/full/obj16/SyblModelFile.gif"
+            extensions="sybl"
+            class="org.example.sybl.presentation.SyblEditor"
+            contributorClass="org.example.sybl.presentation.SyblActionBarContributor">
+      </editor>
+   </extension>
+
+   <extension point="org.eclipse.ui.newWizards">
+      <!-- @generated elasticity -->
+      <category
+            id="org.eclipse.emf.ecore.Wizard.category.ID"
+            name="%_UI_Wizard_category"/>
+   </extension>
 
    <extension point="org.eclipse.ui.editors">
       <!-- @generated elasticity -->
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/ToscaDiagramEditor.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/ToscaDiagramEditor.java
index 565bc92..cd77657 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/ToscaDiagramEditor.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/ToscaDiagramEditor.java
@@ -23,6 +23,7 @@
 import org.eclipse.camf.tosca.DocumentRoot;

 import org.eclipse.camf.tosca.ImplementationArtifactType;

 import org.eclipse.camf.tosca.SourceElementType;

+import org.eclipse.camf.tosca.TArtifactTemplate;

 import org.eclipse.camf.tosca.TDeploymentArtifact;

 import org.eclipse.camf.tosca.TNodeTemplate;

 import org.eclipse.camf.tosca.TNodeTypeImplementation;

@@ -66,6 +67,7 @@
 import org.eclipse.graphiti.mm.pictograms.ContainerShape;

 import org.eclipse.graphiti.mm.pictograms.Diagram;

 import org.eclipse.graphiti.mm.pictograms.PictogramElement;

+import org.eclipse.graphiti.platform.IDiagramBehavior;

 //import org.eclipse.graphiti.services.Graphiti;

 import org.eclipse.graphiti.ui.editor.DiagramEditor;

 import org.eclipse.graphiti.ui.editor.DiagramEditorInput;

@@ -80,527 +82,540 @@
  *

  */

 public class ToscaDiagramEditor extends DiagramEditor {

-  

-  private static GraphicalViewer gViewer;

-  

-  private ToscaModelChangeListener toscaModelChangeListener;

-  

-  private TransactionalEditingDomain transactionalEditingDomain;

-  

-  private static IProject activeProject = null;

-    

-  /**

-   * The Tosca Diagram Editor Constructor.

-   */

-  public ToscaDiagramEditor () {

-    super ();

-  }

-   

-  public static IProject getActiveProject(){

-    

-    return activeProject;

-    

-  }

-  

-  protected void registerBusinessObjectsListener() {

-    

-    this.toscaModelChangeListener = new ToscaModelChangeListener(this);

+	  

+	  private static GraphicalViewer gViewer;

+	  

+	  public static IDiagramBehavior db = null;

+	  

+	  private ToscaModelChangeListener toscaModelChangeListener;

+	  

+	  private TransactionalEditingDomain transactionalEditingDomain;

+	  

+	  private static IProject activeProject = null;

+	    

+	  /**

+	   * The Tosca Diagram Editor Constructor.

+	   */

+	  public ToscaDiagramEditor () {

+		  

+	    super ();

+	    

+	  }

+	   

+	  public static IProject getActiveProject(){

+	    

+	    return activeProject;

+	    

+	  }

+	  

+	  protected void registerBusinessObjectsListener() {

+	    

+	    this.toscaModelChangeListener = new ToscaModelChangeListener(this);

 

-    final TransactionalEditingDomain ted = getEditingDomain();

-    ted.addResourceSetListener(this.toscaModelChangeListener);

-  }

+	    final TransactionalEditingDomain ted = getEditingDomain();

+	    ted.addResourceSetListener(this.toscaModelChangeListener);

+	  }

 

-  /* (non-Javadoc)

-   * @see org.eclipse.graphiti.ui.editor.DiagramEditor#getEditingDomain()

-   */

-  @Override

-  public TransactionalEditingDomain getEditingDomain() {

-    TransactionalEditingDomain ted = super.getEditingDomain();

+	  /* (non-Javadoc)

+	   * @see org.eclipse.graphiti.ui.editor.DiagramEditor#getEditingDomain()

+	   */

+	  @Override

+	  public TransactionalEditingDomain getEditingDomain() {

+	    TransactionalEditingDomain ted = super.getEditingDomain();

 

-    if (ted == null) {

-      ted = this.transactionalEditingDomain;

-    }

+	    if (ted == null) {

+	      ted = this.transactionalEditingDomain;

+	    }

 

-    return ted;

-  }

+	    return ted;

+	  }

 

-  @Override

-  public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {

-    

-    IEditorInput finalInput = null;

+	  @Override

+	  public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {

+	    

+	    IEditorInput finalInput = null;

 

-    try {

-      if (input instanceof ToscaDiagramEditorInput) {

-        finalInput = input;

-      } else {

-        finalInput = createNewDiagramEditorInput(input);

-      }

-    } catch (CoreException exception) {

-      exception.printStackTrace();

-    }

+	    try {

+	      if (input instanceof ToscaDiagramEditorInput) {

+	        finalInput = input;

+	      } else {

+	        finalInput = createNewDiagramEditorInput(input);

+	      }

+	    } catch (CoreException exception) {

+	      exception.printStackTrace();

+	    }

 

-    if ( finalInput instanceof ToscaDiagramEditorInput ){

-      activeProject = ((ToscaDiagramEditorInput) finalInput).getToscaFile().getProject();

-    }

+	    if ( finalInput instanceof ToscaDiagramEditorInput ){

+	      activeProject = ((ToscaDiagramEditorInput) finalInput).getToscaFile().getProject();

+	    }

 

-    super.init(site, finalInput);

-    // Refresh Palette Compartments

-    getDiagramTypeProvider().getFeatureProvider().getDiagramTypeProvider().getDiagramBehavior().refreshPalette();

-    

-  }

-  

+	    super.init(site, finalInput);

+	    // Refresh Palette Compartments

+	    ToscaDiagramEditor.db = getDiagramTypeProvider().getFeatureProvider().getDiagramTypeProvider().getDiagramBehavior();

+	    getDiagramTypeProvider().getFeatureProvider().getDiagramTypeProvider().getDiagramBehavior().refreshPalette();

+	    

+	  }

+	  

 

-  private ToscaDiagramEditorInput createNewDiagramEditorInput(final IEditorInput input) throws CoreException {

+	  private ToscaDiagramEditorInput createNewDiagramEditorInput(final IEditorInput input) throws CoreException {

 

-    final IFile dataFile = ToscaFileService.getDataFileForInput(input);

+	    final IFile dataFile = ToscaFileService.getDataFileForInput(input);

 

-    // now generate the temporary diagram file

-    final IPath dataFilePath = dataFile.getFullPath();

+	    // now generate the temporary diagram file

+	    final IPath dataFilePath = dataFile.getFullPath();

 

-    // get or create the corresponding temporary folder

-    final IFolder tempFolder = ToscaFileService.getOrCreateTempFolder(dataFilePath);

+	    // get or create the corresponding temporary folder

+	    final IFolder tempFolder = ToscaFileService.getOrCreateTempFolder(dataFilePath);

 

-    // finally get the diagram file that corresponds to the data file

-    final IFile diagramFile = ToscaFileService.getTemporaryDiagramFile(dataFilePath, tempFolder);

+	    // finally get the diagram file that corresponds to the data file

+	    final IFile diagramFile = ToscaFileService.getTemporaryDiagramFile(dataFilePath, tempFolder);

 

-    // Create new temporary diagram file

-    ToscaDiagramCreator creator = new ToscaDiagramCreator();

+	    // Create new temporary diagram file

+	    ToscaDiagramCreator creator = new ToscaDiagramCreator();

 

-    return creator.createToscaDiagram(dataFile, diagramFile, this, false);

-  }

-  

-  @Override

-  public void doSave(final IProgressMonitor monitor) {

-    super.doSave(monitor);

-    

-//    final ToscaDiagramEditorInput tdei = (ToscaDiagramEditorInput) getEditorInput();

-    

-    ((BasicCommandStack) getEditingDomain().getCommandStack()).saveIsDone();

-    updateDirtyState();

-  }

-  

-  @Override

-  public boolean isDirty() {

-    TransactionalEditingDomain editingDomain = getEditingDomain();

-    // Check that the editor is not yet disposed

-    if (editingDomain != null && editingDomain.getCommandStack() != null) {

-      return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded();

-    }

-    return false;

-  }

-  

-  @Override

-  protected void setInput(final IEditorInput input) {

-    super.setInput(input);

+	    return creator.createToscaDiagram(dataFile, diagramFile, this, false);

+	  }

+	  

+	  @Override

+	  public void doSave(final IProgressMonitor monitor) {

+	    super.doSave(monitor);

+	    

+//	    final ToscaDiagramEditorInput tdei = (ToscaDiagramEditorInput) getEditorInput();

+	    

+	    ((BasicCommandStack) getEditingDomain().getCommandStack()).saveIsDone();

+	    updateDirtyState();

+	  }

+	  

+	  @Override

+	  public boolean isDirty() {

+	    TransactionalEditingDomain editingDomain = getEditingDomain();

+	    // Check that the editor is not yet disposed

+	    if (editingDomain != null && editingDomain.getCommandStack() != null) {

+	      return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded();

+	    }

+	    return false;

+	  }

+	  

+	  @Override

+	  protected void setInput(final IEditorInput input) {

+	    super.setInput(input);

 

-    final ToscaDiagramEditorInput tdei = (ToscaDiagramEditorInput) input;

-    final IFile dataFile = tdei.getToscaFile();

-    

-    final ToscaModelLayer model = new ToscaModelLayer(getDiagramTypeProvider().getFeatureProvider(), dataFile);

-    ModelHandler.addModel(EcoreUtil.getURI(getDiagramTypeProvider().getDiagram()), model);

-    

-    DocumentRoot documentRoot = null;

-    TOSCAResource toscaResource = null ;

-    ICloudElement findElement = CloudModel.getRoot().findElement( dataFile );

-    if (findElement instanceof TOSCAResource) {

-      toscaResource = (TOSCAResource) findElement;

-    }

-    

-    URI resourceURI = null;

-    //IEditorInput eInput = getEditorInput();

-   

-    if( getEditorInput() instanceof ToscaDiagramEditorInput ) {

-      IFile modelFile = ((ToscaDiagramEditorInput) getEditorInput()).getToscaFile();      

-      resourceURI = URI.createPlatformResourceURI( modelFile.getFullPath().toString(), false );      

-    } 

-    

-    Exception exception = null;

-    Resource resource = null;

-    try {

-      /* Load the resource through the editing domain. */

-      resource = getEditingDomain().getResourceSet().getResource( resourceURI, true );

-    } catch( Exception e ) {

-      exception = e;

-      resource = getEditingDomain().getResourceSet().getResource( resourceURI, false );

-    }

-    Diagnostic diagnostic = analyzeResourceProblems( resource, exception );

-        

-    if( diagnostic.getSeverity() != Diagnostic.OK ) {

-      //todo

-    } else {

-      documentRoot = getDocumentRoot( resource );

-//      documentRoot = toscaResource.getTOSCAModel().getDocumentRoot();

-    }

+	    final ToscaDiagramEditorInput tdei = (ToscaDiagramEditorInput) input;

+	    final IFile dataFile = tdei.getToscaFile();

+	    

+	    final ToscaModelLayer model = new ToscaModelLayer(getDiagramTypeProvider().getFeatureProvider(), dataFile);

+	    ModelHandler.addModel(EcoreUtil.getURI(getDiagramTypeProvider().getDiagram()), model);

+	    

+	    DocumentRoot documentRoot = null;

+	    TOSCAResource toscaResource = null ;

+	    ICloudElement findElement = CloudModel.getRoot().findElement( dataFile );

+	    if (findElement instanceof TOSCAResource) {

+	      toscaResource = (TOSCAResource) findElement;

+	    }

+	    

+	    URI resourceURI = null;

+	    //IEditorInput eInput = getEditorInput();

+	   

+	    if( getEditorInput() instanceof ToscaDiagramEditorInput ) {

+	      IFile modelFile = ((ToscaDiagramEditorInput) getEditorInput()).getToscaFile();      

+	      resourceURI = URI.createPlatformResourceURI( modelFile.getFullPath().toString(), false );      

+	    } 

+	    

+	    Exception exception = null;

+	    Resource resource = null;

+	    try {

+	      /* Load the resource through the editing domain. */

+	      resource = getEditingDomain().getResourceSet().getResource( resourceURI, true );

+	    } catch( Exception e ) {

+	      exception = e;

+	      resource = getEditingDomain().getResourceSet().getResource( resourceURI, false );

+	    }

+	    Diagnostic diagnostic = analyzeResourceProblems( resource, exception );

+	        

+	    if( diagnostic.getSeverity() != Diagnostic.OK ) {

+	      //todo

+	    } else {

+	      documentRoot = getDocumentRoot( resource );

+//	      documentRoot = toscaResource.getTOSCAModel().getDocumentRoot();

+	    }

 

-    

-    if( documentRoot != null ) {

-      model.setDocumentRoot( documentRoot );

-      BasicCommandStack basicCommandStack = ( BasicCommandStack )getEditingDomain().getCommandStack();

-      if( input instanceof DiagramEditorInput ) {

-        basicCommandStack.execute( new RecordingCommand( getEditingDomain() ) {

+	    

+	    if( documentRoot != null ) {

+	      model.setDocumentRoot( documentRoot );

+	      BasicCommandStack basicCommandStack = ( BasicCommandStack )getEditingDomain().getCommandStack();

+	      if( input instanceof DiagramEditorInput ) {

+	        basicCommandStack.execute( new RecordingCommand( getEditingDomain() ) {

 

-          @Override

-          protected void doExecute() {

-            importDiagram( model );

-          }

-        } );

-      }

-      basicCommandStack.saveIsDone();

-      basicCommandStack.flush();

-    }

-  }

-  

-  private final DocumentRoot getDocumentRoot( final Resource resource ) {

-    // Get an iterator to iterate through all contents of the resource.

-    TreeIterator<EObject> iterator = resource.getAllContents();

-    DocumentRoot result = null;

-    while( iterator.hasNext() ) {

-      EObject testElement = iterator.next();

-      /*

-       * Instance-of checks for each EObject that appears in the resource. We

-       * want to get the DocumentRoot EObject which is the root Element inside a

-       * Tosca Document.

-       */

-      if( testElement instanceof DocumentRoot ) {

-        result = ( DocumentRoot ) testElement;

-      }

-    }

-    return result;

-  }

-  

-  

-  /**

-   * @param resource

-   * @param exception

-   * @return

-   */

-  private Diagnostic analyzeResourceProblems( final Resource resource,

-                                             final Exception exception )

-  {

-    Diagnostic basicDiagnostic = null;

-    if( !resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty() ) {

-      basicDiagnostic = new BasicDiagnostic( Diagnostic.ERROR,

-                                             Activator.PLUGIN_ID,

-                                             0,

-                                             String.format( Messages.getString( "ToscaEditor.CreateModelErrorMessage" ), //$NON-NLS-1$

-                                                            resource.getURI() ),

-                                             new Object[]{

-                                               exception == null

-                                                                ? ( Object )resource

-                                                                : exception

-                                             } );

-      ( ( BasicDiagnostic )basicDiagnostic ).merge( EcoreUtil.computeDiagnostic( resource,

-                                                                                 true ) );

-    } else if( exception != null ) {

-      basicDiagnostic = new BasicDiagnostic( Diagnostic.ERROR,

-                                             Activator.PLUGIN_ID,

-                                             0,

-                                             Messages.getString( "ToscaEditor.CreateModelErrorMessage" ), //$NON-NLS-1$

-                                             new Object[]{

-                                               exception

-                                             } );

-    } else {

-      basicDiagnostic = Diagnostic.OK_INSTANCE;

-    }

-    return basicDiagnostic;

-  }

-  

-  

-  protected void importDiagram( final ToscaModelLayer model ) {

-    final Diagram diagram = getDiagramTypeProvider().getDiagram();

-    diagram.setActive( true );

-    getEditingDomain().getCommandStack()

-      .execute( new RecordingCommand( getEditingDomain() ) {

+	          @Override

+	          protected void doExecute() {

+	            importDiagram( model );

+	          }

+	        } );

+	      }

+	      basicCommandStack.saveIsDone();

+	      basicCommandStack.flush();

+	    }

+	  }

+	  

+	  private final DocumentRoot getDocumentRoot( final Resource resource ) {

+	    // Get an iterator to iterate through all contents of the resource.

+	    TreeIterator<EObject> iterator = resource.getAllContents();

+	    DocumentRoot result = null;

+	    while( iterator.hasNext() ) {

+	      EObject testElement = iterator.next();

+	      /*

+	       * Instance-of checks for each EObject that appears in the resource. We

+	       * want to get the DocumentRoot EObject which is the root Element inside a

+	       * Tosca Document.

+	       */

+	      if( testElement instanceof DocumentRoot ) {

+	        result = ( DocumentRoot ) testElement;

+	      }

+	    }

+	    return result;

+	  }

+	  

+	  

+	  /**

+	   * @param resource

+	   * @param exception

+	   * @return

+	   */

+	  private Diagnostic analyzeResourceProblems( final Resource resource,

+	                                             final Exception exception )

+	  {

+	    Diagnostic basicDiagnostic = null;

+	    if( !resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty() ) {

+	      basicDiagnostic = new BasicDiagnostic( Diagnostic.ERROR,

+	                                             Activator.PLUGIN_ID,

+	                                             0,

+	                                             String.format( Messages.getString( "ToscaEditor.CreateModelErrorMessage" ), //$NON-NLS-1$

+	                                                            resource.getURI() ),

+	                                             new Object[]{

+	                                               exception == null

+	                                                                ? ( Object )resource

+	                                                                : exception

+	                                             } );

+	      ( ( BasicDiagnostic )basicDiagnostic ).merge( EcoreUtil.computeDiagnostic( resource,

+	                                                                                 true ) );

+	    } else if( exception != null ) {

+	      basicDiagnostic = new BasicDiagnostic( Diagnostic.ERROR,

+	                                             Activator.PLUGIN_ID,

+	                                             0,

+	                                             Messages.getString( "ToscaEditor.CreateModelErrorMessage" ), //$NON-NLS-1$

+	                                             new Object[]{

+	                                               exception

+	                                             } );

+	    } else {

+	      basicDiagnostic = Diagnostic.OK_INSTANCE;

+	    }

+	    return basicDiagnostic;

+	  }

+	  

+	  

+	  protected void importDiagram( final ToscaModelLayer model ) {

+	    final Diagram diagram = getDiagramTypeProvider().getDiagram();

+	    diagram.setActive( true );

+	    getEditingDomain().getCommandStack()

+	      .execute( new RecordingCommand( getEditingDomain() ) {

 

-        @Override

-        protected void doExecute() {

-          if (model.getDocumentRoot() != null) {

-            DocumentRoot documentRoot = model.getDocumentRoot();

-            DefinitionsType definitionsType = documentRoot.getDefinitions();

-            EList<TServiceTemplate> serviceTemplates = definitionsType.getServiceTemplate();

-            EList<TNodeTypeImplementation> nodeTypesImplementation = definitionsType.getNodeTypeImplementation();

-                        

-            Boolean substitute = false;

-            ContainerShape containerShapeTST = null;

-            

-            for (TServiceTemplate tst : serviceTemplates) { 

-                

-              if ( tst.getSubstitutableNodeType() != null ){

-                //tst is a group component

-                TServiceTemplateExtension tstG = (TServiceTemplateExtension) tst;

-                addContainerElement (tst, containerShapeTST, tstG.getX(), tstG.getY(), tstG.getWidth(), tstG.getHeight());

-                substitute = true;

-              }

-              

-              else{

-                TServiceTemplateExtension tste = (TServiceTemplateExtension) tst;

-                addContainerElement (tst, diagram, 0, 0, tste.getWidth(), tste.getHeight());

-                containerShapeTST = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

-                    .getPictogramElementForBusinessObject( tst );

-              }

-              

-              ContainerShape containerShape = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

-                .getPictogramElementForBusinessObject( tst ); 

-              

-              TTopologyTemplate topology = tst.getTopologyTemplate();

-              

-              if (topology == null)

-                break;

-                           

-                for (TNodeTemplate tnt : topology.getNodeTemplate()) {

+	        @Override

+	        protected void doExecute() {

+	          if (model.getDocumentRoot() != null) {

+	            DocumentRoot documentRoot = model.getDocumentRoot();

+	            DefinitionsType definitionsType = documentRoot.getDefinitions();

+	            EList<TServiceTemplate> serviceTemplates = definitionsType.getServiceTemplate();

+	            EList<TNodeTypeImplementation> nodeTypesImplementation = definitionsType.getNodeTypeImplementation();

+	            EList<TArtifactTemplate> artifactTemplates = definitionsType.getArtifactTemplate();        

+	            

+	            Boolean substitute = false;

+	            ContainerShape containerShapeTST = null;

+	            

+	            for (TServiceTemplate tst : serviceTemplates) { 

+	                

+	              if ( tst.getSubstitutableNodeType() != null ){

+	                //tst is a group component

+	                TServiceTemplateExtension tstG = (TServiceTemplateExtension) tst;

+	                addContainerElement (tst, containerShapeTST, tstG.getX(), tstG.getY(), tstG.getWidth(), tstG.getHeight());

+	                substitute = true;

+	              }

+	              

+	              else{

+	                TServiceTemplateExtension tste = (TServiceTemplateExtension) tst;

+	                addContainerElement (tst, diagram, 0, 0, tste.getWidth(), tste.getHeight());

+	                containerShapeTST = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

+	                    .getPictogramElementForBusinessObject( tst );

+	              }

+	              

+	              ContainerShape containerShape = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

+	                .getPictogramElementForBusinessObject( tst ); 

+	              

+	              TTopologyTemplate topology = tst.getTopologyTemplate();

+	              

+	              if (topology == null)

+	                break;

+	                           

+	                for (TNodeTemplate tnt : topology.getNodeTemplate()) {

 

-                  if ( (tnt.getType()!=null) && (tnt.getType().toString().contains( "substituteNode" )) ) {//$NON-NLS-1$

-                    continue;

-                  }

-                  

-                  TNodeTemplateExtension tnte = (TNodeTemplateExtension) tnt;

-                  addContainerElement( tnt, containerShape, tnte.getX(), tnte.getY(), tnte.getWidth(), tnte.getHeight() );

-                  

-                  ContainerShape containerShapeTNT = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

-                      .getPictogramElementForBusinessObject( tnt ); 

-                  

-                  //Add Deployment Artifacts

-                  if ( tnt.getDeploymentArtifacts() != null && tnt.getDeploymentArtifacts().getDeploymentArtifact() != null ){

-                      for (TDeploymentArtifact tda : tnt.getDeploymentArtifacts().getDeploymentArtifact() ){

+	                  if ( (tnt.getType()!=null) && (tnt.getType().toString().contains( "substituteNode" )) ) {//$NON-NLS-1$

+	                    continue;

+	                  }

+	                  

+	                  TNodeTemplateExtension tnte = (TNodeTemplateExtension) tnt;

+	                  addContainerElement( tnt, containerShape, tnte.getX(), tnte.getY(), tnte.getWidth(), tnte.getHeight() );

+	                  

+	                  ContainerShape containerShapeTNT = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

+	                      .getPictogramElementForBusinessObject( tnt ); 

+	                  

+	                  //Add Deployment Artifacts

+	                  if ( tnt.getDeploymentArtifacts() != null && tnt.getDeploymentArtifacts().getDeploymentArtifact() != null ){

+	                      for (TDeploymentArtifact tda : tnt.getDeploymentArtifacts().getDeploymentArtifact() ){

 

-                                addContainerElement( tda, containerShapeTNT, 0, 0, 0, 0 );

-                          

-                      }

-                  }

-                  

-//                  //Find NodeTypeImplementation

-//                  TNodeTypeImplementation nodeTypeImplementation = null;

-//                  for (TNodeTypeImplementation tempNodeImplementation : nodeTypesImplementation){

-//                    if (tnt.getName().equals( tempNodeImplementation.getNodeType().toString())){

-//                      nodeTypeImplementation = tempNodeImplementation;

-//                      break;

-//                    }

-//                  }

-//                  if (nodeTypeImplementation!=null && nodeTypeImplementation.getImplementationArtifacts()!=null){

-//                    EList<ImplementationArtifactType> implementationArtifacts = nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact();

-//                    for (ImplementationArtifactType tempImplementationArtifact : implementationArtifacts){

-//                      addContainerElement( tempImplementationArtifact, containerShapeTNT, 0, 0, 0, 0 );

-//                    }

-//                  }

- 

-                }                

-                

-                if ( substitute ){

-                  //Composite Component Service Template

-                  //Add deployment artifacts to composite component's service template

-                  

-                  for (TServiceTemplate tempTst : serviceTemplates) { 

-                    for (TNodeTemplate tnt : tempTst.getTopologyTemplate().getNodeTemplate()) {

-  

-                          

-                          if ( tst.getSubstitutableNodeType() != null && (tnt.getType()!=null) && tnt.getType().toString().equals( tst.getSubstitutableNodeType().toString()) ){

-                            //Found the service template that substitutes the specific node template

-                            

-                            ContainerShape containerShapeTNT = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

-                                .getPictogramElementForBusinessObject( tst ); 

-                            

-                            //Add Deployment Artifacts

-                            if ( tnt.getDeploymentArtifacts() != null && tnt.getDeploymentArtifacts().getDeploymentArtifact() != null ){

-                                for (TDeploymentArtifact tda : tnt.getDeploymentArtifacts().getDeploymentArtifact() ){

+	                                addContainerElement( tda, containerShapeTNT, 0, 0, 0, 0 );

+	                          

+	                      }

+	                  }

+	                  

+	                  //Find NodeTypeImplementation

+	                  TNodeTypeImplementation nodeTypeImplementation = null;

+	                  for (TNodeTypeImplementation tempNodeImplementation : nodeTypesImplementation){

+	                    if (tnt.getName().equals( tempNodeImplementation.getNodeType().toString())){

+	                      nodeTypeImplementation = tempNodeImplementation;

+	                      break;

+	                    }

+	                  }

+	                  if (nodeTypeImplementation!=null && nodeTypeImplementation.getImplementationArtifacts()!=null){

+	                    EList<ImplementationArtifactType> implementationArtifacts = nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact();

+	                    for (ImplementationArtifactType tempImplementationArtifact : implementationArtifacts){

+	                      if (tempImplementationArtifact.getOperationName().equals( "execute" ))

+	                      {

+	                        for (TArtifactTemplate tempArtifactTemplate : artifactTemplates){

+	                          if (tempArtifactTemplate.getId().equals(tempImplementationArtifact.getArtifactRef().toString()))

+	                            addContainerElement( tempArtifactTemplate, containerShapeTNT, 0, 0, 0, 0 );

+	                        }

+	                      }

+	     

+	                    }

+	                  }

+	 

+	                }                

+	                

+	                if ( substitute ){

+	                  //Composite Component Service Template

+	                  //Add deployment artifacts to composite component's service template

+	                  

+	                  for (TServiceTemplate tempTst : serviceTemplates) { 

+	                    for (TNodeTemplate tnt : tempTst.getTopologyTemplate().getNodeTemplate()) {

+	  

+	                          

+	                          if ( tst.getSubstitutableNodeType() != null && (tnt.getType()!=null) && tnt.getType().toString().equals( tst.getSubstitutableNodeType().toString()) ){

+	                            //Found the service template that substitutes the specific node template

+	                            

+	                            ContainerShape containerShapeTNT = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

+	                                .getPictogramElementForBusinessObject( tst ); 

+	                            

+	                            //Add Deployment Artifacts

+	                            if ( tnt.getDeploymentArtifacts() != null && tnt.getDeploymentArtifacts().getDeploymentArtifact() != null ){

+	                                for (TDeploymentArtifact tda : tnt.getDeploymentArtifacts().getDeploymentArtifact() ){

 

-                                          addContainerElement( tda, containerShapeTNT, 0, 0, 0, 0 );

-                                    

-                                }

-                            } 

-                            break;

-                          }

-                        

-                      

-                    }

-                  }

-                  substitute = false;

-                }

-                else{

-                  //Application Service Template

-                  //Add deployment artifacts to application's service template

-                  

-                }

+	                                          addContainerElement( tda, containerShapeTNT, 0, 0, 0, 0 );

+	                                    

+	                                }

+	                            } 

+	                            break;

+	                          }

+	                        

+	                      

+	                    }

+	                  }

+	                  substitute = false;

+	                }

+	                else{

+	                  //Application Service Template

+	                  //Add deployment artifacts to application's service template

+	                  

+	                }

 

-            }

-            

-            //Add Relationships

-            for (TServiceTemplate tst : serviceTemplates) { 

-              

-              if ( tst.getTopologyTemplate() == null )

-                continue;

-              

-              for (TRelationshipTemplate trt : tst.getTopologyTemplate().getRelationshipTemplate()) {    

-                  

-               SourceElementType se = trt.getSourceElement();

-               TargetElementType te = trt.getTargetElement();

-               String sourceID = se.getRef();

-               String targetID = te.getRef();

-               Anchor sourceAnchor = null, targetAnchor = null;

-               for (TServiceTemplate tstTemp : serviceTemplates) {

-                   for (TNodeTemplate tnt : tstTemp.getTopologyTemplate().getNodeTemplate()) {

-                     

-                       ContainerShape containerShapeTNT;

-                       

-                       if ( tnt.getId().equals(sourceID) ){

-                           if ( (tnt.getType()!=null) && (tnt.getType().toString().contains( "substituteNode" ) == true) ){

-                               containerShapeTNT = getAnchorContainer(model, tnt);

-                           }else{

-                               containerShapeTNT = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

-                                       .getPictogramElementForBusinessObject( tnt ); 

-                           }

-                           if ( containerShapeTNT.getAnchors() != null ){

-                                for ( Anchor anchor : containerShapeTNT.getAnchors() ){

-                                    if (anchor instanceof ChopboxAnchor){

-                                        sourceAnchor = anchor;

-                                        break;

-                                    }

-                                }

-                           }

-                      

-                       } else if ( tnt.getId().equals(targetID) ){

-                           if ( ((tnt.getType()!=null)) && (tnt.getType().toString().contains( "substituteNode" ) == true) ){

-                               containerShapeTNT = getAnchorContainer(model, tnt);

-                           }else{

-                               containerShapeTNT = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

-                                       .getPictogramElementForBusinessObject( tnt ); 

-                           }

-                           if ( containerShapeTNT.getAnchors() != null ){

-                                for ( Anchor anchor : containerShapeTNT.getAnchors() ){

-                                    if (anchor instanceof ChopboxAnchor){

-                                        targetAnchor = anchor;

-                                        break;

-                                    }

-                                }

-                           }

-                       }

-                   }

-               }

-       

-                

-               addRelationshipContainerElement( trt, sourceAnchor, targetAnchor );

-              }

-          }

-          }

-        }

+	            }

+	            

+	            //Add Relationships

+	            for (TServiceTemplate tst : serviceTemplates) { 

+	              

+	              if ( tst.getTopologyTemplate() == null )

+	                continue;

+	              

+	              for (TRelationshipTemplate trt : tst.getTopologyTemplate().getRelationshipTemplate()) {    

+	                  

+	               SourceElementType se = trt.getSourceElement();

+	               TargetElementType te = trt.getTargetElement();

+	               String sourceID = se.getRef();

+	               String targetID = te.getRef();

+	               Anchor sourceAnchor = null, targetAnchor = null;

+	               for (TServiceTemplate tstTemp : serviceTemplates) {

+	                   for (TNodeTemplate tnt : tstTemp.getTopologyTemplate().getNodeTemplate()) {

+	                     

+	                       ContainerShape containerShapeTNT;

+	                       

+	                       if ( tnt.getId().equals(sourceID) ){

+	                           if ( (tnt.getType()!=null) && (tnt.getType().toString().contains( "substituteNode" ) == true) ){

+	                               containerShapeTNT = getAnchorContainer(model, tnt);

+	                           }else{

+	                               containerShapeTNT = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

+	                                       .getPictogramElementForBusinessObject( tnt ); 

+	                           }

+	                           if ( containerShapeTNT.getAnchors() != null ){

+	                                for ( Anchor anchor : containerShapeTNT.getAnchors() ){

+	                                    if (anchor instanceof ChopboxAnchor){

+	                                        sourceAnchor = anchor;

+	                                        break;

+	                                    }

+	                                }

+	                           }

+	                      

+	                       } else if ( tnt.getId().equals(targetID) ){

+	                           if ( ((tnt.getType()!=null)) && (tnt.getType().toString().contains( "substituteNode" ) == true) ){

+	                               containerShapeTNT = getAnchorContainer(model, tnt);

+	                           }else{

+	                               containerShapeTNT = ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

+	                                       .getPictogramElementForBusinessObject( tnt ); 

+	                           }

+	                           if ( containerShapeTNT.getAnchors() != null ){

+	                                for ( Anchor anchor : containerShapeTNT.getAnchors() ){

+	                                    if (anchor instanceof ChopboxAnchor){

+	                                        targetAnchor = anchor;

+	                                        break;

+	                                    }

+	                                }

+	                           }

+	                       }

+	                   }

+	               }

+	       

+	                

+	               addRelationshipContainerElement( trt, sourceAnchor, targetAnchor );

+	              }

+	          }

+	          }

+	        }

 

-      } );

-  }

-  

-  

-  private ContainerShape getAnchorContainer(final ToscaModelLayer model, TNodeTemplate nodeTemplate){

-        // Find the substitute TServiceTemplate

-      TServiceTemplate substituteNode = null;

+	      } );

+	  }

+	  

+	  

+	  private ContainerShape getAnchorContainer(final ToscaModelLayer model, TNodeTemplate nodeTemplate){

+	        // Find the substitute TServiceTemplate

+	      TServiceTemplate substituteNode = null;

 

-        for (TServiceTemplate tempServiceTemplate : model.getDocumentRoot()

-          .getDefinitions()

-          .getServiceTemplate()){

-           

-          if (tempServiceTemplate.getSubstitutableNodeType() != null &&

-                  tempServiceTemplate.getId().equals(nodeTemplate.getId())) 

-          {

-            substituteNode = tempServiceTemplate;

-            break;

-          }

-        }

-        return ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

-                .getPictogramElementForBusinessObject( substituteNode ); 

-  }

-  

-  protected PictogramElement addContainerElement( final EObject element,

-                                                  final ContainerShape parent, int x_axis, int y_axis, int width, int height )

-  {

-    

-    final IFeatureProvider featureProvider = getDiagramTypeProvider().getFeatureProvider();

-    

-    AddContext context = new AddContext( new AreaContext(), element );

-    IAddFeature addFeature = featureProvider.getAddFeature( context );

-    context.setNewObject( element );    

-    context.setTargetContainer( parent );

-    context.setLocation(x_axis, y_axis);

-    context.setSize( width, height );

-    PictogramElement pictElement = null;

-    

-    boolean canAdd  = false;

-    if (addFeature != null) {

-      canAdd = addFeature.canAdd( context ) ;

-    }

-      

-    if( canAdd ) {

-      pictElement = addFeature.add( context );

-      

-      if (element instanceof TDeploymentArtifact && ((TDeploymentArtifact) element).getArtifactType().toString().compareTo( "MonitoringProbe" )==0){

-        //There is no pictogram element linked to the monitoring image

-        return pictElement;

-      }    

-      else{

-        featureProvider.link( pictElement, new Object[]{ element } );

-        return pictElement;

-      }

-    }

-    

-    return null;

+	        for (TServiceTemplate tempServiceTemplate : model.getDocumentRoot()

+	          .getDefinitions()

+	          .getServiceTemplate()){

+	           

+	          if (tempServiceTemplate.getSubstitutableNodeType() != null &&

+	                  tempServiceTemplate.getId().equals(nodeTemplate.getId())) 

+	          {

+	            substituteNode = tempServiceTemplate;

+	            break;

+	          }

+	        }

+	        return ( ContainerShape )getDiagramTypeProvider().getFeatureProvider()

+	                .getPictogramElementForBusinessObject( substituteNode ); 

+	  }

+	  

+	  protected PictogramElement addContainerElement( final EObject element,

+	                                                  final ContainerShape parent, int x_axis, int y_axis, int width, int height )

+	  {

+	    

+	    final IFeatureProvider featureProvider = getDiagramTypeProvider().getFeatureProvider();

+	    

+	    AddContext context = new AddContext( new AreaContext(), element );

+	    IAddFeature addFeature = featureProvider.getAddFeature( context );

+	    context.setNewObject( element );    

+	    context.setTargetContainer( parent );

+	    context.setLocation(x_axis, y_axis);

+	    context.setSize( width, height );

+	    PictogramElement pictElement = null;

+	    

+	    boolean canAdd  = false;

+	    if (addFeature != null) {

+	      canAdd = addFeature.canAdd( context ) ;

+	    }

+	      

+	    if( canAdd ) {

+	      pictElement = addFeature.add( context );

+	      

+	      if (element instanceof TDeploymentArtifact && ((TDeploymentArtifact) element).getArtifactType().toString().compareTo( "MonitoringProbe" )==0){

+	        //There is no pictogram element linked to the monitoring image

+	        return pictElement;

+	      }    

+	      else{

+	        featureProvider.link( pictElement, new Object[]{ element } );

+	        return pictElement;

+	      }

+	    }

+	    

+	    return null;

 

-  }

+	  }

 

-  protected PictogramElement addRelationshipContainerElement( final EObject element,

-          final Anchor sourceAnchor, final Anchor targetAnchor ){

-      

-      if (sourceAnchor == null)

-          return null;

-      

-      if (targetAnchor == null)

-          return null;

-      

-      AddConnectionContext context = new AddConnectionContext(sourceAnchor, targetAnchor);

-      context.setNewObject( element );

-      

-      final IFeatureProvider featureProvider = getDiagramTypeProvider().getFeatureProvider();

-      IAddFeature addFeature = featureProvider.getAddFeature( context );

-      

-        PictogramElement pictElement = null;

-        

-        boolean canAdd = addFeature.canAdd( context ) ;

-            

-        if( canAdd ) {

-          pictElement = addFeature.add( context );

-          featureProvider.link( pictElement, new Object[]{ element } );

-        }

-        

-        return pictElement;

+	  protected PictogramElement addRelationshipContainerElement( final EObject element,

+	          final Anchor sourceAnchor, final Anchor targetAnchor ){

+	      

+	      if (sourceAnchor == null)

+	          return null;

+	      

+	      if (targetAnchor == null)

+	          return null;

+	      

+	      AddConnectionContext context = new AddConnectionContext(sourceAnchor, targetAnchor);

+	      context.setNewObject( element );

+	      

+	      final IFeatureProvider featureProvider = getDiagramTypeProvider().getFeatureProvider();

+	      IAddFeature addFeature = featureProvider.getAddFeature( context );

+	      

+	        PictogramElement pictElement = null;

+	        

+	        boolean canAdd = addFeature.canAdd( context ) ;

+	            

+	        if( canAdd ) {

+	          pictElement = addFeature.add( context );

+	          featureProvider.link( pictElement, new Object[]{ element } );

+	        }

+	        

+	        return pictElement;

 

-  }

+	  }

 

-  

-  

-  @Override

-  public void createPartControl(Composite parent) {

-    super.createPartControl(parent);

-    // hides grid on diagram, but you can reenable it

-    if (getGraphicalViewer() != null && getGraphicalViewer().getEditPartRegistry() != null) {

-      ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) getGraphicalViewer().getEditPartRegistry().get(LayerManager.ID);

-      IFigure gridFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.GRID_LAYER);

-      gridFigure.setVisible(true);

-    }

-    // setPartName("MyDiagram2");

-  }

+	  

+	  

+	  @Override

+	  public void createPartControl(Composite parent) {

+	    super.createPartControl(parent);

+	    // hides grid on diagram, but you can reenable it

+	    if (getGraphicalViewer() != null && getGraphicalViewer().getEditPartRegistry() != null) {

+	      ScalableFreeformRootEditPart rootEditPart = (ScalableFreeformRootEditPart) getGraphicalViewer().getEditPartRegistry().get(LayerManager.ID);

+	      IFigure gridFigure = ((LayerManager) rootEditPart).getLayer(LayerConstants.GRID_LAYER);

+	      gridFigure.setVisible(true);

+	    }

+	    // setPartName("MyDiagram2");

+	  }

 

-//  @Override

-//  protected ContextMenuProvider createContextMenuProvider() {

-//    return new ActivitiEditorContextMenuProvider(getGraphicalViewer(), getActionRegistry(), getDiagramTypeProvider());

-//  }

+	//  @Override

+	//  protected ContextMenuProvider createContextMenuProvider() {

+//	    return new ActivitiEditorContextMenuProvider(getGraphicalViewer(), getActionRegistry(), getDiagramTypeProvider());

+	//  }

 

-  public static GraphicalViewer getActiveGraphicalViewer() {

-    return gViewer;

-  }

+	  public static GraphicalViewer getActiveGraphicalViewer() {

+	    return gViewer;

+	  }

 

-  @Override

-  public void dispose() {

-    super.dispose();

+	  @Override

+	  public void dispose() {

+	    super.dispose();

 

-    final ToscaDiagramEditorInput tdei = (ToscaDiagramEditorInput) getEditorInput();

+	    final ToscaDiagramEditorInput tdei = (ToscaDiagramEditorInput) getEditorInput();

 

-    ModelHandler.removeModel(EcoreUtil.getURI(getDiagramTypeProvider().getDiagram()));

-    ToscaDiagramCreator.dispose(tdei.getDiagramFile());

-  }

-  

-}

+	    ModelHandler.removeModel(EcoreUtil.getURI(getDiagramTypeProvider().getDiagram()));

+	    ToscaDiagramCreator.dispose(tdei.getDiagramFile());

+	  }

+	  

+	}

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/diagram/ToscaFeatureProvider.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/diagram/ToscaFeatureProvider.java
index fa033fd..4f8ab45 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/diagram/ToscaFeatureProvider.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/diagram/ToscaFeatureProvider.java
@@ -111,35 +111,46 @@
   public IAddFeature getAddFeature( final IAddContext context ) {

     if( context.getNewObject() instanceof TNodeTemplate ) {

       return new AddApplicationComponentFeature( this );

-    } 

-//    else if( context.getNewObject() instanceof TRelationshipTemplate

-//               && ( ( TRelationshipTemplate )context.getNewObject() ).getType().toString().compareTo("Bidirected") == 0 ) //$NON-NLS-1$

-//    {

-//      return new AddBidirectionalRelationFeature( this );

-//    }

+    }

+    // else if( context.getNewObject() instanceof TRelationshipTemplate

+    //               && ( ( TRelationshipTemplate )context.getNewObject() ).getType().toString().compareTo("Bidirected") == 0 ) //$NON-NLS-1$

+    // {

+    // return new AddBidirectionalRelationFeature( this );

+    // }

     else if( context.getNewObject() instanceof TRelationshipTemplate ) {

       return new AddDirectedRelationFeature( this );

-    } else if( context.getNewObject() instanceof TDeploymentArtifact ) {      

-      if (((TDeploymentArtifact)context.getNewObject()).getArtifactType().toString().compareTo( "UA" )==0)

-          return new AddUserApplicationFeature( this );

-      else if (((TDeploymentArtifact)context.getNewObject()).getArtifactType().toString().compareTo( "SD" )==0)

-          return new AddSoftwareDependencyFeature( this );

-      else if (((TDeploymentArtifact)context.getNewObject()).getArtifactType().toString().compareTo( "VMI" )==0)

-          return new AddVirtualMachineFeature( this );

-      else if (((TDeploymentArtifact)context.getNewObject()).getArtifactType().toString().compareTo( "KeyPair" )==0)

+    } else if( context.getNewObject() instanceof TDeploymentArtifact ) {

+      if( ( ( TDeploymentArtifact )context.getNewObject() ).getArtifactType()

+        .toString()

+        .compareTo( "UA" ) == 0 )

+        return new AddUserApplicationFeature( this );

+      else if( ( ( TDeploymentArtifact )context.getNewObject() ).getArtifactType()

+        .toString()

+        .compareTo( "SD" ) == 0 )

+        return new AddSoftwareDependencyFeature( this );

+      else if( ( ( TDeploymentArtifact )context.getNewObject() ).getArtifactType()

+        .toString()

+        .compareTo( "VMI" ) == 0 )

+        return new AddVirtualMachineFeature( this );

+      else if( ( ( TDeploymentArtifact )context.getNewObject() ).getArtifactType()

+        .toString()

+        .compareTo( "KeyPair" ) == 0 )

         return new AddKeyPairFeature( this );

-      else if (((TDeploymentArtifact)context.getNewObject()).getArtifactType().toString().compareTo( "Network" )==0)

+      else if( ( ( TDeploymentArtifact )context.getNewObject() ).getArtifactType()

+        .toString()

+        .compareTo( "Network" ) == 0 )

         return new AddNetworkFeature( this );

-      else if (((TDeploymentArtifact)context.getNewObject()).getArtifactType().toString().compareTo( "MonitoringProbe" )==0)

+      else if( ( ( TDeploymentArtifact )context.getNewObject() ).getArtifactType()

+        .toString()

+        .compareTo( "MonitoringProbe" ) == 0 )

         return new AddMonitorProbeFeature( this );

-      

-    } else if( context.getNewObject() instanceof ResourceCloudElement) {            

-      return getIFileFeature(context);

-    } else if (context.getNewObject() instanceof VirtualMachineImage ){

+    } else if( context.getNewObject() instanceof ResourceCloudElement ) {

+      return getIFileFeature( context );

+    } else if( context.getNewObject() instanceof VirtualMachineImage ) {

       return new AddVirtualMachineFeature( this );

-    } else if (context.getNewObject() instanceof KeyPair ){

+    } else if( context.getNewObject() instanceof KeyPair ) {

       return new AddKeyPairFeature( this );

-    } else if (context.getNewObject() instanceof VirtualNetwork ){

+    } else if( context.getNewObject() instanceof VirtualNetwork ) {

       return new AddNetworkFeature( this );

     } else if( context.getNewObject() instanceof ResizingAction ) {

       return new AddResizingActionFeature( this );

@@ -149,65 +160,50 @@
       return new AddSecurityGroupFeature( this );

     } else if( context.getNewObject() instanceof MonitoringProbe ) {

       return new AddMonitorProbeFeature( this );

-    } 

+    }

     // its a substitutional Service Template

     else if( context.getNewObject() instanceof TServiceTemplate

-        && ( ( TServiceTemplate )context.getNewObject() ).getSubstitutableNodeType() != null )

+             && ( ( TServiceTemplate )context.getNewObject() ).getSubstitutableNodeType() != null )

     {

       return new AddGroupFeature( this );

     } else if( context.getNewObject() instanceof TServiceTemplate ) {

       return new AddServiceTemplateFeature( this );

-    } 

+    }

     return super.getAddFeature( context );

   }

 

   /**

    * @return

    */

-	private AbstractAddShapeFeature getIFileFeature(final IAddContext context) {

-		ResourceCloudElement element = (ResourceCloudElement) context

-				.getNewObject();

-		AbstractAddShapeFeature result = null;

-

-		String extension = element.getResource().getFileExtension();

-		

-		TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE

-				.createTDeploymentArtifact();

-		deploymentArtifact.setName(element.getName());

-		CreateContext createContext = new CreateContext();

-		createContext.setTargetContainer(context.getTargetContainer());

-

-		if (extension.equals("pub")) { //$NON-NLS-1$

-			// Call the Create User Application Feature to create a deployment

-			// artifact for the deployment script and add it to the artifacts

-			// list

-            CreateKeyPairFeature createKPFeature = new CreateKeyPairFeature( new ToscaFeatureProvider( getDiagramTypeProvider() ) );

-

-			deploymentArtifact.setArtifactType(new QName("KeyPair"));

-

-			createKPFeature.setContextObject(deploymentArtifact);

-

-			if (createKPFeature.canCreate(createContext)) {

-				createKPFeature.create(createContext);

-			}

-

-		} else if (extension.equals("sh")) {

-			CreateSoftwareDependencyFeature createSDFeature = new CreateSoftwareDependencyFeature(

-					new ToscaFeatureProvider(getDiagramTypeProvider()));

-

-			deploymentArtifact.setName(element.getName());

-			deploymentArtifact.setArtifactType(new QName("SD"));

-			createSDFeature.setContextObject(deploymentArtifact);

-			

-

-			if (createSDFeature.canCreate(createContext)) {

-				createSDFeature.create(createContext);

-			}

-		}

-

-		return result;

-	}

-  

+  private AbstractAddShapeFeature getIFileFeature( final IAddContext context ) {

+    ResourceCloudElement element = ( ResourceCloudElement )context.getNewObject();

+    AbstractAddShapeFeature result = null;

+    String extension = element.getResource().getFileExtension();

+    TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();

+    deploymentArtifact.setName( element.getName() );

+    CreateContext createContext = new CreateContext();

+    createContext.setTargetContainer( context.getTargetContainer() );

+    if( extension.equals( "pub" ) ) { //$NON-NLS-1$

+      // Call the Create User Application Feature to create a deployment

+      // artifact for the deployment script and add it to the artifacts

+      // list

+      CreateKeyPairFeature createKPFeature = new CreateKeyPairFeature( new ToscaFeatureProvider( getDiagramTypeProvider() ) );

+      deploymentArtifact.setArtifactType( new QName( "KeyPair" ) );

+      createKPFeature.setContextObject( deploymentArtifact );

+      if( createKPFeature.canCreate( createContext ) ) {

+        createKPFeature.create( createContext );

+      }

+    } else if( extension.equals( "sh" ) ) {

+      CreateSoftwareDependencyFeature createSDFeature = new CreateSoftwareDependencyFeature( new ToscaFeatureProvider( getDiagramTypeProvider() ) );

+      deploymentArtifact.setName( element.getName() );

+      deploymentArtifact.setArtifactType( new QName( "SD" ) );

+      createSDFeature.setContextObject( deploymentArtifact );

+      if( createSDFeature.canCreate( createContext ) ) {

+        createSDFeature.create( createContext );

+      }

+    }

+    return result;

+  }

 

   // Initializes all create features

   @Override

@@ -218,7 +214,7 @@
       new CreateNetworkFeature( this ),

       new CreateSoftwareDependencyFeature( this ),

       new CreateMonitorProbeFeature( this ),

-      new CreateFlavorFeature(this),

+      new CreateFlavorFeature( this ),

       new CreateServiceTemplateFeature( this ),

       new CreateResizeActionFeature( this ),

       new CreateUserApplicationFeature( this ),

@@ -230,23 +226,20 @@
 

   // Custom delete feature for application components and composite components

   @Override

-  public IDeleteFeature getDeleteFeature(IDeleteContext context){

+  public IDeleteFeature getDeleteFeature( IDeleteContext context ) {

     PictogramElement pictogramElement = context.getPictogramElement();

     Object bo = getBusinessObjectForPictogramElement( pictogramElement );

     if( bo instanceof TServiceTemplate ) {

-      //TServiceTemplate representing Composite Component

+      // TServiceTemplate representing Composite Component

       return new DeleteGroupFeature( this );

-    }

-    else if (bo instanceof TNodeTemplate){

+    } else if( bo instanceof TNodeTemplate ) {

       return new DeleteApplicationComponentFeature( this );

-    }

-    else if ( bo instanceof TDeploymentArtifact){

+    } else if( bo instanceof TDeploymentArtifact ) {

       return new DeleteDeploymentArtifactFeature( this );

     }

-      

     return super.getDeleteFeature( context );

   }

-  

+

   // Enables direct editing

   @Override

   public IDirectEditingFeature getDirectEditingFeature( final IDirectEditingContext context )

@@ -255,8 +248,7 @@
     Object bo = getBusinessObjectForPictogramElement( pe );

     if( bo instanceof TNodeTemplate ) {

       return new DirectEditApplicationComponentFeature( this );

-    }

-    else if( bo instanceof TServiceTemplate ) {

+    } else if( bo instanceof TServiceTemplate ) {

       return new DirectEditCompositeComponentFeature( this );

     }

     return super.getDirectEditingFeature( context );

@@ -270,7 +262,7 @@
     if( bo instanceof TNodeTemplate ) {

       return new LayoutApplicationComponentFeature( this );

     }

-    if ( bo instanceof TServiceTemplate ){

+    if( bo instanceof TServiceTemplate ) {

       return new LayoutServiceTemplateFeature( this );

     }

     return super.getLayoutFeature( context );

@@ -284,8 +276,7 @@
       Object bo = getBusinessObjectForPictogramElement( pictogramElement );

       if( bo instanceof TNodeTemplate ) {

         return new UpdateApplicationComponentFeature( this );

-      }

-      else if( bo instanceof TServiceTemplate ) {

+      } else if( bo instanceof TServiceTemplate ) {

         return new UpdateCompositeComponentFeature( this );

       }

     }

@@ -301,7 +292,7 @@
     if( bo instanceof TNodeTemplate ) {

       return new MoveApplicationComponentFeature( this );

     }

-    if ( bo instanceof TServiceTemplate ){

+    if( bo instanceof TServiceTemplate ) {

       return new MoveCompositeComponentFeature( this );

     }

     return super.getMoveShapeFeature( context );

@@ -321,21 +312,22 @@
   public ICreateConnectionFeature[] getCreateConnectionFeatures() {

     return new ICreateConnectionFeature[]{

       new CreateDirectedRelationFeature( this )

-//      ,

-//      new CreateBidirectionalRelationFeature( this )

+    // ,

+    // new CreateBidirectionalRelationFeature( this )

     };

   }

-  

+

   @Override

-  public IResizeShapeFeature getResizeShapeFeature(IResizeShapeContext context) {

-      Shape shape = context.getShape();

-      Object bo = getBusinessObjectForPictogramElement(shape);

-      if (bo instanceof TNodeTemplate) {

-        return new ResizeApplicationComponentFeature(this);

-      }

-      if (bo instanceof TServiceTemplate){

-        return new ResizeCompositeComponentFeature(this);

-      }

-      return super.getResizeShapeFeature(context);

+  public IResizeShapeFeature getResizeShapeFeature( IResizeShapeContext context )

+  {

+    Shape shape = context.getShape();

+    Object bo = getBusinessObjectForPictogramElement( shape );

+    if( bo instanceof TNodeTemplate ) {

+      return new ResizeApplicationComponentFeature( this );

+    }

+    if( bo instanceof TServiceTemplate ) {

+      return new ResizeCompositeComponentFeature( this );

+    }

+    return super.getResizeShapeFeature( context );

   }

 }

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/diagram/ToscaToolBehaviorProvider.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/diagram/ToscaToolBehaviorProvider.java
index aab4be3..ec3d2bd 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/diagram/ToscaToolBehaviorProvider.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/diagram/ToscaToolBehaviorProvider.java
@@ -36,6 +36,7 @@
 import org.eclipse.camf.infosystem.model.base.VirtualMachineImage;

 import org.eclipse.camf.infosystem.model.base.VirtualMachineImageType;

 import org.eclipse.camf.infosystem.model.base.VirtualNetwork;

+import org.eclipse.camf.tosca.TArtifactTemplate;

 import org.eclipse.camf.tosca.TDeploymentArtifact;

 import org.eclipse.camf.tosca.TNodeTemplate;

 import org.eclipse.camf.tosca.ToscaFactory;

@@ -54,6 +55,7 @@
 import org.eclipse.camf.tosca.elasticity.TNodeTemplateExtension;

 import org.eclipse.camf.tosca.elasticity.TServiceTemplateExtension;

 import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsFactory;

+import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsPackage;

 import org.eclipse.core.resources.IFile;

 import org.eclipse.core.resources.IFolder;

 import org.eclipse.core.resources.IProject;

@@ -101,8 +103,15 @@
 

 public class ToscaToolBehaviorProvider extends DefaultToolBehaviorProvider {

 

-  MockUpInfoSystem mockUpInfoSystemInstance; 

+	MockUpInfoSystem mockUpInfoSystemInstance; 

+	  

+	private String typesPrefix = Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getNsPrefix();

+  

+	private String typesNamespace = Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getNsURI();

+  

+	private String imageType = Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getImageArtifactPropertiesType().getName();

 

+	private String scriptArtifactType = Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getScriptArtifactPropertiesType().getName();

   

   public ToscaToolBehaviorProvider( final IDiagramTypeProvider dtp ) {

     super( dtp );

@@ -145,31 +154,31 @@
   /**

    * 

    */

-  private void fetchResources() {

-    Job job = new Job( "Resource Fetching" ) { //$NON-NLS-1$

-

-      @Override

-      protected IStatus run( final IProgressMonitor monitor ) {

-        monitor.beginTask( "Fetching Resources from Cloud Provider", 100 );

-        MockUpInfoSystem.getInstance();

-        for( int i = 0; i < 5; i++ ) {

-          try {

-            // sleep a second

-            TimeUnit.SECONDS.sleep( 1 );

-            monitor.subTask( "Resource bundle #" + i );

-            // report that 20 additional units are done

-            monitor.worked( 20 );

-          } catch( InterruptedException e1 ) {

-            e1.printStackTrace();

-            return Status.CANCEL_STATUS;

-          }

-        }

-        System.out.println( "Called save" );

-        return Status.OK_STATUS;

-      }

-    };

-    job.schedule();

-  }

+//  private void fetchResources() {

+//    Job job = new Job( "Resource Fetching" ) { //$NON-NLS-1$

+//

+//      @Override

+//      protected IStatus run( final IProgressMonitor monitor ) {

+//        monitor.beginTask( "Fetching Resources from Cloud Provider", 100 );

+//        MockUpInfoSystem.getInstance();

+//        for( int i = 0; i < 5; i++ ) {

+//          try {

+//            // sleep a second

+//            TimeUnit.SECONDS.sleep( 1 );

+//            monitor.subTask( "Resource bundle #" + i );

+//            // report that 20 additional units are done

+//            monitor.worked( 20 );

+//          } catch( InterruptedException e1 ) {

+//            e1.printStackTrace();

+//            return Status.CANCEL_STATUS;

+//          }

+//        }

+//        System.out.println( "Called save" );

+//        return Status.OK_STATUS;

+//      }

+//    };

+//    job.schedule();

+//  }

 

   // Creates the Palette. Palette entries are retrieved from an SQL database.

   @Override

@@ -266,10 +275,11 @@
           deploymentArtifact.setArtifactType( new QName( "Network" ) );

           vnCF.setContextObject( deploymentArtifact );

 

-          ObjectCreationToolEntry objectCreationToolEntry = new ObjectCreationToolEntry( vn.getUID(),

-                                                                                         vnCF.getName(),

-                                                                                         vnCF.getCreateImageId(),

-                                                                                         vnCF.getCreateLargeImageId(),

+          ObjectCreationToolEntry objectCreationToolEntry = new ObjectCreationToolEntry( 

+        		  																		vn.getName(),

+        		  																		vn.getUID(),

+                                                                                         null,

+                                                                                         null,

                                                                                          vnCF );

           stackEntry.addCreationToolEntry( objectCreationToolEntry );

           

@@ -277,15 +287,17 @@
       }

       

       // add all create-connection-features to the new stack-entry

-      ICreateConnectionFeature[] createConnectionFeatures = featureProvider.getCreateConnectionFeatures();

-      for( ICreateConnectionFeature cf : createConnectionFeatures ) {

-        ConnectionCreationToolEntry connectionCreationToolEntry = new ConnectionCreationToolEntry( vn.getName(),

-                                                                                                   cf.getName(),

-                                                                                                   cf.getCreateImageId(),

-                                                                                                   cf.getCreateLargeImageId() );

-        connectionCreationToolEntry.addCreateConnectionFeature( cf );

-        stackEntry.addCreationToolEntry( connectionCreationToolEntry );

-      }

+//      ICreateConnectionFeature[] createConnectionFeatures = featureProvider.getCreateConnectionFeatures();

+//      for( ICreateConnectionFeature cf : createConnectionFeatures ) {

+//        ConnectionCreationToolEntry connectionCreationToolEntry = new ConnectionCreationToolEntry( 

+//        		//vn.getName(),

+//        		vn.getUID(),

+//                                                                                                   cf.getName(),

+//                                                                                                   cf.getCreateImageId(),

+//                                                                                                   cf.getCreateLargeImageId() );

+//        connectionCreationToolEntry.addCreateConnectionFeature( cf );

+//        stackEntry.addCreationToolEntry( connectionCreationToolEntry );

+//      }

     }    

   }

 

@@ -298,17 +310,21 @@
   {

     ArrayList<TNodeTemplateExtension> appComponents = new ArrayList<TNodeTemplateExtension>();

     TNodeTemplateExtension applicationServerComponent = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createTNodeTemplateExtension();

-    applicationServerComponent.setType( new QName( "appserver" ) );

-    applicationServerComponent.setName( "ApplicationServer" );

+    applicationServerComponent.setType( new QName( "SimpleComponent" ) );

+    applicationServerComponent.setName( "Component" );

     appComponents.add( applicationServerComponent );

-    TNodeTemplateExtension databaseServerComponent = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createTNodeTemplateExtension();

-    databaseServerComponent.setType( new QName( "dbserver" ) );

-    databaseServerComponent.setName( "DatabaseServer" );

-    appComponents.add( databaseServerComponent );

-    TNodeTemplateExtension loadBalancerComponent = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createTNodeTemplateExtension();

-    loadBalancerComponent.setType( new QName( "loadbalancer" ) );

-    loadBalancerComponent.setName( "LoadBalancer" );

-    appComponents.add( loadBalancerComponent );

+//    TNodeTemplateExtension applicationServerComponent = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createTNodeTemplateExtension();

+//    applicationServerComponent.setType( new QName( "appserver" ) );

+//    applicationServerComponent.setName( "ApplicationServer" );

+//    appComponents.add( applicationServerComponent );

+//    TNodeTemplateExtension databaseServerComponent = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createTNodeTemplateExtension();

+//    databaseServerComponent.setType( new QName( "dbserver" ) );

+//    databaseServerComponent.setName( "DatabaseServer" );

+//    appComponents.add( databaseServerComponent );

+//    TNodeTemplateExtension loadBalancerComponent = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createTNodeTemplateExtension();

+//    loadBalancerComponent.setType( new QName( "loadbalancer" ) );

+//    loadBalancerComponent.setName( "LoadBalancer" );

+//    appComponents.add( loadBalancerComponent );

     

     // add new compartment at the end of the existing compartments

     PaletteCompartmentEntry compartmentEntry = new PaletteCompartmentEntry( "Application Components", null ); //$NON-NLS-1$

@@ -333,6 +349,7 @@
                                                                                          appCompCF.getCreateLargeImageId(),

                                                                                          appCompCF );

           stackEntry.addCreationToolEntry( objectCreationToolEntry );

+          break;

         }

       }

     }

@@ -358,6 +375,7 @@
                                                                                        groupCF.getCreateLargeImageId(),

                                                                                        groupCF );

         stackEntry.addCreationToolEntry( objectCreationToolEntry );

+        break;

       }

     }

   }

@@ -403,10 +421,14 @@
           if( cf instanceof CreateSoftwareDependencyFeature ) {

             CreateSoftwareDependencyFeature sdCF = ( CreateSoftwareDependencyFeature )cf;

  

-            TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();

-            deploymentArtifact.setName( script.getName() );

-            deploymentArtifact.setArtifactType( new QName( "SD" ) );

-            sdCF.setContextObject( deploymentArtifact );

+            

+            TArtifactTemplate artifactTemplate = ToscaFactory.eINSTANCE.createTArtifactTemplate();

+            artifactTemplate.setName( "SD"+script.getName() );

+            artifactTemplate.setId( script.getName() );

+            artifactTemplate.setType( new QName( typesNamespace, scriptArtifactType, typesPrefix ) );

+            sdCF.setContextObject( artifactTemplate );

+                        

+            

             // add new stack entry to new compartment

             IToolEntry entry = new ObjectCreationToolEntry( script.getName(),

                                                             script.getDescription(),

@@ -414,6 +436,7 @@
                                                             null,

                                                             sdCF );

             compartmentEntry.addToolEntry( entry );

+            break;

           }

         }

       }

@@ -541,6 +564,7 @@
                                                             null,

                                                             kpCF );

             compartmentEntry.addToolEntry( entry );

+            break;

           }

         }

       }

@@ -633,28 +657,20 @@
           TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();

           deploymentArtifact.setName( vmi.getUID() );

           deploymentArtifact.setArtifactRef( new QName(vmi.getUID()) );

-          deploymentArtifact.setArtifactType( new QName( "VMI" ) );

+          //deploymentArtifact.setArtifactType( new QName( "VMI" ) );

+          deploymentArtifact.setArtifactType( new QName( typesNamespace, imageType, typesPrefix ));

           vmiCF.setContextObject( deploymentArtifact );

 

-          ObjectCreationToolEntry objectCreationToolEntry = new ObjectCreationToolEntry( vmi.getUID(),

+          ObjectCreationToolEntry objectCreationToolEntry = new ObjectCreationToolEntry(  vmi.getName(),

+        		  //vmi.getUID(),

                                                                                          vmiCF.getName(),

                                                                                          vmiCF.getCreateImageId(),

                                                                                          vmiCF.getCreateLargeImageId(),

                                                                                          vmiCF );

           stackEntry.addCreationToolEntry( objectCreationToolEntry );

+          break;

         }

       }

-      

-    // add all create-connection-features to the new stack-entry    

-    ICreateConnectionFeature[] createConnectionFeatures = featureProvider.getCreateConnectionFeatures();

-    for( ICreateConnectionFeature connFeat : createConnectionFeatures ) {

-      ConnectionCreationToolEntry connectionCreationToolEntry = new ConnectionCreationToolEntry( vmi.getName(),

-                                                                                                 connFeat.getName(),

-                                                                                                 connFeat.getCreateImageId(),

-                                                                                                 connFeat.getCreateLargeImageId() );

-      connectionCreationToolEntry.addCreateConnectionFeature( connFeat );

-      stackEntry.addCreationToolEntry( connectionCreationToolEntry );

-    }

     }

   }

   

@@ -725,6 +741,7 @@
                                                                                            mpCF.getCreateLargeImageId(),

                                                                                            mpCF );

             stackEntry.addCreationToolEntry( objectCreationToolEntry );

+            break;

           }

         }

         

@@ -750,7 +767,8 @@
                                                                                              mpCF );

               

               stackEntry.addCreationToolEntry( objectCreationToolEntry );

-            }

+              break;

+            }            

           }

           

         }

@@ -776,7 +794,7 @@
                                                           null,

                                                           mpCF );

           compartmentEntry.addToolEntry( entry );

-

+          break;

         }

       }

     }

@@ -835,6 +853,7 @@
                                                                                          raCF.getCreateLargeImageId(),

                                                                                          raCF );

           stackEntry.addCreationToolEntry( objectCreationToolEntry );

+          break;

         }

       }

     }

@@ -1028,7 +1047,12 @@
   public GraphicsAlgorithm[] getClickArea( final PictogramElement pe ) {

     IFeatureProvider featureProvider = getFeatureProvider();

     Object bo = featureProvider.getBusinessObjectForPictogramElement( pe );

-    if( bo instanceof TNodeTemplate ) {

+    

+    if (bo instanceof TNodeTemplate)

+      if ( ((TNodeTemplate) bo)==null || ((TNodeTemplate) bo).getType() == null)

+        return null;

+    

+    if( bo instanceof TNodeTemplate && ((TNodeTemplate) bo).getType().toString().contains("substituteNode")==false) {

       GraphicsAlgorithm invisible = pe.getGraphicsAlgorithm();

       GraphicsAlgorithm rectangle = invisible.getGraphicsAlgorithmChildren()

         .get( 0 );

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityConditionDialog.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityConditionDialog.java
index 422996d..e897783 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityConditionDialog.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityConditionDialog.java
@@ -68,394 +68,394 @@
 public class ElasticityConditionDialog extends Dialog {

 

 

-  private Label lblCondition;

-  private CCombo cmbCondition;

-  private boolean conditionSelected;

-  private Label lblCondition2;

-  private CCombo cmbCondition2;

-  private boolean conditionSelected2;

-  private ToscaModelLayer model;

-  private String condition;

+	  private Label lblCondition;

+	  private CCombo cmbCondition;

+	  private boolean conditionSelected;

+	  private Label lblCondition2;

+	  private CCombo cmbCondition2;

+	  private boolean conditionSelected2;

+	  private ToscaModelLayer model;

+	  private String condition;

 

-  

-  protected Text typeText;

-  protected Text valueText;

-  protected boolean editMode = false;

-  protected boolean addMode = false;

-  protected String newType;

-  protected String elasticityRequirement;

-  private CCombo cmbGlobalElasticityReq;

-  private CCombo cmbOperator;

-  private String component;

-  private Label unitLabel;

-

-  private String unit;

-

-  private String strategyName;

-  private Label strategyLabel;

-  

-  private String conditionLeft;

-  private String conditionRight;

-  private String conditionOperator;

-  

-  /**

-   * @param parentShell

-   * @param pe 

-   * @param existingDataStage

-   */

-  public ElasticityConditionDialog( final Shell parentShell,  String component,

-		  ToscaModelLayer model, String strategyName

-                                        )

-  {

-    super( parentShell );

-    this.conditionSelected = false;

-    this.conditionSelected2 = false;

-    this.model = model;

-    this.component = component;

-    this.strategyName = strategyName;

-  }

-

-  @Override

-  protected void configureShell( final Shell shell ) {

-    super.configureShell( shell );

-    shell.setText( "Apply Strategy Under Condition" );

-    shell.setSize( 330, 400 );

- 

-  }

-

-  @Override

-  protected Control createDialogArea( final Composite parent ) {

-    Composite composite = ( Composite )super.createDialogArea( parent );

-    composite.setLayout( new GridLayout( 1, false ) );

-    composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );

-

-    this.strategyLabel = new Label( composite, SWT.NONE );

-    this.strategyLabel.setText( this.strategyName );

-    

-    GridData gd = new GridData( GridData.FILL_BOTH );

-    gd.verticalIndent = 7;

-    gd.heightHint = 10;

-    this.strategyLabel.setLayoutData( gd );

-    

-

-    

-    ////////////////////////////////////////////////////////////////////////////////////////////////

-    

-    Group newConstraintGroup = new Group( composite, SWT.NONE );

-    newConstraintGroup.setLayout( new GridLayout( 1, false ) );

-    newConstraintGroup.setText( "&Specify New Condition" );

-    GridData gData = new GridData( SWT.FILL, SWT.FILL, true, true );

-    newConstraintGroup.setLayoutData( gData );

-    

-    

-    

-    Composite newConstraintComposite = new Composite( newConstraintGroup, SWT.NONE );

-    newConstraintComposite.setLayout( new GridLayout( 1, false ) );

-    //GridLayout gLayout = new GridLayout( 2, false );

-    newConstraintComposite.setLayout( new GridLayout( 1, false ) );

-    gData = new GridData( GridData.FILL_BOTH );

-    //gData.grabExcessHorizontalSpace = true;

-    //gData.grabExcessVerticalSpace = true;

-    newConstraintComposite.setLayoutData( gData );

-    

-    Composite typeComposite = new Composite( newConstraintComposite, SWT.NONE );

-    GridLayout gLayout = new GridLayout( 2, false );

-    typeComposite.setLayout( gLayout );

-    gData = new GridData( GridData.FILL_HORIZONTAL );

-    typeComposite.setLayoutData( gData );

-    

-    Label typeLabel = new Label( typeComposite, SWT.LEAD );

-    typeLabel.setText( "Type" ); //$NON-NLS-1$

-    gd = new GridData( 50, 20 );

-    typeLabel.setLayoutData( gd );

-    // Combo - GlobalElasticityReq

-    this.cmbGlobalElasticityReq = new CCombo( typeComposite, SWT.BORDER );

-    this.cmbGlobalElasticityReq.setEnabled( true );

-    gd = new GridData( 212, 20 );

-    this.cmbGlobalElasticityReq.setLayoutData( gd );

-

-    ArrayList<MonitoringProbe> mps = getMetrics();

-    for (MonitoringProbe mp : mps){

-      String metricsString = mp.getDescription();

-      if (metricsString.equals( "" )==false){

-        metricsString = metricsString.substring( 2, metricsString.length()-2 );

-        metricsString = metricsString.replace( "\"", "" );

-      String[] metrics = metricsString.split( "," );

-      for (String metric : metrics)

-        this.cmbGlobalElasticityReq.add(metric);

-      }

-      else{

-        this.cmbGlobalElasticityReq.add(mp.getName());

-      }

-    }

-

-    Composite valueComposite = new Composite( newConstraintComposite, SWT.NONE );

-    gLayout = new GridLayout( 3, false );

-    valueComposite.setLayout( gLayout );

-    gData = new GridData( GridData.FILL_HORIZONTAL );

-    valueComposite.setLayoutData( gData );

-    

-    Label valueLabel = new Label( valueComposite, SWT.LEAD );

-    valueLabel.setText( "Value" ); //$NON-NLS-1$

-    gd = new GridData( 50, 20 );

-    valueLabel.setLayoutData( gd );

-    

-    // Combo - Operator

-    this.cmbOperator = new CCombo( valueComposite, SWT.BORDER );

-    this.cmbOperator.setEnabled( true );

-    gd = new GridData( 40, 20 );

-    this.cmbOperator.setLayoutData( gd );

-    this.cmbOperator.add( "=" ); //$NON-NLS-1$

-    this.cmbOperator.add( "<" ); //$NON-NLS-1$

-    this.cmbOperator.add( ">" );  //$NON-NLS-1$

-    this.cmbOperator.setText( this.cmbOperator.getItem( 0 ) );  

-    

-    this.valueText = new Text( valueComposite, SWT.BORDER );

-    gd = new GridData( 154, 20 );

-    this.valueText.setLayoutData( gd );

-

-    this.cmbGlobalElasticityReq.setEditable( false );

-    this.cmbGlobalElasticityReq.addModifyListener( new ModifyListener() {

-

-      public void modifyText( final ModifyEvent e ) {

-        

-        ElasticityConditionDialog.this.cmbCondition.setEnabled( true );

-        ElasticityConditionDialog.this.cmbCondition2.setEnabled( true );

-        

-        ElasticityConditionDialog.this.newType = ElasticityConditionDialog.this.cmbGlobalElasticityReq.getText();

-        

-    

-      }

-    } );

- 

-    //////////////////////////////////////////////////////////////////////////////////////////////////////////////

-    Group constraintGroup = new Group( composite, SWT.NONE );

-    constraintGroup.setLayout( new GridLayout( 1, false ) );

-    constraintGroup.setText( "&Select Constraint" );

-    gData = new GridData( SWT.FILL, SWT.FILL, true, true );

-    constraintGroup.setLayoutData( gData );

-    

-    Composite constraintComposite = new Composite( constraintGroup, SWT.NONE );

-    constraintComposite.setLayout( new GridLayout( 1, false ) );

-    gData = new GridData( GridData.GRAB_HORIZONTAL );

-    //gData.grabExcessHorizontalSpace = true;

-    //gData.grabExcessVerticalSpace = true;

-    constraintComposite.setLayoutData( gData );

-    

-    

-    // Condition label

-    this.lblCondition = new Label( constraintComposite, SWT.NONE );

-    this.lblCondition.setText( "When fulfilled Constraint:" );

-    gd = new GridData( GridData.FILL_HORIZONTAL );

-    gd.widthHint = 280;

-    this.lblCondition.setLayoutData( gd );

-

-    // Combo - Condition

-    this.cmbCondition = new CCombo( constraintComposite, SWT.BORDER );

-    this.cmbCondition.setEnabled( true );

-    gd = new GridData( GridData.FILL_HORIZONTAL );

-    gd.widthHint = 280;

-    this.cmbCondition.setLayoutData( gd );

-    this.cmbCondition.setEnabled( false );

-

-    

-    ArrayList<String> elasticityConstraints = getAllConstraints();

-    

-    if ( elasticityConstraints.size() > 0 ){

-        for ( String constraint : elasticityConstraints ){

-            this.cmbCondition.add(constraint);

-        }

-    }  

-    

-    this.cmbCondition.setText( "" );

-    

-    this.cmbCondition.addModifyListener( new ModifyListener() {

-

-      @Override

-      public void modifyText( ModifyEvent e ) {

-        if (ElasticityConditionDialog.this.cmbCondition.getText() != ""){

-          ElasticityConditionDialog.this.conditionSelected = true;

-        }

-        

-      }

-      

-    });

-

-    // Condition label

-    this.lblCondition2 = new Label( constraintComposite, SWT.NONE );

-    this.lblCondition2.setText( "When violated Constraint:" );

-    gd = new GridData( GridData.FILL_HORIZONTAL );

-    gd.widthHint = 280;

-    this.lblCondition2.setLayoutData( gd );

-

-    // Combo - Condition

-    this.cmbCondition2 = new CCombo( constraintComposite, SWT.BORDER );

-    this.cmbCondition2.setEnabled( true );

-    gd.widthHint = 280;

-    gd = new GridData( GridData.FILL_HORIZONTAL );

-    this.cmbCondition2.setLayoutData( gd );

-    

-    if ( elasticityConstraints.size() > 0 ){

-        for ( String constraint : elasticityConstraints ){

-            this.cmbCondition2.add(constraint);

-        }

-    }  

-    

-    this.cmbCondition2.setText( "" );

-    

-    this.cmbCondition2.addModifyListener( new ModifyListener() {

-

-      @Override

-      public void modifyText( ModifyEvent e ) {

-        if (ElasticityConditionDialog.this.cmbCondition2.getText() != ""){

-          ElasticityConditionDialog.this.conditionSelected2 = true;

-        }

-        

-      }

-      

-    });

-    

-    return composite;

-  }

-

-  public ArrayList<MonitoringProbe> getMetrics(){

-    

-    ArrayList<MonitoringProbe> mps = MockUpInfoSystem.getInstance()

-        .getMonitoringProbes();

-        

-        ArrayList<MonitoringProbe> mpsCopy = ( ArrayList<MonitoringProbe> )mps.clone();

-        

-    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

-    IProject monitoringProbesProject = workspaceRoot.getProject( "MonitoringProbe" );

-

-    if( monitoringProbesProject.exists() ) {

-      IFolder srcFolder = monitoringProbesProject.getFolder( "src" );

-      IResource[] artifactsResource = null;

-      try {

-        artifactsResource = srcFolder.members();

-      } catch( CoreException e ) {

-        // TODO Auto-generated catch block

-        e.printStackTrace();

-      }

-      for( IResource tempResource : artifactsResource ) {

-        if( tempResource instanceof IFile ) {

-          MonitoringProbe mp = InfoSystemFactory.eINSTANCE.createMonitoringProbe();

-          mp.setUID( tempResource.getName().replaceFirst( ".java", "" ));

-          mp.setName( tempResource.getName().replaceFirst( ".java", "" ));

-          mp.setDescription( "" );

-          mp.setURL( "" );

-          // add new probe to monitoring list

-          mpsCopy.add( 0, mp );

-        }

-      }

-    }

-    

-    return mpsCopy;

-  }

-  

-  // Returns all global, composite and component level elasticity constraints;

-  private ArrayList<String> getAllConstraints(){

 	  

-	  ArrayList<String> constraints = new ArrayList<String>();

+	  protected Text typeText;

+	  protected Text valueText;

+	  protected boolean editMode = false;

+	  protected boolean addMode = false;

+	  protected String newType;

+	  protected String elasticityRequirement;

+	  private CCombo cmbGlobalElasticityReq;

+	  private CCombo cmbOperator;

+	  private String component;

+	  private Label unitLabel;

+

+	  private String unit;

+

+	  private String strategyName;

+	  private Label strategyLabel;

 	  

-	  DocumentRoot toscaRoot = this.model.getDocumentRoot();

-	  EList<TServiceTemplate> toscaServiceTemplates = toscaRoot.getDefinitions().getServiceTemplate();

-	  EList<TNodeTemplate> tempNodeTemplates;

-	  for ( TServiceTemplate tempServiceTemplate : toscaServiceTemplates ){

-		  

-		  //TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension ) tempServiceTemplate.getBoundaryDefinitions();

-		  

-	    TBoundaryDefinitions boundaryDef = ( TBoundaryDefinitions ) tempServiceTemplate.getBoundaryDefinitions();

+	  private String conditionLeft;

+	  private String conditionRight;

+	  private String conditionOperator;

+	  

+	  /**

+	   * @param parentShell

+	   * @param pe 

+	   * @param existingDataStage

+	   */

+	  public ElasticityConditionDialog( final Shell parentShell,  String component,

+			  ToscaModelLayer model, String strategyName

+	                                        )

+	  {

+	    super( parentShell );

+	    this.conditionSelected = false;

+	    this.conditionSelected2 = false;

+	    this.model = model;

+	    this.component = component;

+	    this.strategyName = strategyName;

+	  }

+

+	  @Override

+	  protected void configureShell( final Shell shell ) {

+	    super.configureShell( shell );

+	    shell.setText( "Apply Strategy Under Condition" );

+	    shell.setSize( 330, 400 );

+	 

+	  }

+

+	  @Override

+	  protected Control createDialogArea( final Composite parent ) {

+	    Composite composite = ( Composite )super.createDialogArea( parent );

+	    composite.setLayout( new GridLayout( 1, false ) );

+	    composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );

+

+	    this.strategyLabel = new Label( composite, SWT.NONE );

+	    this.strategyLabel.setText( this.strategyName );

 	    

-		  if ( boundaryDef != null ){

-	

-			  PoliciesType1 globalPolicies = boundaryDef.getPolicies();

-			  

-			  if ( globalPolicies != null ){

-			

-				  for ( int k=0; k<globalPolicies.getPolicy().size(); k++){

-						  

-					  if ( globalPolicies.getPolicy().get(k).getPolicyType().toString().contains( "Constraint" ) ){

-						  constraints.add(globalPolicies.getPolicy().get(k).getName());

-					  }

-				  }

+	    GridData gd = new GridData( GridData.FILL_BOTH );

+	    gd.verticalIndent = 7;

+	    gd.heightHint = 10;

+	    this.strategyLabel.setLayoutData( gd );

+	    

 

-			  }

-		  }

+	    

+	    ////////////////////////////////////////////////////////////////////////////////////////////////

+	    

+	    Group newConstraintGroup = new Group( composite, SWT.NONE );

+	    newConstraintGroup.setLayout( new GridLayout( 1, false ) );

+	    newConstraintGroup.setText( "&Specify New Condition" );

+	    GridData gData = new GridData( SWT.FILL, SWT.FILL, true, true );

+	    newConstraintGroup.setLayoutData( gData );

+	    

+	    

+	    

+	    Composite newConstraintComposite = new Composite( newConstraintGroup, SWT.NONE );

+	    newConstraintComposite.setLayout( new GridLayout( 1, false ) );

+	    //GridLayout gLayout = new GridLayout( 2, false );

+	    newConstraintComposite.setLayout( new GridLayout( 1, false ) );

+	    gData = new GridData( GridData.FILL_BOTH );

+	    //gData.grabExcessHorizontalSpace = true;

+	    //gData.grabExcessVerticalSpace = true;

+	    newConstraintComposite.setLayoutData( gData );

+	    

+	    Composite typeComposite = new Composite( newConstraintComposite, SWT.NONE );

+	    GridLayout gLayout = new GridLayout( 2, false );

+	    typeComposite.setLayout( gLayout );

+	    gData = new GridData( GridData.FILL_HORIZONTAL );

+	    typeComposite.setLayoutData( gData );

+	    

+	    Label typeLabel = new Label( typeComposite, SWT.LEAD );

+	    typeLabel.setText( "Type" ); //$NON-NLS-1$

+	    gd = new GridData( 50, 20 );

+	    typeLabel.setLayoutData( gd );

+	    // Combo - GlobalElasticityReq

+	    this.cmbGlobalElasticityReq = new CCombo( typeComposite, SWT.BORDER );

+	    this.cmbGlobalElasticityReq.setEnabled( true );

+	    gd = new GridData( 212, 20 );

+	    this.cmbGlobalElasticityReq.setLayoutData( gd );

+

+	    ArrayList<MonitoringProbe> mps = getMetrics();

+	    for (MonitoringProbe mp : mps){

+	      String metricsString = mp.getDescription();

+	      if (metricsString.equals( "" )==false){

+	        metricsString = metricsString.substring( 2, metricsString.length()-2 );

+	        metricsString = metricsString.replace( "\"", "" );

+	      String[] metrics = metricsString.split( "," );

+	      for (String metric : metrics)

+	        this.cmbGlobalElasticityReq.add(metric);

+	      }

+	      else{

+	        this.cmbGlobalElasticityReq.add(mp.getName());

+	      }

+	    }

+	    this.cmbGlobalElasticityReq.add("Cost");

+

+	    Composite valueComposite = new Composite( newConstraintComposite, SWT.NONE );

+	    gLayout = new GridLayout( 3, false );

+	    valueComposite.setLayout( gLayout );

+	    gData = new GridData( GridData.FILL_HORIZONTAL );

+	    valueComposite.setLayoutData( gData );

+	    

+	    Label valueLabel = new Label( valueComposite, SWT.LEAD );

+	    valueLabel.setText( "Value" ); //$NON-NLS-1$

+	    gd = new GridData( 50, 20 );

+	    valueLabel.setLayoutData( gd );

+	    

+	    // Combo - Operator

+	    this.cmbOperator = new CCombo( valueComposite, SWT.BORDER );

+	    this.cmbOperator.setEnabled( true );

+	    gd = new GridData( 40, 20 );

+	    this.cmbOperator.setLayoutData( gd );

+	    this.cmbOperator.add( "=" ); //$NON-NLS-1$

+	    this.cmbOperator.add( "<" ); //$NON-NLS-1$

+	    this.cmbOperator.add( ">" );  //$NON-NLS-1$

+	    this.cmbOperator.setText( this.cmbOperator.getItem( 0 ) );  

+	    

+	    this.valueText = new Text( valueComposite, SWT.BORDER );

+	    gd = new GridData( 154, 20 );

+	    this.valueText.setLayoutData( gd );

+

+	    this.cmbGlobalElasticityReq.setEditable( false );

+	    this.cmbGlobalElasticityReq.addModifyListener( new ModifyListener() {

+

+	      public void modifyText( final ModifyEvent e ) {

+	        

+	        ElasticityConditionDialog.this.cmbCondition.setEnabled( true );

+	        ElasticityConditionDialog.this.cmbCondition2.setEnabled( true );

+	        

+	        ElasticityConditionDialog.this.newType = ElasticityConditionDialog.this.cmbGlobalElasticityReq.getText();

+	        

+	    

+	      }

+	    } );

+	 

+	    //////////////////////////////////////////////////////////////////////////////////////////////////////////////

+	    Group constraintGroup = new Group( composite, SWT.NONE );

+	    constraintGroup.setLayout( new GridLayout( 1, false ) );

+	    constraintGroup.setText( "&Select Constraint" );

+	    gData = new GridData( SWT.FILL, SWT.FILL, true, true );

+	    constraintGroup.setLayoutData( gData );

+	    

+	    Composite constraintComposite = new Composite( constraintGroup, SWT.NONE );

+	    constraintComposite.setLayout( new GridLayout( 1, false ) );

+	    gData = new GridData( GridData.GRAB_HORIZONTAL );

+	    //gData.grabExcessHorizontalSpace = true;

+	    //gData.grabExcessVerticalSpace = true;

+	    constraintComposite.setLayoutData( gData );

+	    

+	    

+	    // Condition label

+	    this.lblCondition = new Label( constraintComposite, SWT.NONE );

+	    this.lblCondition.setText( "When fulfilled Constraint:" );

+	    gd = new GridData( GridData.FILL_HORIZONTAL );

+	    gd.widthHint = 280;

+	    this.lblCondition.setLayoutData( gd );

+

+	    // Combo - Condition

+	    this.cmbCondition = new CCombo( constraintComposite, SWT.BORDER );

+	    this.cmbCondition.setEnabled( true );

+	    gd = new GridData( GridData.FILL_HORIZONTAL );

+	    gd.widthHint = 280;

+	    this.cmbCondition.setLayoutData( gd );

+	    this.cmbCondition.setEnabled( false );

+

+	    

+	    ArrayList<String> elasticityConstraints = getAllConstraints();

+	    

+	    if ( elasticityConstraints.size() > 0 ){

+	        for ( String constraint : elasticityConstraints ){

+	            this.cmbCondition.add(constraint);

+	        }

+	    }  

+	    

+	    this.cmbCondition.setText( "" );

+	    

+	    this.cmbCondition.addModifyListener( new ModifyListener() {

+

+	      @Override

+	      public void modifyText( ModifyEvent e ) {

+	        if (ElasticityConditionDialog.this.cmbCondition.getText() != ""){

+	          ElasticityConditionDialog.this.conditionSelected = true;

+	        }

+	        

+	      }

+	      

+	    });

+

+	    // Condition label

+	    this.lblCondition2 = new Label( constraintComposite, SWT.NONE );

+	    this.lblCondition2.setText( "When violated Constraint:" );

+	    gd = new GridData( GridData.FILL_HORIZONTAL );

+	    gd.widthHint = 280;

+	    this.lblCondition2.setLayoutData( gd );

+

+	    // Combo - Condition

+	    this.cmbCondition2 = new CCombo( constraintComposite, SWT.BORDER );

+	    this.cmbCondition2.setEnabled( true );

+	    gd.widthHint = 280;

+	    gd = new GridData( GridData.FILL_HORIZONTAL );

+	    this.cmbCondition2.setLayoutData( gd );

+	    

+	    if ( elasticityConstraints.size() > 0 ){

+	        for ( String constraint : elasticityConstraints ){

+	            this.cmbCondition2.add(constraint);

+	        }

+	    }  

+	    

+	    this.cmbCondition2.setText( "" );

+	    

+	    this.cmbCondition2.addModifyListener( new ModifyListener() {

+

+	      @Override

+	      public void modifyText( ModifyEvent e ) {

+	        if (ElasticityConditionDialog.this.cmbCondition2.getText() != ""){

+	          ElasticityConditionDialog.this.conditionSelected2 = true;

+	        }

+	        

+	      }

+	      

+	    });

+	    

+	    return composite;

+	  }

+

+	  public ArrayList<MonitoringProbe> getMetrics(){

+	    

+	    ArrayList<MonitoringProbe> mps = MockUpInfoSystem.getInstance()

+	        .getMonitoringProbes();

+	        

+	        ArrayList<MonitoringProbe> mpsCopy = ( ArrayList<MonitoringProbe> )mps.clone();

+	        

+	    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

+	    IProject monitoringProbesProject = workspaceRoot.getProject( "MonitoringProbe" );

+

+	    if( monitoringProbesProject.exists() ) {

+	      IFolder srcFolder = monitoringProbesProject.getFolder( "src" );

+	      IResource[] artifactsResource = null;

+	      try {

+	        artifactsResource = srcFolder.members();

+	      } catch( CoreException e ) {

+	        // TODO Auto-generated catch block

+	        e.printStackTrace();

+	      }

+	      for( IResource tempResource : artifactsResource ) {

+	        if( tempResource instanceof IFile ) {

+	          MonitoringProbe mp = InfoSystemFactory.eINSTANCE.createMonitoringProbe();

+	          mp.setUID( tempResource.getName().replaceFirst( ".java", "" ));

+	          mp.setName( tempResource.getName().replaceFirst( ".java", "" ));

+	          mp.setDescription( "" );

+	          // add new probe to monitoring list

+	          mpsCopy.add( 0, mp );

+	        }

+	      }

+	    }

+	    

+	    return mpsCopy;

+	  }

+	  

+	  // Returns all global, composite and component level elasticity constraints;

+	  private ArrayList<String> getAllConstraints(){

 		  

-		  if ( tempServiceTemplate.getTopologyTemplate() != null && tempServiceTemplate.getTopologyTemplate().getNodeTemplate() != null ){

+		  ArrayList<String> constraints = new ArrayList<String>();

+		  

+		  DocumentRoot toscaRoot = this.model.getDocumentRoot();

+		  EList<TServiceTemplate> toscaServiceTemplates = toscaRoot.getDefinitions().getServiceTemplate();

+		  EList<TNodeTemplate> tempNodeTemplates;

+		  for ( TServiceTemplate tempServiceTemplate : toscaServiceTemplates ){

 			  

-			  tempNodeTemplates = tempServiceTemplate.getTopologyTemplate().getNodeTemplate();

-	

-			  for ( final TNodeTemplate tempNodeTemplate : tempNodeTemplates ){

+			  //TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension ) tempServiceTemplate.getBoundaryDefinitions();

+			  

+		    TBoundaryDefinitions boundaryDef = ( TBoundaryDefinitions ) tempServiceTemplate.getBoundaryDefinitions();

+		    

+			  if ( boundaryDef != null ){

+		

+				  PoliciesType1 globalPolicies = boundaryDef.getPolicies();

 				  

-				  if ( tempNodeTemplate.getPolicies() != null && tempNodeTemplate.getPolicies().getPolicy() != null ){

-					  for ( int j=0; j<tempNodeTemplate.getPolicies().getPolicy().size(); j++){

-						  

-						  if (tempNodeTemplate.getPolicies().getPolicy().get(j).getPolicyType().toString().contains( "Constraint" ) ){

-							  constraints.add(tempNodeTemplate.getPolicies().getPolicy().get(j).getName());

+				  if ( globalPolicies != null ){

+				

+					  for ( int k=0; k<globalPolicies.getPolicy().size(); k++){

+							  

+						  if ( globalPolicies.getPolicy().get(k).getPolicyType().toString().contains( "Constraint" ) ){

+							  constraints.add(globalPolicies.getPolicy().get(k).getName());

+						  }

+					  }

+

+				  }

+			  }

+			  

+			  if ( tempServiceTemplate.getTopologyTemplate() != null && tempServiceTemplate.getTopologyTemplate().getNodeTemplate() != null ){

+				  

+				  tempNodeTemplates = tempServiceTemplate.getTopologyTemplate().getNodeTemplate();

+		

+				  for ( final TNodeTemplate tempNodeTemplate : tempNodeTemplates ){

+					  

+					  if ( tempNodeTemplate.getPolicies() != null && tempNodeTemplate.getPolicies().getPolicy() != null ){

+						  for ( int j=0; j<tempNodeTemplate.getPolicies().getPolicy().size(); j++){

+							  

+							  if (tempNodeTemplate.getPolicies().getPolicy().get(j).getPolicyType().toString().contains( "Constraint" ) ){

+								  constraints.add(tempNodeTemplate.getPolicies().getPolicy().get(j).getName());

+							  }

 						  }

 					  }

 				  }

+

+				  

 			  }

 

-			  

 		  }

+		  

+		  return constraints;

 

 	  }

+

 	  

-	  return constraints;

+	  /**

+	   * Access to the List of Data Stage-In elements.

+	   * 

+	   * @return DataStage-In list set by the user.

+	   */

+	  public String getSelectedCondition() {

+	    return ElasticityConditionDialog.this.condition;

+	  }

+	  

+	  public ConditionType getSYBLCondition() {

+	    

+	    ConditionType strategyCondition = SyblFactory.eINSTANCE.createConditionType();

+	    BinaryRestriction br = SyblFactory.eINSTANCE.createBinaryRestriction();

+	    br.setType( this.conditionOperator );

+	    LeftHandSideType conditionLeft = SyblFactory.eINSTANCE.createLeftHandSideType();

+	    conditionLeft.setMetric( this.conditionLeft );

+	    br.setLeftHandSide( conditionLeft );

+	    RightHandSideType conditionRight = SyblFactory.eINSTANCE.createRightHandSideType();

+	    conditionRight.setNumber( this.conditionRight );

+	    br.setRightHandSide( conditionRight );

+	    UnaryRestriction ur = SyblFactory.eINSTANCE.createUnaryRestriction();

+	    ur.setType( "hi4" );

+	    strategyCondition.getBinaryRestrictionsConjunction().add( br );

+	    strategyCondition.getUnaryRestrictionsConjunction().add( ur );

+	    

+	    return strategyCondition;

 

-  }

+	  }

 

-  

-  /**

-   * Access to the List of Data Stage-In elements.

-   * 

-   * @return DataStage-In list set by the user.

-   */

-  public String getSelectedCondition() {

-    return ElasticityConditionDialog.this.condition;

-  }

-  

-  public ConditionType getSYBLCondition() {

-    

-    ConditionType strategyCondition = SyblFactory.eINSTANCE.createConditionType();

-    BinaryRestriction br = SyblFactory.eINSTANCE.createBinaryRestriction();

-    br.setType( this.conditionOperator );

-    LeftHandSideType conditionLeft = SyblFactory.eINSTANCE.createLeftHandSideType();

-    conditionLeft.setMetric( this.conditionLeft );

-    br.setLeftHandSide( conditionLeft );

-    RightHandSideType conditionRight = SyblFactory.eINSTANCE.createRightHandSideType();

-    conditionRight.setNumber( this.conditionRight );

-    br.setRightHandSide( conditionRight );

-    UnaryRestriction ur = SyblFactory.eINSTANCE.createUnaryRestriction();

-    ur.setType( "hi4" );

-    strategyCondition.getBinaryRestrictionsConjunction().add( br );

-    strategyCondition.getUnaryRestrictionsConjunction().add( ur );

-    

-    return strategyCondition;

-

-  }

-

-  @SuppressWarnings("boxing")

-  @Override

-  protected void okPressed() {

-           

-    ElasticityConditionDialog.this.conditionLeft = this.cmbGlobalElasticityReq.getText();

-    ElasticityConditionDialog.this.conditionRight = this.valueText.getText();

-    ElasticityConditionDialog.this.conditionOperator = this.cmbOperator.getText();

-    if ( this.conditionSelected ){

-      ElasticityConditionDialog.this.condition = "CASE fulfilled(" + this.cmbCondition.getText().split( ":" )[0] + "):";

-    }

-    else if ( this.conditionSelected2 ){

-    	ElasticityConditionDialog.this.condition = "CASE violated(" + this.cmbCondition2.getText().split( ":" )[0] + "):";

-    }

-    else {      

-      ElasticityConditionDialog.this.condition = "CASE " + this.cmbGlobalElasticityReq.getText() + this.cmbOperator.getText() + this.valueText.getText();

-    }

-                                                                                             

-    super.okPressed();

-  }

-}

+	  @SuppressWarnings("boxing")

+	  @Override

+	  protected void okPressed() {

+	           

+	    ElasticityConditionDialog.this.conditionLeft = this.cmbGlobalElasticityReq.getText();

+	    ElasticityConditionDialog.this.conditionRight = this.valueText.getText();

+	    ElasticityConditionDialog.this.conditionOperator = this.cmbOperator.getText();

+	    if ( this.conditionSelected ){

+	      ElasticityConditionDialog.this.condition = "CASE fulfilled(" + this.cmbCondition.getText().split( ":" )[0] + "):";

+	    }

+	    else if ( this.conditionSelected2 ){

+	    	ElasticityConditionDialog.this.condition = "CASE violated(" + this.cmbCondition2.getText().split( ":" )[0] + "):";

+	    }

+	    else {      

+	      ElasticityConditionDialog.this.condition = "CASE " + this.cmbGlobalElasticityReq.getText() + this.cmbOperator.getText() + this.valueText.getText();

+	    }

+	                                                                                             

+	    super.okPressed();

+	  }

+	}

 

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityConstraintDialog.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityConstraintDialog.java
index fc252ef..b808e32 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityConstraintDialog.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityConstraintDialog.java
@@ -52,19 +52,14 @@
 

 public class ElasticityConstraintDialog extends Dialog {

 

-  protected Text typeText;

-  protected Text valueText;

-  protected boolean editMode = false;

-  protected boolean addMode = false;

-  protected String newType;

-  protected String elasticityRequirement;

-  private CCombo cmbGlobalElasticityReq;

-  private CCombo cmbOperator;

-  private String component;

-  private String constraintLeft;

-  private String constraintRight;

-  private String constraintOperator;

-

+	 protected Text typeText;

+	  protected Text valueText;

+	  protected boolean editMode = false;

+	  protected boolean addMode = false;

+	  protected String newType;

+	  protected String elasticityRequirement;

+	  private CCombo cmbGlobalElasticityReq;

+	  private CCombo cmbOperator;

   

   /**

    * @param parentShell

@@ -74,7 +69,6 @@
     super( parentShell );

     this.elasticityRequirement = null;

     this.addMode = true;

-    this.component = component;

   }

 

   @Override

@@ -101,33 +95,28 @@
     this.cmbGlobalElasticityReq.setEnabled( true );

     gd = new GridData( 212, 20 );

     this.cmbGlobalElasticityReq.setLayoutData( gd );

-    

     ArrayList<MonitoringProbe> mps = getMetrics();

-    

-    for (MonitoringProbe mp : mps){

+    for( MonitoringProbe mp : mps ) {

       String metricsString = mp.getDescription();

-      if (metricsString.equals( "" )==false){

-        metricsString = metricsString.substring( 2, metricsString.length()-2 );

+      if( metricsString.equals( "" ) == false ) {

+        metricsString = metricsString.substring( 2, metricsString.length() - 2 );

         metricsString = metricsString.replace( "\"", "" );

-      String[] metrics = metricsString.split( "," );

-      for (String metric : metrics)

-        this.cmbGlobalElasticityReq.add(metric);

-      }

-      else{

-        this.cmbGlobalElasticityReq.add(mp.getName());

+        String[] metrics = metricsString.split( "," );

+        for( String metric : metrics )

+          this.cmbGlobalElasticityReq.add( metric );

+      } else {

+        this.cmbGlobalElasticityReq.add( mp.getName() );

       }

     }

     this.cmbGlobalElasticityReq.add( "CostPerHour ($)" );

-

+    this.cmbGlobalElasticityReq.add( "Response Time" );

     Composite valueComposite = new Composite( composite, SWT.NONE );

     gLayout = new GridLayout( 3, false );

     valueComposite.setLayout( gLayout );

-    

     Label valueLabel = new Label( valueComposite, SWT.LEAD );

     valueLabel.setText( "Value" ); //$NON-NLS-1$

     gd = new GridData( 50, 20 );

     valueLabel.setLayoutData( gd );

-    

     // Combo - Operator

     this.cmbOperator = new CCombo( valueComposite, SWT.BORDER );

     this.cmbOperator.setEnabled( true );

@@ -135,92 +124,55 @@
     this.cmbOperator.setLayoutData( gd );

     this.cmbOperator.add( "=" ); //$NON-NLS-1$

     this.cmbOperator.add( "<" ); //$NON-NLS-1$

-    this.cmbOperator.add( ">" );  //$NON-NLS-1$

-    this.cmbOperator.setText( this.cmbOperator.getItem( 0 ) );  

-    

+    this.cmbOperator.add( ">" ); //$NON-NLS-1$

+    this.cmbOperator.setText( this.cmbOperator.getItem( 0 ) );

     this.valueText = new Text( valueComposite, SWT.BORDER );

     gd = new GridData( 154, 20 );

-    this.valueText.setLayoutData( gd ); 

-

+    this.valueText.setLayoutData( gd );

     return composite;

   }

 

-  public ArrayList<MonitoringProbe> getMetrics(){

-    

-    ArrayList<MonitoringProbe> mps = MockUpInfoSystem.getInstance()

-        .getMonitoringProbes();

-        

-        ArrayList<MonitoringProbe> mpsCopy = ( ArrayList<MonitoringProbe> )mps.clone();

-        

-    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

-    IProject monitoringProbesProject = workspaceRoot.getProject( "MonitoringProbe" );

+  public ArrayList<MonitoringProbe> getMetrics() {

+	    ArrayList<MonitoringProbe> mps = MockUpInfoSystem.getInstance()

+	      .getMonitoringProbes();

+	    @SuppressWarnings("unchecked")

+	    ArrayList<MonitoringProbe> mpsCopy = ( ArrayList<MonitoringProbe> )mps.clone();

+	    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

+	    IProject monitoringProbesProject = workspaceRoot.getProject( "MonitoringProbe" );

+	    if( monitoringProbesProject.exists() ) {

+	      IFolder srcFolder = monitoringProbesProject.getFolder( "src" );

+	      IResource[] artifactsResource = null;

+	      try {

+	        artifactsResource = srcFolder.members();

+	      } catch( CoreException e ) {

+	        // TODO Auto-generated catch block

+	        e.printStackTrace();

+	      }

+	      for( IResource tempResource : artifactsResource ) {

+	        if( tempResource instanceof IFile ) {

+	          MonitoringProbe mp = InfoSystemFactory.eINSTANCE.createMonitoringProbe();

+	          mp.setUID( tempResource.getName().replaceFirst( ".java", "" ) );

+	          mp.setName( tempResource.getName().replaceFirst( ".java", "" ) );

+	          mp.setDescription( "" );

+	          // add new probe to monitoring list

+	          mpsCopy.add( 0, mp );

+	        }

+	      }

+	    }

+	    return mpsCopy;

+	  }

 

-    if( monitoringProbesProject.exists() ) {

-      IFolder srcFolder = monitoringProbesProject.getFolder( "src" );

-      IResource[] artifactsResource = null;

-      try {

-        artifactsResource = srcFolder.members();

-      } catch( CoreException e ) {

-        // TODO Auto-generated catch block

-        e.printStackTrace();

-      }

-      for( IResource tempResource : artifactsResource ) {

-        if( tempResource instanceof IFile ) {

-          MonitoringProbe mp = InfoSystemFactory.eINSTANCE.createMonitoringProbe();

-          mp.setUID( tempResource.getName().replaceFirst( ".java", "" ));

-          mp.setName( tempResource.getName().replaceFirst( ".java", "" ));

-          mp.setDescription( "" );

-          mp.setURL( "" );

-          // add new probe to monitoring list

-          mpsCopy.add( 0, mp );

-        }

-      }

-    }

-    

-    return mpsCopy;

-  }

-  

-  public String getElasticityConstraint() {

-    return ElasticityConstraintDialog.this.elasticityRequirement;

-  }

-  

-  public SyblElasticityRequirementsDescription getSYBLConstraint(){

+	  public String getElasticityConstraint() {

+	    return ElasticityConstraintDialog.this.elasticityRequirement;

+	  }

 

-    SyblElasticityRequirementsDescription serd = SyblFactory.eINSTANCE.createSyblElasticityRequirementsDescription();

-    

-    Constraint propertiesConstraint = SyblFactory.eINSTANCE.createConstraint();

-    ToEnforceType1 constraintToEnforce = SyblFactory.eINSTANCE.createToEnforceType1();

-    propertiesConstraint.setId( "hi" );

-    propertiesConstraint.setToEnforce( constraintToEnforce );

-    

-    BinaryRestriction br = SyblFactory.eINSTANCE.createBinaryRestriction();

-    br.setType( this.constraintOperator );

-    LeftHandSideType constraintLeft = SyblFactory.eINSTANCE.createLeftHandSideType();

-    constraintLeft.setMetric( this.constraintLeft );

-    br.setLeftHandSide( constraintLeft );

-    RightHandSideType constraintRight = SyblFactory.eINSTANCE.createRightHandSideType();

-    constraintRight.setNumber( this.constraintRight );

-    br.setRightHandSide( constraintRight );

-    constraintToEnforce.getBinaryRestrictionsConjunction().add( br );

-    

-    SYBLSpecificationType sst = SyblFactory.eINSTANCE.createSYBLSpecificationType();

-    sst.getConstraint().add( propertiesConstraint );

-    serd.getSYBLSpecification().add( sst );

-    

-    return serd;

-  }

-

-  @SuppressWarnings("boxing")

-  @Override

-  protected void okPressed() {

- 

-    ElasticityConstraintDialog.this.constraintLeft = this.cmbGlobalElasticityReq.getText();

-    ElasticityConstraintDialog.this.constraintRight = this.valueText.getText();

-    ElasticityConstraintDialog.this.constraintOperator = this.cmbOperator.getText();

-    

-    ElasticityConstraintDialog.this.elasticityRequirement = this.cmbGlobalElasticityReq.getText() + this.cmbOperator.getText() + this.valueText.getText();

-                                                                                             

-    super.okPressed();

-  }

+	  @SuppressWarnings("boxing")

+	  @Override

+	  protected void okPressed() {

+	    ElasticityConstraintDialog.this.elasticityRequirement = this.cmbGlobalElasticityReq.getText()

+	                                                            + this.cmbOperator.getText()

+	                                                            + this.valueText.getText();

+	    super.okPressed();

+	  }

 }

 

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityStrategyDialog.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityStrategyDialog.java
index bd46d88..31332f5 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityStrategyDialog.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/dialog/ElasticityStrategyDialog.java
@@ -39,7 +39,7 @@
 

 public class ElasticityStrategyDialog extends Dialog {

 

-  protected Text typeText;

+	protected Text typeText;

   protected Text valueText;

   protected boolean editMode = false;

   protected boolean addMode = false;

@@ -48,19 +48,17 @@
   private CCombo cmbStrategy;

   private CCombo cmbMetric;

   private CCombo cmbElasticityAction;

-  private String component;

-  

+  private String nodeName;

+

   /**

    * @param parentShell

    */

-  public ElasticityStrategyDialog( final Shell parentShell, String component )

-  {

+  public ElasticityStrategyDialog( final Shell parentShell, String component, String nodeName ) {

     super( parentShell );

     this.addMode = true;

-    this.component = component;

+    this.nodeName = nodeName;

   }

 

-

   @Override

   protected void configureShell( final Shell shell ) {

     super.configureShell( shell );

@@ -73,69 +71,47 @@
     Composite composite = ( Composite )super.createDialogArea( parent );

     composite.setLayout( new GridLayout( 1, false ) );

     composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );

-

     // Choose from Supported Elasticity Actions Group

     Group elasticityActionsGroup = new Group( composite, SWT.NONE );

     elasticityActionsGroup.setLayout( new GridLayout( 1, false ) );

     elasticityActionsGroup.setText( "&Select Strategy" );

     GridData gData = new GridData( SWT.FILL, SWT.FILL, true, true );

     elasticityActionsGroup.setLayoutData( gData );

-

     // Combo - GlobalElasticityReq

     this.cmbElasticityAction = new CCombo( elasticityActionsGroup, SWT.BORDER );

     this.cmbElasticityAction.setEnabled( true );

     GridData gd = new GridData( GridData.FILL_HORIZONTAL );

     this.cmbElasticityAction.setLayoutData( gd );

-

-    this.cmbElasticityAction.add( "AddVM" );

-    this.cmbElasticityAction.add( "RemoveVM" );

-    this.cmbElasticityAction.setText( this.cmbElasticityAction.getItem( 0 ) );  

-    

+//	    this.cmbElasticityAction.add( "AddVM" );

+//	    this.cmbElasticityAction.add( "RemoveVM" );

+    this.cmbElasticityAction.add( "scaleIn" );

+    this.cmbElasticityAction.add( "scaleOut" );

+    this.cmbElasticityAction.setText( this.cmbElasticityAction.getItem( 0 ) );

     this.cmbElasticityAction.setEditable( false );

-    

-    //Create New Strategy Group

+    // Create New Strategy Group

     Group customStrategyGroup = new Group( composite, SWT.NONE );

     customStrategyGroup.setLayout( new GridLayout( 1, false ) );

     customStrategyGroup.setText( "&Specify New Strategy" );

     gData = new GridData( SWT.FILL, SWT.FILL, true, true );

     customStrategyGroup.setLayoutData( gData );

-

     // Combo - GlobalElasticityReq

     this.cmbStrategy = new CCombo( customStrategyGroup, SWT.BORDER );

     this.cmbStrategy.setEnabled( true );

     gd = new GridData( GridData.FILL_HORIZONTAL );

     this.cmbStrategy.setLayoutData( gd );

-

     this.cmbStrategy.add( "Maximize" );

     this.cmbStrategy.add( "Minimize" );

-    this.cmbStrategy.setText( this.cmbStrategy.getItem( 0 ) );  

-    

+    this.cmbStrategy.setText( this.cmbStrategy.getItem( 0 ) );

     this.cmbStrategy.setEditable( false );

-        

     // Combo - Metric

-

     this.cmbMetric = new CCombo( customStrategyGroup, SWT.BORDER );

     this.cmbMetric.setEnabled( true );

     this.cmbMetric.setEditable( false );

     GridData gdMetric = new GridData( GridData.FILL_HORIZONTAL );

     this.cmbMetric.setLayoutData( gdMetric );

-    

-//    if( this.component.compareTo( "Application" ) == 0 ) {

-//      List<ElasticityRequirementCategory> categories = ElasticityRequirementCategory.VALUES;

-//      for( ElasticityRequirementCategory tempCat : categories ) {

-//        this.cmbMetric.add( tempCat.toString() );

-//      }

-//    } 

-//    else if( this.component.compareTo( "Application Component" ) == 0 ) {

-//      List<ApplicationComponentElasticityRequirementCategory> categories = ApplicationComponentElasticityRequirementCategory.VALUES;

-//      for( ApplicationComponentElasticityRequirementCategory tempCat : categories )

-//      {

-//        this.cmbMetric.add( tempCat.toString() );

-//      }

-//      this.cmbMetric.add( "Latency" );

-//    }

-

-    this.cmbMetric.add( "Latency" );

+    this.cmbMetric.add( "Cost" );

+    this.cmbMetric.add( "Throughput" );

+    this.cmbMetric.add( "Response Time" );

     return composite;

   }

 

@@ -147,35 +123,22 @@
   public String getElasticityStrategy() {

     return ElasticityStrategyDialog.this.elasticityStrategy;

   }

-  

-  public SyblElasticityRequirementsDescription getSYBLStrategy(){

-

-    SyblElasticityRequirementsDescription serd = SyblFactory.eINSTANCE.createSyblElasticityRequirementsDescription();

-    

-    Strategy propertiesStrategy = SyblFactory.eINSTANCE.createStrategy();

-    ToEnforceType strategyToEnforce = SyblFactory.eINSTANCE.createToEnforceType();

-    propertiesStrategy.setId( "hi" );

-    propertiesStrategy.setToEnforce( strategyToEnforce );

-    strategyToEnforce.setActionName( this.elasticityStrategy );

-    strategyToEnforce.setParameter( "hi2" );

-    SYBLSpecificationType sst = SyblFactory.eINSTANCE.createSYBLSpecificationType();

-    sst.getStrategy().add( propertiesStrategy );

-    serd.getSYBLSpecification().add( sst );

-    

-    return serd;

-  }

 

   @SuppressWarnings("boxing")

   @Override

   protected void okPressed() {

-

-    if ( !(this.cmbMetric.getText().equals( "" )) ){

-      ElasticityStrategyDialog.this.elasticityStrategy = this.cmbStrategy.getText() + " (" + this.cmbMetric.getText() + ")";

-    } 

-    else{

-      ElasticityStrategyDialog.this.elasticityStrategy = this.cmbElasticityAction.getText();

+    if( !( this.cmbMetric.getText().equals( "" ) ) ) {

+      ElasticityStrategyDialog.this.elasticityStrategy = this.cmbStrategy.getText()

+                                                         + " ("

+                                                         + this.cmbMetric.getText()

+                                                         + ")";

+    } else {

+      //ElasticityStrategyDialog.this.elasticityStrategy = this.cmbElasticityAction.getText();

+      ElasticityStrategyDialog.this.elasticityStrategy = this.cmbElasticityAction.getText()

+          + " ("

+          + this.nodeName

+          + ")";

     }

-    

     super.okPressed();

   }

 }

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/AddSoftwareDependencyFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/AddSoftwareDependencyFeature.java
index 65097d2..2b59eb5 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/AddSoftwareDependencyFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/AddSoftwareDependencyFeature.java
@@ -16,12 +16,14 @@
  *******************************************************************************/
 package org.eclipse.camf.tosca.editor.features;
 
+import org.eclipse.camf.tosca.TArtifactTemplate;
 import org.eclipse.camf.tosca.TDeploymentArtifact;
 import org.eclipse.camf.tosca.editor.StyleUtil;
 import org.eclipse.graphiti.features.IAddFeature;
 import org.eclipse.graphiti.features.IFeatureProvider;
 import org.eclipse.graphiti.features.context.IAddContext;
 import org.eclipse.graphiti.features.context.IContext;
+import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
 import org.eclipse.graphiti.features.impl.AbstractFeature;
 import org.eclipse.graphiti.mm.algorithms.Polyline;
 import org.eclipse.graphiti.mm.algorithms.Rectangle;
@@ -38,8 +40,7 @@
 import org.eclipse.graphiti.util.ColorConstant;
 import org.eclipse.graphiti.util.IColorConstant;
 
-public class AddSoftwareDependencyFeature extends AbstractFeature
-  implements IAddFeature
+public class AddSoftwareDependencyFeature extends AbstractAddShapeFeature
 {
 
   private static final IColorConstant E_CLASS_TEXT_FOREGROUND = IColorConstant.BLACK;
@@ -59,14 +60,16 @@
   public boolean canAdd( final IAddContext context ) {
 	  
 	    boolean result = false;
-	    boolean diagraminstance = context.getTargetContainer() instanceof Diagram;
-
-	    if( context.getNewObject() instanceof TDeploymentArtifact
-	        && !diagraminstance )
-	    {
-	      if (((TDeploymentArtifact)context.getNewObject()).getArtifactType().toString().compareTo( "SD" )==0)
-	        result = true;
-	    }
+	    boolean diagraminstance = context.getTargetContainer() instanceof Diagram;    
+	    
+	     if( context.getNewObject() instanceof TArtifactTemplate
+      && !diagraminstance )
+      {
+        if (((TArtifactTemplate)context.getNewObject()).getName().contains( "SD" ))
+          result = true;
+      }
+	    
+	    
 	    return result;
 
   }
@@ -75,7 +78,7 @@
   @Override
   public PictogramElement add( final IAddContext context ) {
 	  
-	TDeploymentArtifact addedClass = ( TDeploymentArtifact )context.getNewObject();
+    TArtifactTemplate addedClass = ( TArtifactTemplate )context.getNewObject();
 	    
     ContainerShape targetDiagram = context.getTargetContainer();
     Object[] targetDiagrams = targetDiagram.getChildren().toArray();
@@ -135,7 +138,9 @@
       // create shape for text
       Shape shape = peCreateService.createShape( containerShape, false );
       // create and set text graphics algorithm
-      Text text = gaService.createText( shape, addedClass.getName() );
+      // 2 is the size of "SD"
+      Text text = gaService.createText( shape, addedClass.getName().substring( 2 ) );
+      //Text text = gaService.createText( shape, findImplementationArtifactName(addedClass.getId()) );
       text.setForeground( manageColor( E_CLASS_TEXT_FOREGROUND ) );
       text.setHorizontalAlignment( Orientation.ALIGNMENT_CENTER );
       // vertical alignment has as default value "center"
@@ -151,13 +156,23 @@
     return containerShape;
   }
 
-  @Override
-  public boolean canExecute( final IContext context ) {
-    return false;
-  }
-
-  @Override
-  public void execute( final IContext context ) {
-    // TODO Auto-generated method stub
-  }
+  
+//  private String findImplementationArtifactName(String artifactId){
+//    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );
+//    DocumentRoot dr = model.getDocumentRoot();
+//    DefinitionsType dt = dr.getDefinitions();
+//    EList<TArtifactTemplate> artifactTemplates =
+//    dt.getArtifactTemplate();
+//
+//    for (TArtifactTemplate tempArtifactTemplate : artifactTemplates){
+//      if (tempArtifactTemplate.getId().equals( artifactId )){
+//        TArtifactReference artifactRef = tempArtifactTemplate.getArtifactReferences().getArtifactReference().get( 0 );
+//        String artifactReference = artifactRef.getReference();
+//        String artifactName = artifactReference.substring( artifactReference.indexOf( "\\" ) +1);
+//        return artifactName;
+//      }
+//    }
+//
+//   return null;
+//  }
 }
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/AddVirtualMachineFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/AddVirtualMachineFeature.java
index e43e144..a093570 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/AddVirtualMachineFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/AddVirtualMachineFeature.java
@@ -22,6 +22,7 @@
 import org.eclipse.camf.tosca.TDeploymentArtifact;
 import org.eclipse.camf.tosca.ToscaFactory;
 import org.eclipse.camf.tosca.editor.diagram.ToscaFeatureProvider;
+import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsPackage;
 import org.eclipse.graphiti.features.IFeatureProvider;
 import org.eclipse.graphiti.features.context.IAddContext;
 import org.eclipse.graphiti.features.context.impl.CreateContext;
@@ -50,6 +51,8 @@
                                                                               178,
                                                                               170 );
 
+  private String imageType = Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getImageArtifactPropertiesType().getName();
+
   public AddVirtualMachineFeature( final IFeatureProvider fp ) {
     super( fp );
   }
@@ -69,7 +72,7 @@
     {
       if( ( ( TDeploymentArtifact )context.getNewObject() ).getArtifactType()
         .toString()
-        .compareTo( "VMI" ) == 0 )
+        .compareTo( imageType ) == 0 )
         result = true;
     } else if( context.getNewObject() instanceof VirtualMachineImage ) {
       result = true;
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateApplicationComponentFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateApplicationComponentFeature.java
index 520101f..688cdcb 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateApplicationComponentFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateApplicationComponentFeature.java
@@ -44,7 +44,6 @@
   
   //-1 means not specified by user
   private static int DEFAULT_MAX_INSTANCES = -1;
-  private static int DEFAULT_INIT_INSTANCES = 1;
   
   private Object contextObject = null;
 
@@ -73,64 +72,63 @@
   // Creates the business object for the application component
   @Override
   public Object[] create( final ICreateContext context ) {
-    
-    if (this.contextObject == null) {
-      return null;
-    }
-    // create Application Component
-    TNodeTemplateExtension newClass = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createTNodeTemplateExtension();
-        
-    //newClass.setYcsbmulti( 1 );
-    //newClass.setCasmulti( 1 );
-    
-    // initialize Application Component
-    // Max or Min instances == 0 => nothing specified by user
-    newClass.setInitInstances( DEFAULT_INIT_INSTANCES );
-    newClass.setMinInstances( DEFAULT_MIN_INSTANCES );
-    newClass.setMaxInstances(  BigInteger.valueOf( DEFAULT_MAX_INSTANCES ) );
-    newClass.setId( ( "C" + ( Integer )newClass.hashCode() ).toString() );
-    //newClass.setType(((TNodeTemplateExtension) this.contextObject ).getType());
-    
-    //Set X and Y required for reloading tosca model in tosca editor
-    newClass.setX(context.getX());
-    newClass.setY(context.getY());
-    // create the node template
-    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );    
-    model.getDocumentRoot()
-      .getDefinitions()
-      .getServiceTemplate()
-      .get( 0 )
-      .getTopologyTemplate()
-      .getNodeTemplate()
-      .add( newClass );
-    Object parentObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getTargetContainer() );
-    TServiceTemplate serviceTemplate = null;
-    if( parentObject == null )
-      return null;
-    if( parentObject instanceof TServiceTemplate ) {
-      serviceTemplate = ( TServiceTemplate )parentObject;
-    }
-    TTopologyTemplate topology = null;
-    if( serviceTemplate.getTopologyTemplate() == null ) {
-      topology = ToscaFactory.eINSTANCE.createTTopologyTemplate();
-      serviceTemplate.setTopologyTemplate( topology );
-    } else {
-      topology = serviceTemplate.getTopologyTemplate();
-    }
-    
-    // Add object to domain model
-    topology.getNodeTemplate().add( newClass );
-        
-    // Add object to diagram model
-    //getDiagram().eResource().getContents().add(newClass);
-    
-    // do the add
-    addGraphicalRepresentation( context, newClass );
-    // activate direct editing after object creation
-    getFeatureProvider().getDirectEditingInfo().setActive( true );
-    // return newly created business object(s)
-    return new Object[]{
-      newClass
-    };
-  }
+	    
+	    if (this.contextObject == null) {
+	      return null;
+	    }
+	    // create Application Component
+	    TNodeTemplateExtension newClass = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createTNodeTemplateExtension();
+	        
+	    //newClass.setYcsbmulti( 1 );
+	    //newClass.setCasmulti( 1 );
+	    
+	    // initialize Application Component
+	    // Max or Min instances == 0 => nothing specified by user
+	    newClass.setMinInstances( DEFAULT_MIN_INSTANCES );
+	    newClass.setMaxInstances(  BigInteger.valueOf( DEFAULT_MAX_INSTANCES ) );
+	    newClass.setId( ( "C" + ( Integer )newClass.hashCode() ).toString() );
+	    //newClass.setType(((TNodeTemplateExtension) this.contextObject ).getType());
+	    
+	    //Set X and Y required for reloading tosca model in tosca editor
+	    newClass.setX(context.getX());
+	    newClass.setY(context.getY());
+	    // create the node template
+	    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );    
+	    model.getDocumentRoot()
+	      .getDefinitions()
+	      .getServiceTemplate()
+	      .get( 0 )
+	      .getTopologyTemplate()
+	      .getNodeTemplate()
+	      .add( newClass );
+	    Object parentObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getTargetContainer() );
+	    TServiceTemplate serviceTemplate = null;
+	    if( parentObject == null )
+	      return null;
+	    if( parentObject instanceof TServiceTemplate ) {
+	      serviceTemplate = ( TServiceTemplate )parentObject;
+	    }
+	    TTopologyTemplate topology = null;
+	    if( serviceTemplate.getTopologyTemplate() == null ) {
+	      topology = ToscaFactory.eINSTANCE.createTTopologyTemplate();
+	      serviceTemplate.setTopologyTemplate( topology );
+	    } else {
+	      topology = serviceTemplate.getTopologyTemplate();
+	    }
+	    
+	    // Add object to domain model
+	    topology.getNodeTemplate().add( newClass );
+	        
+	    // Add object to diagram model
+	    //getDiagram().eResource().getContents().add(newClass);
+	    
+	    // do the add
+	    addGraphicalRepresentation( context, newClass );
+	    // activate direct editing after object creation
+	    getFeatureProvider().getDirectEditingInfo().setActive( true );
+	    // return newly created business object(s)
+	    return new Object[]{
+	      newClass
+	    };
+	  }
 }
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateKeyPairFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateKeyPairFeature.java
index ed4d28f..241bbd7 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateKeyPairFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateKeyPairFeature.java
@@ -16,10 +16,22 @@
  *******************************************************************************/
 package org.eclipse.camf.tosca.editor.features;
 
+import org.eclipse.camf.tosca.DefinitionsType;
+import org.eclipse.camf.tosca.PropertiesType;
+import org.eclipse.camf.tosca.TArtifactTemplate;
 import org.eclipse.camf.tosca.TDeploymentArtifact;
 import org.eclipse.camf.tosca.TDeploymentArtifacts;
 import org.eclipse.camf.tosca.TNodeTemplate;
 import org.eclipse.camf.tosca.ToscaFactory;
+import org.eclipse.camf.tosca.editor.ModelHandler;
+import org.eclipse.camf.tosca.editor.ToscaModelLayer;
+import org.eclipse.camf.tosca.elasticity.ImageArtifactPropertiesType;
+import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsFactory;
+import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsPackage;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.util.FeatureMap.Entry;
+import org.eclipse.emf.ecore.xml.type.internal.QName;
 import org.eclipse.emf.transaction.RecordingCommand;
 import org.eclipse.emf.transaction.TransactionalEditingDomain;
 import org.eclipse.emf.transaction.util.TransactionUtil;
@@ -46,7 +58,7 @@
   // business object
   @Override
   public boolean canCreate( final ICreateContext context ) {
-    if( context.getTargetContainer() instanceof Diagram ){
+    if( context.getTargetContainer() instanceof Diagram ) {
       return false;
     }
     Object parentBo = getFeatureProvider().getBusinessObjectForPictogramElement( context.getTargetContainer() );
@@ -58,24 +70,22 @@
 
   // Creates the business object for the user application
   @Override
-  public Object[] create( final ICreateContext context ) {    
+  public Object[] create( final ICreateContext context ) {
     if( this.contextObject == null )
       return null;
     Object parentObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getTargetContainer() );
     TNodeTemplate tNode = null;
-    
     if( parentObject == null )
       return null;
-    
     if( parentObject instanceof TNodeTemplate ) {
       tNode = ( TNodeTemplate )parentObject;
     }
-    
-    if (tNode.getName()==null){
-      MessageDialog.openError(null, "Error", "Give a Name to the selected Component and try again.");
+    if( tNode.getName() == null ) {
+      MessageDialog.openError( null,
+                               "Error",
+                               "Give a Name to the selected Component and try again." );
       return null;
     }
-    
     if( tNode.getDeploymentArtifacts() == null ) {
       final TNodeTemplate node = tNode;
       TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
@@ -89,11 +99,14 @@
     }
     // Add the new deployment artifact to the list
     final TDeploymentArtifacts deploymentArtifacts = tNode.getDeploymentArtifacts();
-    TDeploymentArtifact tempDeploymentArtifact = ( TDeploymentArtifact ) this.contextObject;
+    TDeploymentArtifact tempDeploymentArtifact = ( TDeploymentArtifact )this.contextObject;
     TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();
     deploymentArtifact.setName( tempDeploymentArtifact.getName() );
     deploymentArtifact.setArtifactType( tempDeploymentArtifact.getArtifactType() );
-    
+    String deploymentArtifactName = "K"
+                                    + ( tempDeploymentArtifact.getName() ).replaceAll( "[^a-zA-Z0-9\\s]",
+                                                                                       "" );
+    deploymentArtifact.setArtifactRef( new QName( deploymentArtifactName ) );
     final TDeploymentArtifact tempArtifact = deploymentArtifact;
     TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
     editingDomain.getCommandStack()
@@ -105,6 +118,13 @@
       } );
     // ///////////////////////////////////////////
     addGraphicalRepresentation( context, deploymentArtifact );
+    // Create Key Pair Artifact Template
+    String deploymentArtifactRef = "K"
+                                   + ( deploymentArtifact.getArtifactRef().toString() ).replaceAll( "[^a-zA-Z0-9\\s]",
+                                                                                                    "" );
+    createArtifactTemplate( "not_specified",
+                            deploymentArtifactName,
+                            deploymentArtifactRef );
     // ///////////////////////////////////////////
     // activate direct editing after object creation
     getFeatureProvider().getDirectEditingInfo().setActive( true );
@@ -113,4 +133,49 @@
       deploymentArtifact
     };
   }
+
+  private void createArtifactTemplate( String description,
+                                       String artifactRef,
+                                       String imageId )
+  {
+    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );
+    for( TArtifactTemplate tempArtifactTemplate : model.getDocumentRoot()
+      .getDefinitions()
+      .getArtifactTemplate() )
+    {
+      if( tempArtifactTemplate.getId().equals( imageId ) )
+        return;
+    }
+    // Create Artifact Template
+    final TArtifactTemplate artifactTemplate = ToscaFactory.eINSTANCE.createTArtifactTemplate();
+    // Create Image Artifact Properties
+    ImageArtifactPropertiesType imageProperties = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createImageArtifactPropertiesType();
+    imageProperties.setDescription( description );
+    if( imageId != null ) {
+      imageProperties.setId( imageId );
+    }
+    // Set the Properties of the Policy Template
+    PropertiesType properties = ToscaFactory.eINSTANCE.createPropertiesType();
+    // Add the SYBL Policy to the FeatureMap of the Policy's Properties element
+    Entry e = FeatureMapUtil.createEntry( Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getDocumentRoot_ImageArtifactProperties(),
+                                          imageProperties );
+    properties.getAny().add( e );
+    artifactTemplate.setProperties( properties );
+    // artifactTemplate.setId( imageId );
+    artifactTemplate.setId( artifactRef );
+    // Add the new Artifact Template to the TOSCA Definitions element
+    DefinitionsType definitions = model.getDocumentRoot().getDefinitions();
+    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );
+    editingDomain.getCommandStack()
+      .execute( new RecordingCommand( editingDomain ) {
+
+        @Override
+        protected void doExecute() {
+          model.getDocumentRoot()
+            .getDefinitions()
+            .getArtifactTemplate()
+            .add( artifactTemplate );
+        }
+      } );
+  }
 }
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateNetworkFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateNetworkFeature.java
index 5d78403..8bc0404 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateNetworkFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateNetworkFeature.java
@@ -16,10 +16,22 @@
  *******************************************************************************/
 package org.eclipse.camf.tosca.editor.features;
 
+import org.eclipse.camf.tosca.DefinitionsType;
+import org.eclipse.camf.tosca.PropertiesType;
+import org.eclipse.camf.tosca.TArtifactTemplate;
 import org.eclipse.camf.tosca.TDeploymentArtifact;
 import org.eclipse.camf.tosca.TDeploymentArtifacts;
 import org.eclipse.camf.tosca.TNodeTemplate;
 import org.eclipse.camf.tosca.ToscaFactory;
+import org.eclipse.camf.tosca.editor.ModelHandler;
+import org.eclipse.camf.tosca.editor.ToscaModelLayer;
+import org.eclipse.camf.tosca.elasticity.ImageArtifactPropertiesType;
+import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsFactory;
+import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsPackage;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.util.FeatureMap.Entry;
+import org.eclipse.emf.ecore.xml.type.internal.QName;
 import org.eclipse.emf.transaction.RecordingCommand;
 import org.eclipse.emf.transaction.TransactionalEditingDomain;
 import org.eclipse.emf.transaction.util.TransactionUtil;
@@ -94,6 +106,9 @@
     deploymentArtifact.setName( tempDeploymentArtifact.getName() );
     deploymentArtifact.setArtifactType( tempDeploymentArtifact.getArtifactType() );
     
+    String deploymentArtifactName = "N" + (tempDeploymentArtifact.getName()).replaceAll("[^a-zA-Z0-9\\s]", "");
+    deploymentArtifact.setArtifactRef( new QName(deploymentArtifactName) );
+    
     final TDeploymentArtifact tempArtifact = deploymentArtifact;
     TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
     editingDomain.getCommandStack()
@@ -106,6 +121,11 @@
     // ///////////////////////////////////////////
     addGraphicalRepresentation( context, deploymentArtifact );
     // ///////////////////////////////////////////
+    
+    //Create Network Artifact Template
+    String deploymentArtifactRef = "N" + (deploymentArtifact.getArtifactRef().toString()).replaceAll("[^a-zA-Z0-9\\s]", "");
+    createArtifactTemplate("not_specified", deploymentArtifactName, deploymentArtifactRef);
+    
     // activate direct editing after object creation
     getFeatureProvider().getDirectEditingInfo().setActive( true );
     // return newly created business object(s)
@@ -113,4 +133,55 @@
       deploymentArtifact
     };
   }
+  
+  private void createArtifactTemplate(String description, String artifactRef, String imageId){
+	    
+	    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );
+	    
+	    for (TArtifactTemplate tempArtifactTemplate : model.getDocumentRoot()
+	        .getDefinitions()
+	        .getArtifactTemplate()){
+	      if (tempArtifactTemplate.getId().equals( imageId ))
+	        return;
+	    }
+	  
+	    //Create Artifact Template
+	    final TArtifactTemplate artifactTemplate = ToscaFactory.eINSTANCE.createTArtifactTemplate();
+	    
+	    //Create Image Artifact Properties
+	    ImageArtifactPropertiesType imageProperties = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createImageArtifactPropertiesType();
+	    imageProperties.setDescription( description );
+	    
+	    if (imageId!=null){
+	      imageProperties.setId( imageId );
+	    }
+	    
+	    // Set the Properties of the Policy Template    
+	    PropertiesType properties = ToscaFactory.eINSTANCE.createPropertiesType();   
+	    
+	    // Add the SYBL Policy to the FeatureMap of the Policy's Properties element
+	    Entry e = FeatureMapUtil.createEntry(     Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getDocumentRoot_ImageArtifactProperties(),  imageProperties );
+	    properties.getAny().add( e );   
+	    
+	    artifactTemplate.setProperties( properties );
+	 
+	    //artifactTemplate.setId( imageId );
+	    artifactTemplate.setId( artifactRef );
+	    
+	    // Add the new Artifact Template to the TOSCA Definitions element
+	    
+	    DefinitionsType definitions = model.getDocumentRoot().getDefinitions();
+	       
+	    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );
+	    editingDomain.getCommandStack()
+	      .execute( new RecordingCommand( editingDomain ) {
+
+	        @Override
+	        protected void doExecute() {
+	          model.getDocumentRoot().getDefinitions().getArtifactTemplate().add( artifactTemplate );
+	          
+	        }
+	      } );
+
+	  }
 }
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateResizeActionFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateResizeActionFeature.java
index cc27002..222ecc3 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateResizeActionFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/CreateResizeActionFeature.java
@@ -30,6 +30,7 @@
 import org.eclipse.camf.tosca.editor.ModelHandler;
 import org.eclipse.camf.tosca.editor.ToscaModelLayer;
 import org.eclipse.camf.tosca.elasticity.TBoundaryDefinitionsExtension;
+import org.eclipse.camf.tosca.elementCreators.CreateArtifactTemplate;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.emf.transaction.RecordingCommand;
@@ -46,257 +47,245 @@
 
 public class CreateResizeActionFeature extends AbstractCreateFeature {
 
-  private Object contextObject = null;
+	  private Object contextObject = null;
 
-  public CreateResizeActionFeature( final IFeatureProvider fp ) {
-    // set name and description of the creation feature
-    super( fp, "Resizing Action", "Resizing Action" ); //$NON-NLS-1$ //$NON-NLS-2$
-  }
+	  public CreateResizeActionFeature( final IFeatureProvider fp ) {
+	    // set name and description of the creation feature
+	    super( fp, "Resizing Action", "Resizing Action" ); //$NON-NLS-1$ //$NON-NLS-2$
+	  }
 
-  public void setContextObject( final Object obj ) {
-    this.contextObject = obj;
-  }
+	  public void setContextObject( final Object obj ) {
+	    this.contextObject = obj;
+	  }
 
-  // Checks if user can create an elasticity action object in the target
-  // business object
-  @Override
-  public boolean canCreate( final ICreateContext context ) {
-    Object parentBo = getFeatureProvider().getBusinessObjectForPictogramElement( context.getTargetContainer() );
-    if( parentBo instanceof TNodeTemplate || parentBo instanceof TServiceTemplate ) {
-      return true;
-    }
-    return false;
-  }
+	  // Checks if user can create an elasticity action object in the target
+	  // business object
+	  @Override
+	  public boolean canCreate( final ICreateContext context ) {
+	    Object parentBo = getFeatureProvider().getBusinessObjectForPictogramElement( context.getTargetContainer() );
+	    if( parentBo instanceof TNodeTemplate || parentBo instanceof TServiceTemplate ) {
+	      return true;
+	    }
+	    return false;
+	  }
 
-  // Creates the business object for the elasticity action
-  @Override
-  public Object[] create( final ICreateContext context ) {
-    // MessageConsole myConsole = findConsole("MyConsole");
-    // MessageConsoleStream out = myConsole.newMessageStream();
-    if( this.contextObject == null )
-      return null;
-    
-    String level = null;
-    
-    ResizingAction ra = ( ResizingAction )this.contextObject;
-    
-    Object parentObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getTargetContainer() );
+	  // Creates the business object for the elasticity action
+	  @Override
+	  public Object[] create( final ICreateContext context ) {
+	    // MessageConsole myConsole = findConsole("MyConsole");
+	    // MessageConsoleStream out = myConsole.newMessageStream();
+	    if( this.contextObject == null )
+	      return null;
+	    
+	    String level = null;
+	    
+	    ResizingAction ra = ( ResizingAction )this.contextObject;
+	    
+	    CreateArtifactTemplate artTempl = new CreateArtifactTemplate(ra.getName(), new QName("RA"), ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) ));
+	    
+	    Object parentObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getTargetContainer() );
 
-    if( parentObject == null )
-      return null;
-    
-    TNodeTemplate tNode = null;
-    TServiceTemplate tService = null;
-    
-    // Application Component
-    if( parentObject instanceof TNodeTemplate ) {
-      level = "C";
-      tNode = ( TNodeTemplate )parentObject;
-      
-      if (tNode.getName()==null){
-        MessageDialog.openError(null, "Error", "Give a Name to the selected Component and try again.");
-        return null;
-      }
-    }
-    
-    else if ( parentObject instanceof TServiceTemplate ){
-      level = "G";
-      tService = ( TServiceTemplate )parentObject;
-      if (tService.getSubstitutableNodeType() != null){
-     // Composite Application Component
-     
-      // Find the substitute TNodeTemplate
-      TNodeTemplate substituteNode = null;
-      ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );
-      for (TNodeTemplate tempNodeTemplate : model.getDocumentRoot()
-        .getDefinitions()
-        .getServiceTemplate()
-        .get( 0 )
-        .getTopologyTemplate()
-        .getNodeTemplate()){
-           
-        if ( tempNodeTemplate.getId().toString().equals( tService.getId().toString()) )
-        {
-          substituteNode = tempNodeTemplate;
-          break;
-        }
-                 
-      }
-                  
-      tNode = substituteNode;
-      
+	    if( parentObject == null )
+	      return null;
+	    
+	    TNodeTemplate tNode = null;
+	    TServiceTemplate tService = null;
+	    
+	    // Application Component
+	    if( parentObject instanceof TNodeTemplate ) {
+	      level = "C";
+	      tNode = ( TNodeTemplate )parentObject;
+	      
+	      if (tNode.getName()==null){
+	        MessageDialog.openError(null, "Error", "Give a Name to the selected Component and try again.");
+	        return null;
+	      }
+	    }
+	    
+	    else if ( parentObject instanceof TServiceTemplate ){
+	      level = "G";
+	      tService = ( TServiceTemplate )parentObject;
+	      if (tService.getSubstitutableNodeType() != null){
+	     // Composite Application Component
+	     
+	      // Find the substitute TNodeTemplate
+	      TNodeTemplate substituteNode = null;
+	      ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );
+	      for (TNodeTemplate tempNodeTemplate : model.getDocumentRoot()
+	        .getDefinitions()
+	        .getServiceTemplate()
+	        .get( 0 )
+	        .getTopologyTemplate()
+	        .getNodeTemplate()){
+	           
+	        if ( tempNodeTemplate.getId().toString().equals( tService.getId().toString()) )
+	        {
+	          substituteNode = tempNodeTemplate;
+	          break;
+	        }
+	                 
+	      }
+	                  
+	      tNode = substituteNode;
+	      
 
-        
-      }
-      else{
-     // Application
-        
-        level = "A";
-        final TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension )( ( ( TServiceTemplate )parentObject ).getBoundaryDefinitions() );        
-        
-        
-        if ( boundaryDef.getPolicies() == null ){
-          
-          final PoliciesType1 boundaryPolicies = ToscaFactory.eINSTANCE.createPoliciesType1();
-          
-          TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
-          editingDomain.getCommandStack()
-            .execute( new RecordingCommand( editingDomain ) {
+	        
+	      }
+	      else{
+	     // Application
+	        
+	        level = "A";
+	        final TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension )( ( ( TServiceTemplate )parentObject ).getBoundaryDefinitions() );        
+	        
+	        
+	        if ( boundaryDef.getPolicies() == null ){
+	          
+	          final PoliciesType1 boundaryPolicies = ToscaFactory.eINSTANCE.createPoliciesType1();
+	          
+	          TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
+	          editingDomain.getCommandStack()
+	            .execute( new RecordingCommand( editingDomain ) {
 
-              @Override
-              protected void doExecute() {
-                boundaryDef.setPolicies( boundaryPolicies );
-              }
-            } );
-          
-         
-        }
-        
-        PoliciesType1 nodePolicyList = boundaryDef.getPolicies();
-        
-        final EList<TPolicy> policy = nodePolicyList.getPolicy();
-        
-        final TPolicy newPolicy = createNewPolicy(level, ra.getName());
-        
-//        final TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();
-//        
-//        final String policyUniqueName = "G" + policy.size();
-//        
-//        newPolicy.setPolicyType( new QName("SYBLStrategy") );          
-//        
-////        newPolicy.setName( "S" + policyUniqueName + ":STRATEGY " + ra.getName() );
-//
-//        newPolicy.setName( "STRATEGY " + ra.getName() );
-        
-        
-        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
-        editingDomain.getCommandStack()
-          .execute( new RecordingCommand( editingDomain ) {
+	              @Override
+	              protected void doExecute() {
+	                boundaryDef.setPolicies( boundaryPolicies );
+	              }
+	            } );
+	          
+	         
+	        }
+	        
+	        PoliciesType1 nodePolicyList = boundaryDef.getPolicies();
+	        
+	        final EList<TPolicy> policy = nodePolicyList.getPolicy();
+	        
+	        final TPolicy newPolicy = createNewPolicy(level, ra.getName());
+	        
+//	        final TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();
+//	        
+//	        final String policyUniqueName = "G" + policy.size();
+//	        
+//	        newPolicy.setPolicyType( new QName("SYBLStrategy") );          
+//	        
+////	        newPolicy.setName( "S" + policyUniqueName + ":STRATEGY " + ra.getName() );
+	//
+//	        newPolicy.setName( "STRATEGY " + ra.getName() );
+	        
+	        
+	        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
+	        editingDomain.getCommandStack()
+	          .execute( new RecordingCommand( editingDomain ) {
 
-            @Override
-            protected void doExecute() {
-              policy.add( newPolicy );
-            }
-          } );
-        
-        return new Object[]{
-          newPolicy
-        };
-      }
-        
-    }
+	            @Override
+	            protected void doExecute() {
+	              policy.add( newPolicy );
+	            }
+	          } );
+	        
+	        return new Object[]{
+	          newPolicy
+	        };
+	      }
+	        
+	    }
 
-    
-    final TNodeTemplate nodeTemplate = tNode;
-    
-    if ( nodeTemplate.getPolicies() == null ){
-      final PoliciesType nodePolicyList = ToscaFactory.eINSTANCE.createPoliciesType();
-      
-      TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
-      editingDomain.getCommandStack()
-        .execute( new RecordingCommand( editingDomain ) {
+	    
+	    final TNodeTemplate nodeTemplate = tNode;
+	    
+	    if ( nodeTemplate.getPolicies() == null ){
+	      final PoliciesType nodePolicyList = ToscaFactory.eINSTANCE.createPoliciesType();
+	      
+	      TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
+	      editingDomain.getCommandStack()
+	        .execute( new RecordingCommand( editingDomain ) {
 
-          @Override
-          protected void doExecute() {
-            nodeTemplate.setPolicies( nodePolicyList );
-          }
-        } );
-      
-     
-    }
-    
-    final EList<TPolicy> policy = nodeTemplate.getPolicies().getPolicy();
-    
-    final TPolicy newPolicy = createNewPolicy(level, ra.getName());
-    
-//    final TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();
-//    
-//    final String policyUniqueName = nodeTemplate.getId() + policy.size();
-//    
-//    newPolicy.setPolicyType( new QName("SYBLStrategy") );         
-//    
-////    newPolicy.setName( "S" + policyUniqueName + ":STRATEGY " + ra.getName() );
-//    newPolicy.setName( "STRATEGY " + ra.getName() );
-    
-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
-    editingDomain.getCommandStack()
-      .execute( new RecordingCommand( editingDomain ) {
+	          @Override
+	          protected void doExecute() {
+	            nodeTemplate.setPolicies( nodePolicyList );
+	          }
+	        } );
+	      
+	     
+	    }
+	    
+	    final EList<TPolicy> policy = nodeTemplate.getPolicies().getPolicy();
+	    
+	    final TPolicy newPolicy = createNewPolicy(level, ra.getName());
+	    
+//	    final TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();
+	//    
+//	    final String policyUniqueName = nodeTemplate.getId() + policy.size();
+	//    
+//	    newPolicy.setPolicyType( new QName("SYBLStrategy") );         
+	//    
+////	    newPolicy.setName( "S" + policyUniqueName + ":STRATEGY " + ra.getName() );
+//	    newPolicy.setName( "STRATEGY " + ra.getName() );
+	    
+	    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( parentObject );
+	    editingDomain.getCommandStack()
+	      .execute( new RecordingCommand( editingDomain ) {
 
-        @Override
-        protected void doExecute() {
-          policy.add( newPolicy );
-        }
-      } );
-    
-    
-    // do the add
-    addGraphicalRepresentation( context, ra );
-    // activate direct editing after object creation
-    getFeatureProvider().getDirectEditingInfo().setActive( true );
-    // return newly created business object(s)
-    return new Object[]{
-      newPolicy
-    };
-  }
+	        @Override
+	        protected void doExecute() {
+	          policy.add( newPolicy );
+	        }
+	      } );
+	    
+	    
+	    // do the add
+	    addGraphicalRepresentation( context, ra );
+	    // activate direct editing after object creation
+	    getFeatureProvider().getDirectEditingInfo().setActive( true );
+	    // return newly created business object(s)
+	    return new Object[]{
+	      newPolicy
+	    };
+	  }
 
-  //level can be "C" for Application Component, "G" for Composite Component, "A" for Application
-  TPolicy createNewPolicy(String level, String policyName){
+	  //level can be "C" for Application Component, "G" for Composite Component, "A" for Application
+	  TPolicy createNewPolicy(String level, String policyName){
 
-    // Create Policy Template 
-    
-    final TPolicyTemplate newPolicyTemplate = ToscaFactory.eINSTANCE.createTPolicyTemplate();
-    
-    QName policyTypeName = new QName( "http://www.example.org/SYBL", "Strategy" );
-    
-    newPolicyTemplate.setType( policyTypeName );
-    
-    String id = level + ( ( Integer )newPolicyTemplate.hashCode() ).toString();
-    
-    newPolicyTemplate.setId( id );
-    
-    // Add the new Policy Template to the TOSCA Definitions element
-    
-    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );
-    
-    DefinitionsType definitions = model.getDocumentRoot().getDefinitions();
-    
-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );
-    editingDomain.getCommandStack()
-      .execute( new RecordingCommand( editingDomain ) {
+	    // Create Policy Template 
+	    
+	    final TPolicyTemplate newPolicyTemplate = ToscaFactory.eINSTANCE.createTPolicyTemplate();
+	    
+	    QName policyTypeName = new QName( "http://www.example.org/SYBL", "Strategy" );
+	    
+	    newPolicyTemplate.setType( policyTypeName );
+	    
+	    String id = level + ( ( Integer )newPolicyTemplate.hashCode() ).toString();
+	    
+	    newPolicyTemplate.setId( id );
+	    
+	    // Add the new Policy Template to the TOSCA Definitions element
+	    
+	    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );
+	    
+	    DefinitionsType definitions = model.getDocumentRoot().getDefinitions();
+	    
+	    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );
+	    editingDomain.getCommandStack()
+	      .execute( new RecordingCommand( editingDomain ) {
 
-        @Override
-        protected void doExecute() {
-          model.getDocumentRoot().getDefinitions().getPolicyTemplate().add( newPolicyTemplate );
-        }
-      } );
-    
-    // Assign the created Policy Template to the new Policy
-    
-    TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();
-    
-    QName qnamePolicyTemplate = new QName( newPolicyTemplate.getId() );
-    
-    newPolicy.setPolicyType( policyTypeName );  
-    
-    newPolicy.setPolicyRef( qnamePolicyTemplate );
-    
-    newPolicy.setName( "STRATEGY " + policyName );
-    
-    return newPolicy;
-  }
-  
-  private MessageConsole findConsole( String name ) {
-    ConsolePlugin plugin = ConsolePlugin.getDefault();
-    IConsoleManager conMan = plugin.getConsoleManager();
-    IConsole[] existing = conMan.getConsoles();
-    for( int i = 0; i < existing.length; i++ )
-      if( name.equals( existing[ i ].getName() ) )
-        return ( MessageConsole )existing[ i ];
-    // no console found, so create a new one
-    MessageConsole myConsole = new MessageConsole( name, null );
-    conMan.addConsoles( new IConsole[]{
-      myConsole
-    } );
-    return myConsole;
-  }
-}
+	        @Override
+	        protected void doExecute() {
+	          model.getDocumentRoot().getDefinitions().getPolicyTemplate().add( newPolicyTemplate );
+	        }
+	      } );
+	    
+	    // Assign the created Policy Template to the new Policy
+	    
+	    TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();
+	    
+	    QName qnamePolicyTemplate = new QName( newPolicyTemplate.getId() );
+	    
+	    newPolicy.setPolicyType( policyTypeName );  
+	    
+	    newPolicy.setPolicyRef( qnamePolicyTemplate );
+	    
+	    newPolicy.setName( "STRATEGY " + policyName );
+	    
+	    return newPolicy;
+	  }
+	  
+	}
\ No newline at end of file
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteApplicationComponentFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteApplicationComponentFeature.java
index 7c189e5..b678806 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteApplicationComponentFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteApplicationComponentFeature.java
@@ -19,6 +19,7 @@
 import javax.xml.namespace.QName;

 

 import org.eclipse.camf.tosca.TArtifactTemplate;

+import org.eclipse.camf.tosca.TDeploymentArtifact;

 import org.eclipse.camf.tosca.TImplementationArtifact;

 import org.eclipse.camf.tosca.TNodeTemplate;

 import org.eclipse.camf.tosca.TNodeTypeImplementation;

@@ -35,102 +36,109 @@
 

 public class DeleteApplicationComponentFeature extends DefaultDeleteFeature {

 

-  public DeleteApplicationComponentFeature( IFeatureProvider fp ) {

-    super( fp );

-    // TODO Auto-generated constructor stub

-  }

+	  public DeleteApplicationComponentFeature( IFeatureProvider fp ) {

+	    super( fp );

+	    // TODO Auto-generated constructor stub

+	  }

 

-  @Override

-  public void preDelete( IDeleteContext context ) {

-    // Removes the relationships related to the deleted application component

-    Object deletedObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getPictogramElement() );

-    

-    

-    TNodeTemplate deletedNodeTemplate = ( TNodeTemplate )deletedObject;

-    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-    // Delete Policy Templates

-    if ( deletedNodeTemplate.getPolicies() != null )

-    {

-      for( TPolicy tempPolicy : deletedNodeTemplate.getPolicies().getPolicy() )

-        for( TPolicyTemplate tempPolicyTemplate : model.getDocumentRoot()

-          .getDefinitions()

-          .getPolicyTemplate() )

-        {

-          if( tempPolicy.getPolicyRef()

-            .toString()

-            .compareTo( tempPolicyTemplate.getId() ) == 0 )

-          {

-            model.getDocumentRoot()

-              .getDefinitions()

-              .getPolicyTemplate()

-              .remove( tempPolicyTemplate );

-          }

-        }

-    }

-    // Delete Relationships

-    for( TServiceTemplate tempServiceTemplate : model.getDocumentRoot()

-      .getDefinitions()

-      .getServiceTemplate() )

-    {

-      if ( tempServiceTemplate.getTopologyTemplate() != null ){

-        for( TRelationshipTemplate tempRelationshipTemplate : tempServiceTemplate.getTopologyTemplate()

-          .getRelationshipTemplate() )

-        {

-          if( tempRelationshipTemplate.getSourceElement()

-            .getRef()

-            .compareTo( deletedNodeTemplate.getId() ) == 0

-              || tempRelationshipTemplate.getTargetElement()

-                .getRef()

-                .compareTo( deletedNodeTemplate.getId() ) == 0 )

-          {

-            tempServiceTemplate.getTopologyTemplate()

-              .getRelationshipTemplate()

-              .remove( tempRelationshipTemplate );

-          }

-        }

-      }

-    }

-    //Delete NodeTypeImplementations

-    if (model.getDocumentRoot()

-        .getDefinitions()

-        .getNodeTypeImplementation() != null){

-    QName[] artifactTemplatesIDs = new QName[1];

-    for( TNodeTypeImplementation tempNodeTypeImplementation : model.getDocumentRoot()

-        .getDefinitions()

-        .getNodeTypeImplementation() )

-      {

-        if ( tempNodeTypeImplementation.getNodeType().toString().equals( deletedNodeTemplate.getName()) ){

-          //Find Artifact Templates to be Deleted

-          {

-            for (TImplementationArtifact tempImplementationArtifact: tempNodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact()){

-              artifactTemplatesIDs[artifactTemplatesIDs.length-1]=tempImplementationArtifact.getArtifactRef();

-            }

-          }

-          //Delete NodeTypeImplementation

-            {

-              model.getDocumentRoot()

-              .getDefinitions()

-              .getNodeTypeImplementation()

-                .remove( tempNodeTypeImplementation );

-            }

-          } 

-      }

-    

-    //Delete ArtifactTemplates

-    for( TArtifactTemplate tempArtifactTemplate : model.getDocumentRoot()

-        .getDefinitions().getArtifactTemplate()){

-      for (QName tempArtifactTemplateID : artifactTemplatesIDs){

-        if (tempArtifactTemplate.getId().equals( tempArtifactTemplateID.toString() )){

-          //Delete Artifact Template

-          {

-            model.getDocumentRoot()

-            .getDefinitions()

-            .getArtifactTemplate()

-              .remove( tempArtifactTemplate );

-          }

-        }

-      }

-    }

-  }

-  }

-}

+	  @Override

+	  public void preDelete( IDeleteContext context ) {

+	    // Removes the relationships related to the deleted application component

+	    Object deletedObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getPictogramElement() );

+	    

+	    

+	    TNodeTemplate deletedNodeTemplate = ( TNodeTemplate )deletedObject;

+	    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

+	    // Delete Policy Templates

+	    if ( deletedNodeTemplate.getPolicies() != null )

+	    {

+	      for( TPolicy tempPolicy : deletedNodeTemplate.getPolicies().getPolicy() )

+	        for( TPolicyTemplate tempPolicyTemplate : model.getDocumentRoot()

+	          .getDefinitions()

+	          .getPolicyTemplate() )

+	        {

+	          if( tempPolicy.getPolicyRef()

+	            .toString()

+	            .compareTo( tempPolicyTemplate.getId() ) == 0 )

+	          {

+	            model.getDocumentRoot()

+	              .getDefinitions()

+	              .getPolicyTemplate()

+	              .remove( tempPolicyTemplate );

+	          }

+	        }

+	    }

+	    // Delete Relationships

+	    for( TServiceTemplate tempServiceTemplate : model.getDocumentRoot()

+	      .getDefinitions()

+	      .getServiceTemplate() )

+	    {

+	      if ( tempServiceTemplate.getTopologyTemplate() != null ){

+	        for( TRelationshipTemplate tempRelationshipTemplate : tempServiceTemplate.getTopologyTemplate()

+	          .getRelationshipTemplate() )

+	        {

+	          if( tempRelationshipTemplate.getSourceElement()

+	            .getRef()

+	            .compareTo( deletedNodeTemplate.getId() ) == 0

+	              || tempRelationshipTemplate.getTargetElement()

+	                .getRef()

+	                .compareTo( deletedNodeTemplate.getId() ) == 0 )

+	          {

+	            tempServiceTemplate.getTopologyTemplate()

+	              .getRelationshipTemplate()

+	              .remove( tempRelationshipTemplate );

+	          }

+	        }

+	      }

+	    }

+	    //Delete NodeTypeImplementations

+	    if (model.getDocumentRoot()

+	        .getDefinitions()

+	        .getNodeTypeImplementation() != null){

+	    QName[] artifactTemplatesIDs = new QName[1];

+	    for( TNodeTypeImplementation tempNodeTypeImplementation : model.getDocumentRoot()

+	        .getDefinitions()

+	        .getNodeTypeImplementation() )

+	      {

+	        if ( tempNodeTypeImplementation.getNodeType().toString().equals( deletedNodeTemplate.getName()) ){

+	          //Find Artifact Templates to be Deleted

+	          {

+	            for (TImplementationArtifact tempImplementationArtifact: tempNodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact()){

+	              artifactTemplatesIDs[artifactTemplatesIDs.length-1]=tempImplementationArtifact.getArtifactRef();

+	            }

+	          }

+	          //Delete NodeTypeImplementation

+	            {

+	              model.getDocumentRoot()

+	              .getDefinitions()

+	              .getNodeTypeImplementation()

+	                .remove( tempNodeTypeImplementation );

+	            }

+	          } 

+	      }

+	    

+	    //Find DeploymentArtifacts to be deleted

+	    if (deletedNodeTemplate.getDeploymentArtifacts() != null){

+	      for (TDeploymentArtifact tempDeploymentArtifact: deletedNodeTemplate.getDeploymentArtifacts().getDeploymentArtifact()){

+	        artifactTemplatesIDs[artifactTemplatesIDs.length-1]=tempDeploymentArtifact.getArtifactRef();

+	      }

+	    }

+	    

+	    //Delete ArtifactTemplates

+	    for( TArtifactTemplate tempArtifactTemplate : model.getDocumentRoot()

+	        .getDefinitions().getArtifactTemplate()){

+	      for (QName tempArtifactTemplateID : artifactTemplatesIDs){

+	        if (tempArtifactTemplateID != null && tempArtifactTemplate.getId().equals( tempArtifactTemplateID.toString() )){

+	          //Delete Artifact Template

+	          {

+	            model.getDocumentRoot()

+	            .getDefinitions()

+	            .getArtifactTemplate()

+	              .remove( tempArtifactTemplate );

+	          }

+	        }

+	      }

+	    }

+	  }

+	  }

+	}

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteArtifactTemplateFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteArtifactTemplateFeature.java
new file mode 100644
index 0000000..cc95589
--- /dev/null
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteArtifactTemplateFeature.java
@@ -0,0 +1,86 @@
+package org.eclipse.camf.tosca.editor.features;

+

+import org.eclipse.emf.common.util.EList;

+import org.eclipse.emf.ecore.util.EcoreUtil;

+import org.eclipse.emf.transaction.RecordingCommand;

+import org.eclipse.emf.transaction.TransactionalEditingDomain;

+import org.eclipse.emf.transaction.util.TransactionUtil;

+import org.eclipse.graphiti.features.IFeatureProvider;

+import org.eclipse.graphiti.features.context.IDeleteContext;

+import org.eclipse.graphiti.mm.pictograms.PictogramElement;

+import org.eclipse.graphiti.services.Graphiti;

+import org.eclipse.graphiti.ui.features.DefaultDeleteFeature;

+

+import org.eclipse.camf.tosca.TArtifactTemplate;

+import org.eclipse.camf.tosca.TImplementationArtifact;

+import org.eclipse.camf.tosca.TNodeTemplate;

+import org.eclipse.camf.tosca.TNodeTypeImplementation;

+import org.eclipse.camf.tosca.editor.ModelHandler;

+import org.eclipse.camf.tosca.editor.ToscaModelLayer;

+

+

+public class DeleteArtifactTemplateFeature extends DefaultDeleteFeature{

+  

+  private TNodeTypeImplementation parentNodeTypeImplementation;

+

+  public DeleteArtifactTemplateFeature( IFeatureProvider fp ) {

+    super( fp );

+  }

+  

+  @Override

+  public void preDelete(IDeleteContext context) {

+

+    //TArtifactTemplate

+    Object deletedObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getPictogramElement() );

+    

+    TArtifactTemplate deletedArtifactTemplate = (TArtifactTemplate) deletedObject;

+    

+    String deletedArtifactTemplateId = deletedArtifactTemplate.getId();

+    

+    //TNodeTemplate parent of TArtifactTemplate

+    PictogramElement parentPE = Graphiti.getPeService().getPictogramElementParent( context.getPictogramElement() );

+    

+    TNodeTemplate parentNodeTemplate = ( TNodeTemplate ) getFeatureProvider().getBusinessObjectForPictogramElement( parentPE );

+    

+    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

+    

+    final EList<TNodeTypeImplementation> nodeTypeImplementations = model.getDocumentRoot().getDefinitions().getNodeTypeImplementation();

+    

+    this.parentNodeTypeImplementation = null;

+    for (final TNodeTypeImplementation tempNodeTypeImplementation : nodeTypeImplementations){

+      if (tempNodeTypeImplementation.getNodeType().toString().compareTo( parentNodeTemplate.getName() )==0){

+        this.parentNodeTypeImplementation = tempNodeTypeImplementation;

+        break;

+      }

+    }

+    

+    if (this.parentNodeTypeImplementation == null)

+      return;

+    

+    final TNodeTypeImplementation nodeTypeImplementation = parentNodeTypeImplementation;

+    //for (final TImplementationArtifact tempImplementationArtifact : nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact()){

+    for (int i=0; i<nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact().size(); i++){

+      final TImplementationArtifact tempImplementationArtifact = nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact().get( i );

+      if (tempImplementationArtifact.getArtifactRef().toString().compareTo( deletedArtifactTemplateId )==0){

+        //Implementation artifact refers to the TArtifactTemplate to be deleted

+        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( nodeTypeImplementation );

+        editingDomain.getCommandStack()

+          .execute( new RecordingCommand( editingDomain ) {

+

+            @Override

+            protected void doExecute() {

+              nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact().remove( tempImplementationArtifact );

+            }

+          } );

+

+      }

+    }

+

+    //if there are no more implementation artifacts, delete implementation artifacts element

+    if (nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact().size()==0){

+      nodeTypeImplementations.remove( nodeTypeImplementation );

+    }

+      

+  }

+    

+}

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteDeploymentArtifactFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteDeploymentArtifactFeature.java
index 9454fe2..c04a4cd 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteDeploymentArtifactFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/DeleteDeploymentArtifactFeature.java
@@ -16,7 +16,12 @@
  *******************************************************************************/

 package org.eclipse.camf.tosca.editor.features;

 

+import org.eclipse.camf.tosca.TArtifactTemplate;

+import org.eclipse.camf.tosca.TDeploymentArtifact;

 import org.eclipse.camf.tosca.TNodeTemplate;

+import org.eclipse.camf.tosca.editor.ModelHandler;

+import org.eclipse.camf.tosca.editor.ToscaModelLayer;

+import org.eclipse.emf.ecore.util.EcoreUtil;

 import org.eclipse.graphiti.features.IFeatureProvider;

 import org.eclipse.graphiti.features.context.IDeleteContext;

 import org.eclipse.graphiti.mm.pictograms.PictogramElement;

@@ -24,35 +29,47 @@
 import org.eclipse.graphiti.ui.features.DefaultDeleteFeature;

 

 public class DeleteDeploymentArtifactFeature extends DefaultDeleteFeature{

-  

-  private boolean deleteDeploymentArtifact = false;

-  private TNodeTemplate parentNodeTemplate;

+	  

+	  private boolean deleteDeploymentArtifact = false;

+	  private TNodeTemplate parentNodeTemplate;

 

-  public DeleteDeploymentArtifactFeature( IFeatureProvider fp ) {

-    super( fp );

-    // TODO Auto-generated constructor stub

-  }

-  

-  @Override

-  public void preDelete(IDeleteContext context) {

-    // Checks whether the node template contained only the deleted deployment artifact  

-     

-    PictogramElement parentPE = Graphiti.getPeService().getPictogramElementParent( context.getPictogramElement() );

-    

-    TNodeTemplate parentNodeTemplate = ( TNodeTemplate ) getFeatureProvider().getBusinessObjectForPictogramElement( parentPE );

-    

-    if ( parentNodeTemplate.getDeploymentArtifacts().getDeploymentArtifact().size() == 1 ){

-      this.deleteDeploymentArtifact = true;

-      this.parentNodeTemplate = parentNodeTemplate;

-    }

-  }

-  

-  @Override

-  public void postDelete(IDeleteContext context) {

-    // Removes the deployment artifacts element if no more artifacts left 

-     

-    if ( this.deleteDeploymentArtifact == true )

-      this.parentNodeTemplate.setDeploymentArtifacts( null );

-  }

+	  public DeleteDeploymentArtifactFeature( IFeatureProvider fp ) {

+	    super( fp );

+	  }

+	  

+	  @Override

+	  public void preDelete(IDeleteContext context) {

+	    // Checks whether the node template contained only the deleted deployment artifact  

+	     

+	    PictogramElement parentPE = Graphiti.getPeService().getPictogramElementParent( context.getPictogramElement() );

+	    

+	    TNodeTemplate parentNodeTemplate = ( TNodeTemplate ) getFeatureProvider().getBusinessObjectForPictogramElement( parentPE );

+	    

+	    if ( parentNodeTemplate.getDeploymentArtifacts().getDeploymentArtifact().size() == 1 ){

+	      this.deleteDeploymentArtifact = true;

+	      this.parentNodeTemplate = parentNodeTemplate;

+	    }

+	    

+	    //Delete corresponding TArtifactTemplate

+	    Object deletedObject = getFeatureProvider().getBusinessObjectForPictogramElement( context.getPictogramElement() );

+	    TDeploymentArtifact deletedDeploymentArtifact = (TDeploymentArtifact) deletedObject;

+	    String deletedDeploymentArtifactId = deletedDeploymentArtifact.getArtifactRef().toString();

+	    

+	    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

+	    

+	    for ( TArtifactTemplate tempArtifactTemplate : model.getDocumentRoot().getDefinitions().getArtifactTemplate() ){

+	      if (tempArtifactTemplate.getId().compareTo( deletedDeploymentArtifactId )==0){

+	        model.getDocumentRoot().getDefinitions().getArtifactTemplate().remove( tempArtifactTemplate );

+	      }

+	    }

+	  }

+	  

+	  @Override

+	  public void postDelete(IDeleteContext context) {

+	    // Removes the deployment artifacts element if no more artifacts left 

+	     

+	    if ( this.deleteDeploymentArtifact == true )

+	      this.parentNodeTemplate.setDeploymentArtifacts( null );

+	  }

 

-}

+	}
\ No newline at end of file
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/RenameCompositeComponentFeature.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/RenameCompositeComponentFeature.java
index d3d2bc0..37ba308 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/RenameCompositeComponentFeature.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/features/RenameCompositeComponentFeature.java
@@ -91,7 +91,6 @@
         this.hasDoneChanges = true;

         tServiceTemplate.setName( newName );

         

-        /////////////////////////////////////////////////////////////////////////////////////////////////////

         tServiceTemplate.setSubstitutableNodeType(new QName("substituteNode_"+newName));

         

         // Find the substitute TNodeTemplate

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentElasticityRequirementsSection.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentElasticityRequirementsSection.java
index 0fb3a93..3b7683d 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentElasticityRequirementsSection.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentElasticityRequirementsSection.java
@@ -58,6 +58,7 @@
 import org.eclipse.camf.tosca.elasticity.TNodeTemplateExtension;

 import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsFactory;

 import org.eclipse.camf.tosca.elasticity.Tosca_Elasticity_ExtensionsPackage;

+import org.eclipse.camf.tosca.elementCreators.CreateArtifactTemplate;

 import org.eclipse.core.resources.IFile;

 import org.eclipse.core.resources.IProject;

 import org.eclipse.core.runtime.CoreException;

@@ -106,613 +107,625 @@
  * Application Component Properties - Elasticity Tab

  */

 public class ApplicationComponentElasticityRequirementsSection

-  extends GFPropertySection implements ITabbedPropertyConstants

+extends GFPropertySection implements ITabbedPropertyConstants

 {

 

-  Composite client;

-  Section section;

-  private Table table;

-  private Button addButton;

-  private Button removeButton;

-  private Button addExecutableButton;

-  TableViewer tableViewer;

-  List<TPolicy> appComponentElasticityRequirements = new ArrayList<TPolicy>();

-  Section sectionRA;

-  private Table tableResizingActions;

-  private Button removeButtonRA;

-  private Button addButtonRA;

-  private Button conditionButtonRA;

-  TableViewer tableResizingActionsViewer;

-  List<TPolicy> appComponentResizingActions = new ArrayList<TPolicy>();

-  protected Tosca_Elasticity_ExtensionsFactory elasticityFactory = Tosca_Elasticity_ExtensionsFactory.eINSTANCE;

+Composite client;

+Section section;

+private Table table;

+private Button addButton;

+private Button removeButton;

+private Button addExecutableButton;

+TableViewer tableViewer;

+List<TPolicy> appComponentElasticityRequirements = new ArrayList<TPolicy>();

+Section sectionRA;

+private Table tableResizingActions;

+private Button removeButtonRA;

+private Button addButtonRA;

+private Button conditionButtonRA;

+TableViewer tableResizingActionsViewer;

+List<TPolicy> appComponentResizingActions = new ArrayList<TPolicy>();

+protected Tosca_Elasticity_ExtensionsFactory elasticityFactory = Tosca_Elasticity_ExtensionsFactory.eINSTANCE;

 

-  @Override

-  public void createControls( final Composite parent,

-                              TabbedPropertySheetPage tabbedPropertySheetPage )

-  {

-    super.createControls( parent, tabbedPropertySheetPage );

-    FormToolkit toolkit = new FormToolkit( parent.getDisplay() );

-    // Application Component Elasticity Requirements Section

-    this.section = toolkit.createSection( parent, Section.TITLE_BAR );

-    this.section.setText( "Application Component Elasticity Constraints" ); //$NON-NLS-1$

-    Composite client = toolkit.createComposite( this.section, SWT.WRAP );

-    Composite client1 = toolkit.createComposite( client, SWT.WRAP );

-    Composite client2 = toolkit.createComposite( client, SWT.WRAP );

-    GridLayout layout = new GridLayout();

-    layout.numColumns = 2;

-    layout.marginTop = 15;

-    layout.verticalSpacing = 15;

-    layout.marginWidth = 2;

-    layout.marginHeight = 2;

-    client.setLayout( layout );

-    layout = new GridLayout();

-    layout.numColumns = 1;

-    client1.setLayout( layout );

-    layout = new GridLayout();

-    layout.numColumns = 1;

-    client2.setLayout( layout );

-    GridData gd;

-    this.table = new Table( client1, SWT.BORDER

-                                     | SWT.VIRTUAL

-                                     | SWT.MULTI

-                                     | SWT.FULL_SELECTION );

-    this.table.setHeaderVisible( true );

-    this.table.setLinesVisible( false );

-    this.table.getHorizontalBar().setEnabled( false );

-    gd = new GridData( 300, this.table.getItemHeight() * 4 );

-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

-    this.table.setLayoutData( gd );

-    TableLayout tableLayout = new TableLayout();

-    this.table.setLayout( tableLayout );

-    TableColumn nameColumn = new TableColumn( this.table, SWT.CENTER );

-    ColumnLayoutData data = new ColumnWeightData( 100 );

-    tableLayout.addColumnData( data );

-    data = new ColumnWeightData( 100 );

-    tableLayout.addColumnData( data );

-    data = new ColumnWeightData( 150 );

-    tableLayout.addColumnData( data );

-    nameColumn.setText( "Constraint" ); //$NON-NLS-1$

-    this.tableViewer = new TableViewer( this.table );

-    ElasticityConstraintsProvider ERProvider = new ElasticityConstraintsProvider();

-    IStructuredContentProvider contentProvider = ERProvider.ERContentProvider;

-    this.tableViewer.setContentProvider( contentProvider );

-    this.tableViewer.setLabelProvider( ERProvider.ERContentLabelProvider );

-    this.tableViewer.setInput( this.appComponentElasticityRequirements );

-    this.addButton = new Button( client2, SWT.PUSH );

-    this.addButton.setText( "Add" ); //$NON-NLS-1$

-    gd = new GridData();

-    gd.widthHint = 60;

-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.addButton.setLayoutData( gd );

-    // Listener for Add button

-    this.addButton.addSelectionListener( new SelectionListener() {

+@Override

+public void createControls( final Composite parent,

+                            TabbedPropertySheetPage tabbedPropertySheetPage )

+{

+  super.createControls( parent, tabbedPropertySheetPage );

+  FormToolkit toolkit = new FormToolkit( parent.getDisplay() );

+  // Application Component Elasticity Requirements Section

+  this.section = toolkit.createSection( parent, Section.TITLE_BAR );

+  this.section.setText( "Application Component Elasticity Constraints" ); //$NON-NLS-1$

+  Composite client = toolkit.createComposite( this.section, SWT.WRAP );

+  Composite client1 = toolkit.createComposite( client, SWT.WRAP );

+  Composite client2 = toolkit.createComposite( client, SWT.WRAP );

+  GridLayout layout = new GridLayout();

+  layout.numColumns = 2;

+  layout.marginTop = 15;

+  layout.verticalSpacing = 15;

+  layout.marginWidth = 2;

+  layout.marginHeight = 2;

+  client.setLayout( layout );

+  layout = new GridLayout();

+  layout.numColumns = 1;

+  client1.setLayout( layout );

+  layout = new GridLayout();

+  layout.numColumns = 1;

+  client2.setLayout( layout );

+  GridData gd;

+  this.table = new Table( client1, SWT.BORDER

+                                   | SWT.VIRTUAL

+                                   | SWT.MULTI

+                                   | SWT.FULL_SELECTION );

+  this.table.setHeaderVisible( true );

+  this.table.setLinesVisible( false );

+  this.table.getHorizontalBar().setEnabled( false );

+  gd = new GridData( 300, this.table.getItemHeight() * 4 );

+  gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

+  this.table.setLayoutData( gd );

+  TableLayout tableLayout = new TableLayout();

+  this.table.setLayout( tableLayout );

+  TableColumn nameColumn = new TableColumn( this.table, SWT.CENTER );

+  ColumnLayoutData data = new ColumnWeightData( 100 );

+  tableLayout.addColumnData( data );

+  data = new ColumnWeightData( 100 );

+  tableLayout.addColumnData( data );

+  data = new ColumnWeightData( 150 );

+  tableLayout.addColumnData( data );

+  nameColumn.setText( "Constraint" ); //$NON-NLS-1$

+  this.tableViewer = new TableViewer( this.table );

+  ElasticityConstraintsProvider ERProvider = new ElasticityConstraintsProvider();

+  IStructuredContentProvider contentProvider = ERProvider.ERContentProvider;

+  this.tableViewer.setContentProvider( contentProvider );

+  this.tableViewer.setLabelProvider( ERProvider.ERContentLabelProvider );

+  this.tableViewer.setInput( this.appComponentElasticityRequirements );

+  this.addButton = new Button( client2, SWT.PUSH );

+  this.addButton.setText( "Add" ); //$NON-NLS-1$

+  gd = new GridData();

+  gd.widthHint = 60;

+  gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.addButton.setLayoutData( gd );

+  // Listener for Add button

+  this.addButton.addSelectionListener( new SelectionListener() {

 

-      @Override

-      public void widgetSelected( SelectionEvent e ) {

-        editDataStagingEntry( null );

-      }

+    @Override

+    public void widgetSelected( SelectionEvent e ) {

+      editDataStagingEntry( null );

+    }

 

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    

-    this.removeButton = new Button( client2, SWT.PUSH );

-    this.removeButton.setText( "Remove" ); //$NON-NLS-1$

-    gd = new GridData();

-    gd.widthHint = 60;

-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.removeButton.setLayoutData( gd );

-    // Listener for Remove button

-    this.removeButton.addSelectionListener( new SelectionListener() {

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  this.removeButton = new Button( client2, SWT.PUSH );

+  this.removeButton.setText( "Remove" ); //$NON-NLS-1$

+  gd = new GridData();

+  gd.widthHint = 60;

+  gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.removeButton.setLayoutData( gd );

+  // Listener for Remove button

+  this.removeButton.addSelectionListener( new SelectionListener() {

 

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        removeApplicationComponentElasticityRequirement( getSelectedObject() );

-      }

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      removeApplicationComponentElasticityRequirement( getSelectedObject() );

+    }

 

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    // Add section components to the toolkit

-    toolkit.adapt( this.table, true, true );

-    toolkit.adapt( this.addButton, true, true );

-    toolkit.adapt( this.removeButton, true, true );

-    this.section.setClient( client );

-    // Application Component Elasticity Actions Section

-    this.sectionRA = toolkit.createSection( parent, Section.TITLE_BAR );

-    this.sectionRA.setText( "Elasticity Strategies" ); //$NON-NLS-1$

-    Composite clientRA = toolkit.createComposite( this.sectionRA, SWT.WRAP );

-    Composite clientRA1 = toolkit.createComposite( clientRA, SWT.WRAP );

-    Composite clientRA2 = toolkit.createComposite( clientRA, SWT.WRAP );

-    GridLayout layoutRA;

-    layoutRA = new GridLayout();

-    layoutRA.numColumns = 2;

-    layoutRA.marginTop = 15;

-    layoutRA.verticalSpacing = 15;

-    layoutRA.marginWidth = 2;

-    layoutRA.marginHeight = 2;

-    clientRA.setLayout( layoutRA );

-    layoutRA = new GridLayout();

-    layoutRA.numColumns = 1;

-    clientRA1.setLayout( layoutRA );

-    layoutRA = new GridLayout();

-    layoutRA.numColumns = 1;

-    clientRA2.setLayout( layoutRA );

-    this.tableResizingActions = new Table( clientRA1, SWT.BORDER

-                                                      | SWT.VIRTUAL

-                                                      | SWT.MULTI

-                                                      | SWT.FULL_SELECTION );

-    this.tableResizingActions.setHeaderVisible( true );

-    this.tableResizingActions.setLinesVisible( false );

-    this.tableResizingActions.getHorizontalBar().setEnabled( false );

-    GridData gdRA;

-    gdRA = new GridData( 300, this.tableResizingActions.getItemHeight() * 4 );

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    gdRA.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

-    this.tableResizingActions.setLayoutData( gdRA );

-    TableLayout tableLayoutRA = new TableLayout();

-    this.tableResizingActions.setLayout( tableLayoutRA );

-    TableColumn nameColumnRA = new TableColumn( this.tableResizingActions,

-                                                SWT.CENTER );

-    nameColumnRA.setText( "Strategy" ); //$NON-NLS-1$

-    nameColumnRA.setWidth( 100 );

-    ColumnWeightData dataRA = new ColumnWeightData( 100 );

-    tableLayoutRA.addColumnData( dataRA );

-    // Set the Elasticity Actions table viewer

-    ResizingActionsProvider RAProvider = new ResizingActionsProvider();

-    this.tableResizingActionsViewer = new TableViewer( this.tableResizingActions );

-    IStructuredContentProvider contentProviderRA = RAProvider.RAContentProvider;

-    this.tableResizingActionsViewer.setContentProvider( contentProviderRA );

-    this.tableResizingActionsViewer.setLabelProvider( RAProvider.RAContentLabelProvider );

-    this.tableResizingActionsViewer.setInput( this.appComponentResizingActions );

-    // Add Elasticity Strategy button

-    this.addButtonRA = new Button( clientRA2, SWT.PUSH );

-    this.addButtonRA.setText( "Add" ); //$NON-NLS-1$

-    // Listener for Adding Elasticity Strategy button

-    this.addButtonRA.addSelectionListener( new SelectionListener() {

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  // Add section components to the toolkit

+  toolkit.adapt( this.table, true, true );

+  toolkit.adapt( this.addButton, true, true );

+  toolkit.adapt( this.removeButton, true, true );

+  this.section.setClient( client );

+  // Application Component Elasticity Actions Section

+  this.sectionRA = toolkit.createSection( parent, Section.TITLE_BAR );

+  this.sectionRA.setText( "Elasticity Strategies" ); //$NON-NLS-1$

+  Composite clientRA = toolkit.createComposite( this.sectionRA, SWT.WRAP );

+  Composite clientRA1 = toolkit.createComposite( clientRA, SWT.WRAP );

+  Composite clientRA2 = toolkit.createComposite( clientRA, SWT.WRAP );

+  GridLayout layoutRA;

+  layoutRA = new GridLayout();

+  layoutRA.numColumns = 2;

+  layoutRA.marginTop = 15;

+  layoutRA.verticalSpacing = 15;

+  layoutRA.marginWidth = 2;

+  layoutRA.marginHeight = 2;

+  clientRA.setLayout( layoutRA );

+  layoutRA = new GridLayout();

+  layoutRA.numColumns = 1;

+  clientRA1.setLayout( layoutRA );

+  layoutRA = new GridLayout();

+  layoutRA.numColumns = 1;

+  clientRA2.setLayout( layoutRA );

+  this.tableResizingActions = new Table( clientRA1, SWT.BORDER

+                                                    | SWT.VIRTUAL

+                                                    | SWT.MULTI

+                                                    | SWT.FULL_SELECTION );

+  this.tableResizingActions.setHeaderVisible( true );

+  this.tableResizingActions.setLinesVisible( false );

+  this.tableResizingActions.getHorizontalBar().setEnabled( false );

+  GridData gdRA;

+  gdRA = new GridData( 300, this.tableResizingActions.getItemHeight() * 4 );

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  gdRA.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

+  this.tableResizingActions.setLayoutData( gdRA );

+  TableLayout tableLayoutRA = new TableLayout();

+  this.tableResizingActions.setLayout( tableLayoutRA );

+  TableColumn nameColumnRA = new TableColumn( this.tableResizingActions,

+                                              SWT.CENTER );

+  nameColumnRA.setText( "Strategy" ); //$NON-NLS-1$

+  nameColumnRA.setWidth( 100 );

+  ColumnWeightData dataRA = new ColumnWeightData( 100 );

+  tableLayoutRA.addColumnData( dataRA );

+  // Set the Elasticity Actions table viewer

+  ResizingActionsProvider RAProvider = new ResizingActionsProvider();

+  this.tableResizingActionsViewer = new TableViewer( this.tableResizingActions );

+  IStructuredContentProvider contentProviderRA = RAProvider.RAContentProvider;

+  this.tableResizingActionsViewer.setContentProvider( contentProviderRA );

+  this.tableResizingActionsViewer.setLabelProvider( RAProvider.RAContentLabelProvider );

+  this.tableResizingActionsViewer.setInput( this.appComponentResizingActions );

+  // Add Elasticity Strategy button

+  this.addButtonRA = new Button( clientRA2, SWT.PUSH );

+  this.addButtonRA.setText( "Add" ); //$NON-NLS-1$

+  // Listener for Adding Elasticity Strategy button

+  this.addButtonRA.addSelectionListener( new SelectionListener() {

 

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        editDataStagingEntryRA( getSelectedObject() );

-      }

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      editDataStagingEntryRA( getSelectedObject() );

+    }

 

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    gdRA = new GridData();

-    gdRA.widthHint = 80;

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.addButtonRA.setLayoutData( gdRA );

-    

-    ////////////////////////////////////////////////////////////////////

-    

-    // Add Elasticity Strategy Executable button

-    this.addExecutableButton = new Button( clientRA2, SWT.PUSH );

-    this.addExecutableButton.setText( "Exectutable" ); //$NON-NLS-1$

-    // Listener for Adding Elasticity Strategy button

-    this.addExecutableButton.addSelectionListener( new SelectionListener() {

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  gdRA = new GridData();

+  gdRA.widthHint = 80;

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.addButtonRA.setLayoutData( gdRA );

+  // //////////////////////////////////////////////////////////////////

+  // Add Elasticity Strategy Executable button

+  this.addExecutableButton = new Button( clientRA2, SWT.PUSH );

+  this.addExecutableButton.setText( "Exectutable" ); //$NON-NLS-1$

+  // Listener for Adding Elasticity Strategy button

+  this.addExecutableButton.addSelectionListener( new SelectionListener() {

 

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        addResizingActionExecutable( parent, getSelectedElasticityStrategy() );

-      }

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      addResizingActionExecutable( parent, getSelectedElasticityStrategy() );

+    }

 

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    gdRA = new GridData();

-    gdRA.widthHint = 80;

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.addExecutableButton.setLayoutData( gdRA );

-    

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  gdRA = new GridData();

+  gdRA.widthHint = 80;

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.addExecutableButton.setLayoutData( gdRA );

+  // /////////////////////////////////////////////////////////////////

+  this.removeButtonRA = new Button( clientRA2, SWT.PUSH );

+  this.removeButtonRA.setText( "Remove" ); //$NON-NLS-1$

+  // Listener for Remove Elasticity Strategy button

+  this.removeButtonRA.addSelectionListener( new SelectionListener() {

 

-    ///////////////////////////////////////////////////////////////////

-    

-    

-    this.removeButtonRA = new Button( clientRA2, SWT.PUSH );

-    this.removeButtonRA.setText( "Remove" ); //$NON-NLS-1$

-    // Listener for Remove Elasticity Strategy button

-    this.removeButtonRA.addSelectionListener( new SelectionListener() {

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      removeApplicationComponentResizingAction( getSelectedElasticityStrategy() );

+    }

 

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        removeApplicationComponentResizingAction( getSelectedElasticityStrategy() );

-      }

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  gdRA = new GridData();

+  gdRA.widthHint = 80;

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.removeButtonRA.setLayoutData( gdRA );

+  this.conditionButtonRA = new Button( clientRA2, SWT.PUSH );

+  this.conditionButtonRA.setText( "Condition" ); //$NON-NLS-1$

+  // Listener for Remove Elasticity Strategy button

+  this.conditionButtonRA.addSelectionListener( new SelectionListener() {

 

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    gdRA = new GridData();

-    gdRA.widthHint = 80;

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.removeButtonRA.setLayoutData( gdRA );

-    this.conditionButtonRA = new Button( clientRA2, SWT.PUSH );

-    this.conditionButtonRA.setText( "Condition" ); //$NON-NLS-1$

-    // Listener for Remove Elasticity Strategy button

-    this.conditionButtonRA.addSelectionListener( new SelectionListener() {

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      addStrategyCondition( getSelectedElasticityStrategy() );

+    }

 

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        addStrategyCondition( getSelectedElasticityStrategy() );

-      }

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  gdRA = new GridData();

+  gdRA.widthHint = 80;

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.conditionButtonRA.setLayoutData( gdRA );

+  // Add section components to the toolkit

+  toolkit.adapt( this.tableResizingActions, true, true );

+  toolkit.adapt( this.removeButtonRA, true, true );

+  toolkit.adapt( this.addButtonRA, true, true );

+  // toolkit.adapt( this.uploadButtonRA, true, true );

+  toolkit.adapt( this.conditionButtonRA, true, true );

+  toolkit.adapt( this.addExecutableButton, true, true );

+  this.sectionRA.setClient( clientRA );

+}

 

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    gdRA = new GridData();

-    gdRA.widthHint = 80;

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.conditionButtonRA.setLayoutData( gdRA );

-    // Add section components to the toolkit

-    toolkit.adapt( this.tableResizingActions, true, true );

-    toolkit.adapt( this.removeButtonRA, true, true );

-    toolkit.adapt( this.addButtonRA, true, true );

-    // toolkit.adapt( this.uploadButtonRA, true, true );

-    toolkit.adapt( this.conditionButtonRA, true, true );

-    

-    toolkit.adapt( this.addExecutableButton, true, true);

-    this.sectionRA.setClient( clientRA );

-  }

+// Add Application Component Elasticity Requirement

+void editDataStagingEntry( final TPolicy selectedObject ) {

+  ElasticityConstraintDialog dialog;

+  if( selectedObject == null ) {

+    // Add button is pressed

+    dialog = new ElasticityConstraintDialog( this.section.getShell(),

+                                             "Application Component" ); //$NON-NLS-1$

+    if( dialog.open() == Window.OK ) {

+      String newElasticityConstraint = dialog.getElasticityConstraint();

 

-  // Add Application Component Elasticity Requirement

-  void editDataStagingEntry( final TPolicy selectedObject ) {

-    ElasticityConstraintDialog dialog;

-    if( selectedObject == null ) {

-      // Add button is pressed

-      dialog = new ElasticityConstraintDialog( this.section.getShell(),

-                                               "Application Component" ); //$NON-NLS-1$

-      if( dialog.open() == Window.OK ) {

-        String newElasticityConstraint = dialog.getElasticityConstraint();

-

+      if( newElasticityConstraint != null ) {

         

-        if (newElasticityConstraint.contains( "<" )){

+        if( newElasticityConstraint.contains( "<" ) ) {

           String[] cond = newElasticityConstraint.split( "<" );

-          newElasticityConstraint = cond[0] + "&lt;" + cond[1];

-        }

-        else if (newElasticityConstraint.contains( ">" )){

+          newElasticityConstraint = cond[ 0 ] + "&lt;" + cond[ 1 ];

+        } else if( newElasticityConstraint.contains( ">" ) ) {

           String[] cond = newElasticityConstraint.split( ">" );

-          newElasticityConstraint = cond[0] + "&gt;" + cond[1];

+          newElasticityConstraint = cond[ 0 ] + "&gt;" + cond[ 1 ];

         }

-                

         

-        SyblElasticityRequirementsDescription newSYBLConstraint = dialog.getSYBLConstraint();

-        if( newElasticityConstraint != null ) {

-          // Add Application Component Elasticity Requirement to TOSCA

-          PictogramElement pe = getSelectedPictogramElement();

-          Object bo = null;

-          if( pe != null ) {

-            bo = Graphiti.getLinkService()

-              .getBusinessObjectForLinkedPictogramElement( pe );

-          }

-          final TNodeTemplateExtension nodeTemplate;

-          if( bo instanceof TDeploymentArtifact ) {

-            PictogramElement parentPE = Graphiti.getPeService()

-              .getPictogramElementParent( pe );

-            nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()

-              .getBusinessObjectForLinkedPictogramElement( parentPE );

-          } else { // bo instanceof TNodeTemplate

-            nodeTemplate = ( TNodeTemplateExtension )bo;

-          }

-          if( nodeTemplate.getPolicies() == null ) {

-            final PoliciesType nodePolicyList = ToscaFactory.eINSTANCE.createPoliciesType();

-            TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( nodeTemplate );

-            editingDomain.getCommandStack()

-              .execute( new RecordingCommand( editingDomain ) {

-

-                @Override

-                protected void doExecute() {

-                  nodeTemplate.setPolicies( nodePolicyList );

-                }

-              } );

-          }

-          PoliciesType nodePolicyList = nodeTemplate.getPolicies();

-          final EList<TPolicy> policy = nodePolicyList.getPolicy();

-          final TPolicy newPolicy = createNewPolicy( "Constraint",

-                                                     newElasticityConstraint, newSYBLConstraint );

+        // Add Application Component Elasticity Requirement to TOSCA

+        PictogramElement pe = getSelectedPictogramElement();

+        Object bo = null;

+        if( pe != null ) {

+          bo = Graphiti.getLinkService()

+            .getBusinessObjectForLinkedPictogramElement( pe );

+        }

+        final TNodeTemplateExtension nodeTemplate;

+        if( bo instanceof TDeploymentArtifact ) {

+          PictogramElement parentPE = Graphiti.getPeService()

+            .getPictogramElementParent( pe );

+          nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()

+            .getBusinessObjectForLinkedPictogramElement( parentPE );

+        } else { // bo instanceof TNodeTemplate

+          nodeTemplate = ( TNodeTemplateExtension )bo;

+        }

+        if( nodeTemplate.getPolicies() == null ) {

+          final PoliciesType nodePolicyList = ToscaFactory.eINSTANCE.createPoliciesType();

           TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( nodeTemplate );

           editingDomain.getCommandStack()

             .execute( new RecordingCommand( editingDomain ) {

 

               @Override

               protected void doExecute() {

-                policy.add( newPolicy );

+                nodeTemplate.setPolicies( nodePolicyList );

               }

             } );

-          // Add Application Component Elasticity Requirement to temp list

-          this.appComponentElasticityRequirements.add( newPolicy );

-          this.tableViewer.refresh();

-        } else {

         }

+        PoliciesType nodePolicyList = nodeTemplate.getPolicies();

+        final EList<TPolicy> policy = nodePolicyList.getPolicy();

+        final TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();

+        String type = "Constraint";

+        QName policyTypeName = new QName( "http://www.example.org/SYBL",

+                                          type,

+                                          null );

+        newPolicy.setPolicyType( policyTypeName );

+        newPolicy.setName( type.toUpperCase() + " " + newElasticityConstraint );

+        

+        String id = "C" + ( ( Integer )nodeTemplate.hashCode() ).toString() + nodePolicyList.getPolicy().size();

+        QName qnamePolicyTemplate = new QName( id );

+        newPolicy.setPolicyRef( qnamePolicyTemplate );

+        

+        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( nodeTemplate );

+        editingDomain.getCommandStack()

+          .execute( new RecordingCommand( editingDomain ) {

+

+            @Override

+            protected void doExecute() {

+              policy.add( newPolicy );

+            }

+          } );

+        // Add Application Component Elasticity Requirement to temp list

+        this.appComponentElasticityRequirements.add( newPolicy );

+        this.tableViewer.refresh();

       }

     }

   }

+}

 

-  void editDataStagingEntryRA( final TPolicy selectedObject ) {

-    ElasticityStrategyDialog dialog;

-    if( selectedObject == null ) {

-      // Add button is pressed

-      dialog = new ElasticityStrategyDialog( this.section.getShell(),

-                                             "Application Component" ); //$NON-NLS-1$

-      if( dialog.open() == Window.OK ) {

-        String newElasticityStrategy = dialog.getElasticityStrategy();

-        SyblElasticityRequirementsDescription newSYBLStrategy = dialog.getSYBLStrategy();

-        if( newElasticityStrategy != null ) {

-          // Add Application Component Elasticity Strategy to TOSCA

-          PictogramElement pe = getSelectedPictogramElement();

-          Object bo = null;

-          if( pe != null ) {

-            bo = Graphiti.getLinkService()

-              .getBusinessObjectForLinkedPictogramElement( pe );

-          }

-          final TNodeTemplateExtension nodeTemplate;

-          if( bo instanceof TDeploymentArtifact ) {

-            PictogramElement parentPE = Graphiti.getPeService()

-              .getPictogramElementParent( pe );

-            nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()

-              .getBusinessObjectForLinkedPictogramElement( parentPE );

-          } else { // bo instanceof TNodeTemplate

-            nodeTemplate = ( TNodeTemplateExtension )bo;

-          }

-          if( nodeTemplate.getPolicies() == null ) {

-            final PoliciesType nodePolicyList = ToscaFactory.eINSTANCE.createPoliciesType();

-            TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

-            editingDomain.getCommandStack()

-              .execute( new RecordingCommand( editingDomain ) {

+void editDataStagingEntryRA( final TPolicy selectedObject ) {

+  ElasticityStrategyDialog dialog;

+  if( selectedObject == null ) {

+    // Add button is pressed

+    

+    PictogramElement pe = getSelectedPictogramElement();

+    Object bo = null;

+    if( pe != null ) {

+      bo = Graphiti.getLinkService()

+        .getBusinessObjectForLinkedPictogramElement( pe );

+    }

+    final TNodeTemplateExtension nodeTemplate;

+    if( bo instanceof TDeploymentArtifact ) {

+      PictogramElement parentPE = Graphiti.getPeService()

+        .getPictogramElementParent( pe );

+      nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()

+        .getBusinessObjectForLinkedPictogramElement( parentPE );

+    } else { // bo instanceof TNodeTemplate

+      nodeTemplate = ( TNodeTemplateExtension )bo;

+    }

+    

+    dialog = new ElasticityStrategyDialog( this.section.getShell(),

+                                           "Application Component", nodeTemplate.getName() ); //$NON-NLS-1$

+    if( dialog.open() == Window.OK ) {

+      String newElasticityStrategy = dialog.getElasticityStrategy();

+      if( newElasticityStrategy != null ) {

+        // Add Application Component Elasticity Strategy to TOSCA

 

-                @Override

-                protected void doExecute() {

-                  nodeTemplate.setPolicies( nodePolicyList );

-                }

-              } );

-          }

-          PoliciesType nodePolicyList = nodeTemplate.getPolicies();

-          final EList<TPolicy> policy = nodePolicyList.getPolicy();

-          final TPolicy newPolicy = createNewPolicy( "Strategy",

-                                                     newElasticityStrategy, newSYBLStrategy );

+        if( nodeTemplate.getPolicies() == null ) {

+          final PoliciesType nodePolicyList = ToscaFactory.eINSTANCE.createPoliciesType();

           TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

           editingDomain.getCommandStack()

             .execute( new RecordingCommand( editingDomain ) {

 

               @Override

               protected void doExecute() {

-                policy.add( newPolicy );

+                nodeTemplate.setPolicies( nodePolicyList );

               }

             } );

-          this.appComponentResizingActions.add( newPolicy );

-          this.tableResizingActionsViewer.refresh();

-        } else {

-          // Edit

         }

+        PoliciesType nodePolicyList = nodeTemplate.getPolicies();

+        final EList<TPolicy> policy = nodePolicyList.getPolicy();

+        final TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();

+        String type = "Strategy";

+        QName policyTypeName = new QName( "http://www.example.org/SYBL",

+                                          type,

+                                          null );

+        newPolicy.setPolicyType( policyTypeName );

+        newPolicy.setName( type.toUpperCase() + " " + newElasticityStrategy );

+        

+        String id = "C" + ( ( Integer )nodeTemplate.hashCode() ).toString() + nodePolicyList.getPolicy().size();

+        QName qnamePolicyTemplate = new QName( id );

+        newPolicy.setPolicyRef( qnamePolicyTemplate );

+        

+        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

+        editingDomain.getCommandStack()

+          .execute( new RecordingCommand( editingDomain ) {

+

+            @Override

+            protected void doExecute() {

+              policy.add( newPolicy );

+            }

+          } );

+        this.appComponentResizingActions.add( newPolicy );

+        this.tableResizingActionsViewer.refresh();

+      } else {

+        // Edit

       }

     }

   }

+}

 

+void addStrategyCondition( final TPolicy selectedObject ) {

+  if( selectedObject == null )

+    return;

+  TNodeTemplate nodeTemplate = null;

+  if( getSelectedPictogramElement() != null )

+    nodeTemplate = ( TNodeTemplate )Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( getSelectedPictogramElement() );

+  ElasticityConditionDialog dialog;

+  ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

+  dialog = new ElasticityConditionDialog( this.section.getShell(),

+                                          "Application Component",

+                                          model,

+                                          selectedObject.getName() ); //$NON-NLS-1$

+  String newElasticityCondition = null;

+  if( dialog.open() == Window.OK ) {

+    newElasticityCondition = dialog.getSelectedCondition();

+  }

+  if( newElasticityCondition == null )

+    return;

+  // final String condition = newElasticityCondition;

+  String newCond = newElasticityCondition;

+  if( newCond.contains( "<" ) ) {

+    String[] cond = newCond.split( "<" );

+    newCond = cond[ 0 ] + "&lt;" + cond[ 1 ];

+  } else if( newCond.contains( ">" ) ) {

+    String[] cond = newCond.split( ">" );

+    newCond = cond[ 0 ] + "&gt;" + cond[ 1 ];

+  }

+  final String condition = newCond;

+  TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( nodeTemplate );

+  editingDomain.getCommandStack()

+    .execute( new RecordingCommand( editingDomain ) {

 

-  // type is either "Constraint" or "Strategy"

-  TPolicy createNewPolicy(String type, String policyName, SyblElasticityRequirementsDescription syblPolicy){

+      @Override

+      protected void doExecute() {

+        String[] strategy = selectedObject.getName().split( "STRATEGY" );

+        selectedObject.setName( strategy[ 0 ]

+                                + "STRATEGY "

+                                + condition

+                                + " :"

+                                + strategy[ 1 ] );

+      }

+    } );

+  this.tableResizingActionsViewer.refresh();

+}

 

-    // Create Policy Template 

-    

-    final TPolicyTemplate newPolicyTemplate = ToscaFactory.eINSTANCE.createTPolicyTemplate();

-    

-    QName policyTypeName = new QName( "http://www.example.org/SYBL", type, null );

-    

-    newPolicyTemplate.setType( policyTypeName );

-    

-    String id = "C" + ( ( Integer )newPolicyTemplate.hashCode() ).toString();

-    

-    newPolicyTemplate.setId( id );

+// Remove the selected Application Component Elasticity Requirement from TOSCA

+void removeApplicationComponentElasticityRequirement( final TPolicy selectedObject )

+{

+  PictogramElement pe = getSelectedPictogramElement();

+  Object bo = null;

+  if( pe != null ) {

+    bo = Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( pe );

+  }

+  final TNodeTemplateExtension nodeTemplate;

+  if( bo instanceof TDeploymentArtifact ) {

+    PictogramElement parentPE = Graphiti.getPeService()

+      .getPictogramElementParent( pe );

+    nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( parentPE );

+  } else { // bo instanceof TNodeTemplate

+    nodeTemplate = ( TNodeTemplateExtension )bo;

+  }

+  PoliciesType nodePolicyList = nodeTemplate.getPolicies();

+  final EList<TPolicy> policy = nodePolicyList.getPolicy();

+  TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

+  editingDomain.getCommandStack()

+    .execute( new RecordingCommand( editingDomain ) {

 

-    

-    // Set the Properties of the Policy Template    

-    

-    PropertiesType properties = ToscaFactory.eINSTANCE.createPropertiesType();    

-  

-    // Add the SYBL Policy to the FeatureMap of the Policy's Properties element

-    Entry e = FeatureMapUtil.createEntry(     SyblPackage.eINSTANCE.getDocumentRoot_SYBLElasticityRequirementsDescription(),  syblPolicy );

-    properties.getAny().add( e );      

-    

-    newPolicyTemplate.setProperties( properties );

-        

-    // Add the new Policy Template to the TOSCA Definitions element

-    

-    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-    

-    DefinitionsType definitions = model.getDocumentRoot().getDefinitions();

-       

-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );

-    editingDomain.getCommandStack()

-      .execute( new RecordingCommand( editingDomain ) {

-

-        @Override

-        protected void doExecute() {

-          model.getDocumentRoot().getDefinitions().getPolicyTemplate().add( newPolicyTemplate );

-          

+      @Override

+      protected void doExecute() {

+        for( TPolicy tempPolicy : policy ) {

+          if( tempPolicy.getPolicyType().toString().contains( "Constraint" ) ) //$NON-NLS-1$

+            if( tempPolicy.getName().compareTo( selectedObject.getName() ) == 0 )

+            {

+              policy.remove( tempPolicy );

+              if( policy.size() == 0 )

+                nodeTemplate.setPolicies( null );

+              break;

+            }

         }

-      } );

-    

-    // Assign the created Policy Template to the new Policy

-    

-    TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();

-    

-    QName qnamePolicyTemplate = new QName( newPolicyTemplate.getId() );

-    

-    newPolicy.setPolicyType( policyTypeName );  

-    

-    newPolicy.setPolicyRef( qnamePolicyTemplate );

-    

-    newPolicy.setName( type.toUpperCase() + " " + policyName );

-    

-    return newPolicy;

-  }

-  

-  void addStrategyCondition( final TPolicy selectedObject ) {

-    if( selectedObject == null )

-      return;

-    TNodeTemplate nodeTemplate = null;

-    if( getSelectedPictogramElement() != null )

-      nodeTemplate = ( TNodeTemplate )Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( getSelectedPictogramElement() );

-    ElasticityConditionDialog dialog;

-    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-    dialog = new ElasticityConditionDialog( this.section.getShell(),

-                                            "Application Component",

-                                            model,

-                                            selectedObject.getName() ); //$NON-NLS-1$

-    String newElasticityCondition = null;

-    ConditionType policyCondition = null;

-    if( dialog.open() == Window.OK ) {

-      newElasticityCondition = dialog.getSelectedCondition();

-      policyCondition = dialog.getSYBLCondition();

-    }

-    if( newElasticityCondition == null )

-      return;

-    

-    //final String condition = newElasticityCondition;

-    

-    String newCond = newElasticityCondition;

-    

-    if (newCond.contains( "<" )){

-      String[] cond = newCond.split( "<" );

-      newCond = cond[0] + "&lt;" + cond[1];

-    }

-    else if (newCond.contains( ">" )){

-      String[] cond = newCond.split( ">" );

-      newCond = cond[0] + "&gt;" + cond[1];

-    }

-    

-    final String condition = newCond;

-        

-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( nodeTemplate );

-    editingDomain.getCommandStack()

-      .execute( new RecordingCommand( editingDomain ) {

+      }

+    } );

+  this.appComponentElasticityRequirements.remove( selectedObject );

+  this.tableViewer.refresh();

+}

 

-        @Override

-        protected void doExecute() {

-          String[] strategy = selectedObject.getName().split( "STRATEGY" );

-          selectedObject.setName( strategy[ 0 ]

-                                  + "STRATEGY "

-                                  + condition

-                                  + " :" + strategy[ 1 ] );

+// Return the selected Elasticity Requirement

+TPolicy getSelectedObject() {

+  TPolicy result = null;

+  IStructuredSelection selection = ( IStructuredSelection )this.tableViewer.getSelection();

+  Object obj = selection.getFirstElement();

+  result = ( TPolicy )obj;

+  return result;

+}

+

+// Return the selected Elasticity Action

+TPolicy getSelectedElasticityStrategy() {

+  TPolicy result = null;

+  IStructuredSelection selection = ( IStructuredSelection )this.tableResizingActionsViewer.getSelection();

+  Object obj = selection.getFirstElement();

+  result = ( TPolicy )obj;

+  return result;

+}

+

+/**

+ * Get Application Component Elasticity Actions

+ */

+public void getResizingActions() {

+  PictogramElement pe = getSelectedPictogramElement();

+  Object bo = null;

+  if( pe != null ) {

+    bo = Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( pe );

+  }

+  final TNodeTemplateExtension appComponent;

+  if( bo instanceof TDeploymentArtifact ) {

+    PictogramElement parentPE = Graphiti.getPeService()

+      .getPictogramElementParent( pe );

+    appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( parentPE );

+  } else { // bo instanceof TNodeTemplate

+    appComponent = ( TNodeTemplateExtension )bo;

+  }

+

+  if( appComponent == null || appComponent.getPolicies() == null )

+    return;

+  PoliciesType nodePolicyList = appComponent.getPolicies();

+  for( TPolicy tempPolicy : nodePolicyList.getPolicy() ) {

+    if( tempPolicy.getPolicyType().toString().contains( "Strategy" ) ) //$NON-NLS-1$

+      this.appComponentResizingActions.add( tempPolicy );

+  }

+}

+

+/**

+ * Get Application Component Elasticity Constraints

+ */

+public void getElasticityConstraints() {

+  PictogramElement pe = getSelectedPictogramElement();

+  Object bo = null;

+  if( pe != null ) {

+    bo = Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( pe );

+  }

+  final TNodeTemplateExtension appComponent;

+  if( bo instanceof TDeploymentArtifact ) {

+    PictogramElement parentPE = Graphiti.getPeService()

+      .getPictogramElementParent( pe );

+    appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( parentPE );

+  } else { // bo instanceof TNodeTemplate

+    appComponent = ( TNodeTemplateExtension )bo;

+  }

+

+  if( appComponent == null || appComponent.getPolicies() == null )

+    return;

+  PoliciesType nodePolicyList = appComponent.getPolicies();

+  for( TPolicy tempPolicy : nodePolicyList.getPolicy() ) {

+    if( tempPolicy.getPolicyType().toString().contains( "Constraint" ) ) //$NON-NLS-1$

+      this.appComponentElasticityRequirements.add( tempPolicy );

+  }

+}

+

+// Remove Application Component Elasticity Action

+void removeApplicationComponentResizingAction( final TPolicy selectedObject )

+{

+  PictogramElement pe = getSelectedPictogramElement();

+  Object bo = null;

+  if( pe != null ) {

+    bo = Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( pe );

+  }

+  final TNodeTemplateExtension nodeTemplate;

+  if( bo instanceof TDeploymentArtifact ) {

+    PictogramElement parentPE = Graphiti.getPeService()

+      .getPictogramElementParent( pe );

+    nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( parentPE );

+  } else { // bo instanceof TNodeTemplate

+    nodeTemplate = ( TNodeTemplateExtension )bo;

+  }

+  PoliciesType nodePolicyList = nodeTemplate.getPolicies();

+  final EList<TPolicy> policy = nodePolicyList.getPolicy();

+  TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

+  editingDomain.getCommandStack()

+    .execute( new RecordingCommand( editingDomain ) {

+

+      @Override

+      protected void doExecute() {

+        for( TPolicy tempPolicy : policy ) {

+          if( tempPolicy.getPolicyType().toString().contains( "Strategy" ) ) //$NON-NLS-1$

+            if( tempPolicy.getName().compareTo( selectedObject.getName() ) == 0 )

+            {

+              policy.remove( tempPolicy );

+              if( policy.size() == 0 )

+                nodeTemplate.setPolicies( null );

+              break;

+            }

         }

-      } );

-    this.tableResizingActionsViewer.refresh();

-    

-    //addPolicyCondition( selectedObject, policyCondition);

-  }

-  

-//  void addPolicyCondition(final TPolicy selectedPolicy, final ConditionType policyCondition){

-//    

-//    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-//    EList<TPolicyTemplate> policyTemplates = model.getDocumentRoot().getDefinitions().getPolicyTemplate();

-//    TPolicyTemplate policyTemplate = null;

-//    for ( TPolicyTemplate tempPolicyTemplate : policyTemplates ){

-//      if (tempPolicyTemplate.getId().toString().equals(selectedPolicy.getPolicyRef().toString())){

-//        policyTemplate = tempPolicyTemplate;

-//        break;

-//      }      

-//    }

-//    

-//    final SyblElasticityRequirementsDescription syblPolicy = (SyblElasticityRequirementsDescription) policyTemplate.getProperties().getAny().get(0).getValue();

-//    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( policyTemplate );

-//    editingDomain.getCommandStack()

-//      .execute( new RecordingCommand( editingDomain ) {

-//

-//        @Override

-//        protected void doExecute() {

-//          syblPolicy.getSYBLSpecification().get( 0 ).getStrategy().get( 0 ).setCondition( policyCondition );

-//        }

-//      } );

-//  }

+      }

+    } );

+  this.appComponentResizingActions.remove( selectedObject );

+  this.tableResizingActionsViewer.refresh();

+}

 

-  // Remove the selected Application Component Elasticity Requirement from TOSCA

-  void removeApplicationComponentElasticityRequirement( final TPolicy selectedObject )

-  {

-    PictogramElement pe = getSelectedPictogramElement();

-    Object bo = null;

-    if( pe != null ) {

-      bo = Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( pe );

-    }

-    final TNodeTemplateExtension nodeTemplate;

-    if( bo instanceof TDeploymentArtifact ) {

-      PictogramElement parentPE = Graphiti.getPeService()

-        .getPictogramElementParent( pe );

-      nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( parentPE );

-    } else { // bo instanceof TNodeTemplate

-      nodeTemplate = ( TNodeTemplateExtension )bo;

-    }

-    PoliciesType nodePolicyList = nodeTemplate.getPolicies();

-    final EList<TPolicy> policy = nodePolicyList.getPolicy();

-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

-    editingDomain.getCommandStack()

-      .execute( new RecordingCommand( editingDomain ) {

-

-        @Override

-        protected void doExecute() {

-          for( TPolicy tempPolicy : policy ) {

-            if( tempPolicy.getPolicyType().toString().contains( "Constraint" ) ) //$NON-NLS-1$

-              if( tempPolicy.getName().compareTo( selectedObject.getName() ) == 0 )

-              {

-                policy.remove( tempPolicy );

-                if( policy.size() == 0 )

-                  nodeTemplate.setPolicies( null );

-                // remove corresponding Policy Template

-                String removedPolicyId = tempPolicy.getPolicyRef().toString();

-                ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-                DefinitionsType toscaDefinitions = model.getDocumentRoot()

-                  .getDefinitions();

-                final EList<TPolicyTemplate> policyTemplate = toscaDefinitions.getPolicyTemplate();

-                for( TPolicyTemplate tempPolicyTemplate : policyTemplate ) {

-                  if( tempPolicyTemplate.getId().equals( removedPolicyId ) ) {

-                    policyTemplate.remove( tempPolicyTemplate );

-                  }

-                }

-                break;

-              }

-          }

-        }

-      } );

-    this.appComponentElasticityRequirements.remove( selectedObject );

-    this.tableViewer.refresh();

-  }

-

-  // Return the selected Elasticity Requirement

-  TPolicy getSelectedObject() {

-    TPolicy result = null;

-    IStructuredSelection selection = ( IStructuredSelection )this.tableViewer.getSelection();

-    Object obj = selection.getFirstElement();

-    result = ( TPolicy )obj;

-    return result;

-  }

-

-  // Return the selected Elasticity Action

-  TPolicy getSelectedElasticityStrategy() {

-    TPolicy result = null;

-    IStructuredSelection selection = ( IStructuredSelection )this.tableResizingActionsViewer.getSelection();

-    Object obj = selection.getFirstElement();

-    result = ( TPolicy )obj;

-    return result;

-  }

-

-  /**

-   * Get Application Component Elasticity Actions

-   */

-  public void getResizingActions() {

+void addResizingActionExecutable( final Composite parent,

+                                  final TPolicy selectedObject )

+{

+  if( selectedObject == null )

+    return;

+  FileDialog dialog = new FileDialog( parent.getShell(), SWT.OPEN );

+  dialog.setText( "Select Executable File" ); //$NON-NLS-1$

+  String result = dialog.open();

+  if( result != null ) {

     PictogramElement pe = getSelectedPictogramElement();

     Object bo = null;

     if( pe != null ) {

@@ -728,331 +741,205 @@
     } else { // bo instanceof TNodeTemplate

       appComponent = ( TNodeTemplateExtension )bo;

     }

-    PoliciesType nodePolicyList = appComponent.getPolicies();

-    if( nodePolicyList == null )

-      return;

-    for( TPolicy tempPolicy : nodePolicyList.getPolicy() ) {

-      if( tempPolicy.getPolicyType().toString().contains( "Strategy" ) ) //$NON-NLS-1$

-        this.appComponentResizingActions.add( tempPolicy );

-    }

-  }

-

-  /**

-   * Get Application Component Elasticity Constraints

-   */

-  public void getElasticityConstraints() {

-    PictogramElement pe = getSelectedPictogramElement();

-    Object bo = null;

-    if( pe != null ) {

-      bo = Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( pe );

-    }

-    final TNodeTemplateExtension appComponent;

-    if( bo instanceof TDeploymentArtifact ) {

-      PictogramElement parentPE = Graphiti.getPeService()

-        .getPictogramElementParent( pe );

-      appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( parentPE );

-    } else { // bo instanceof TNodeTemplate

-      appComponent = ( TNodeTemplateExtension )bo;

-    }

-    PoliciesType nodePolicyList = appComponent.getPolicies();

-    if( nodePolicyList == null )

-      return;

-    for( TPolicy tempPolicy : nodePolicyList.getPolicy() ) {

-      if( tempPolicy.getPolicyType().toString().contains( "Constraint" ) ) //$NON-NLS-1$

-        this.appComponentElasticityRequirements.add( tempPolicy );

-    }

-  }

-

-  // Remove Application Component Elasticity Action

-  void removeApplicationComponentResizingAction( final TPolicy selectedObject )

-  {

-    PictogramElement pe = getSelectedPictogramElement();

-    Object bo = null;

-    if( pe != null ) {

-      bo = Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( pe );

-    }

-    final TNodeTemplateExtension nodeTemplate;

-    if( bo instanceof TDeploymentArtifact ) {

-      PictogramElement parentPE = Graphiti.getPeService()

-        .getPictogramElementParent( pe );

-      nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( parentPE );

-    } else { // bo instanceof TNodeTemplate

-      nodeTemplate = ( TNodeTemplateExtension )bo;

-    }

-    PoliciesType nodePolicyList = nodeTemplate.getPolicies();

-    final EList<TPolicy> policy = nodePolicyList.getPolicy();

-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

-    editingDomain.getCommandStack()

-      .execute( new RecordingCommand( editingDomain ) {

-

-        @Override

-        protected void doExecute() {

-          for( TPolicy tempPolicy : policy ) {

-            if( tempPolicy.getPolicyType().toString().contains( "Strategy" ) ) //$NON-NLS-1$

-              if( tempPolicy.getName().compareTo( selectedObject.getName() ) == 0 )

-              {

-                policy.remove( tempPolicy );

-                if( policy.size() == 0 )

-                  nodeTemplate.setPolicies( null );

-                // remove corresponding Policy Template

-                String removedPolicyId = tempPolicy.getPolicyRef().toString();

-                ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-                DefinitionsType toscaDefinitions = model.getDocumentRoot()

-                  .getDefinitions();

-                final EList<TPolicyTemplate> policyTemplate = toscaDefinitions.getPolicyTemplate();

-                for( TPolicyTemplate tempPolicyTemplate : policyTemplate ) {

-                  if( tempPolicyTemplate.getId().equals( removedPolicyId ) ) {

-                    policyTemplate.remove( tempPolicyTemplate );

-                  }

-                }

-                break;

-              }

-          }

-        }

-      } );

-    this.appComponentResizingActions.remove( selectedObject );

-    this.tableResizingActionsViewer.refresh();

-  }

-

-  void addResizingActionExecutable( final Composite parent, final TPolicy selectedObject ) {

+    // Create Resizing Artifact Template

     

-    if (selectedObject == null)

-      return;

+    CreateArtifactTemplate artTempl = new CreateArtifactTemplate(dialog.getFileName(), new QName("RA"), ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) ));

     

-    FileDialog dialog = new FileDialog( parent.getShell(), SWT.OPEN );

-    dialog.setText( "Select Executable File" ); //$NON-NLS-1$

+    // Create Implementation Artifact

+    String operationName = selectedObject.getName();

+    // String operationName = "";

+    createImplementationArtifact( operationName,

+                                  dialog.getFileName(),

+                                  new QName( appComponent.getName() ),

+                                  new QName( dialog.getFileName() ) );

     

-    String result = dialog.open();

-    

-    if( result != null ) {

-

-      PictogramElement pe = getSelectedPictogramElement();

-      Object bo = null;

-      if( pe != null ) {

-        bo = Graphiti.getLinkService()

-          .getBusinessObjectForLinkedPictogramElement( pe );

-      }

-      final TNodeTemplateExtension appComponent;

-      if( bo instanceof TDeploymentArtifact ) {

-        PictogramElement parentPE = Graphiti.getPeService()

-          .getPictogramElementParent( pe );

-        appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()

-          .getBusinessObjectForLinkedPictogramElement( parentPE );

-      } else { // bo instanceof TNodeTemplate

-        appComponent = ( TNodeTemplateExtension )bo;

-      }

-      //Create Resizing Artifact Template

-      createArtifactTemplate(appComponent.getName(), dialog.getFileName());

-      

-      //Create Implementation Artifact

-      String operationName = selectedObject.getName();

-      //String operationName = "";

-      createImplementationArtifact( operationName, dialog.getFileName(), new QName(appComponent.getName()), new QName(appComponent.getName()+"_"+ dialog.getFileName() +"_"+"Script"));

-      

-      // Add uploaded resizing scripts to Project Artifacts folder    

-     

-      IWorkbenchPage activePage = PlatformUI.getWorkbench()

-        .getActiveWorkbenchWindow()

-        .getActivePage();

-      IEditorInput input = activePage.getActiveEditor().getEditorInput();

-      IFile file = null;

-      if( input instanceof ToscaDiagramEditorInput ) {

-        file = ( ( ToscaDiagramEditorInput )input ).getToscaFile();

-      }

-      IProject project = file.getProject();

-      String targetPath = Platform.getLocation()

-                          + File.separator + project.getName() + File.separator + "Artifacts" + File.separator + "Reconfiguration Scripts" + File.separator + dialog.getFileName(); //$NON-NLS-1$ //$NON-NLS-2$

-      

-      File tmp = new File( targetPath );

-      try {

-        tmp.createNewFile();   

-      } catch( IOException e1 ) {

-        // TODO Auto-generated catch block

-        e1.printStackTrace();

-      }

-      

-      copySelectedFileToCloudProject( new File(result), tmp );

-

-      IProgressMonitor monitor = null;

-      try {

-        CloudModel.getRoot().refresh( monitor );

-      } catch( ProblemException e2 ) {

-        e2.printStackTrace();

-      }

-      // Refresh Palette Compartments

-      getDiagramTypeProvider().getFeatureProvider()

-        .getDiagramTypeProvider()

-        .getDiagramBehavior()

-        .refreshPalette();

+    // Add uploaded resizing scripts to Project Artifacts folder

+    IWorkbenchPage activePage = PlatformUI.getWorkbench()

+      .getActiveWorkbenchWindow()

+      .getActivePage();

+    IEditorInput input = activePage.getActiveEditor().getEditorInput();

+    IFile file = null;

+    if( input instanceof ToscaDiagramEditorInput ) {

+      file = ( ( ToscaDiagramEditorInput )input ).getToscaFile();

     }

-  }

-  

-  private void copySelectedFileToCloudProject(File source, File destination){

-   

-    InputStream selection = null;

-    OutputStream output = null;

+    IProject project = file.getProject();

+    String targetPath = Platform.getLocation()

+                        + System.getProperty( "file.separator" )

+                        + project.getName()

+                        + System.getProperty( "file.separator" )

+                        + "Artifacts" + System.getProperty( "file.separator" ) + "Reconfiguration Scripts" + System.getProperty( "file.separator" ) + dialog.getFileName(); //$NON-NLS-1$ //$NON-NLS-2$

+    File tmp = new File( targetPath );

     try {

-      try {

-        selection = new FileInputStream(source);

-      } catch( FileNotFoundException e ) {

-        // TODO Auto-generated catch block

-        e.printStackTrace();

-      }

+      tmp.createNewFile();

+    } catch( IOException e1 ) {

+      // TODO Auto-generated catch block

+      e1.printStackTrace();

+    }

+    copySelectedFileToCloudProject( new File( result ), tmp );

+    IProgressMonitor monitor = null;

     try {

-      output = new FileOutputStream(destination);

+      CloudModel.getRoot().refresh( monitor );

+    } catch( ProblemException e2 ) {

+      e2.printStackTrace();

+    }

+//    // Refresh Palette Compartments

+//    getDiagramTypeProvider().getFeatureProvider()

+//      .getDiagramTypeProvider()

+//      .getDiagramBehavior()

+//      .refreshPalette();

+  }

+}

+

+private void copySelectedFileToCloudProject( File source, File destination ) {

+  InputStream selection = null;

+  OutputStream output = null;

+  try {

+    try {

+      selection = new FileInputStream( source );

     } catch( FileNotFoundException e ) {

       // TODO Auto-generated catch block

       e.printStackTrace();

     }

-    byte[] buf = new byte[1024];

+    try {

+      output = new FileOutputStream( destination );

+    } catch( FileNotFoundException e ) {

+      // TODO Auto-generated catch block

+      e.printStackTrace();

+    }

+    byte[] buf = new byte[ 1024 ];

     int bytesRead;

-     try {

-      while ((bytesRead = selection.read(buf)) > 0) {

-      output.write(buf, 0, bytesRead);

+    try {

+      while( ( bytesRead = selection.read( buf ) ) > 0 ) {

+        output.write( buf, 0, bytesRead );

       }

     } catch( IOException e ) {

       // TODO Auto-generated catch block

       e.printStackTrace();

     }

-    } finally {

-      try {

-        selection.close();

-        output.close();

-      } catch( IOException e ) {

-        // TODO Auto-generated catch block

-        e.printStackTrace();

-      }

-    

+  } finally {

+    try {

+      selection.close();

+      output.close();

+    } catch( IOException e ) {

+      // TODO Auto-generated catch block

+      e.printStackTrace();

     }

   }

-  

-  private void createArtifactTemplate(String nodeName, String artifactName){

-    

-    //Create Artifact Template

-    final TArtifactTemplate artifactTemplate = ToscaFactory.eINSTANCE.createTArtifactTemplate();

-    

-    //Create Script Artifact Properties

-    ScriptArtifactPropertiesType scriptProperties = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createScriptArtifactPropertiesType();

-    scriptProperties.setLanguage( "Shell" );

-    

-    // Set the Properties of the Policy Template    

-    PropertiesType properties = ToscaFactory.eINSTANCE.createPropertiesType();   

-    

-    // Add the SYBL Policy to the FeatureMap of the Policy's Properties element

-    Entry e = FeatureMapUtil.createEntry(     Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getDocumentRoot_ScriptArtifactProperties(),  scriptProperties );

-    properties.getAny().add( e );      

-    

-    artifactTemplate.setProperties( properties );

-    

-    artifactTemplate.setId( nodeName + "_" + artifactName + "_" + "Script" );

-    

-    

-    // Set artifact ref

-    TArtifactReference artifactRef = ToscaFactory.eINSTANCE.createTArtifactReference();

-    artifactRef.setReference( "Scripts"+ File.separator + artifactName);

+}

 

-    ArtifactReferencesType artifactRefType = ToscaFactory.eINSTANCE.createArtifactReferencesType();

-    artifactRefType.getArtifactReference().add( artifactRef );

-    

-    artifactTemplate.setArtifactReferences( artifactRefType );

-    

-    // Add the new Artifact Template to the TOSCA Definitions element

-    

-    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-    

-    DefinitionsType definitions = model.getDocumentRoot().getDefinitions();

-       

+private void createArtifactTemplate( String nodeName, String artifactName ) {

+  // Create Artifact Template

+  final TArtifactTemplate artifactTemplate = ToscaFactory.eINSTANCE.createTArtifactTemplate();

+  // Create Script Artifact Properties

+  ScriptArtifactPropertiesType scriptProperties = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createScriptArtifactPropertiesType();

+  scriptProperties.setLanguage( "Shell" );

+  // Set the Properties of the Policy Template

+  PropertiesType properties = ToscaFactory.eINSTANCE.createPropertiesType();

+  // Add the SYBL Policy to the FeatureMap of the Policy's Properties element

+  Entry e = FeatureMapUtil.createEntry( Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getDocumentRoot_ScriptArtifactProperties(),

+                                        scriptProperties );

+  properties.getAny().add( e );

+  artifactTemplate.setProperties( properties );

+  artifactTemplate.setId( nodeName + "_" + artifactName + "_" + "Script" );

+  artifactTemplate.setType( new QName( "ScriptArtifact" ) );

+  // Set artifact ref

+  TArtifactReference artifactRef = ToscaFactory.eINSTANCE.createTArtifactReference();

+  artifactRef.setReference( "Scripts" + System.getProperty( "file.separator" ) + artifactName );

+  ArtifactReferencesType artifactRefType = ToscaFactory.eINSTANCE.createArtifactReferencesType();

+  artifactRefType.getArtifactReference().add( artifactRef );

+  artifactTemplate.setArtifactReferences( artifactRefType );

+  // Add the new Artifact Template to the TOSCA Definitions element

+  final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

+  DefinitionsType definitions = model.getDocumentRoot().getDefinitions();

+  TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );

+  editingDomain.getCommandStack()

+    .execute( new RecordingCommand( editingDomain ) {

+

+      @Override

+      protected void doExecute() {

+        model.getDocumentRoot()

+          .getDefinitions()

+          .getArtifactTemplate()

+          .add( artifactTemplate );

+      }

+    } );

+}

+

+// Creates the install implementation artifact

+private ImplementationArtifactType createImplementationArtifact( String resizingActionName,

+                                                                 String artifactName,

+                                                                 QName nodeType,

+                                                                 QName artifactID )

+{

+  final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

+  final DefinitionsType definitions = model.getDocumentRoot()

+    .getDefinitions();

+  TNodeTypeImplementation nodeTypeImplementation = null;

+  // Test if NodeTypeImplementation for nodeType already exists

+  for( TNodeTypeImplementation tempNodeTypeImplementation : definitions.getNodeTypeImplementation() )

+  {

+    if( tempNodeTypeImplementation.getNodeType()

+      .toString()

+      .equals( nodeType.toString() ) )

+    {

+      // NodeTypeImplementation already exists

+      // We are going to add the artifact to the existing implementation

+      nodeTypeImplementation = tempNodeTypeImplementation;

+    }

+  }

+  if( nodeTypeImplementation == null ) {

+    // NodeTypeImplementation does not exists

+    final TNodeTypeImplementation newNodeTypeImplementation = ToscaFactory.eINSTANCE.createTNodeTypeImplementation();

+    newNodeTypeImplementation.setNodeType( nodeType );

+    TImplementationArtifacts implementationArtifacts = ToscaFactory.eINSTANCE.createTImplementationArtifacts();

+    newNodeTypeImplementation.setImplementationArtifacts( implementationArtifacts );

     TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );

     editingDomain.getCommandStack()

       .execute( new RecordingCommand( editingDomain ) {

 

         @Override

         protected void doExecute() {

-          model.getDocumentRoot().getDefinitions().getArtifactTemplate().add( artifactTemplate );

-          

+          definitions.getNodeTypeImplementation()

+            .add( newNodeTypeImplementation );

         }

       } );

-

+    nodeTypeImplementation = newNodeTypeImplementation;

   }

-  

-  

-  //Creates the install implementation artifact

-  private ImplementationArtifactType createImplementationArtifact(String resizingActionName, String artifactName, QName nodeType, QName artifactID){

-    

-    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-    

-    final DefinitionsType definitions = model.getDocumentRoot().getDefinitions();

-    

-    TNodeTypeImplementation nodeTypeImplementation = null;

-    

-    //Test if NodeTypeImplementation for nodeType already exists

-    for ( TNodeTypeImplementation tempNodeTypeImplementation : definitions.getNodeTypeImplementation() ){

-      if ( tempNodeTypeImplementation.getNodeType().toString().equals(nodeType.toString()) ){

-        //NodeTypeImplementation already exists

-        //We are going to add the artifact to the existing implementation

-        nodeTypeImplementation = tempNodeTypeImplementation;

+  // Create Implementation Artifact

+  final ImplementationArtifactType installArtifactType = ToscaFactory.eINSTANCE.createImplementationArtifactType();

+  installArtifactType.setArtifactType( new QName( "ScriptArtifact" ) );

+  installArtifactType.setArtifactRef( artifactID );

+  installArtifactType.setInterfaceName( "Lifecycle" );

+  installArtifactType.setOperationName( resizingActionName );

+  final TNodeTypeImplementation nodeImplementation = nodeTypeImplementation;

+  TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( nodeTypeImplementation );

+  editingDomain.getCommandStack()

+    .execute( new RecordingCommand( editingDomain ) {

+

+      @Override

+      protected void doExecute() {

+        nodeImplementation.getImplementationArtifacts()

+          .getImplementationArtifact()

+          .add( installArtifactType );

       }

-    }

-    

-    if ( nodeTypeImplementation == null ){

-      //NodeTypeImplementation does not exists

-      final TNodeTypeImplementation newNodeTypeImplementation = ToscaFactory.eINSTANCE.createTNodeTypeImplementation();

-      newNodeTypeImplementation.setNodeType( nodeType );

-      TImplementationArtifacts implementationArtifacts = ToscaFactory.eINSTANCE.createTImplementationArtifacts();

-      newNodeTypeImplementation.setImplementationArtifacts( implementationArtifacts );

-      

-      TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );

-      editingDomain.getCommandStack()

-        .execute( new RecordingCommand( editingDomain ) {

+    } );

+  return installArtifactType;

+}

 

-          @Override

-          protected void doExecute() {

-            definitions.getNodeTypeImplementation().add( newNodeTypeImplementation );

-            

-          }

-        } );

-      nodeTypeImplementation = newNodeTypeImplementation;

-    }

-

-    //Create Implementation Artifact

-    final ImplementationArtifactType installArtifactType = ToscaFactory.eINSTANCE.createImplementationArtifactType();

-    installArtifactType.setArtifactType( new QName("ScriptArtifact") );

-    installArtifactType.setArtifactRef( artifactID );

-    installArtifactType.setInterfaceName( "Lifecycle" );

-    installArtifactType.setOperationName( resizingActionName );

-    

-    final TNodeTypeImplementation nodeImplementation = nodeTypeImplementation;

-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( nodeTypeImplementation );

-    editingDomain.getCommandStack()

-      .execute( new RecordingCommand( editingDomain ) {

-

-        @Override

-        protected void doExecute() {

-          nodeImplementation.getImplementationArtifacts().getImplementationArtifact().add( installArtifactType );

-          

-        }

-      } );    

-

-    return installArtifactType;

-  }

-  /*

-   * Refresh Elasticity Tab(non-Javadoc)

-   * @see

-   * org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()

-   */

-  @Override

-  public void refresh() {

-    // Refresh Elasticity Constraints

-    this.appComponentElasticityRequirements.clear();

-    getElasticityConstraints();

-    this.tableViewer.refresh();

-    // Refresh Elasticity Actions

-    this.appComponentResizingActions.clear();

-    getResizingActions();

-    this.tableResizingActionsViewer.refresh();

-  }

+/*

+ * Refresh Elasticity Tab(non-Javadoc)

+ * @see

+ * org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()

+ */

+@Override

+public void refresh() {

+  // Refresh Elasticity Constraints

+  this.appComponentElasticityRequirements.clear();

+  getElasticityConstraints();

+  this.tableViewer.refresh();

+  // Refresh Elasticity Actions

+  this.appComponentResizingActions.clear();

+  getResizingActions();

+  this.tableResizingActionsViewer.refresh();

+}

 }

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentNameSection.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentNameSection.java
index 2059b42..344e374 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentNameSection.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentNameSection.java
@@ -89,664 +89,672 @@
  * Application Component Properties - Main Tab
  */
 public class ApplicationComponentNameSection extends GFPropertySection
-  implements ITabbedPropertyConstants, ModifyListener, SelectionListener
+implements ITabbedPropertyConstants, ModifyListener, SelectionListener
 {
 
-  private Text nameText;
-  private Text descrText;
-  private Text imageText;
-  private Text keypairText;
-  private Text initialInstancesText;
-  private Text minInstancesText;
-  private Text maxInstancesText;
-  private CCombo cmbImageSize;
-  private Button uploadImage;
-  private Button keypairSelect;
+	private Text nameText;
+	private Text descrText;
+	private Text imageText;
+	private Text keypairText;
+	private Text initialInstancesText;
+	private Text minInstancesText;
+	private Text maxInstancesText;
+	private CCombo cmbImageSize;
+	private Button uploadImage;
+	private Button keypairSelect;
 
-  @Override
-  public void createControls( final Composite parent,
-                              TabbedPropertySheetPage tabbedPropertySheetPage )
-  {
-    super.createControls( parent, tabbedPropertySheetPage );
-    TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
-    FormToolkit toolkit = new FormToolkit( parent.getDisplay() );
-    // Application Component Properties Section\
-    // Application Name label
-    Section section = toolkit.createSection( parent, Section.TITLE_BAR );
-    section.setText( "Application Component Properties" ); //$NON-NLS-1$
-    Composite client = toolkit.createComposite( section, SWT.WRAP );
-    GridLayout layout = new GridLayout();
-    layout.numColumns = 3;
-    layout.marginTop = 15;
-    layout.verticalSpacing = 15;
-    layout.marginWidth = 2;
-    layout.marginHeight = 2;
-    client.setLayout( layout );
-    GridData gd;
-    CLabel valueLabel = factory.createCLabel( client, "Name:" ); //$NON-NLS-1$
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    gd.widthHint = 80;
-    // gd.widthHint=STANDARD_LABEL_WIDTH;
-    valueLabel.setLayoutData( gd );
-    // Application Name text
-    this.nameText = factory.createText( client, "" ); //$NON-NLS-1$
-    this.nameText.setEditable( true );
-    gd = new GridData();
-    gd.horizontalSpan = 2;
-    gd.widthHint = 160;
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
-    this.nameText.setLayoutData( gd );
-    // Application VM label
-    CLabel imageLabel = factory.createCLabel( client, "VM Image:" ); //$NON-NLS-1$
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    gd.widthHint = 80;
-    // gd.widthHint=STANDARD_LABEL_WIDTH;
-    imageLabel.setLayoutData( gd );
-    this.imageText = factory.createText( client, "" ); //$NON-NLS-1$
-    this.imageText.setEditable( true );
-    gd = new GridData();
-    gd.widthHint = 160;
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
-    // Application VM text
-    this.imageText.setLayoutData( gd );
-    this.imageText.addModifyListener( this );
-    // VM Upload Image Button
-    this.uploadImage = new Button( client, SWT.PUSH );
-    this.uploadImage.setText( " Add Image... " ); //$NON-NLS-1$
-    gd = new GridData();
-    gd.widthHint = 80;
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    this.uploadImage.setLayoutData( gd );
-    // Listener for Add button
-    this.uploadImage.addSelectionListener( new SelectionListener() {
+	private String typesPrefix = Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getNsPrefix();
 
-      @Override
-      public void widgetSelected( SelectionEvent e ) {
-        FileDialog dialog = new FileDialog( parent.getShell(), SWT.OPEN );
-        dialog.setText( "Select Image File" ); //$NON-NLS-1$
-        // dialog.setFilterExtensions(new String [] {"*.html"});
-        // dialog.setFilterPath("c:\\temp");
-        String result = dialog.open();
-        if( result != null ) {
-          // Add uploaded image to Project Artifacts folder
-          IWorkbenchPage activePage = PlatformUI.getWorkbench()
-            .getActiveWorkbenchWindow()
-            .getActivePage();
-          IEditorInput input = activePage.getActiveEditor().getEditorInput();
-          IFile file = null;
-          if( input instanceof ToscaDiagramEditorInput ) {
-            file = ( ( ToscaDiagramEditorInput )input ).getToscaFile();
-          }
-          IProject project = file.getProject();
-          String targetPath = Platform.getLocation()
-                              + File.separator + project.getName() + File.separator + "Artifacts"+ File.separator + "Virtual Machine Images" + File.separator + dialog.getFileName(); //$NON-NLS-1$ //$NON-NLS-2$
-          File tmp = new File( targetPath );
-          try {
-            tmp.createNewFile();
-          } catch( IOException e1 ) {
-            // TODO Auto-generated catch block
-            e1.printStackTrace();
-          }
-          
-          // Get image Id
-          BufferedReader reader = null;
-          try {
-            reader = new BufferedReader( new FileReader (new File(result)));
-          } catch( FileNotFoundException e3 ) {
-            // TODO Auto-generated catch block
-            e3.printStackTrace();
-          }
-          String         line = null;
-          StringBuilder  stringBuilder = new StringBuilder();
+	private String typesNamespace = Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getNsURI();
 
-          try {
-            while( ( line = reader.readLine() ) != null ) {
-                stringBuilder.append( line );
-            }
-          } catch( IOException e1 ) {
-            // TODO Auto-generated catch block
-            e1.printStackTrace();
-          }
+	private String imageType = Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getImageArtifactPropertiesType().getName();
 
-          String imageId = stringBuilder.toString();
-          
-          
-          
-          copySelectedFileToCloudProject( new File(result), tmp );
-          
-          IProgressMonitor monitor = null;
-          try {
-            CloudModel.getRoot().refresh( monitor );
-          } catch( ProblemException e2 ) {
-            e2.printStackTrace();
-          }
-          // Refresh Palette Compartments
-          getDiagramTypeProvider().getFeatureProvider()
-            .getDiagramTypeProvider()
-            .getDiagramBehavior()
-            .refreshPalette();        
-          
-          
-          CreateVMIFeature createImageFeature = new CreateVMIFeature( new ToscaFeatureProvider( getDiagramTypeProvider() ) );
-          TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();
-          deploymentArtifact.setName( dialog.getFileName());
-          deploymentArtifact.setArtifactRef( new QName (imageId) );
-          deploymentArtifact.setArtifactType( new QName( "VMI" ) ); //$NON-NLS-1$
-          createImageFeature.setContextObject( deploymentArtifact );
-          CreateContext createContext = new CreateContext();
-          createContext.setTargetContainer( ( ContainerShape )getSelectedPictogramElement() );
-          if( createImageFeature.canCreate( createContext ) )
-            createImageFeature.create( createContext );
-          refresh();
+	@Override
+	public void createControls( final Composite parent,
+			TabbedPropertySheetPage tabbedPropertySheetPage )
+	{
+		super.createControls( parent, tabbedPropertySheetPage );
+		TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
+		FormToolkit toolkit = new FormToolkit( parent.getDisplay() );
+		// Application Component Properties Section\
+		// Application Name label
+		Section section = toolkit.createSection( parent, Section.TITLE_BAR );
+		section.setText( "Application Component Properties" ); //$NON-NLS-1$
+		Composite client = toolkit.createComposite( section, SWT.WRAP );
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 3;
+		layout.marginTop = 15;
+		layout.verticalSpacing = 15;
+		layout.marginWidth = 2;
+		layout.marginHeight = 2;
+		client.setLayout( layout );
+		GridData gd;
+		CLabel valueLabel = factory.createCLabel( client, "Name:" ); //$NON-NLS-1$
+		gd = new GridData();
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		gd.widthHint = 80;
+		// gd.widthHint=STANDARD_LABEL_WIDTH;
+		valueLabel.setLayoutData( gd );
+		// Application Name text
+		this.nameText = factory.createText( client, "" ); //$NON-NLS-1$
+		this.nameText.setEditable( true );
+		gd = new GridData();
+		gd.horizontalSpan = 2;
+		gd.widthHint = 160;
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
+		this.nameText.setLayoutData( gd );
+		// Application VM label
+		CLabel imageLabel = factory.createCLabel( client, "VM Image:" ); //$NON-NLS-1$
+		gd = new GridData();
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		gd.widthHint = 80;
+		// gd.widthHint=STANDARD_LABEL_WIDTH;
+		imageLabel.setLayoutData( gd );
+		this.imageText = factory.createText( client, "" ); //$NON-NLS-1$
+		this.imageText.setEditable( true );
+		gd = new GridData();
+		gd.widthHint = 160;
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
+		// Application VM text
+		this.imageText.setLayoutData( gd );
+		this.imageText.addModifyListener( this );
+		// VM Upload Image Button
+		this.uploadImage = new Button( client, SWT.PUSH );
+		this.uploadImage.setText( " Add Image... " ); //$NON-NLS-1$
+		gd = new GridData();
+		gd.widthHint = 80;
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		this.uploadImage.setLayoutData( gd );
+		// Listener for Add button
+		this.uploadImage.addSelectionListener( new SelectionListener() {
 
-        }
-      }
+			@Override
+			public void widgetSelected( SelectionEvent e ) {
+				FileDialog dialog = new FileDialog( parent.getShell(), SWT.OPEN );
+				dialog.setText( "Select Image File" ); //$NON-NLS-1$
+				// dialog.setFilterExtensions(new String [] {"*.html"});
+				// dialog.setFilterPath("c:\\temp");
+				String result = dialog.open();
+				if( result != null ) {
+					// Add uploaded image to Project Artifacts folder
+					IWorkbenchPage activePage = PlatformUI.getWorkbench()
+							.getActiveWorkbenchWindow()
+							.getActivePage();
+					IEditorInput input = activePage.getActiveEditor().getEditorInput();
+					IFile file = null;
+					if( input instanceof ToscaDiagramEditorInput ) {
+						file = ( ( ToscaDiagramEditorInput )input ).getToscaFile();
+					}
+					IProject project = file.getProject();
 
-      @Override
-      public void widgetDefaultSelected( final SelectionEvent e ) {
-        // TODO Auto-generated method stub
-      }
-    } );
-    // VM Description Label
-    CLabel vmDecsrLabel = factory.createCLabel( client, "VM Description:" ); //$NON-NLS-1$
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    gd.widthHint = 80;
-    // gd.widthHint=STANDARD_LABEL_WIDTH;
-    // VM Description text
-    vmDecsrLabel.setLayoutData( gd );
-    this.descrText = factory.createText( client, "" ); //$NON-NLS-1$
-    this.descrText.setEditable( false );
-    gd = new GridData();
-    gd.horizontalSpan = 2;
-    gd.widthHint = 160;
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
-    this.descrText.setLayoutData( gd );
-    // VM Image Flavor label
-    CLabel vmImageLabel = factory.createCLabel( client, "VM Type:" ); //$NON-NLS-1$
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    gd.widthHint = 80;
-    vmImageLabel.setLayoutData( gd );
-    // Combo - VM Image Flavor
-    this.cmbImageSize = new CCombo( client, SWT.BORDER );
-    this.cmbImageSize.setEnabled( true );
-    
-    // // TODO - nickl For now use Amazon Flavors - get them from IS
+					String targetPath = Platform.getLocation()
+							+ System.getProperty( "file.separator" ) + project.getName() + System.getProperty( "file.separator" ) + "Artifacts"+ System.getProperty( "file.separator" ) + "Virtual Machine Images" + System.getProperty( "file.separator" ) + dialog.getFileName(); //$NON-NLS-1$ //$NON-NLS-2$
+					File tmp = new File( targetPath );
+					try {
+						tmp.createNewFile();
+					} catch( IOException e1 ) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					}
+
+					// Get image Id
+					BufferedReader reader = null;
+					try {
+						reader = new BufferedReader( new FileReader (new File(result)));
+					} catch( FileNotFoundException e3 ) {
+						// TODO Auto-generated catch block
+						e3.printStackTrace();
+					}
+					String         line = null;
+					StringBuilder  stringBuilder = new StringBuilder();
+
+					try {
+						while( ( line = reader.readLine() ) != null ) {
+							stringBuilder.append( line );
+						}
+					} catch( IOException e1 ) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					}
+
+					String imageId = stringBuilder.toString();
+
+					copySelectedFileToCloudProject( new File(result), tmp );
+
+					IProgressMonitor monitor = null;
+					try {
+						CloudModel.getRoot().refresh( monitor );
+					} catch( ProblemException e2 ) {
+						e2.printStackTrace();
+					}
+					// Refresh Palette Compartments
+					getDiagramTypeProvider().getFeatureProvider()
+					.getDiagramTypeProvider()
+					.getDiagramBehavior()
+					.refreshPalette();        
+
+
+					CreateVMIFeature createImageFeature = new CreateVMIFeature( new ToscaFeatureProvider( getDiagramTypeProvider() ) );
+					TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();
+					deploymentArtifact.setName( dialog.getFileName());
+					deploymentArtifact.setArtifactRef( new QName (imageId) );
+					deploymentArtifact.setArtifactType( new QName( typesNamespace, imageType, typesPrefix ) ); //$NON-NLS-1$
+					//deploymentArtifact.setArtifactType( new QName( "VMI" ) ); //$NON-NLS-1$
+					createImageFeature.setContextObject( deploymentArtifact );
+					CreateContext createContext = new CreateContext();
+					createContext.setTargetContainer( ( ContainerShape )getSelectedPictogramElement() );
+					if( createImageFeature.canCreate( createContext ) )
+						createImageFeature.create( createContext );
+					refresh();
+
+				}
+			}
+
+			@Override
+			public void widgetDefaultSelected( final SelectionEvent e ) {
+				// TODO Auto-generated method stub
+			}
+		} );
+
+		//VM Description Label
+		CLabel vmDecsrLabel = factory.createCLabel( client, "VM Description:" ); //$NON-NLS-1$
+		gd = new GridData();
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		gd.widthHint = 80;
+		// gd.widthHint=STANDARD_LABEL_WIDTH;
+		// VM Description text
+		vmDecsrLabel.setLayoutData( gd );
+		this.descrText = factory.createText( client, "" ); //$NON-NLS-1$
+		this.descrText.setEditable( false );
+		gd = new GridData();
+		gd.horizontalSpan = 2;
+		gd.widthHint = 160;
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
+		this.descrText.setLayoutData( gd );
+		// VM Image Flavor label
+		CLabel vmImageLabel = factory.createCLabel( client, "VM Type:" ); //$NON-NLS-1$
+		gd = new GridData();
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		gd.widthHint = 80;
+		vmImageLabel.setLayoutData( gd );
+		// Combo - VM Image Flavor
+		this.cmbImageSize = new CCombo( client, SWT.BORDER );
+		this.cmbImageSize.setEnabled( true );
+
+		// TODO - nickl For now use Amazon Flavors - get them from IS
 		ArrayList<VirtualMachineImageFlavor> flavors = MockUpInfoSystem
 				.getInstance().getFlavors();
-			
+
 		for (VirtualMachineImageFlavor f : flavors) {
 			this.cmbImageSize.add(f.getName());
 		}
-		
-		
-    this.cmbImageSize.setEditable( false );
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
-    gd.horizontalSpan = 2;
-    gd.widthHint = 200;
-    this.cmbImageSize.setLayoutData( gd );
-    // Listener for Flavor
-    this.cmbImageSize.addSelectionListener( new SelectionListener() {
 
-      @Override
-      public void widgetSelected( final SelectionEvent e ) {
-        createNodeFlavorProperties( ApplicationComponentNameSection.this.cmbImageSize.getText() );
-      }
+		this.cmbImageSize.setEditable( false );
+		gd = new GridData();
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
+		gd.horizontalSpan = 2;
+		gd.widthHint = 200;
+		this.cmbImageSize.setLayoutData( gd );
+		// Listener for Flavor
+		this.cmbImageSize.addSelectionListener( new SelectionListener() {
 
-      @Override
-      public void widgetDefaultSelected( final SelectionEvent e ) {
-        // TODO Auto-generated method stub
-      }
-    } );
-    // KeyPair Label
-    CLabel keypairLabel = factory.createCLabel( client, "Keypair:" ); //$NON-NLS-1$
-    gd = new GridData();
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    gd.widthHint = 80;
-    keypairLabel.setLayoutData( gd );
-    // KeyPair text
-    this.keypairText = factory.createText( client, "" ); //$NON-NLS-1$
-    this.keypairText.setEditable( true );
-    gd = new GridData();
-    gd.widthHint = 160;
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
-    this.keypairText.setLayoutData( gd );
-    this.keypairText.addModifyListener( this );
-    // Select KeyPair Button
-    this.keypairSelect = new Button( client, SWT.PUSH );
-    this.keypairSelect.setText( " Select... " ); //$NON-NLS-1$
-    gd = new GridData();
-    gd.widthHint = 80;
-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    this.keypairSelect.setLayoutData( gd );
-    // Listener for Add button
-    this.keypairSelect.addSelectionListener( new SelectionListener() {
+			@Override
+			public void widgetSelected( final SelectionEvent e ) {
+				createNodeFlavorProperties( ApplicationComponentNameSection.this.cmbImageSize.getText() );
+			}
 
-      @Override
-      public void widgetSelected( final SelectionEvent e ) {
-        FileDialog dialog = new FileDialog( parent.getShell(), SWT.OPEN );
-        dialog.setText( "Select Keypair " ); //$NON-NLS-1$
-        dialog.setFilterExtensions( new String[]{
-          "*.pub"} ); // filter only pub keys //$NON-NLS-1$
-        // dialog.setFilterPath("c:\\temp");
-        String result = dialog.open();
-        if( result != null ) {
-          CreateVMIFeature createImageFeature = new CreateVMIFeature( new ToscaFeatureProvider( getDiagramTypeProvider() ) );
-          TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();
-          deploymentArtifact.setName( dialog.getFileName() );
-          deploymentArtifact.setArtifactType( new QName( "KeyPair" ) ); //$NON-NLS-1$
-          createImageFeature.setContextObject( deploymentArtifact );
-          CreateContext createContext = new CreateContext();
-          createContext.setTargetContainer( ( ContainerShape )getSelectedPictogramElement() );
-          if( createImageFeature.canCreate( createContext ) )
-            createImageFeature.create( createContext );
-          refresh();
-          // Add uploaded image to Project Artifacts folder
-          IWorkbenchPage activePage = PlatformUI.getWorkbench()
-            .getActiveWorkbenchWindow()
-            .getActivePage();
-          IEditorInput input = activePage.getActiveEditor().getEditorInput();
-          IFile file = null;
-          if( input instanceof ToscaDiagramEditorInput ) {
-            file = ( ( ToscaDiagramEditorInput )input ).getToscaFile();
-          }
-          IProject project = file.getProject();
-          String target = Platform.getLocation()
-                          + "/" + project.getName() + "/Artifacts/Deployment Scripts/" + dialog.getFileName(); //$NON-NLS-1$ //$NON-NLS-2$
-          String source = dialog.getFilterPath()
-                          + System.getProperty( "file.separator" ) + dialog.getFileName(); //$NON-NLS-1$
-          File targetFile = new File( target );
-          if( !targetFile.exists() ) {
-            try {
-              new LocalFile( new File( source ) ).copy( new LocalFile( new File( target ) ),
-                                                        EFS.NONE,
-                                                        null );
-            } catch( CoreException e1 ) {
-              e1.printStackTrace();
-            }
-          }
-          // File tmp = new File( targetPath );
-          // try {
-          // tmp.createNewFile();
-          // tmp.
-          // } catch( IOException e1 ) {
-          // // TODO Auto-generated catch block
-          // e1.printStackTrace();
-          // }
-          IProgressMonitor monitor = null;
-          try {
-            CloudModel.getRoot().refresh( monitor );
-          } catch( ProblemException e2 ) {
-            e2.printStackTrace();
-          }
-          // Refresh Palette Compartments
-          getDiagramTypeProvider().getFeatureProvider()
-            .getDiagramTypeProvider()
-            .getDiagramBehavior()
-            .refreshPalette();
-          ApplicationComponentNameSection.this.keypairText.setText( dialog.getFileName() );
-        }
-      }
+			@Override
+			public void widgetDefaultSelected( final SelectionEvent e ) {
+				// TODO Auto-generated method stub
+			}
+		} );
+		// KeyPair Label
+		CLabel keypairLabel = factory.createCLabel( client, "Keypair:" ); //$NON-NLS-1$
+		gd = new GridData();
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		gd.widthHint = 80;
+		keypairLabel.setLayoutData( gd );
+		// KeyPair text
+		this.keypairText = factory.createText( client, "" ); //$NON-NLS-1$
+		this.keypairText.setEditable( true );
+		gd = new GridData();
+		gd.widthHint = 160;
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
+		this.keypairText.setLayoutData( gd );
+		this.keypairText.addModifyListener( this );
+		// Select KeyPair Button
+		this.keypairSelect = new Button( client, SWT.PUSH );
+		this.keypairSelect.setText( " Select... " ); //$NON-NLS-1$
+		gd = new GridData();
+		gd.widthHint = 80;
+		gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		this.keypairSelect.setLayoutData( gd );
+		// Listener for Add button
+		this.keypairSelect.addSelectionListener( new SelectionListener() {
 
-      @Override
-      public void widgetDefaultSelected( final SelectionEvent e ) {
-        // TODO Auto-generated method stub
-      }
-    } );
-    // Add section components to the toolkit
-    toolkit.adapt( vmImageLabel, true, true );
-    toolkit.adapt( this.cmbImageSize, true, true );
-    toolkit.adapt( valueLabel, true, true );
-    toolkit.adapt( this.nameText, true, true );
-    toolkit.adapt( imageLabel, true, true );
-    toolkit.adapt( this.imageText, true, true );
-    toolkit.adapt( keypairLabel, true, true );
-    toolkit.adapt( this.keypairText, true, true );
-    toolkit.adapt( vmDecsrLabel, true, true );
-    toolkit.adapt( this.descrText, true, true);
-    section.setClient( client );
-    // Application Component Instances Section
-    Section sectionInstances = toolkit.createSection( parent, Section.TITLE_BAR );
-    sectionInstances.setText( "Number of Instances" ); //$NON-NLS-1$
-    Composite clientInstances = toolkit.createComposite( sectionInstances,
-                                                         SWT.WRAP );
-    GridLayout layoutInstances = new GridLayout();
-    layoutInstances.numColumns = 2;
-    layoutInstances.marginTop = 15;
-    layoutInstances.verticalSpacing = 15;
-    layoutInstances.marginWidth = 2;
-    layoutInstances.marginHeight = 2;
-    clientInstances.setLayout( layoutInstances );
-    GridData gdInstances;
-    CLabel initialInstancesLabel = factory.createCLabel( clientInstances,
-                                                         "Initial:" ); //$NON-NLS-1$
-    gdInstances = new GridData();
-    gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    // gd.widthHint=STANDARD_LABEL_WIDTH;
-    initialInstancesLabel.setLayoutData( gdInstances );
-    this.initialInstancesText = factory.createText( clientInstances, "1" ); //$NON-NLS-1$
-    this.initialInstancesText.setEditable( true );
-    gdInstances = new GridData();
-    gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    gdInstances.widthHint = 160;
-    this.initialInstancesText.setLayoutData( gdInstances );
-    this.initialInstancesText.addModifyListener( this );
-    CLabel minInstancesLabel = factory.createCLabel( clientInstances, "Min:" ); //$NON-NLS-1$
-    gdInstances = new GridData();
-    gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    // gd.widthHint=STANDARD_LABEL_WIDTH;
-    minInstancesLabel.setLayoutData( gdInstances );
-    this.minInstancesText = factory.createText( clientInstances, "" ); //$NON-NLS-1$
-    this.minInstancesText.setEditable( true );
-    gdInstances = new GridData();
-    gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    gdInstances.widthHint = 160;
-    this.minInstancesText.setLayoutData( gdInstances );
-    this.minInstancesText.addModifyListener( this );
-    CLabel maxInstancesLabel = factory.createCLabel( clientInstances, "Max:" ); //$NON-NLS-1$
-    gdInstances = new GridData();
-    gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    // gd.widthHint=STANDARD_LABEL_WIDTH;
-    maxInstancesLabel.setLayoutData( gdInstances );
-    this.maxInstancesText = factory.createText( clientInstances, "" ); //$NON-NLS-1$
-    this.maxInstancesText.setEditable( true );
-    gdInstances = new GridData();
-    gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
-    gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
-    gdInstances.widthHint = 160;
-    this.maxInstancesText.setLayoutData( gdInstances );
-    this.maxInstancesText.addModifyListener( this );
-    // Add section components to the toolkit
-    toolkit.adapt( valueLabel, true, true );
-    toolkit.adapt( this.nameText, true, true );
-    toolkit.adapt( imageLabel, true, true );
-    toolkit.adapt( this.imageText, true, true );
-    section.setClient( client );
-    toolkit.adapt( minInstancesLabel, true, true );
-    toolkit.adapt( maxInstancesLabel, true, true );
-    toolkit.adapt( this.minInstancesText, true, true );
-    toolkit.adapt( this.maxInstancesText, true, true );
-    sectionInstances.setClient( clientInstances );
-  }
+			@Override
+			public void widgetSelected( final SelectionEvent e ) {
+				FileDialog dialog = new FileDialog( parent.getShell(), SWT.OPEN );
+				dialog.setText( "Select Keypair " ); //$NON-NLS-1$
+				dialog.setFilterExtensions( new String[]{
+				"*.pub"} ); // filter only pub keys //$NON-NLS-1$
+				// dialog.setFilterPath("c:\\temp");
+				String result = dialog.open();
+				if( result != null ) {
+					CreateVMIFeature createImageFeature = new CreateVMIFeature( new ToscaFeatureProvider( getDiagramTypeProvider() ) );
+					TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();
+					deploymentArtifact.setName( dialog.getFileName() );
+					deploymentArtifact.setArtifactType( new QName( "KeyPair" ) ); //$NON-NLS-1$
+					createImageFeature.setContextObject( deploymentArtifact );
+					CreateContext createContext = new CreateContext();
+					createContext.setTargetContainer( ( ContainerShape )getSelectedPictogramElement() );
+					if( createImageFeature.canCreate( createContext ) )
+						createImageFeature.create( createContext );
+					refresh();
+					// Add uploaded image to Project Artifacts folder
+					IWorkbenchPage activePage = PlatformUI.getWorkbench()
+							.getActiveWorkbenchWindow()
+							.getActivePage();
+					IEditorInput input = activePage.getActiveEditor().getEditorInput();
+					IFile file = null;
+					if( input instanceof ToscaDiagramEditorInput ) {
+						file = ( ( ToscaDiagramEditorInput )input ).getToscaFile();
+					}
+					IProject project = file.getProject();
+					String target = Platform.getLocation()
+							+ System.getProperty( "file.separator" ) + project.getName() + System.getProperty( "file.separator" ) + "Artifacts" +System.getProperty( "file.separator" )+"Deployment Scripts"+System.getProperty( "file.separator" ) + dialog.getFileName(); //$NON-NLS-1$ //$NON-NLS-2$
+					String source = dialog.getFilterPath()
+							+ System.getProperty( "file.separator" ) + dialog.getFileName(); //$NON-NLS-1$
+					File targetFile = new File( target );
+					if( !targetFile.exists() ) {
+						try {
+							new LocalFile( new File( source ) ).copy( new LocalFile( new File( target ) ),
+									EFS.NONE,
+									null );
+						} catch( CoreException e1 ) {
+							e1.printStackTrace();
+						}
+					}
+					// File tmp = new File( targetPath );
+					// try {
+						// tmp.createNewFile();
+						// tmp.
+						// } catch( IOException e1 ) {
+					// // TODO Auto-generated catch block
+					// e1.printStackTrace();
+					// }
+					IProgressMonitor monitor = null;
+					try {
+						CloudModel.getRoot().refresh( monitor );
+					} catch( ProblemException e2 ) {
+						e2.printStackTrace();
+					}
+					// Refresh Palette Compartments
+					        getDiagramTypeProvider().getFeatureProvider()
+					          .getDiagramTypeProvider()
+					          .getDiagramBehavior()
+					          .refreshPalette();
+					ApplicationComponentNameSection.this.keypairText.setText( dialog.getFileName() );
+				}
+			}
 
-  /*
-   * Refresh values of max and min instances
-   */
-  void refreshInstances() {
-    PictogramElement pe = getSelectedPictogramElement();
-    if( pe != null ) {
-      Object bo = Graphiti.getLinkService()
-        .getBusinessObjectForLinkedPictogramElement( pe );
-      if( bo == null )
-        return;
-      TNodeTemplateExtension appComponent;
-      if( bo instanceof TDeploymentArtifact ) {
-        PictogramElement parentPE = Graphiti.getPeService()
-          .getPictogramElementParent( pe );
-        appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()
-          .getBusinessObjectForLinkedPictogramElement( parentPE );
-      } else { // bo instanceof TNodeTemplate
-        appComponent = ( TNodeTemplateExtension )bo;
-      }
-      String initInstances = Integer.toString( appComponent.getInitInstances() );
-      this.initialInstancesText.setText( initInstances );
-      String minInstances = Integer.toString( appComponent.getMinInstances() );
-      String maxInstances = ( ( BigInteger )appComponent.getMaxInstances() ).toString();
-      if( minInstances.compareTo( "-1" ) == 0 ) //$NON-NLS-1$
-        minInstances = ""; //$NON-NLS-1$
-      if( maxInstances.compareTo( "-1" ) == 0 ) //$NON-NLS-1$
-        maxInstances = ""; //$NON-NLS-1$
-      this.minInstancesText.setText( minInstances );
-      this.maxInstancesText.setText( maxInstances );
-    }
-  }
+			@Override
+			public void widgetDefaultSelected( final SelectionEvent e ) {
+				// TODO Auto-generated method stub
+			}
+		} );
+		// Add section components to the toolkit
+		toolkit.adapt( vmImageLabel, true, true );
+		toolkit.adapt( this.cmbImageSize, true, true );
+		toolkit.adapt( valueLabel, true, true );
+		toolkit.adapt( this.nameText, true, true );
+		toolkit.adapt( imageLabel, true, true );
+		toolkit.adapt( this.imageText, true, true );
+		toolkit.adapt( keypairLabel, true, true );
+		toolkit.adapt( this.keypairText, true, true );
+		toolkit.adapt( vmDecsrLabel, true, true );
+		toolkit.adapt( this.descrText, true, true);
+		section.setClient( client );
+		// Application Component Instances Section
+		Section sectionInstances = toolkit.createSection( parent, Section.TITLE_BAR );
+		sectionInstances.setText( "Number of Instances" ); //$NON-NLS-1$
+		Composite clientInstances = toolkit.createComposite( sectionInstances,
+				SWT.WRAP );
+		GridLayout layoutInstances = new GridLayout();
+		layoutInstances.numColumns = 2;
+		layoutInstances.marginTop = 15;
+		layoutInstances.verticalSpacing = 15;
+		layoutInstances.marginWidth = 2;
+		layoutInstances.marginHeight = 2;
+		clientInstances.setLayout( layoutInstances );
+		GridData gdInstances;
+		CLabel initialInstancesLabel = factory.createCLabel( clientInstances, "Initial:" ); //$NON-NLS-1$
+		gdInstances = new GridData();
+		gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		// gd.widthHint=STANDARD_LABEL_WIDTH;
+		initialInstancesLabel.setLayoutData( gdInstances );
+		this.initialInstancesText = factory.createText( clientInstances, "1" ); //$NON-NLS-1$
+		this.initialInstancesText.setEditable( true );
+		gdInstances = new GridData();
+		gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		gdInstances.widthHint = 160;
+		this.initialInstancesText.setLayoutData( gdInstances );
+		this.initialInstancesText.addModifyListener( this );
+		CLabel minInstancesLabel = factory.createCLabel( clientInstances, "Min:" ); //$NON-NLS-1$
+		gdInstances = new GridData();
+		gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		// gd.widthHint=STANDARD_LABEL_WIDTH;
+		minInstancesLabel.setLayoutData( gdInstances );
+		this.minInstancesText = factory.createText( clientInstances, "" ); //$NON-NLS-1$
+		this.minInstancesText.setEditable( true );
+		gdInstances = new GridData();
+		gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		gdInstances.widthHint = 160;
+		this.minInstancesText.setLayoutData( gdInstances );
+		this.minInstancesText.addModifyListener( this );
+		CLabel maxInstancesLabel = factory.createCLabel( clientInstances, "Max:" ); //$NON-NLS-1$
+		gdInstances = new GridData();
+		gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		// gd.widthHint=STANDARD_LABEL_WIDTH;
+		maxInstancesLabel.setLayoutData( gdInstances );
+		this.maxInstancesText = factory.createText( clientInstances, "" ); //$NON-NLS-1$
+		this.maxInstancesText.setEditable( true );
+		gdInstances = new GridData();
+		gdInstances.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;
+		gdInstances.verticalAlignment = GridData.VERTICAL_ALIGN_CENTER;
+		gdInstances.widthHint = 160;
+		this.maxInstancesText.setLayoutData( gdInstances );
+		this.maxInstancesText.addModifyListener( this );
+		// Add section components to the toolkit
+		toolkit.adapt( valueLabel, true, true );
+		toolkit.adapt( this.nameText, true, true );
+		toolkit.adapt( imageLabel, true, true );
+		toolkit.adapt( this.imageText, true, true );
+		section.setClient( client );
+		toolkit.adapt( minInstancesLabel, true, true );
+		toolkit.adapt( maxInstancesLabel, true, true );
+		toolkit.adapt( this.minInstancesText, true, true );
+		toolkit.adapt( this.maxInstancesText, true, true );
+		sectionInstances.setClient( clientInstances );
+	}
 
-  // Refresh Tab
-  @Override
-  public void refresh() {
-    PictogramElement pe = getSelectedPictogramElement();
-    if( pe != null ) {
-      final Object bo = Graphiti.getLinkService()
-        .getBusinessObjectForLinkedPictogramElement( pe );
-      if( bo == null )
-        return;
-      TNodeTemplate appComponent;
-      if( bo instanceof TDeploymentArtifact ) {
-        PictogramElement parentPE = Graphiti.getPeService()
-          .getPictogramElementParent( pe );
-        appComponent = ( TNodeTemplate )Graphiti.getLinkService()
-          .getBusinessObjectForLinkedPictogramElement( parentPE );
-      } else { // bo instanceof TNodeTemplate
-        appComponent = ( TNodeTemplate )bo;
-      }
-      String name = appComponent.getName();
-      this.nameText.setText( name == null
-                                         ? "" : name ); //$NON-NLS-1$
-      // set Image Artifact
-      String imageName = null;
-      TDeploymentArtifacts deploymentArtifacts = appComponent.getDeploymentArtifacts();
-      if( deploymentArtifacts != null ) {
-        for( TDeploymentArtifact artifact : deploymentArtifacts.getDeploymentArtifact() )
-        {
-          if( artifact.getArtifactType().toString().equals( "VMI" ) ) { //$NON-NLS-1$
-            imageName = artifact.getName();
-            break;
-          }
-        }
-      }
-      this.imageText.setText( imageName == null
-                                               ? "" : imageName ); //$NON-NLS-1$
-      
-      // set VM Flavor
-      if ( appComponent.getProperties() != null ){
-        NodePropertiesType nodeProperties = (NodePropertiesType) appComponent.getProperties().getAny().get( 0 ).getValue();
-        String flavor = nodeProperties.getFlavor();
-        this.cmbImageSize.setText( flavor == null
-                                           ? "" : flavor ); //$NON-NLS-1$
-      }
-      else{
-        this.cmbImageSize.setText( "" );
-      }
-      
-      if( !( bo instanceof TDeploymentArtifact ) )
-        refreshInstances();
-    }
-  }
+	/*
+	 * Refresh values of max and min instances
+	 */
+	void refreshInstances() {
+		PictogramElement pe = getSelectedPictogramElement();
+		if( pe != null ) {
+			Object bo = Graphiti.getLinkService()
+					.getBusinessObjectForLinkedPictogramElement( pe );
+			if( bo == null )
+				return;
+			TNodeTemplateExtension appComponent;
+			if( bo instanceof TDeploymentArtifact ) {
+				PictogramElement parentPE = Graphiti.getPeService()
+						.getPictogramElementParent( pe );
+				appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()
+						.getBusinessObjectForLinkedPictogramElement( parentPE );
+			} else { // bo instanceof TNodeTemplate
+				appComponent = ( TNodeTemplateExtension )bo;
+			}
 
-  // Updates Application name or number of instances according the triggered
-  // listener
-  @Override
-  public void modifyText( final ModifyEvent e ) {
-    PictogramElement pe = getSelectedPictogramElement();
-    if( pe != null ) {
-      final Object bo = Graphiti.getLinkService()
-        .getBusinessObjectForLinkedPictogramElement( pe );
-      // the filter assured, that it is a TNodeTemplate
-      if( bo == null )
-        return;
-      final TNodeTemplateExtension nodeTemplate;
-      if( bo instanceof TDeploymentArtifact ) {
-        PictogramElement parentPE = Graphiti.getPeService()
-          .getPictogramElementParent( pe );
-        nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()
-          .getBusinessObjectForLinkedPictogramElement( parentPE );
-      } else { // bo instanceof TNodeTemplate
-        nodeTemplate = ( TNodeTemplateExtension )bo;
-      }
-      // nameText Listener
-      if( e.widget == this.nameText ) {
-        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
-        editingDomain.getCommandStack()
-          .execute( new RecordingCommand( editingDomain ) {
+			String initInstances = Integer.toString( appComponent.getInitInstances() );
+		    this.initialInstancesText.setText( initInstances );
+		    String minInstances = Integer.toString( appComponent.getMinInstances() );
+		    String maxInstances = ( ( BigInteger )appComponent.getMaxInstances() ).toString();
+		    if( minInstances.compareTo( "-1" ) == 0 ) //$NON-NLS-1$
+		    	minInstances = ""; //$NON-NLS-1$
+		    if( maxInstances.compareTo( "-1" ) == 0 ) //$NON-NLS-1$
+		    	 maxInstances = ""; //$NON-NLS-1$
+		    this.minInstancesText.setText( minInstances );
+		    this.maxInstancesText.setText( maxInstances );
+		}
+	}
 
-            protected void doExecute() {
-              nodeTemplate.setName( ApplicationComponentNameSection.this.nameText.getText() );
-            }
-          } );
-      }
-      // minInstancesText Listener
-      else if( e.widget == this.minInstancesText ) {
-        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
-        editingDomain.getCommandStack()
-          .execute( new RecordingCommand( editingDomain ) {
+	// Refresh Tab
+	@Override
+	public void refresh() {
+		PictogramElement pe = getSelectedPictogramElement();
+		if( pe != null ) {
+			final Object bo = Graphiti.getLinkService()
+					.getBusinessObjectForLinkedPictogramElement( pe );
+			if( bo == null )
+				return;
+			TNodeTemplate appComponent;
+			if( bo instanceof TDeploymentArtifact ) {
+				PictogramElement parentPE = Graphiti.getPeService()
+						.getPictogramElementParent( pe );
+				appComponent = ( TNodeTemplate )Graphiti.getLinkService()
+						.getBusinessObjectForLinkedPictogramElement( parentPE );
+			} else { // bo instanceof TNodeTemplate
+				appComponent = ( TNodeTemplate )bo;
+			}
+			String name = appComponent.getName();
+			this.nameText.setText( name == null
+					? "" : name ); //$NON-NLS-1$
+			
+			// set Image Artifact
+			String imageName = null;
+			TDeploymentArtifacts deploymentArtifacts = appComponent.getDeploymentArtifacts();
+			if( deploymentArtifacts != null ) {
+				for( TDeploymentArtifact artifact : deploymentArtifacts.getDeploymentArtifact() )
+				{
+					//if( artifact.getArtifactType().toString().equals( "VMI" ) ) { //$NON-NLS-1$
+					if( artifact.getArtifactType().getLocalPart().equals( imageType ) ) { //$NON-NLS-1$
+						imageName = artifact.getName();
+						break;
+					}
+				}
+			}
+			this.imageText.setText( imageName == null
+					? "" : imageName ); //$NON-NLS-1$
 
-            protected void doExecute() {
-              if( nodeTemplate != null ) {
-                if( ApplicationComponentNameSection.this.minInstancesText.getText()
-                  .equals( "" ) ) { //$NON-NLS-1$
-                  // nodeTemplate.setMinInstances( -1 );
-                } else
-                  nodeTemplate.setMinInstances( Integer.parseInt( ApplicationComponentNameSection.this.minInstancesText.getText() ) );
-              }
-            }
-          } );
-      }
-      // maxInstancesText Listener
-      else if( e.widget == this.maxInstancesText ) {
-        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
-        editingDomain.getCommandStack()
-          .execute( new RecordingCommand( editingDomain ) {
+			// set VM Flavor
+			if ( appComponent.getProperties() != null ){
+				NodePropertiesType nodeProperties = (NodePropertiesType) appComponent.getProperties().getAny().get( 0 ).getValue();
+				String flavor = nodeProperties.getFlavor();
+				this.cmbImageSize.setText( flavor == null
+						? "" : flavor ); //$NON-NLS-1$
+			}
+			else{
+				this.cmbImageSize.setText( "" );
+			}
 
-            protected void doExecute() {
-              if( ApplicationComponentNameSection.this.maxInstancesText.getText()
-                .compareTo( "" ) == 0 ) { //$NON-NLS-1$
-                // nodeTemplate.setMaxInstances( ( BigInteger
-                // )BigInteger.valueOf(-1) );
-              } else
-                nodeTemplate.setMaxInstances( ( BigInteger )BigInteger.valueOf( Integer.parseInt( ApplicationComponentNameSection.this.maxInstancesText.getText() ) ) );
-            }
-          } );
-      }
-      // initialInstancesText Listener
-      else if( e.widget == this.initialInstancesText ) {
-        if( ApplicationComponentNameSection.this.initialInstancesText.getText()
-          .compareTo( "" ) == 0 ) { //$NON-NLS-1$
-          TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
-          editingDomain.getCommandStack()
-            .execute( new RecordingCommand( editingDomain ) {
+			if( !( bo instanceof TDeploymentArtifact ) )
+				refreshInstances();
+		}
+	}
 
-              protected void doExecute() {
-                nodeTemplate.setInitInstances( 1 );
-              }
-            } );
-        } else if( nodeTemplate.getInitInstances() != Integer.parseInt( ApplicationComponentNameSection.this.initialInstancesText.getText() ) )
-        {
-          TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
-          editingDomain.getCommandStack()
-            .execute( new RecordingCommand( editingDomain ) {
+	// Updates Application name or number of instances according the triggered
+	// listener
+	@Override
+	public void modifyText( final ModifyEvent e ) {
+		PictogramElement pe = getSelectedPictogramElement();
+		if( pe != null ) {
+			final Object bo = Graphiti.getLinkService()
+					.getBusinessObjectForLinkedPictogramElement( pe );
+			// the filter assured, that it is a TNodeTemplate
+			if( bo == null )
+				return;
+			final TNodeTemplateExtension nodeTemplate;
+			if( bo instanceof TDeploymentArtifact ) {
+				PictogramElement parentPE = Graphiti.getPeService()
+						.getPictogramElementParent( pe );
+				nodeTemplate = ( TNodeTemplateExtension )Graphiti.getLinkService()
+						.getBusinessObjectForLinkedPictogramElement( parentPE );
+			} else { // bo instanceof TNodeTemplate
+				nodeTemplate = ( TNodeTemplateExtension )bo;
+			}
+			// nameText Listener
+			if( e.widget == this.nameText ) {
+				TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
+				editingDomain.getCommandStack()
+				.execute( new RecordingCommand( editingDomain ) {
 
-              protected void doExecute() {
-                nodeTemplate.setInitInstances( Integer.parseInt( ApplicationComponentNameSection.this.initialInstancesText.getText() ) );
-              }
-            } );
-        }
-      }
-    }
-  }
+					protected void doExecute() {
+						nodeTemplate.setName( ApplicationComponentNameSection.this.nameText.getText() );
+					}
+				} );
+			}
+			// minInstancesText Listener
+			else if( e.widget == this.minInstancesText ) {
+				TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
+				editingDomain.getCommandStack()
+				.execute( new RecordingCommand( editingDomain ) {
 
-  private void createNodeFlavorProperties( String flavor ) {
-    PictogramElement pe = getSelectedPictogramElement();
-    final TNodeTemplateExtension appComponent;
-    Object bo = Graphiti.getLinkService()
-      .getBusinessObjectForLinkedPictogramElement( pe );
-    if( bo == null )
-      return;
-    if( bo instanceof TDeploymentArtifact ) {
-      PictogramElement parentPE = Graphiti.getPeService()
-        .getPictogramElementParent( pe );
-      appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()
-        .getBusinessObjectForLinkedPictogramElement( parentPE );
-    } else { // bo instanceof TNodeTemplate
-      appComponent = ( TNodeTemplateExtension )bo;
-    }
-    // Create Flavor Properties
-    NodePropertiesType nodeProperties = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createNodePropertiesType();
-    nodeProperties.setFlavor( flavor );
-    // Set the Properties of the Policy Template
-    final PropertiesType properties = ToscaFactory.eINSTANCE.createPropertiesType();
-    // Add the SYBL Policy to the FeatureMap of the Policy's Properties element
-    Entry e = FeatureMapUtil.createEntry( Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getDocumentRoot_NodeProperties(),
-                                          nodeProperties );
-    properties.getAny().add( e );
-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( appComponent );
-    editingDomain.getCommandStack()
-      .execute( new RecordingCommand( editingDomain ) {
+					protected void doExecute() {
+						if( nodeTemplate != null ) {
+							if( ApplicationComponentNameSection.this.minInstancesText.getText()
+									.equals( "" ) ) { //$NON-NLS-1$
+								// nodeTemplate.setMinInstances( -1 );
+							} else
+								nodeTemplate.setMinInstances( Integer.parseInt( ApplicationComponentNameSection.this.minInstancesText.getText() ) );
+						}
+					}
+				} );
+			}
+			// maxInstancesText Listener
+			else if( e.widget == this.maxInstancesText ) {
+				TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
+				editingDomain.getCommandStack()
+				.execute( new RecordingCommand( editingDomain ) {
 
-        @Override
-        protected void doExecute() {
-          appComponent.setProperties( properties );
-        }
-      } );
-  }
+					protected void doExecute() {
+						if( ApplicationComponentNameSection.this.maxInstancesText.getText()
+								.compareTo( "" ) == 0 ) { //$NON-NLS-1$
+							// nodeTemplate.setMaxInstances( ( BigInteger
+							// )BigInteger.valueOf(-1) );
+						} else
+							nodeTemplate.setMaxInstances( ( BigInteger )BigInteger.valueOf( Integer.parseInt( ApplicationComponentNameSection.this.maxInstancesText.getText() ) ) );
+					}
+				} );
+			}
+			// initialInstancesText Listener
+		    else if( e.widget == this.initialInstancesText ) {
+		        if( ApplicationComponentNameSection.this.initialInstancesText.getText()
+		          .compareTo( "" ) == 0 ) { //$NON-NLS-1$
+		          TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
+		          editingDomain.getCommandStack()
+		            .execute( new RecordingCommand( editingDomain ) {
 
-  @Override
-  public void widgetSelected( SelectionEvent e ) {
-    // TODO Auto-generated method stub
-    
-  }
+		              protected void doExecute() {
+		                nodeTemplate.setInitInstances( 1 );
+		              }
+		            } );
+		        } else if( nodeTemplate.getInitInstances() != Integer.parseInt( ApplicationComponentNameSection.this.initialInstancesText.getText() ) )
+		        {
+		          TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );
+		          editingDomain.getCommandStack()
+		            .execute( new RecordingCommand( editingDomain ) {
 
-  @Override
-  public void widgetDefaultSelected( SelectionEvent e ) {
-    // TODO Auto-generated method stub
-    
-  }
-  
-  private void copySelectedFileToCloudProject(File source, File destination){
-    
-    InputStream selection = null;
-    OutputStream output = null;
-    try {
-      try {
-        selection = new FileInputStream(source);
-      } catch( FileNotFoundException e ) {
-        // TODO Auto-generated catch block
-        e.printStackTrace();
-      }
-    try {
-      output = new FileOutputStream(destination);
-    } catch( FileNotFoundException e ) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-    byte[] buf = new byte[1024];
-    int bytesRead;
-     try {
-      while ((bytesRead = selection.read(buf)) > 0) {
-      output.write(buf, 0, bytesRead);
-      }
-    } catch( IOException e ) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
-    } finally {
-      try {
-        selection.close();
-        output.close();
-      } catch( IOException e ) {
-        // TODO Auto-generated catch block
-        e.printStackTrace();
-      }
-    
-    }
+		              protected void doExecute() {
+		                nodeTemplate.setInitInstances( Integer.parseInt( ApplicationComponentNameSection.this.initialInstancesText.getText() ) );
+		              }
+		            } );
+		        }
+		      }
+		}
+	}
 
-  }
+	private void createNodeFlavorProperties( String flavor ) {
+		PictogramElement pe = getSelectedPictogramElement();
+		final TNodeTemplateExtension appComponent;
+		Object bo = Graphiti.getLinkService()
+				.getBusinessObjectForLinkedPictogramElement( pe );
+		if( bo == null )
+			return;
+		if( bo instanceof TDeploymentArtifact ) {
+			PictogramElement parentPE = Graphiti.getPeService()
+					.getPictogramElementParent( pe );
+			appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()
+					.getBusinessObjectForLinkedPictogramElement( parentPE );
+		} else { // bo instanceof TNodeTemplate
+			appComponent = ( TNodeTemplateExtension )bo;
+		}
+		// Create Flavor Properties
+		NodePropertiesType nodeProperties = Tosca_Elasticity_ExtensionsFactory.eINSTANCE.createNodePropertiesType();
+		nodeProperties.setFlavor( flavor );
+		// Set the Properties of the Policy Template
+		final PropertiesType properties = ToscaFactory.eINSTANCE.createPropertiesType();
+		// Add the SYBL Policy to the FeatureMap of the Policy's Properties element
+		Entry e = FeatureMapUtil.createEntry( Tosca_Elasticity_ExtensionsPackage.eINSTANCE.getDocumentRoot_NodeProperties(),
+				nodeProperties );
+		properties.getAny().add( e );
+		TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( appComponent );
+		editingDomain.getCommandStack()
+		.execute( new RecordingCommand( editingDomain ) {
+
+			@Override
+			protected void doExecute() {
+				appComponent.setProperties( properties );
+			}
+		} );
+	}
+
+	@Override
+	public void widgetSelected( SelectionEvent e ) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void widgetDefaultSelected( SelectionEvent e ) {
+		// TODO Auto-generated method stub
+
+	}
+
+	private void copySelectedFileToCloudProject(File source, File destination){
+
+		InputStream selection = null;
+		OutputStream output = null;
+		try {
+			try {
+				selection = new FileInputStream(source);
+			} catch( FileNotFoundException e ) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			try {
+				output = new FileOutputStream(destination);
+			} catch( FileNotFoundException e ) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			byte[] buf = new byte[1024];
+			int bytesRead;
+			try {
+				while ((bytesRead = selection.read(buf)) > 0) {
+					output.write(buf, 0, bytesRead);
+				}
+			} catch( IOException e ) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		} finally {
+			try {
+				selection.close();
+				output.close();
+			} catch( IOException e ) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+
+		}
+
+	}
 }
diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentScriptSection.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentScriptSection.java
index b912bd4..66946d6 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentScriptSection.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationComponentScriptSection.java
@@ -25,18 +25,28 @@
 

 import org.eclipse.camf.core.model.CloudModel;

 import org.eclipse.camf.core.reporting.ProblemException;

+import org.eclipse.camf.tosca.DefinitionsType;

+import org.eclipse.camf.tosca.DocumentRoot;

+import org.eclipse.camf.tosca.TArtifactReference;

+import org.eclipse.camf.tosca.TArtifactTemplate;

 import org.eclipse.camf.tosca.TDeploymentArtifact;

 import org.eclipse.camf.tosca.TDeploymentArtifacts;

 import org.eclipse.camf.tosca.ToscaFactory;

+import org.eclipse.camf.tosca.editor.ModelHandler;

 import org.eclipse.camf.tosca.editor.ToscaDiagramEditor;

+import org.eclipse.camf.tosca.editor.ToscaModelLayer;

 import org.eclipse.camf.tosca.editor.diagram.ToscaFeatureProvider;

 import org.eclipse.camf.tosca.editor.features.CreateSoftwareDependencyFeature;

 import org.eclipse.camf.tosca.elasticity.TNodeTemplateExtension;

 import org.eclipse.core.resources.IFile;

 import org.eclipse.core.resources.IProject;

+import org.eclipse.core.resources.IResource;

 import org.eclipse.core.runtime.CoreException;

 import org.eclipse.core.runtime.IProgressMonitor;

+import org.eclipse.core.runtime.NullProgressMonitor;

 import org.eclipse.core.runtime.Path;

+import org.eclipse.emf.common.util.EList;

+import org.eclipse.emf.ecore.util.EcoreUtil;

 import org.eclipse.graphiti.features.context.impl.CreateContext;

 import org.eclipse.graphiti.mm.pictograms.ContainerShape;

 import org.eclipse.graphiti.mm.pictograms.PictogramElement;

@@ -60,240 +70,240 @@
  *  Application Component Properties - Custom Scripts Tab

  */

 public class ApplicationComponentScriptSection extends GFPropertySection

-  implements ITabbedPropertyConstants, ModifyListener

+implements ITabbedPropertyConstants, ModifyListener

 {

 

-  Section section;

-  private Text deploymentScriptText;

+Section section;

+private Text deploymentScriptText;

 

-  @Override

-  public void createControls( Composite parent,

-                              TabbedPropertySheetPage tabbedPropertySheetPage )

-  {

-    super.createControls( parent, tabbedPropertySheetPage );

-    // TabbedPropertySheetWidgetFactory factory = getWidgetFactory();

-    FormToolkit toolkit = new FormToolkit( parent.getDisplay() );

-    this.section = toolkit.createSection( parent, Section.TITLE_BAR );

-    this.section.setText( "Deployment Script" ); //$NON-NLS-1$

-    Composite client = toolkit.createComposite( this.section, SWT.WRAP );

+@Override

+public void createControls( Composite parent,

+                            TabbedPropertySheetPage tabbedPropertySheetPage )

+{

+  super.createControls( parent, tabbedPropertySheetPage );

+  // TabbedPropertySheetWidgetFactory factory = getWidgetFactory();

+  FormToolkit toolkit = new FormToolkit( parent.getDisplay() );

+  this.section = toolkit.createSection( parent, Section.TITLE_BAR );

+  this.section.setText( "Deployment Script" ); //$NON-NLS-1$

+  Composite client = toolkit.createComposite( this.section, SWT.WRAP );

+  GridLayout layout = new GridLayout();

+  layout.numColumns = 1;

+  layout.marginTop = 15;

+  layout.marginWidth = 2;

+  layout.marginHeight = 2;

+  client.setLayout( layout );

+  TabbedPropertySheetWidgetFactory factory = getWidgetFactory();

+  deploymentScriptText = factory.createText( client,

+                                             "", SWT.V_SCROLL | SWT.H_SCROLL ); //$NON-NLS-1$

+  GridData gd = new GridData();

+  gd.widthHint = 1100;

+  gd.heightHint = 150;

+  gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

+  this.deploymentScriptText.setLayoutData( gd );

+  deploymentScriptText.addModifyListener( this );

+  // Add section components to the toolkit

+  toolkit.adapt( this.deploymentScriptText, true, true );

+  this.section.setClient( client );

+}

 

-    GridLayout layout = new GridLayout();

-    layout.numColumns = 1;

-    layout.marginTop = 15;

-    layout.marginWidth = 2;

-    layout.marginHeight = 2;

-    client.setLayout( layout );

-

-    TabbedPropertySheetWidgetFactory factory = getWidgetFactory();

-    

-    deploymentScriptText = factory.createText(client, "", SWT.V_SCROLL | SWT.H_SCROLL ); //$NON-NLS-1$

-    

-    GridData gd = new GridData();

-    gd.widthHint = 1100;

-    gd.heightHint = 150;

-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;   

-    

-    this.deploymentScriptText.setLayoutData( gd );

-    

-

-    deploymentScriptText.addModifyListener( this );   

-

-    // Add section components to the toolkit

-    toolkit.adapt( this.deploymentScriptText, true, true );

-    this.section.setClient( client );

-  }

-

-

-

-  /*

-   *  Refresh Tab(non-Javadoc)

-   * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()

-   */

-  @Override

-  public void refresh() {

-    

-    

-    PictogramElement pe = getSelectedPictogramElement();

-    TNodeTemplateExtension appComponent = null;

-    if( pe != null ) {

-      Object bo = Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( pe );

-      if( bo == null )

-        return;

-            

-      if ( bo instanceof TDeploymentArtifact ){

-        PictogramElement parentPE = Graphiti.getPeService().getPictogramElementParent( pe );

-        

-        appComponent =  ( TNodeTemplateExtension ) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement( parentPE );

-      }

-      else { // bo instanceof TNodeTemplate

-        appComponent = ( TNodeTemplateExtension )bo;

-      }

-    }

-    

-    String fileName = null;

-    TDeploymentArtifacts deploymentArtifacts = appComponent.getDeploymentArtifacts();

-    if ( deploymentArtifacts != null ){

-      for ( TDeploymentArtifact artifact : deploymentArtifacts.getDeploymentArtifact() ){

-        if ( artifact.getArtifactType().toString().equals( "UA" )){

-          fileName = artifact.getName();

-          break;

-        }

-      }

-    }

-    

-    IProject activeProject = ToscaDiagramEditor.getActiveProject();

-    

-    if ( activeProject != null ){

-      

-      IFile file = activeProject.getFile( new Path("/Artifacts/Deployment Scripts/" +  fileName));

-      

-      if ( file.exists() == true ){

-        //Convert deployment script file to String        

-        BufferedReader br = null;

-        StringBuilder sb = new StringBuilder();

-        String line;

-        

-        try {

-          br = new BufferedReader(new InputStreamReader(file.getContents()));

-        } catch( CoreException e1 ) {

-          // TODO Auto-generated catch block

-          e1.printStackTrace();

-        }

-

-        try {

-          while ((line = br.readLine()) != null) {

-              sb.append(line + "\n");

-          }

-        } catch( IOException e1 ) {

-          // TODO Auto-generated catch block

-          e1.printStackTrace();

-        }

-        

-        this.deploymentScriptText.setText(sb.toString());

-      }

-      else{

-        this.deploymentScriptText.setText( "" );

-      }

-      }

-    

-  }

-

-  @Override

-  public void modifyText( ModifyEvent e ) {

-    

-    if ( this.deploymentScriptText.getText().equals("") ){

-      // this is also the case where the Deployment Script tab is preopened

+/*

+ * Refresh Tab(non-Javadoc)

+ * @see

+ * org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()

+ */

+@Override

+public void refresh() {

+  PictogramElement pe = getSelectedPictogramElement();

+  PictogramElement parentPE = Graphiti.getPeService()

+    .getPictogramElementParent( pe );

+  TNodeTemplateExtension appComponent = null;

+  if( pe != null ) {

+    Object bo = Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( pe );

+    if( bo == null )

       return;

+    if( bo instanceof TArtifactTemplate ) {

+      appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()

+        .getBusinessObjectForLinkedPictogramElement( parentPE );

+    } else { // bo instanceof TNodeTemplate

+      appComponent = ( TNodeTemplateExtension )bo;

     }

-    

-    PictogramElement pe = getSelectedPictogramElement();

-    TNodeTemplateExtension appComponent = null;

-    if( pe != null ) {

-      Object bo = Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( pe );

-      if( bo == null )

-        return;

-            

-      if ( bo instanceof TDeploymentArtifact ){

-        PictogramElement parentPE = Graphiti.getPeService().getPictogramElementParent( pe );

-        

-        appComponent =  ( TNodeTemplateExtension ) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement( parentPE );

-      }

-      else { // bo instanceof TNodeTemplate

-        appComponent = ( TNodeTemplateExtension )bo;

-      }

-    }

-    

-    IProject activeProject = ToscaDiagramEditor.getActiveProject();

-    

-    if ( activeProject != null ){

-      

-      String fileName = appComponent.getName() + " Deployment.sh";

-      

-      IFile file = activeProject.getFile( new Path("/Artifacts/Deployment Scripts/" +  fileName));

-      

-      if ( !file.exists() ){

-        file = createDeploymentScript(activeProject);

-      }

-      else{

-        try {

-          file.setContents( new ByteArrayInputStream(this.deploymentScriptText.getText().getBytes()), false, false, null );

-        } catch( CoreException e1 ) {

-          // TODO Auto-generated catch block

-          e1.printStackTrace();

-        }

-      }

-

-    

-    }

-

   }

   

-  // Creates the Application Deployment file

-  public IFile createDeploymentScript(IProject activeProject) {   

-

-    IFile file = null;

-    

-    PictogramElement pe = getSelectedPictogramElement();

-    TNodeTemplateExtension appComponent = null;

-    if( pe != null ) {

-      Object bo = Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( pe );

-      if( bo == null )

-        return null;

-            

-      if ( bo instanceof TDeploymentArtifact ){

-        PictogramElement parentPE = Graphiti.getPeService().getPictogramElementParent( pe );

-        pe = parentPE;

-        appComponent =  ( TNodeTemplateExtension ) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement( parentPE );

-        

-      }

-      else { // bo instanceof TNodeTemplate

-        appComponent = ( TNodeTemplateExtension )bo;

-      }

-    }

-    

-    String fileName = appComponent.getName() + "Deployment";  

-        

-     file = activeProject.getFile( new Path("/Artifacts/Deployment Scripts/" +  fileName));

-     try {

-      file.create(new ByteArrayInputStream(this.deploymentScriptText.getText().getBytes()), false, null);

-      } catch (CoreException e1) {

-          // TODO Auto-generated catch block

-          e1.printStackTrace();

-          return null;

-      }

-  

-    

-      IProgressMonitor monitor = null;

+  String fileName = findImplementationArtifactName(appComponent.getName()+"Script");

+//  String fileName = null;

+//  // Find NodeTypeImplementation

+//   ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI(

+//   getDiagram() ) );

+//   DocumentRoot dr = model.getDocumentRoot();

+//   DefinitionsType dt = dr.getDefinitions();

+//   EList<TNodeTypeImplementation> nodeTypesImplementation =

+//   dt.getNodeTypeImplementation();

+//   EList<TArtifactTemplate> artifactTemplates = dt.getArtifactTemplate();

+//   TNodeTypeImplementation nodeTypeImplementation = null;

+//   for (TNodeTypeImplementation tempNodeImplementation :

+//   nodeTypesImplementation){

+//   if (appComponent.getName().equals(

+//   tempNodeImplementation.getNodeType().toString())){

+//   nodeTypeImplementation = tempNodeImplementation;

+//   break;

+//   }

+//   }

+//   if (nodeTypeImplementation!=null &&

+//   nodeTypeImplementation.getImplementationArtifacts()!=null){

+//   EList<ImplementationArtifactType> implementationArtifacts =

+//   nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact();

+//   for (ImplementationArtifactType tempImplementationArtifact :

+//   implementationArtifacts){

+//   for (TArtifactTemplate tempArtifactTemplate : artifactTemplates){

+//   if

+//   (tempArtifactTemplate.getId().equals(tempImplementationArtifact.getArtifactRef().toString())){

+//   fileName=tempArtifactTemplate.getId();

+//   break;

+//   }

+//   }

+//  

+//   }

+//   }

+  //fileName = appComponent.getName() + "Deployment.sh";

+  IProject activeProject = ToscaDiagramEditor.getActiveProject();

+  if( activeProject != null ) {

+    IFile file = activeProject.getFile( new Path( "/Artifacts/Deployment Scripts/"

+                                                  + fileName ) );

+    if( file.exists() == true ) {

+      // if ( file.exists() == true ){

+      // Convert deployment script file to String

+      BufferedReader br = null;

+      StringBuilder sb = new StringBuilder();

+      String line;

       try {

-        CloudModel.getRoot().refresh( monitor );

-      } catch( ProblemException e ) {

-        e.printStackTrace();

+        br = new BufferedReader( new InputStreamReader( file.getContents() ) );

+      } catch( CoreException e1 ) {

+        // TODO Auto-generated catch block

+        e1.printStackTrace();

       }

- 

-      // Refresh Palette Compartments

-      getDiagramTypeProvider().getFeatureProvider().getDiagramTypeProvider().getDiagramBehavior().refreshPalette();

-      

-    // Call the Create User Application Feature to create a deployment artifact for the deployment script and add it to the artifacts list 

-    CreateSoftwareDependencyFeature createSDFeature = new CreateSoftwareDependencyFeature( new ToscaFeatureProvider(getDiagramTypeProvider()) );

-    

-    TDeploymentArtifact deploymentArtifact = ToscaFactory.eINSTANCE.createTDeploymentArtifact();

-    deploymentArtifact.setName( fileName );

-    deploymentArtifact.setArtifactType( new QName( "SD" ) );  

-    

-    createSDFeature.setContextObject( deploymentArtifact );

-    

-    CreateContext createContext = new CreateContext();

-    createContext.setTargetContainer( (ContainerShape) pe );

-    

-    if ( createSDFeature.canCreate( createContext ))

-      createSDFeature.create( createContext );

-   

-    return file;

-    

+      try {

+        while( ( line = br.readLine() ) != null ) {

+          sb.append( line + "\n" );

+        }

+      } catch( IOException e1 ) {

+        // TODO Auto-generated catch block

+        e1.printStackTrace();

+      }

+      this.deploymentScriptText.setText( sb.toString() );

+    } else {

+      this.deploymentScriptText.setText( "" );

+    }

+  }

+}

+

+@Override

+public void modifyText( ModifyEvent e ) {

+  if( this.deploymentScriptText.getText().equals( "" ) ) {

+    // this is also the case where the Deployment Script tab is preopened

+    return;

+  }

+  IProject activeProject = ToscaDiagramEditor.getActiveProject();

+  if( activeProject != null ) {

+    createDeploymentScript( activeProject );

+  }

+}

+

+// Creates the Application Deployment file

+public IFile createDeploymentScript( IProject activeProject ) {

+  IFile file = null;

+  PictogramElement pe = getSelectedPictogramElement();

+  TNodeTemplateExtension appComponent = null;

+  if( pe != null ) {

+    Object bo = Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( pe );

+    if( bo == null )

+      return null;

+    if( bo instanceof TDeploymentArtifact ) {

+      PictogramElement parentPE = Graphiti.getPeService()

+        .getPictogramElementParent( pe );

+      pe = parentPE;

+      appComponent = ( TNodeTemplateExtension )Graphiti.getLinkService()

+        .getBusinessObjectForLinkedPictogramElement( parentPE );

+    } else { // bo instanceof TNodeTemplate

+      appComponent = ( TNodeTemplateExtension )bo;

+    }

+  }

+  String fileName = appComponent.getName() + "Deployment.sh";

+  file = activeProject.getFile( new Path( "/Artifacts/Deployment Scripts/"

+                                          + fileName ) );

+  if( file.exists() ) {

+    // Deployment file exists, update its contents

+    try {

+      file.setContents( new ByteArrayInputStream( this.deploymentScriptText.getText()

+                          .getBytes() ),

+                        false,

+                        false,

+                        null );

+    } catch( CoreException e1 ) {

+      // TODO Auto-generated catch block

+      e1.printStackTrace();

+    }

+    return null;

+  }

+  // Deployment file does not exists, create one

+  try {

+    file.create( new ByteArrayInputStream( this.deploymentScriptText.getText()

+                   .getBytes() ),

+                 false,

+                 null );

+  } catch( CoreException e1 ) {

+    // TODO Auto-generated catch block

+    e1.printStackTrace();

+    return null;

+  }

+  try {

+    activeProject.refreshLocal( IResource.DEPTH_INFINITE,

+                                new NullProgressMonitor() );

+  } catch( CoreException e1 ) {

+    // TODO Auto-generated catch block

+    e1.printStackTrace();

+  }

+  IProgressMonitor monitor = null;

+  try {

+    CloudModel.getRoot().refresh( monitor );

+  } catch( ProblemException e ) {

+    e.printStackTrace();

+  }

+  // Refresh Palette Compartments

+  // getDiagramTypeProvider().getFeatureProvider().getDiagramTypeProvider().getDiagramBehavior().refreshPalette();

+  // Call the Create User Application Feature to create a deployment artifact

+  // for the deployment script and add it to the artifacts list

+  CreateSoftwareDependencyFeature createSDFeature = new CreateSoftwareDependencyFeature( new ToscaFeatureProvider( getDiagramTypeProvider() ) );

+  TArtifactTemplate artifactTemplate = ToscaFactory.eINSTANCE.createTArtifactTemplate();

+  artifactTemplate.setName( "SD"+fileName );

+  artifactTemplate.setId( fileName );

+  artifactTemplate.setType( new QName( "ScriptArtifact" ) );

+  createSDFeature.setContextObject( artifactTemplate );

+  CreateContext createContext = new CreateContext();

+  createContext.setTargetContainer( ( ContainerShape )pe );

+  if( createSDFeature.canCreate( createContext ) )

+    createSDFeature.create( createContext );

+  return file;

+}

+

+private String findImplementationArtifactName(String artifactId){

+  ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

+  DocumentRoot dr = model.getDocumentRoot();

+  DefinitionsType dt = dr.getDefinitions();

+  EList<TArtifactTemplate> artifactTemplates =

+  dt.getArtifactTemplate();

+

+  for (TArtifactTemplate tempArtifactTemplate : artifactTemplates){

+    if (tempArtifactTemplate.getId().equals( artifactId )){

+      TArtifactReference artifactRef = tempArtifactTemplate.getArtifactReferences().getArtifactReference().get( 0 );

+      String artifactReference = artifactRef.getReference();

+      String artifactName = artifactReference.substring( artifactReference.indexOf( "\\" ) +1);

+      return artifactName;

+    }

   }

 

+ return null;

+}

 }

diff --git a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationGlobalElasticityReqSection.java b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationGlobalElasticityReqSection.java
index 5f73157..aad7be9 100644
--- a/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationGlobalElasticityReqSection.java
+++ b/plugins/org.eclipse.camf.tosca.editor/src/org/eclipse/camf/tosca/editor/property/ApplicationGlobalElasticityReqSection.java
@@ -76,685 +76,564 @@
 /**

  * Application Properties - Elasticity Tab

  */

-public class ApplicationGlobalElasticityReqSection

-  extends GFPropertySection implements ITabbedPropertyConstants

+public class ApplicationGlobalElasticityReqSection extends GFPropertySection

+implements ITabbedPropertyConstants

 {

 

-  Composite client;

-  Section section;

-  private Table table;

-  private Button addButton;

-  private Button removeButton;

-  TableViewer tableViewer;

-  List<TPolicy> appComponentElasticityRequirements = new ArrayList<TPolicy>();

-  Section sectionRA;

-  private Table tableResizingActions;

-  private Button removeButtonRA;

-  private Button addButtonRA;

-  private Button conditionButtonRA;

-  TableViewer tableResizingActionsViewer;

-  List<TPolicy> appComponentResizingActions = new ArrayList<TPolicy>();

-  protected Tosca_Elasticity_ExtensionsFactory elasticityFactory = Tosca_Elasticity_ExtensionsFactory.eINSTANCE;

+Composite client;

+Section section;

+private Table table;

+private Button addButton;

+private Button removeButton;

+TableViewer tableViewer;

+List<TPolicy> appComponentElasticityRequirements = new ArrayList<TPolicy>();

+Section sectionRA;

+private Table tableResizingActions;

+private Button removeButtonRA;

+private Button addButtonRA;

+private Button conditionButtonRA;

+TableViewer tableResizingActionsViewer;

+List<TPolicy> appComponentResizingActions = new ArrayList<TPolicy>();

+protected Tosca_Elasticity_ExtensionsFactory elasticityFactory = Tosca_Elasticity_ExtensionsFactory.eINSTANCE;

 

-  @Override

-  public void createControls( final Composite parent,

-                              TabbedPropertySheetPage tabbedPropertySheetPage )

-  {

-    super.createControls( parent, tabbedPropertySheetPage );

-    FormToolkit toolkit = new FormToolkit( parent.getDisplay() );

-    // Application Component Elasticity Requirements Section

-    this.section = toolkit.createSection( parent, Section.TITLE_BAR );

-    this.section.setText( "Application Component Elasticity Constraints" ); //$NON-NLS-1$

-    Composite client = toolkit.createComposite( this.section, SWT.WRAP );

-    Composite client1 = toolkit.createComposite( client, SWT.WRAP );

-    Composite client2 = toolkit.createComposite( client, SWT.WRAP );

-    GridLayout layout = new GridLayout();

-    layout.numColumns = 2;

-    layout.marginTop = 15;

-    layout.verticalSpacing = 15;

-    layout.marginWidth = 2;

-    layout.marginHeight = 2;

-    client.setLayout( layout );

-    layout = new GridLayout();

-    layout.numColumns = 1;

-    client1.setLayout( layout );

-    layout = new GridLayout();

-    layout.numColumns = 1;

-    client2.setLayout( layout );

-    GridData gd;

-    this.table = new Table( client1, SWT.BORDER

-                                     | SWT.VIRTUAL

-                                     | SWT.MULTI

-                                     | SWT.FULL_SELECTION );

-    this.table.setHeaderVisible( true );

-    this.table.setLinesVisible( false );

-    this.table.getHorizontalBar().setEnabled( false );

-    gd = new GridData( 300, this.table.getItemHeight() * 4 );

-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

-    this.table.setLayoutData( gd );

-    TableLayout tableLayout = new TableLayout();

-    this.table.setLayout( tableLayout );

-    TableColumn nameColumn = new TableColumn( this.table, SWT.CENTER );

-    ColumnLayoutData data = new ColumnWeightData( 100 );

-    tableLayout.addColumnData( data );

-    data = new ColumnWeightData( 100 );

-    tableLayout.addColumnData( data );

-    data = new ColumnWeightData( 150 );

-    tableLayout.addColumnData( data );

-    nameColumn.setText( "Constraint" ); //$NON-NLS-1$

-    this.tableViewer = new TableViewer( this.table );

-    ElasticityConstraintsProvider ERProvider = new ElasticityConstraintsProvider();

-    IStructuredContentProvider contentProvider = ERProvider.ERContentProvider;

-    this.tableViewer.setContentProvider( contentProvider );

-    this.tableViewer.setLabelProvider( ERProvider.ERContentLabelProvider );

-    this.tableViewer.setInput( this.appComponentElasticityRequirements );

-    this.addButton = new Button( client2, SWT.PUSH );

-    this.addButton.setText( "Add" ); //$NON-NLS-1$

-    gd = new GridData();

-    gd.widthHint = 60;

-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.addButton.setLayoutData( gd );

-    // Listener for Add button

-    this.addButton.addSelectionListener( new SelectionListener() {

+@Override

+public void createControls( final Composite parent,

+                            TabbedPropertySheetPage tabbedPropertySheetPage )

+{

+  super.createControls( parent, tabbedPropertySheetPage );

+  FormToolkit toolkit = new FormToolkit( parent.getDisplay() );

+  // Application Component Elasticity Requirements Section

+  this.section = toolkit.createSection( parent, Section.TITLE_BAR );

+  this.section.setText( "Application Component Elasticity Constraints" ); //$NON-NLS-1$

+  Composite client = toolkit.createComposite( this.section, SWT.WRAP );

+  Composite client1 = toolkit.createComposite( client, SWT.WRAP );

+  Composite client2 = toolkit.createComposite( client, SWT.WRAP );

+  GridLayout layout = new GridLayout();

+  layout.numColumns = 2;

+  layout.marginTop = 15;

+  layout.verticalSpacing = 15;

+  layout.marginWidth = 2;

+  layout.marginHeight = 2;

+  client.setLayout( layout );

+  layout = new GridLayout();

+  layout.numColumns = 1;

+  client1.setLayout( layout );

+  layout = new GridLayout();

+  layout.numColumns = 1;

+  client2.setLayout( layout );

+  GridData gd;

+  this.table = new Table( client1, SWT.BORDER

+                                   | SWT.VIRTUAL

+                                   | SWT.MULTI

+                                   | SWT.FULL_SELECTION );

+  this.table.setHeaderVisible( true );

+  this.table.setLinesVisible( false );

+  this.table.getHorizontalBar().setEnabled( false );

+  gd = new GridData( 300, this.table.getItemHeight() * 4 );

+  gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

+  this.table.setLayoutData( gd );

+  TableLayout tableLayout = new TableLayout();

+  this.table.setLayout( tableLayout );

+  TableColumn nameColumn = new TableColumn( this.table, SWT.CENTER );

+  ColumnLayoutData data = new ColumnWeightData( 100 );

+  tableLayout.addColumnData( data );

+  data = new ColumnWeightData( 100 );

+  tableLayout.addColumnData( data );

+  data = new ColumnWeightData( 150 );

+  tableLayout.addColumnData( data );

+  nameColumn.setText( "Constraint" ); //$NON-NLS-1$

+  this.tableViewer = new TableViewer( this.table );

+  ElasticityConstraintsProvider ERProvider = new ElasticityConstraintsProvider();

+  IStructuredContentProvider contentProvider = ERProvider.ERContentProvider;

+  this.tableViewer.setContentProvider( contentProvider );

+  this.tableViewer.setLabelProvider( ERProvider.ERContentLabelProvider );

+  this.tableViewer.setInput( this.appComponentElasticityRequirements );

+  this.addButton = new Button( client2, SWT.PUSH );

+  this.addButton.setText( "Add" ); //$NON-NLS-1$

+  gd = new GridData();

+  gd.widthHint = 60;

+  gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.addButton.setLayoutData( gd );

+  // Listener for Add button

+  this.addButton.addSelectionListener( new SelectionListener() {

 

-      @Override

-      public void widgetSelected( SelectionEvent e ) {

-        editDataStagingEntry( null );

-      }

-

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    this.removeButton = new Button( client2, SWT.PUSH );

-    this.removeButton.setText( "Remove" ); //$NON-NLS-1$

-    gd = new GridData();

-    gd.widthHint = 60;

-    gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.removeButton.setLayoutData( gd );

-    // Listener for Remove button

-    this.removeButton.addSelectionListener( new SelectionListener() {

-

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        removeApplicationComponentElasticityRequirement( getSelectedObject() );

-      }

-

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    // Add section components to the toolkit

-    toolkit.adapt( this.table, true, true );

-    toolkit.adapt( this.addButton, true, true );

-    toolkit.adapt( this.removeButton, true, true );

-    this.section.setClient( client );

-    // Application Component Elasticity Actions Section

-    this.sectionRA = toolkit.createSection( parent, Section.TITLE_BAR );

-    this.sectionRA.setText( "Elasticity Strategies" ); //$NON-NLS-1$

-    Composite clientRA = toolkit.createComposite( this.sectionRA, SWT.WRAP );

-    Composite clientRA1 = toolkit.createComposite( clientRA, SWT.WRAP );

-    Composite clientRA2 = toolkit.createComposite( clientRA, SWT.WRAP );

-    GridLayout layoutRA;

-    layoutRA = new GridLayout();

-    layoutRA.numColumns = 2;

-    layoutRA.marginTop = 15;

-    layoutRA.verticalSpacing = 15;

-    layoutRA.marginWidth = 2;

-    layoutRA.marginHeight = 2;

-    clientRA.setLayout( layoutRA );

-    layoutRA = new GridLayout();

-    layoutRA.numColumns = 1;

-    clientRA1.setLayout( layoutRA );

-    layoutRA = new GridLayout();

-    layoutRA.numColumns = 1;

-    clientRA2.setLayout( layoutRA );

-    this.tableResizingActions = new Table( clientRA1, SWT.BORDER

-                                                      | SWT.VIRTUAL

-                                                      | SWT.MULTI

-                                                      | SWT.FULL_SELECTION );

-    this.tableResizingActions.setHeaderVisible( true );

-    this.tableResizingActions.setLinesVisible( false );

-    this.tableResizingActions.getHorizontalBar().setEnabled( false );

-    GridData gdRA;

-    gdRA = new GridData( 300, this.tableResizingActions.getItemHeight() * 4 );

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    gdRA.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

-    this.tableResizingActions.setLayoutData( gdRA );

-    TableLayout tableLayoutRA = new TableLayout();

-    this.tableResizingActions.setLayout( tableLayoutRA );

-    TableColumn nameColumnRA = new TableColumn( this.tableResizingActions,

-                                                SWT.CENTER );

-    nameColumnRA.setText( "Strategy" ); //$NON-NLS-1$

-    nameColumnRA.setWidth( 100 );

-    ColumnWeightData dataRA = new ColumnWeightData( 100 );

-    tableLayoutRA.addColumnData( dataRA );

-    // Set the Elasticity Actions table viewer

-    ResizingActionsProvider RAProvider = new ResizingActionsProvider();

-    this.tableResizingActionsViewer = new TableViewer( this.tableResizingActions );

-    IStructuredContentProvider contentProviderRA = RAProvider.RAContentProvider;

-    this.tableResizingActionsViewer.setContentProvider( contentProviderRA );

-    this.tableResizingActionsViewer.setLabelProvider( RAProvider.RAContentLabelProvider );

-    this.tableResizingActionsViewer.setInput( this.appComponentResizingActions );

-    // Add Elasticity Strategy button

-    this.addButtonRA = new Button( clientRA2, SWT.PUSH );

-    this.addButtonRA.setText( "Add" ); //$NON-NLS-1$

-    // Listener for Adding Elasticity Strategy button

-    this.addButtonRA.addSelectionListener( new SelectionListener() {

-

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        editDataStagingEntryRA( getSelectedObject() );

-      }

-

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    gdRA = new GridData();

-    gdRA.widthHint = 60;

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.addButtonRA.setLayoutData( gdRA );

-    this.removeButtonRA = new Button( clientRA2, SWT.PUSH );

-    this.removeButtonRA.setText( "Remove" ); //$NON-NLS-1$

-    // Listener for Remove Elasticity Strategy button

-    this.removeButtonRA.addSelectionListener( new SelectionListener() {

-

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        removeApplicationComponentResizingAction( getSelectedElasticityStrategy() );

-      }

-

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    gdRA = new GridData();

-    gdRA.widthHint = 60;

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.removeButtonRA.setLayoutData( gdRA );

-    this.conditionButtonRA = new Button( clientRA2, SWT.PUSH );

-    this.conditionButtonRA.setText( "Condition" ); //$NON-NLS-1$

-    // Listener for Remove Elasticity Strategy button

-    this.conditionButtonRA.addSelectionListener( new SelectionListener() {

-

-      @Override

-      public void widgetSelected( final SelectionEvent e ) {

-        addStrategyCondition( getSelectedElasticityStrategy() );

-      }

-

-      @Override

-      public void widgetDefaultSelected( final SelectionEvent e ) {

-        // TODO Auto-generated method stub

-      }

-    } );

-    gdRA = new GridData();

-    gdRA.widthHint = 60;

-    gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

-    this.conditionButtonRA.setLayoutData( gdRA );

-    // Add section components to the toolkit

-    toolkit.adapt( this.tableResizingActions, true, true );

-    toolkit.adapt( this.removeButtonRA, true, true );

-    toolkit.adapt( this.addButtonRA, true, true );

-    // toolkit.adapt( this.uploadButtonRA, true, true );

-    toolkit.adapt( this.conditionButtonRA, true, true );

-    this.sectionRA.setClient( clientRA );

-  }

-

-  // Add Application Component Elasticity Requirement

-  void editDataStagingEntry( final TPolicy selectedObject ) {

-    ElasticityConstraintDialog dialog;

-    if( selectedObject == null ) {

-      // Add button is pressed

-      dialog = new ElasticityConstraintDialog( this.section.getShell(),

-                                               "Application" ); //$NON-NLS-1$

-      if( dialog.open() == Window.OK ) {

-        String newElasticityConstraint = dialog.getElasticityConstraint();

-        

-        if (newElasticityConstraint.contains( "<" )){

-          String[] cond = newElasticityConstraint.split( "<" );

-          newElasticityConstraint = cond[0] + "&lt;" + cond[1];

-        }

-        else if (newElasticityConstraint.contains( ">" )){

-          String[] cond = newElasticityConstraint.split( ">" );

-          newElasticityConstraint = cond[0] + "&gt;" + cond[1];

-        }      

-        

-        

-        SyblElasticityRequirementsDescription newSYBLConstraint = dialog.getSYBLConstraint();

-        if( newElasticityConstraint != null ) {

-          // Add Application Component Elasticity Requirement to TOSCA

-          PictogramElement pe = getSelectedPictogramElement();

-          Object bo = null;

-          if( pe != null ) {

-            bo = Graphiti.getLinkService()

-              .getBusinessObjectForLinkedPictogramElement( pe );

-          }

-          final TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension )( ( ( TServiceTemplate )bo ).getBoundaryDefinitions() );        

-          

-          

-          if ( boundaryDef.getPolicies() == null ){

-            

-            final PoliciesType1 boundaryPolicies = ToscaFactory.eINSTANCE.createPoliciesType1();

-            

-            TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

-            editingDomain.getCommandStack()

-              .execute( new RecordingCommand( editingDomain ) {

-

-                @Override

-                protected void doExecute() {

-                  boundaryDef.setPolicies( boundaryPolicies );

-                }

-              } );

-            

-           

-          }

-          

-          PoliciesType1 nodePolicyList = boundaryDef.getPolicies();

-

-          final EList<TPolicy> policy = nodePolicyList.getPolicy();

-          final TPolicy newPolicy = createNewPolicy( "Constraint",

-                                                     newElasticityConstraint, newSYBLConstraint );

-          TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

-          editingDomain.getCommandStack()

-            .execute( new RecordingCommand( editingDomain ) {

-

-              @Override

-              protected void doExecute() {

-                policy.add( newPolicy );

-              }

-            } );

-          // Add Application Component Elasticity Requirement to temp list

-          this.appComponentElasticityRequirements.add( newPolicy );

-          this.tableViewer.refresh();

-        } else {

-        }

-      }

+    @Override

+    public void widgetSelected( SelectionEvent e ) {

+      editDataStagingEntry( null );

     }

-  }

 

-  void editDataStagingEntryRA( final TPolicy selectedObject ) {

-    ElasticityStrategyDialog dialog;

-    if( selectedObject == null ) {

-      // Add button is pressed

-      dialog = new ElasticityStrategyDialog( this.section.getShell(),

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  this.removeButton = new Button( client2, SWT.PUSH );

+  this.removeButton.setText( "Remove" ); //$NON-NLS-1$

+  gd = new GridData();

+  gd.widthHint = 60;

+  gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.removeButton.setLayoutData( gd );

+  // Listener for Remove button

+  this.removeButton.addSelectionListener( new SelectionListener() {

+

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      removeApplicationComponentElasticityRequirement( getSelectedObject() );

+    }

+

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  // Add section components to the toolkit

+  toolkit.adapt( this.table, true, true );

+  toolkit.adapt( this.addButton, true, true );

+  toolkit.adapt( this.removeButton, true, true );

+  this.section.setClient( client );

+  // Application Component Elasticity Actions Section

+  this.sectionRA = toolkit.createSection( parent, Section.TITLE_BAR );

+  this.sectionRA.setText( "Elasticity Strategies" ); //$NON-NLS-1$

+  Composite clientRA = toolkit.createComposite( this.sectionRA, SWT.WRAP );

+  Composite clientRA1 = toolkit.createComposite( clientRA, SWT.WRAP );

+  Composite clientRA2 = toolkit.createComposite( clientRA, SWT.WRAP );

+  GridLayout layoutRA;

+  layoutRA = new GridLayout();

+  layoutRA.numColumns = 2;

+  layoutRA.marginTop = 15;

+  layoutRA.verticalSpacing = 15;

+  layoutRA.marginWidth = 2;

+  layoutRA.marginHeight = 2;

+  clientRA.setLayout( layoutRA );

+  layoutRA = new GridLayout();

+  layoutRA.numColumns = 1;

+  clientRA1.setLayout( layoutRA );

+  layoutRA = new GridLayout();

+  layoutRA.numColumns = 1;

+  clientRA2.setLayout( layoutRA );

+  this.tableResizingActions = new Table( clientRA1, SWT.BORDER

+                                                    | SWT.VIRTUAL

+                                                    | SWT.MULTI

+                                                    | SWT.FULL_SELECTION );

+  this.tableResizingActions.setHeaderVisible( true );

+  this.tableResizingActions.setLinesVisible( false );

+  this.tableResizingActions.getHorizontalBar().setEnabled( false );

+  GridData gdRA;

+  gdRA = new GridData( 300, this.tableResizingActions.getItemHeight() * 4 );

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  gdRA.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;

+  this.tableResizingActions.setLayoutData( gdRA );

+  TableLayout tableLayoutRA = new TableLayout();

+  this.tableResizingActions.setLayout( tableLayoutRA );

+  TableColumn nameColumnRA = new TableColumn( this.tableResizingActions,

+                                              SWT.CENTER );

+  nameColumnRA.setText( "Strategy" ); //$NON-NLS-1$

+  nameColumnRA.setWidth( 100 );

+  ColumnWeightData dataRA = new ColumnWeightData( 100 );

+  tableLayoutRA.addColumnData( dataRA );

+  // Set the Elasticity Actions table viewer

+  ResizingActionsProvider RAProvider = new ResizingActionsProvider();

+  this.tableResizingActionsViewer = new TableViewer( this.tableResizingActions );

+  IStructuredContentProvider contentProviderRA = RAProvider.RAContentProvider;

+  this.tableResizingActionsViewer.setContentProvider( contentProviderRA );

+  this.tableResizingActionsViewer.setLabelProvider( RAProvider.RAContentLabelProvider );

+  this.tableResizingActionsViewer.setInput( this.appComponentResizingActions );

+  // Add Elasticity Strategy button

+  this.addButtonRA = new Button( clientRA2, SWT.PUSH );

+  this.addButtonRA.setText( "Add" ); //$NON-NLS-1$

+  // Listener for Adding Elasticity Strategy button

+  this.addButtonRA.addSelectionListener( new SelectionListener() {

+

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      editDataStagingEntryRA( getSelectedObject() );

+    }

+

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  gdRA = new GridData();

+  gdRA.widthHint = 60;

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.addButtonRA.setLayoutData( gdRA );

+  this.removeButtonRA = new Button( clientRA2, SWT.PUSH );

+  this.removeButtonRA.setText( "Remove" ); //$NON-NLS-1$

+  // Listener for Remove Elasticity Strategy button

+  this.removeButtonRA.addSelectionListener( new SelectionListener() {

+

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      removeApplicationComponentResizingAction( getSelectedElasticityStrategy() );

+    }

+

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  gdRA = new GridData();

+  gdRA.widthHint = 60;

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.removeButtonRA.setLayoutData( gdRA );

+  this.conditionButtonRA = new Button( clientRA2, SWT.PUSH );

+  this.conditionButtonRA.setText( "Condition" ); //$NON-NLS-1$

+  // Listener for Remove Elasticity Strategy button

+  this.conditionButtonRA.addSelectionListener( new SelectionListener() {

+

+    @Override

+    public void widgetSelected( final SelectionEvent e ) {

+      addStrategyCondition( getSelectedElasticityStrategy() );

+    }

+

+    @Override

+    public void widgetDefaultSelected( final SelectionEvent e ) {

+      // TODO Auto-generated method stub

+    }

+  } );

+  gdRA = new GridData();

+  gdRA.widthHint = 60;

+  gdRA.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING;

+  this.conditionButtonRA.setLayoutData( gdRA );

+  // Add section components to the toolkit

+  toolkit.adapt( this.tableResizingActions, true, true );

+  toolkit.adapt( this.removeButtonRA, true, true );

+  toolkit.adapt( this.addButtonRA, true, true );

+  // toolkit.adapt( this.uploadButtonRA, true, true );

+  toolkit.adapt( this.conditionButtonRA, true, true );

+  this.sectionRA.setClient( clientRA );

+}

+

+// Add Application Component Elasticity Requirement

+void editDataStagingEntry( final TPolicy selectedObject ) {

+  ElasticityConstraintDialog dialog;

+  if( selectedObject == null ) {

+    // Add button is pressed

+    dialog = new ElasticityConstraintDialog( this.section.getShell(),

                                              "Application" ); //$NON-NLS-1$

-      if( dialog.open() == Window.OK ) {

-        String newElasticityStrategy = dialog.getElasticityStrategy();

-        SyblElasticityRequirementsDescription newSYBLStrategy = dialog.getSYBLStrategy();

-        if( newElasticityStrategy != null ) {

-          // Add Application Component Elasticity Strategy to TOSCA

-          PictogramElement pe = getSelectedPictogramElement();

-          Object bo = null;

-          if( pe != null ) {

-            bo = Graphiti.getLinkService()

-              .getBusinessObjectForLinkedPictogramElement( pe );

-          }

-          final TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension )( ( ( TServiceTemplate )bo ).getBoundaryDefinitions() );        

-          

-          if ( boundaryDef.getPolicies() == null ){

-            

-            final PoliciesType1 boundaryPolicies = ToscaFactory.eINSTANCE.createPoliciesType1();

-            

-            TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

-            editingDomain.getCommandStack()

-              .execute( new RecordingCommand( editingDomain ) {

-

-                @Override

-                protected void doExecute() {

-                  boundaryDef.setPolicies( boundaryPolicies );

-                }

-              } );

-          }

-          

-          PoliciesType1 nodePolicyList = boundaryDef.getPolicies();

-          final EList<TPolicy> policy = nodePolicyList.getPolicy();

-          final TPolicy newPolicy = createNewPolicy( "Strategy",

-                                                     newElasticityStrategy, newSYBLStrategy );

+    if( dialog.open() == Window.OK ) {

+      String newElasticityConstraint = dialog.getElasticityConstraint();

+      

+      if( newElasticityConstraint != null ) {

+        

+        if( newElasticityConstraint.contains( "<" ) ) {

+          String[] cond = newElasticityConstraint.split( "<" );

+          newElasticityConstraint = cond[ 0 ] + "&lt;" + cond[ 1 ];

+        } else if( newElasticityConstraint.contains( ">" ) ) {

+          String[] cond = newElasticityConstraint.split( ">" );

+          newElasticityConstraint = cond[ 0 ] + "&gt;" + cond[ 1 ];

+        }

+        

+        // Add Application Component Elasticity Requirement to TOSCA

+        PictogramElement pe = getSelectedPictogramElement();

+        Object bo = null;

+        if( pe != null ) {

+          bo = Graphiti.getLinkService()

+            .getBusinessObjectForLinkedPictogramElement( pe );

+        }

+        final TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension )( ( ( TServiceTemplate )bo ).getBoundaryDefinitions() );

+        if( boundaryDef.getPolicies() == null ) {

+          final PoliciesType1 boundaryPolicies = ToscaFactory.eINSTANCE.createPoliciesType1();

           TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

           editingDomain.getCommandStack()

             .execute( new RecordingCommand( editingDomain ) {

 

               @Override

               protected void doExecute() {

-                policy.add( newPolicy );

+                boundaryDef.setPolicies( boundaryPolicies );

               }

             } );

-          this.appComponentResizingActions.add( newPolicy );

-          this.tableResizingActionsViewer.refresh();

-        } else {

-          // Edit

         }

+        PoliciesType1 nodePolicyList = boundaryDef.getPolicies();

+        final EList<TPolicy> policy = nodePolicyList.getPolicy();

+        final TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();

+        String type = "Constraint";

+        QName policyTypeName = new QName( "http://www.example.org/SYBL",

+                                          type,

+                                          null );

+        newPolicy.setPolicyType( policyTypeName );

+        newPolicy.setName( type.toUpperCase() + " " + newElasticityConstraint );

+        

+        String id = "A" + ( ( Integer )boundaryDef.hashCode() ).toString() + nodePolicyList.getPolicy().size();

+        QName qnamePolicyTemplate = new QName( id );

+        newPolicy.setPolicyRef( qnamePolicyTemplate );

+        

+        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

+        editingDomain.getCommandStack()

+          .execute( new RecordingCommand( editingDomain ) {

+

+            @Override

+            protected void doExecute() {

+              policy.add( newPolicy );

+            }

+          } );

+        // Add Application Component Elasticity Requirement to temp list

+        this.appComponentElasticityRequirements.add( newPolicy );

+        this.tableViewer.refresh();

       }

     }

   }

+}

 

-

-  // type is either "Constraint" or "Strategy"

-  TPolicy createNewPolicy(String type, String policyName, SyblElasticityRequirementsDescription syblPolicy){

-

-    // Create Policy Template 

+void editDataStagingEntryRA( final TPolicy selectedObject ) {

+  ElasticityStrategyDialog dialog;

+  if( selectedObject == null ) {

+    // Add button is pressed

+    PictogramElement pe = getSelectedPictogramElement();

+    Object bo = null;

+    if( pe != null ) {

+      bo = Graphiti.getLinkService()

+        .getBusinessObjectForLinkedPictogramElement( pe );

+    }

+    TServiceTemplate application = (TServiceTemplate) bo;

     

-    final TPolicyTemplate newPolicyTemplate = ToscaFactory.eINSTANCE.createTPolicyTemplate();

-    

-    QName policyTypeName = new QName( "http://www.example.org/SYBL", type, null );

-    

-    newPolicyTemplate.setType( policyTypeName );

-    

-    String id = "A" + ( ( Integer )newPolicyTemplate.hashCode() ).toString();

-    

-    newPolicyTemplate.setId( id );

-

-    

-    // Set the Properties of the Policy Template    

-    

-    PropertiesType properties = ToscaFactory.eINSTANCE.createPropertiesType();    

-  

-    // Add the SYBL Policy to the FeatureMap of the Policy's Properties element

-    Entry e = FeatureMapUtil.createEntry(     SyblPackage.eINSTANCE.getDocumentRoot_SYBLElasticityRequirementsDescription(),  syblPolicy );

-    properties.getAny().add( e );      

-    

-    newPolicyTemplate.setProperties( properties );

-        

-    // Add the new Policy Template to the TOSCA Definitions element

-    

-    final ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-    

-    DefinitionsType definitions = model.getDocumentRoot().getDefinitions();

-       

-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( definitions );

-    editingDomain.getCommandStack()

-      .execute( new RecordingCommand( editingDomain ) {

-

-        @Override

-        protected void doExecute() {

-          model.getDocumentRoot().getDefinitions().getPolicyTemplate().add( newPolicyTemplate );

-          

-        }

-      } );

-    

-    // Assign the created Policy Template to the new Policy

-    

-    TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();

-    

-    QName qnamePolicyTemplate = new QName( newPolicyTemplate.getId() );

-    

-    newPolicy.setPolicyType( policyTypeName );  

-    

-    newPolicy.setPolicyRef( qnamePolicyTemplate );

-    

-    newPolicy.setName( type.toUpperCase() + " " + policyName );

-    

-    return newPolicy;

-  }

-  

-  void addStrategyCondition( final TPolicy selectedObject ) {

-    if( selectedObject == null )

-      return;

-    

-    TServiceTemplate serviceTemplate = null;

-    

-    if (getSelectedPictogramElement() != null) 

-      serviceTemplate = (TServiceTemplate) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(getSelectedPictogramElement());

-    

-    ElasticityConditionDialog dialog;

-    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-    dialog = new ElasticityConditionDialog( this.section.getShell(),

-                                            "Application Component",

-                                            model,

-                                            selectedObject.getName() ); //$NON-NLS-1$

-    String newElasticityCondition = null;

-    ConditionType policyCondition = null;

+    dialog = new ElasticityStrategyDialog( this.section.getShell(),

+                                           "Application", application.getName() ); //$NON-NLS-1$

     if( dialog.open() == Window.OK ) {

-      newElasticityCondition = dialog.getSelectedCondition();

-      policyCondition = dialog.getSYBLCondition();

-    }

-    if( newElasticityCondition == null )

-      return;

+      String newElasticityStrategy = dialog.getElasticityStrategy();

+      if( newElasticityStrategy != null ) {

+        // Add Application Component Elasticity Strategy to TOSCA

 

-    String newCond = newElasticityCondition;

-    

-    if (newCond.contains( "<" )){

-      String[] cond = newCond.split( "<" );

-      newCond = cond[0] + "&lt;" + cond[1];

-    }

-    else if (newCond.contains( ">" )){

-      String[] cond = newCond.split( ">" );

-      newCond = cond[0] + "&gt;" + cond[1];

-    }

-    

-    final String condition = newCond;

-    

-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( serviceTemplate );

-    editingDomain.getCommandStack()

-      .execute( new RecordingCommand( editingDomain ) {

+        final TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension )( application.getBoundaryDefinitions() );

+        if( boundaryDef.getPolicies() == null ) {

+          final PoliciesType1 boundaryPolicies = ToscaFactory.eINSTANCE.createPoliciesType1();

+          TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

+          editingDomain.getCommandStack()

+            .execute( new RecordingCommand( editingDomain ) {

 

-        @Override

-        protected void doExecute() {

-          String[] strategy = selectedObject.getName().split( "STRATEGY" );

-          selectedObject.setName( strategy[ 0 ]

-                                  + "STRATEGY "

-                                  + condition + " :" 

-                                  + strategy[ 1 ] );

-        }

-      } );

-    this.tableResizingActionsViewer.refresh();

-    

-    //addPolicyCondition( selectedObject, policyCondition);

-  }

-  

-//  void addPolicyCondition(final TPolicy selectedPolicy, final ConditionType policyCondition){

-//    

-//    ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-//    EList<TPolicyTemplate> policyTemplates = model.getDocumentRoot().getDefinitions().getPolicyTemplate();

-//    TPolicyTemplate policyTemplate = null;

-//    for ( TPolicyTemplate tempPolicyTemplate : policyTemplates ){

-//      if (tempPolicyTemplate.getId().toString().equals(selectedPolicy.getPolicyRef().toString())){

-//        policyTemplate = tempPolicyTemplate;

-//        break;

-//      }      

-//    }

-//    

-//    final SyblElasticityRequirementsDescription syblPolicy = (SyblElasticityRequirementsDescription) policyTemplate.getProperties().getAny().get(0).getValue();

-//    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( policyTemplate );

-//    editingDomain.getCommandStack()

-//      .execute( new RecordingCommand( editingDomain ) {

-//

-//        @Override

-//        protected void doExecute() {

-//          syblPolicy.getSYBLSpecification().get( 0 ).getStrategy().get( 0 ).setCondition( policyCondition );

-//        }

-//      } );

-//  }

-

-  // Remove the selected Application Component Elasticity Requirement from TOSCA

-  void removeApplicationComponentElasticityRequirement( final TPolicy selectedObject )

-  {

-    PictogramElement pe = getSelectedPictogramElement();

-    Object bo = null;

-    if( pe != null ) {

-      bo = Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( pe );

-    }

-    

-    final TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension )( ( ( TServiceTemplate )bo ).getBoundaryDefinitions() );        

-    

-    PoliciesType1 nodePolicyList = boundaryDef.getPolicies();

-    

-    final EList<TPolicy> policy = nodePolicyList.getPolicy();

-    

-    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

-    editingDomain.getCommandStack()

-      .execute( new RecordingCommand( editingDomain ) {

-

-        @Override

-        protected void doExecute() {

-          for( TPolicy tempPolicy : policy ) {

-            if( tempPolicy.getPolicyType().toString().contains( "Constraint" ) ) //$NON-NLS-1$

-              if( tempPolicy.getName().compareTo( selectedObject.getName() ) == 0 )

-              {

-                policy.remove( tempPolicy );

-                if( policy.size() == 0 )

-                  boundaryDef.setPolicies( null );

-                // remove corresponding Policy Template

-                String removedPolicyId = tempPolicy.getPolicyRef().toString();

-                ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

-                DefinitionsType toscaDefinitions = model.getDocumentRoot()

-                  .getDefinitions();

-                final EList<TPolicyTemplate> policyTemplate = toscaDefinitions.getPolicyTemplate();

-                for( TPolicyTemplate tempPolicyTemplate : policyTemplate ) {

-                  if( tempPolicyTemplate.getId().equals( removedPolicyId ) ) {

-                    policyTemplate.remove( tempPolicyTemplate );

-                  }

-                }

-                break;

+              @Override

+              protected void doExecute() {

+                boundaryDef.setPolicies( boundaryPolicies );

               }

-          }

+            } );

         }

-      } );

-    this.appComponentElasticityRequirements.remove( selectedObject );

-    this.tableViewer.refresh();

-  }

+        PoliciesType1 nodePolicyList = boundaryDef.getPolicies();

+        final EList<TPolicy> policy = nodePolicyList.getPolicy();

+        final TPolicy newPolicy = ToscaFactory.eINSTANCE.createTPolicy();

+        String type = "Strategy";

+        QName policyTypeName = new QName( "http://www.example.org/SYBL",

+                                          type,

+                                          null );

+        newPolicy.setPolicyType( policyTypeName );

+        newPolicy.setName( type.toUpperCase() + " " + newElasticityStrategy );

+        

+        String id = "A" + ( ( Integer )boundaryDef.hashCode() ).toString() + nodePolicyList.getPolicy().size();

+        QName qnamePolicyTemplate = new QName( id );

+        newPolicy.setPolicyRef( qnamePolicyTemplate );

+        

+        TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( bo );

+        editingDomain.getCommandStack()

+          .execute( new RecordingCommand( editingDomain ) {

 

-  // Return the selected Elasticity Requirement

-  TPolicy getSelectedObject() {

-    TPolicy result = null;

-    IStructuredSelection selection = ( IStructuredSelection )this.tableViewer.getSelection();

-    Object obj = selection.getFirstElement();

-    result = ( TPolicy )obj;

-    return result;

-  }

-

-  // Return the selected Elasticity Action

-  TPolicy getSelectedElasticityStrategy() {

-    TPolicy result = null;

-    IStructuredSelection selection = ( IStructuredSelection )this.tableResizingActionsViewer.getSelection();

-    Object obj = selection.getFirstElement();

-    result = ( TPolicy )obj;

-    return result;

-  }

-

-  /**

-   * Get Application Elasticity Actions

-   */

-  public void getResizingActions() {

-    // initiate global elasticity requirement list with requirements from

-    // description wizard

-    PictogramElement pe = getSelectedPictogramElement();

-    Object bo = null;

-    if( pe != null ) {

-      bo = Graphiti.getLinkService()

-        .getBusinessObjectForLinkedPictogramElement( pe );

+            @Override

+            protected void doExecute() {

+              policy.add( newPolicy );

+            }

+          } );

+        this.appComponentResizingActions.add( newPolicy );

+        this.tableResizingActionsViewer.refresh();

+      }

     }

-    TBoundaryDefinitionsExtension boundaryDef = ( TBoundaryDefinitionsExtension )( ( ( TServiceTemplate )bo ).getBoundaryDefinitions() );        

-    

-    PoliciesType1 nodePolicyList = boundaryDef.getPolicies();

-    

-    if( nodePolicyList == null )

-      return;

-    

-    for( TPolicy tempPolicy : nodePolicyList.getPolicy() )

-    {

-      if( tempPolicy.getPolicyType().toString().contains( "Strategy" ) ) //$NON-NLS-1$

-        this.appComponentResizingActions.add( tempPolicy );

-    }

-    

   }

+}

 

+void addStrategyCondition( final TPolicy selectedObject ) {

+  if( selectedObject == null )

+    return;

+  TServiceTemplate serviceTemplate = null;

+  if( getSelectedPictogramElement() != null )

+    serviceTemplate = ( TServiceTemplate )Graphiti.getLinkService()

+      .getBusinessObjectForLinkedPictogramElement( getSelectedPictogramElement() );

+  ElasticityConditionDialog dialog;

+  ToscaModelLayer model = ModelHandler.getModel( EcoreUtil.getURI( getDiagram() ) );

+  dialog = new ElasticityConditionDialog( this.section.getShell(),

+                                          "Application Component",

+                                          model,

+                                          selectedObject.getName() ); //$NON-NLS-1$

+  String newElasticityCondition = null;

+  if( dialog.open() == Window.OK ) {

+    newElasticityCondition = dialog.getSelectedCondition();

+  }

+  if( newElasticityCondition == null )

+    return;

+  String newCond = newElasticityCondition;

+  if( newCond.contains( "<" ) ) {

+    String[] cond = newCond.split( "<" );

+    newCond = cond[ 0 ] + "&lt;" + cond[ 1 ];

+  } else if( newCond.contains( ">" ) ) {

+    String[] cond = newCond.split( ">" );

+    newCond = cond[ 0 ] + "&gt;" + cond[ 1 ];

+  }

+  final String condition = newCond;

+  TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain( serviceTemplate );

+  editingDomain.getCommandStack()

+    .execute( new RecordingCommand( editingDomain ) {

+

+      @Override

+      protected void doExecute() {

+        String[] strategy = selectedObject.getName().split( "STRATEGY" );

+        selectedObject.setName( strategy[ 0 ]

+                                + "STRATEGY "

+                                + condition

+                                + " :"

+                                + strategy[ 1 ] );

+