diff --git a/extra/sql/bulkload/clds-create-db-objects.sql b/extra/sql/bulkload/clds-create-db-objects.sql
index 38cc466..ac64b5d 100644
--- a/extra/sql/bulkload/clds-create-db-objects.sql
+++ b/extra/sql/bulkload/clds-create-db-objects.sql
@@ -59,6 +59,7 @@
   control_name_uuid VARCHAR(36) NOT NULL,
   service_type_id VARCHAR(80) NULL,
   deployment_id VARCHAR(80) NULL,
+  deployment_status_url VARCHAR(300) NULL,
   PRIMARY KEY (model_id),
   UNIQUE (model_name),
   UNIQUE (control_name_uuid),
diff --git a/extra/sql/bulkload/clds-stored-procedures.sql b/extra/sql/bulkload/clds-stored-procedures.sql
index aa8edb8..b48e86a 100644
--- a/extra/sql/bulkload/clds-stored-procedures.sql
+++ b/extra/sql/bulkload/clds-stored-procedures.sql
@@ -134,6 +134,7 @@
    OUT v_model_id VARCHAR(36),
    OUT v_service_type_id VARCHAR(80),
    OUT v_deployment_id VARCHAR(80),
+   OUT v_deployment_status_url VARCHAR(300),
    OUT v_template_name VARCHAR(80),
    OUT v_template_id VARCHAR(36),
    OUT v_model_prop_id VARCHAR(36),
@@ -153,6 +154,7 @@
 		 m.model_id,
 		 m.service_type_id,
 		 m.deployment_id,
+		 m.deployment_status_url,
 		 t.template_name,
 		 m.template_id,
 		 mp.model_prop_id,
@@ -171,6 +173,7 @@
 		 v_model_id,
 		 v_service_type_id,
 		 v_deployment_id,
+		 v_deployment_status_url,
 		 v_template_name,
          v_template_id,
          v_model_prop_id,
@@ -210,6 +213,7 @@
    OUT v_model_id VARCHAR(36),
    OUT v_service_type_id VARCHAR(80),
    OUT v_deployment_id VARCHAR(80),
+   OUT v_deployment_status_url VARCHAR(300),
    OUT v_template_name VARCHAR(80),
    OUT v_template_id VARCHAR(36),
    OUT v_model_prop_id VARCHAR(36),
@@ -240,6 +244,7 @@
     v_model_id,
 	v_service_type_id,
 	v_deployment_id,
+	v_deployment_status_url,
     v_template_name,
     v_template_id,
     v_model_prop_id,
@@ -274,6 +279,7 @@
    IN v_model_blueprint_text MEDIUMTEXT,
    IN v_service_type_id VARCHAR(80),
    IN v_deployment_id VARCHAR(80),
+   IN v_deployment_status_url VARCHAR(300),
    INOUT v_control_name_prefix VARCHAR(80),
    INOUT v_control_name_uuid VARCHAR(36),
    OUT v_model_id VARCHAR(36),
@@ -295,6 +301,7 @@
   DECLARE v_old_model_blueprint_text MEDIUMTEXT;
   DECLARE v_old_service_type_id VARCHAR(80);
   DECLARE v_old_deployment_id VARCHAR(80);
+  DECLARE v_old_deployment_status_url VARCHAR(300);
   SET v_model_id = NULL;
   CALL get_model(
     v_model_name,
@@ -303,6 +310,7 @@
     v_model_id,
 	v_old_service_type_id,
 	v_old_deployment_id,
+	v_old_deployment_status_url,
     v_old_template_name,
     v_old_template_id,
     v_model_prop_id,
@@ -325,8 +333,8 @@
 	  END IF;
       SET v_model_id = v_control_name_uuid;
       INSERT INTO model
-	    (model_id, model_name, template_id, control_name_prefix, control_name_uuid, service_type_id, deployment_id)
-	    VALUES (v_model_id, v_model_name, v_template_id, v_control_name_prefix, v_control_name_uuid, v_service_type_id, v_deployment_id);
+	    (model_id, model_name, template_id, control_name_prefix, control_name_uuid, service_type_id, deployment_id, deployment_status_url)
+	    VALUES (v_model_id, v_model_name, v_template_id, v_control_name_prefix, v_control_name_uuid, v_service_type_id, v_deployment_id,v_deployment_status_url);
 	  # since just created model, insert CREATED event as initial default event
 	  SET v_action_cd = 'CREATE';
 	  SET v_action_state_cd = 'COMPLETED';
@@ -368,7 +376,8 @@
 	    model_prop_id = v_model_prop_id,
 	    model_blueprint_id = v_model_blueprint_id,
 	    service_type_id = v_service_type_id,
-	    deployment_id = v_deployment_id
+	    deployment_id = v_deployment_id,
+	    deployment_status_url = v_deployment_status_url
     WHERE model_id = v_model_id;
 END;
 CREATE PROCEDURE ins_model_instance
diff --git a/pom.xml b/pom.xml
index 72f62f0..f95805f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -856,9 +856,9 @@
 						<plugin>
 								<groupId>org.apache.maven.plugins</groupId>
 								<artifactId>maven-surefire-plugin</artifactId>
-								<version>2.19.1</version>
+								<version>2.22.1</version>
 								<configuration>
-										<forkCount>1</forkCount>
+										<forkCount>0</forkCount>
 										<reuseForks>false</reuseForks>
 								</configuration>
 						</plugin>
@@ -866,8 +866,7 @@
 						<plugin>
 								<groupId>org.apache.maven.plugins</groupId>
 								<artifactId>maven-failsafe-plugin</artifactId>
-								<version>2.17</version>
-
+								<version>2.22.1</version>
 								<executions>
 										<execution>
 												<id>integration-tests</id>
@@ -876,10 +875,13 @@
 														<goal>verify</goal>
 												</goals>
 												<configuration>
+														<additionalClasspathElements>
+															<additionalClasspathElement>${project.build.directory}/classes</additionalClasspathElement>
+														</additionalClasspathElements>
 														<includes>
 																<include>**/*ItCase.java</include>
 														</includes>
-														<forkCount>1</forkCount>
+														<forkCount>0</forkCount>
 														<reuseForks>false</reuseForks>
 												</configuration>
 										</execution>
diff --git a/src/main/java/org/onap/clamp/clds/client/CldsEventDelegate.java b/src/main/java/org/onap/clamp/clds/client/CldsEventDelegate.java
index 8dfa190..8ae10b2 100644
--- a/src/main/java/org/onap/clamp/clds/client/CldsEventDelegate.java
+++ b/src/main/java/org/onap/clamp/clds/client/CldsEventDelegate.java
@@ -27,7 +27,6 @@
 import com.att.eelf.configuration.EELFManager;
 
 import org.apache.camel.Exchange;
-import org.apache.camel.Handler;
 import org.onap.clamp.clds.dao.CldsDao;
 import org.onap.clamp.clds.model.CldsEvent;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,23 +48,26 @@
      *
      * @param camelExchange
      *        The Camel Exchange object containing the properties
+     * @param actionState
+     *        The action state that is used instead of the one in exchange property
      */
-    @Handler
-    public void execute(Exchange camelExchange) {
+
+    public void addEvent(Exchange camelExchange, String actionState) {
         String controlName = (String) camelExchange.getProperty("controlName");
         String actionCd = (String) camelExchange.getProperty("actionCd");
-        String actionStateCd = ((String) camelExchange.getProperty("actionStateCd")) != null
+        String actionStateCd = (actionState != null) ? actionState : CldsEvent.ACTION_STATE_COMPLETED;
+        actionStateCd = ((String) camelExchange.getProperty("actionStateCd")) != null
             ? ((String) camelExchange.getProperty("actionStateCd"))
-                : CldsEvent.ACTION_STATE_COMPLETED;
-            // Flag indicate whether it is triggered by Validation Test button from
-            // UI
-            boolean isTest = (boolean) camelExchange.getProperty("isTest");
-            boolean isInsertTestEvent = (boolean) camelExchange.getProperty("isInsertTestEvent");
-            String userid = (String) camelExchange.getProperty("userid");
-            // do not insert events for test actions unless flag set to insert them
-            if (!isTest || isInsertTestEvent) {
-                // won't really have userid here...
-                CldsEvent.insEvent(cldsDao, controlName, userid, actionCd, actionStateCd, camelExchange.getExchangeId());
-            }
+            : actionStateCd;
+        // Flag indicate whether it is triggered by Validation Test button from
+        // UI
+        boolean isTest = (boolean) camelExchange.getProperty("isTest");
+        boolean isInsertTestEvent = (boolean) camelExchange.getProperty("isInsertTestEvent");
+        String userid = (String) camelExchange.getProperty("userid");
+        // do not insert events for test actions unless flag set to insert them
+        if (!isTest || isInsertTestEvent) {
+            // won't really have userid here...
+            CldsEvent.insEvent(cldsDao, controlName, userid, actionCd, actionStateCd, camelExchange.getExchangeId());
+        }
     }
 }
diff --git a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
index d3e89fb..121114b 100644
--- a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
+++ b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
@@ -86,6 +86,7 @@
     private SimpleJdbcCall procInsertDictionaryElement;
 
     private static final String DATE_FORMAT = "MM-dd-yyyy HH:mm:ss";
+
     /**
      * Log message when instantiating
      */
@@ -184,6 +185,7 @@
             .addValue("v_model_prop_text", model.getPropText())
             .addValue("v_model_blueprint_text", model.getBlueprintText())
             .addValue("v_service_type_id", model.getTypeId()).addValue("v_deployment_id", model.getDeploymentId())
+            .addValue("v_deployment_status_url", model.getDeploymentStatusUrl())
             .addValue("v_control_name_prefix", model.getControlNamePrefix())
             .addValue(V_CONTROL_NAME_UUID, model.getControlNameUuid());
         Map<String, Object> out = logSqlExecution(procSetModel, in);
@@ -475,6 +477,7 @@
         model.getEvent().setUserid((String) out.get("v_event_user_id"));
         model.setTypeId((String) out.get("v_service_type_id"));
         model.setDeploymentId((String) out.get("v_deployment_id"));
+        model.setDeploymentStatusUrl((String) out.get("v_deployment_status_url"));
     }
 
     /**
@@ -525,18 +528,19 @@
         }
         toscaModelSql += " AND tmr.version = (select max(version) from tosca_model_revision st where tmr.tosca_model_id=st.tosca_model_id)";
 
-        Optional.ofNullable(jdbcTemplateObject.queryForList(toscaModelSql, params)).orElse(Collections.emptyList()).forEach(row -> {
-            CldsToscaModel cldsToscaModel = new CldsToscaModel();
-            cldsToscaModel.setId((String) row.get("tosca_model_id"));
-            cldsToscaModel.setPolicyType((String) row.get("policy_type"));
-            cldsToscaModel.setToscaModelName((String) row.get("tosca_model_name"));
-            cldsToscaModel.setUserId((String) row.get("user_id"));
-            cldsToscaModel.setRevisionId((String) row.get("tosca_model_revision_id"));
-            cldsToscaModel.setVersion(((Double) row.get("version")));
-            cldsToscaModel.setCreatedDate(sdf.format(row.get("createdTimestamp")));
-            cldsToscaModel.setToscaModelYaml((String) row.get("tosca_model_yaml"));
-            cldsToscaModels.add(cldsToscaModel);
-        });
+        Optional.ofNullable(jdbcTemplateObject.queryForList(toscaModelSql, params)).orElse(Collections.emptyList())
+            .forEach(row -> {
+                CldsToscaModel cldsToscaModel = new CldsToscaModel();
+                cldsToscaModel.setId((String) row.get("tosca_model_id"));
+                cldsToscaModel.setPolicyType((String) row.get("policy_type"));
+                cldsToscaModel.setToscaModelName((String) row.get("tosca_model_name"));
+                cldsToscaModel.setUserId((String) row.get("user_id"));
+                cldsToscaModel.setRevisionId((String) row.get("tosca_model_revision_id"));
+                cldsToscaModel.setVersion(((Double) row.get("version")));
+                cldsToscaModel.setCreatedDate(sdf.format(row.get("createdTimestamp")));
+                cldsToscaModel.setToscaModelYaml((String) row.get("tosca_model_yaml"));
+                cldsToscaModels.add(cldsToscaModel);
+            });
         return cldsToscaModels;
     }
 
@@ -626,15 +630,16 @@
             .map(Arrays::stream).map(s -> s.map(param -> param + " = :" + param).collect(Collectors.joining(" AND ")))
             .orElse("1");
 
-        Optional.ofNullable(jdbcTemplateObject.queryForList(dictionarySql, namedParameters)).orElse(Collections.emptyList()).forEach(row -> {
-            CldsDictionary cldsDictionary = new CldsDictionary();
-            cldsDictionary.setDictionaryId((String) row.get("dictionary_id"));
-            cldsDictionary.setDictionaryName((String) row.get("dictionary_name"));
-            cldsDictionary.setCreatedBy((String) row.get("created_by"));
-            cldsDictionary.setUpdatedBy((String) row.get("modified_by"));
-            cldsDictionary.setLastUpdatedDate(sdf.format(row.get("timestamp")));
-            dictionaries.add(cldsDictionary);
-        });
+        Optional.ofNullable(jdbcTemplateObject.queryForList(dictionarySql, namedParameters))
+            .orElse(Collections.emptyList()).forEach(row -> {
+                CldsDictionary cldsDictionary = new CldsDictionary();
+                cldsDictionary.setDictionaryId((String) row.get("dictionary_id"));
+                cldsDictionary.setDictionaryName((String) row.get("dictionary_name"));
+                cldsDictionary.setCreatedBy((String) row.get("created_by"));
+                cldsDictionary.setUpdatedBy((String) row.get("modified_by"));
+                cldsDictionary.setLastUpdatedDate(sdf.format(row.get("timestamp")));
+                dictionaries.add(cldsDictionary);
+            });
         return dictionaries;
     }
 
@@ -671,8 +676,7 @@
             .addValue("dict_element_name", cldsDictionaryItem.getDictElementName())
             .addValue("dict_element_short_name", cldsDictionaryItem.getDictElementShortName())
             .addValue("dict_element_description", cldsDictionaryItem.getDictElementDesc())
-            .addValue("dict_element_type", cldsDictionaryItem.getDictElementType())
-            .addValue("modified_by", userId)
+            .addValue("dict_element_type", cldsDictionaryItem.getDictElementType()).addValue("modified_by", userId)
             .addValue("dict_element_id", dictionaryElementId);
         jdbcTemplateObject.update(dictionarySql, namedParameters);
         cldsDictionaryItem.setUpdatedBy(userId);
@@ -695,31 +699,32 @@
         String dictionarySql = "SELECT de.dict_element_id, de.dictionary_id, de.dict_element_name, de.dict_element_short_name, de.dict_element_description, de.dict_element_type, de.created_by, de.modified_by, de.timestamp  "
             + "FROM dictionary_elements de, dictionary d WHERE de.dictionary_id = d.dictionary_id ";
         if (dictionaryId != null) {
-            dictionarySql+=" AND d.dictionary_id = :dictionaryId";
+            dictionarySql += " AND d.dictionary_id = :dictionaryId";
             namedParameters.addValue("dictionaryId", dictionaryId);
         }
-        if (dictElementShortName!=null) {
-            dictionarySql+=" AND de.dict_element_short_name = :dictElementShortName";
+        if (dictElementShortName != null) {
+            dictionarySql += " AND de.dict_element_short_name = :dictElementShortName";
             namedParameters.addValue("dictElementShortName", dictElementShortName);
         }
-        if (dictionaryName!=null) {
-            dictionarySql+=" AND dictionary_name = :dictionaryName";
+        if (dictionaryName != null) {
+            dictionarySql += " AND dictionary_name = :dictionaryName";
             namedParameters.addValue("dictionaryName", dictionaryName);
         }
 
-        Optional.ofNullable(jdbcTemplateObject.queryForList(dictionarySql,namedParameters)).orElse(Collections.emptyList()).forEach(row -> {
-            CldsDictionaryItem dictionaryItem = new CldsDictionaryItem();
-            dictionaryItem.setDictElementId((String) row.get("dict_element_id"));
-            dictionaryItem.setDictionaryId((String) row.get("dictionary_id"));
-            dictionaryItem.setDictElementName((String) row.get("dict_element_name"));
-            dictionaryItem.setDictElementShortName((String) row.get("dict_element_short_name"));
-            dictionaryItem.setDictElementDesc((String) row.get("dict_element_description"));
-            dictionaryItem.setDictElementType((String) row.get("dict_element_type"));
-            dictionaryItem.setCreatedBy((String) row.get("created_by"));
-            dictionaryItem.setUpdatedBy((String) row.get("modified_by"));
-            dictionaryItem.setLastUpdatedDate(sdf.format(row.get("timestamp")));
-            dictionaryItems.add(dictionaryItem);
-        });
+        Optional.ofNullable(jdbcTemplateObject.queryForList(dictionarySql, namedParameters))
+            .orElse(Collections.emptyList()).forEach(row -> {
+                CldsDictionaryItem dictionaryItem = new CldsDictionaryItem();
+                dictionaryItem.setDictElementId((String) row.get("dict_element_id"));
+                dictionaryItem.setDictionaryId((String) row.get("dictionary_id"));
+                dictionaryItem.setDictElementName((String) row.get("dict_element_name"));
+                dictionaryItem.setDictElementShortName((String) row.get("dict_element_short_name"));
+                dictionaryItem.setDictElementDesc((String) row.get("dict_element_description"));
+                dictionaryItem.setDictElementType((String) row.get("dict_element_type"));
+                dictionaryItem.setCreatedBy((String) row.get("created_by"));
+                dictionaryItem.setUpdatedBy((String) row.get("modified_by"));
+                dictionaryItem.setLastUpdatedDate(sdf.format(row.get("timestamp")));
+                dictionaryItems.add(dictionaryItem);
+            });
         return dictionaryItems;
     }
 }
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsEvent.java b/src/main/java/org/onap/clamp/clds/model/CldsEvent.java
index 8d3807b..90dc996 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsEvent.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsEvent.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * 
+ *
  */
 
 package org.onap.clamp.clds.model;
@@ -31,7 +31,6 @@
 public class CldsEvent {
     public static final String ACTION_TEST = "TEST";
     public static final String ACTION_CREATE = "CREATE";
-    public static final String ACTION_MODIFY = "MODIFY";
     public static final String ACTION_SUBMIT = "SUBMIT";
     // an update before model is active
     public static final String ACTION_RESUBMIT = "RESUBMIT";
@@ -80,15 +79,15 @@
      * @return
      */
     public static CldsEvent insEvent(CldsDao cldsDao, String controlName, String userid, String actionCd,
-            String actionStateCd, String processInstanceId) {
+        String actionStateCd, String processInstanceId) {
         CldsModel model = CldsModel.createUsingControlName(controlName);
         return insEvent(cldsDao, model, userid, actionCd, actionStateCd, processInstanceId);
     }
 
     /**
-     * Insert event using controlNameUuid to find the model. This method meant
-     * for processing events from dcae.
-     * 
+     * Insert event using controlNameUuid to find the model. This method meant for
+     * processing events from dcae.
+     *
      * @param cldsDao
      * @param model
      * @param userId
@@ -98,7 +97,7 @@
      * @return
      */
     public static CldsEvent insEvent(CldsDao cldsDao, CldsModel model, String userId, String actionCd,
-            String actionStateCd, String processInstanceId) {
+        String actionStateCd, String processInstanceId) {
         CldsEvent event = new CldsEvent();
         event.setUserid(userId);
         event.setActionCd(actionCd);
@@ -109,9 +108,9 @@
     }
 
     /**
-     * Check if actionCd is equal to the supplied checkActionCd checkActionCd
-     * should not be null.
-     * 
+     * Check if actionCd is equal to the supplied checkActionCd checkActionCd should
+     * not be null.
+     *
      * @param checkActionCd
      * @return
      */
@@ -123,9 +122,9 @@
     }
 
     /**
-     * Check if actionCd and actionStateCd are equal to the supplied
-     * checkActionCd and checkActionStateCd. Treat checkActionStateCd == null as
-     * a wildcard checkActionCd should not be null.
+     * Check if actionCd and actionStateCd are equal to the supplied checkActionCd
+     * and checkActionStateCd. Treat checkActionStateCd == null as a wildcard
+     * checkActionCd should not be null.
      *
      * @param checkActionCd
      * @param checkActionStateCd
@@ -163,7 +162,7 @@
 
     /**
      * @param actionCd
-     *            the actionCd to set
+     *        the actionCd to set
      */
     public void setActionCd(String actionCd) {
         this.actionCd = actionCd;
@@ -178,7 +177,7 @@
 
     /**
      * @param actionStateCd
-     *            the actionStateCd to set
+     *        the actionStateCd to set
      */
     public void setActionStateCd(String actionStateCd) {
         this.actionStateCd = actionStateCd;
@@ -193,7 +192,7 @@
 
     /**
      * @param processInstanceId
-     *            the processInstanceId to set
+     *        the processInstanceId to set
      */
     public void setProcessInstanceId(String processInstanceId) {
         this.processInstanceId = processInstanceId;
@@ -208,7 +207,7 @@
 
     /**
      * @param userid
-     *            the userid to set
+     *        the userid to set
      */
     public void setUserid(String userid) {
         this.userid = userid;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsModel.java b/src/main/java/org/onap/clamp/clds/model/CldsModel.java
index 1d14562..14fe443 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsModel.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsModel.java
@@ -75,6 +75,7 @@
     private String typeId;
     private String typeName;
     private String deploymentId;
+    private String deploymentStatusUrl;
 
     /**
      * Construct empty model.
@@ -97,7 +98,7 @@
         return model;
     }
 
-    public boolean canInventoryCall() {
+    public boolean canDcaeInventoryCall() {
         boolean canCall = false;
         /* Below checks the clds event is submit/resubmit/distribute */
         if (event.isActionCd(CldsEvent.ACTION_SUBMIT) || event.isActionCd(CldsEvent.ACTION_RESUBMIT)
@@ -120,31 +121,27 @@
     /**
      * set the status in the model
      */
-    private void determineStatus() {
+    public void determineStatus() {
         status = STATUS_UNKNOWN;
         if (event == null || event.getActionCd() == null) {
             status = STATUS_DESIGN;
         } else if (event.isActionStateCd(CldsEvent.ACTION_STATE_ERROR)) {
             status = STATUS_ERROR;
-        } else if (event.isActionAndStateCd(CldsEvent.ACTION_CREATE, CldsEvent.ACTION_STATE_ANY)
-            || event.isActionAndStateCd(CldsEvent.ACTION_SUBMIT, CldsEvent.ACTION_STATE_ANY)
-            || event.isActionAndStateCd(CldsEvent.ACTION_RESUBMIT, CldsEvent.ACTION_STATE_ANY)
-            || event.isActionAndStateCd(CldsEvent.ACTION_SUBMITDCAE, CldsEvent.ACTION_STATE_ANY)
-            || event.isActionAndStateCd(CldsEvent.ACTION_DELETE, CldsEvent.ACTION_STATE_RECEIVED)
-            || event.isActionAndStateCd(CldsEvent.ACTION_MODIFY, CldsEvent.ACTION_STATE_ANY)) {
+        } else if (event.isActionAndStateCd(CldsEvent.ACTION_CREATE, CldsEvent.ACTION_STATE_ANY)) {
             status = STATUS_DESIGN;
         } else if (event.isActionAndStateCd(CldsEvent.ACTION_DISTRIBUTE, CldsEvent.ACTION_STATE_RECEIVED)
-            || event.isActionAndStateCd(CldsEvent.ACTION_UNDEPLOY, CldsEvent.ACTION_STATE_RECEIVED)) {
+            || event.isActionAndStateCd(CldsEvent.ACTION_UNDEPLOY, CldsEvent.ACTION_STATE_COMPLETED)
+            || event.isActionAndStateCd(CldsEvent.ACTION_SUBMIT, CldsEvent.ACTION_STATE_COMPLETED)
+            || event.isActionAndStateCd(CldsEvent.ACTION_RESUBMIT, CldsEvent.ACTION_STATE_COMPLETED)) {
             status = STATUS_DISTRIBUTED;
         } else if (event.isActionAndStateCd(CldsEvent.ACTION_DELETE, CldsEvent.ACTION_STATE_SENT)) {
             status = STATUS_DELETING;
-        } else if (event.isActionAndStateCd(CldsEvent.ACTION_DEPLOY, CldsEvent.ACTION_STATE_RECEIVED)
-            || event.isActionAndStateCd(CldsEvent.ACTION_RESTART, CldsEvent.ACTION_STATE_ANY)
-            || event.isActionAndStateCd(CldsEvent.ACTION_UPDATE, CldsEvent.ACTION_STATE_ANY)
-            || event.isActionAndStateCd(CldsEvent.ACTION_DEPLOY, CldsEvent.ACTION_STATE_ANY)
+        } else if (event.isActionAndStateCd(CldsEvent.ACTION_DEPLOY, CldsEvent.ACTION_STATE_COMPLETED)
+            || event.isActionAndStateCd(CldsEvent.ACTION_RESTART, CldsEvent.ACTION_STATE_COMPLETED)
+            || event.isActionAndStateCd(CldsEvent.ACTION_UPDATE, CldsEvent.ACTION_STATE_COMPLETED)
             || event.isActionAndStateCd(CldsEvent.ACTION_SUBMITPOLICY, CldsEvent.ACTION_STATE_ANY)) {
             status = STATUS_ACTIVE;
-        } else if (event.isActionAndStateCd(CldsEvent.ACTION_STOP, CldsEvent.ACTION_STATE_ANY)) {
+        } else if (event.isActionAndStateCd(CldsEvent.ACTION_STOP, CldsEvent.ACTION_STATE_COMPLETED)) {
             status = STATUS_STOPPED;
         }
     }
@@ -176,39 +173,23 @@
     }
 
     /**
-     * Determine permittedActionCd list using the actionCd from the current
-     * event. It's a states graph, given the next action that can be executed
-     * from the one that has been executed (described in the event object).
-     * ACTION_CREATE being the first one.
+     * Determine permittedActionCd list using the actionCd from the current event.
+     * It's a states graph, given the next action that can be executed from the one
+     * that has been executed (described in the event object). ACTION_CREATE being
+     * the first one.
      */
-    private void determinePermittedActionCd() {
+    public void determinePermittedActionCd() {
         String actionCd = getCurrentActionCd();
         switch (actionCd) {
         case CldsEvent.ACTION_CREATE:
-            permittedActionCd = Arrays.asList(CldsEvent.ACTION_SUBMIT, CldsEvent.ACTION_TEST,
-                CldsEvent.ACTION_DELETE);
+            permittedActionCd = Arrays.asList(CldsEvent.ACTION_SUBMIT, CldsEvent.ACTION_TEST, CldsEvent.ACTION_DELETE);
             if (isSimplifiedModel()) {
                 permittedActionCd = Arrays.asList(CldsEvent.ACTION_SUBMITDCAE, CldsEvent.ACTION_SUBMITPOLICY,
                     CldsEvent.ACTION_TEST, CldsEvent.ACTION_DELETE);
             }
             break;
-        case CldsEvent.ACTION_MODIFY:
-            permittedActionCd = Arrays.asList(CldsEvent.ACTION_RESUBMIT, CldsEvent.ACTION_DELETE);
-            if (isSimplifiedModel()) {
-                permittedActionCd = Arrays.asList(CldsEvent.ACTION_SUBMITDCAE, CldsEvent.ACTION_SUBMITPOLICY,
-                    CldsEvent.ACTION_DELETE);
-            }
-            break;
         case CldsEvent.ACTION_SUBMIT:
         case CldsEvent.ACTION_RESUBMIT:
-            permittedActionCd = Arrays.asList(CldsEvent.ACTION_RESUBMIT, CldsEvent.ACTION_DELETE);
-            break;
-        case CldsEvent.ACTION_SUBMITDCAE:
-            permittedActionCd = Arrays.asList(CldsEvent.ACTION_SUBMITDCAE, CldsEvent.ACTION_DELETE);
-            break;
-        case CldsEvent.ACTION_SUBMITPOLICY:
-            permittedActionCd = Arrays.asList(CldsEvent.ACTION_UPDATE, CldsEvent.ACTION_STOP);
-            break;
         case CldsEvent.ACTION_DISTRIBUTE:
             permittedActionCd = Arrays.asList(CldsEvent.ACTION_DEPLOY, CldsEvent.ACTION_RESUBMIT,
                 CldsEvent.ACTION_DELETE);
@@ -217,6 +198,12 @@
                     CldsEvent.ACTION_DELETE);
             }
             break;
+        case CldsEvent.ACTION_SUBMITDCAE:
+            permittedActionCd = Arrays.asList(CldsEvent.ACTION_SUBMITDCAE, CldsEvent.ACTION_DELETE);
+            break;
+        case CldsEvent.ACTION_SUBMITPOLICY:
+            permittedActionCd = Arrays.asList(CldsEvent.ACTION_UPDATE, CldsEvent.ACTION_STOP);
+            break;
         case CldsEvent.ACTION_UNDEPLOY:
             permittedActionCd = Arrays.asList(CldsEvent.ACTION_UPDATE, CldsEvent.ACTION_DEPLOY,
                 CldsEvent.ACTION_RESUBMIT, CldsEvent.ACTION_DELETE);
@@ -226,13 +213,13 @@
             }
             break;
         case CldsEvent.ACTION_DEPLOY:
-            permittedActionCd = Arrays.asList(CldsEvent.ACTION_UNDEPLOY,
-                CldsEvent.ACTION_UPDATE, CldsEvent.ACTION_STOP);
+            permittedActionCd = Arrays.asList(CldsEvent.ACTION_UNDEPLOY, CldsEvent.ACTION_UPDATE,
+                CldsEvent.ACTION_STOP);
             break;
         case CldsEvent.ACTION_RESTART:
         case CldsEvent.ACTION_UPDATE:
-            permittedActionCd = Arrays.asList(CldsEvent.ACTION_DEPLOY, CldsEvent.ACTION_UPDATE,
-                CldsEvent.ACTION_STOP, CldsEvent.ACTION_UNDEPLOY);
+            permittedActionCd = Arrays.asList(CldsEvent.ACTION_DEPLOY, CldsEvent.ACTION_UPDATE, CldsEvent.ACTION_STOP,
+                CldsEvent.ACTION_UNDEPLOY);
             if (isPolicyOnly()) {
                 permittedActionCd = Arrays.asList(CldsEvent.ACTION_UPDATE, CldsEvent.ACTION_STOP);
             }
@@ -283,30 +270,30 @@
     }
 
     /**
-     * Validate requestedActionCd - determine permittedActionCd and then check
-     * if contained in permittedActionCd Throw IllegalArgumentException if
-     * requested actionCd is not permitted.
+     * Validate requestedActionCd - determine permittedActionCd and then check if
+     * contained in permittedActionCd Throw IllegalArgumentException if requested
+     * actionCd is not permitted.
      */
     public void validateAction(String requestedActionCd) {
         determinePermittedActionCd();
         if (!permittedActionCd.contains(requestedActionCd)) {
             throw new IllegalArgumentException(
-                "Invalid requestedActionCd: " + requestedActionCd + ".  Given current actionCd: "
-                    + getCurrentActionCd() + ", the permittedActionCd: " + permittedActionCd);
+                "Invalid requestedActionCd: " + requestedActionCd + ".  Given current actionCd: " + getCurrentActionCd()
+                    + ", the permittedActionCd: " + permittedActionCd);
         }
     }
 
     /**
-     * Extract the UUID portion of a given full control name (controlNamePrefix
-     * + controlNameUuid). No fields are populated other than controlNamePrefix
-     * and controlNameUuid. Throws BadRequestException if length of given
-     * control name is less than UUID_LENGTH.
+     * Extract the UUID portion of a given full control name (controlNamePrefix +
+     * controlNameUuid). No fields are populated other than controlNamePrefix and
+     * controlNameUuid. Throws BadRequestException if length of given control name
+     * is less than UUID_LENGTH.
      */
     public static CldsModel createUsingControlName(String fullControlName) {
         if (fullControlName == null || fullControlName.length() < UUID_LENGTH) {
             throw new BadRequestException(
                 "closed loop id / control name length, " + (fullControlName != null ? fullControlName.length() : 0)
-                + ", less than the minimum of: " + UUID_LENGTH);
+                    + ", less than the minimum of: " + UUID_LENGTH);
         }
         CldsModel model = new CldsModel();
         model.setControlNamePrefix(fullControlName.substring(0, fullControlName.length() - UUID_LENGTH));
@@ -329,9 +316,9 @@
         CldsModel cldsModel = createUsingControlName(controlName);
         cldsModel = cldsDao.getModelByUuid(cldsModel.getControlNameUuid());
         cldsModel.determineStatus();
-        if (dcaeEvent.getCldsActionCd().equals(CldsEvent.ACTION_UNDEPLOY) || (dcaeEvent.getCldsActionCd()
-            .equals(CldsEvent.ACTION_DEPLOY)
-            && (cldsModel.getStatus().equals(STATUS_DISTRIBUTED) || cldsModel.getStatus().equals(STATUS_DESIGN)))) {
+        if (dcaeEvent.getCldsActionCd().equals(CldsEvent.ACTION_UNDEPLOY)
+            || (dcaeEvent.getCldsActionCd().equals(CldsEvent.ACTION_DEPLOY)
+                && (cldsModel.getStatus().equals(STATUS_DISTRIBUTED) || cldsModel.getStatus().equals(STATUS_DESIGN)))) {
             CldsEvent.insEvent(cldsDao, dcaeEvent.getControlName(), userid, dcaeEvent.getCldsActionCd(),
                 CldsEvent.ACTION_STATE_RECEIVED, null);
         }
@@ -348,7 +335,7 @@
 
     /**
      * @param name
-     *            the name to set
+     *        the name to set
      */
     public void setName(String name) {
         this.name = name;
@@ -382,7 +369,7 @@
 
     /**
      * @param controlNamePrefix
-     *            the controlNamePrefix to set
+     *        the controlNamePrefix to set
      */
     public void setControlNamePrefix(String controlNamePrefix) {
         this.controlNamePrefix = controlNamePrefix;
@@ -397,7 +384,7 @@
 
     /**
      * @param controlNameUuid
-     *            the controlNameUuid to set
+     *        the controlNameUuid to set
      */
     public void setControlNameUuid(String controlNameUuid) {
         this.controlNameUuid = controlNameUuid;
@@ -412,7 +399,7 @@
 
     /**
      * @param propText
-     *            the propText to set
+     *        the propText to set
      */
     public void setPropText(String propText) {
         this.propText = propText;
@@ -443,7 +430,7 @@
 
     /**
      * @param event
-     *            the event to set
+     *        the event to set
      */
     public void setEvent(CldsEvent event) {
         this.event = event;
@@ -458,7 +445,7 @@
 
     /**
      * @param status
-     *            the status to set
+     *        the status to set
      */
     public void setStatus(String status) {
         this.status = status;
@@ -530,4 +517,12 @@
     public void setErrorMessageForUi(String errorMessageForUi) {
         this.errorMessageForUi = errorMessageForUi;
     }
+
+    public String getDeploymentStatusUrl() {
+        return deploymentStatusUrl;
+    }
+
+    public void setDeploymentStatusUrl(String deploymentStatusUrl) {
+        this.deploymentStatusUrl = deploymentStatusUrl;
+    }
 }
diff --git a/src/main/java/org/onap/clamp/clds/model/DcaeEvent.java b/src/main/java/org/onap/clamp/clds/model/DcaeEvent.java
index d573711..7c76af2 100644
--- a/src/main/java/org/onap/clamp/clds/model/DcaeEvent.java
+++ b/src/main/java/org/onap/clamp/clds/model/DcaeEvent.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * 
+ *
  */
 
 package org.onap.clamp.clds.model;
@@ -32,16 +32,16 @@
  */
 public class DcaeEvent {
     // this is an event we (clds) sends to dcae
-    public static final String      EVENT_CREATED        = "created";
-    public static final String      EVENT_DISTRIBUTION   = "distribute";
-    public static final String      EVENT_DEPLOYMENT     = "deployment";
-    public static final String      EVENT_UNDEPLOYMENT   = "undeployment";
-    public static final String      ARTIFACT_NAME_SUFFIX = ".yml";
+    public static final String EVENT_CREATED = "created";
+    public static final String EVENT_DISTRIBUTION = "distribute";
+    public static final String EVENT_DEPLOYMENT = "deployment";
+    public static final String EVENT_UNDEPLOYMENT = "undeployment";
+    public static final String ARTIFACT_NAME_SUFFIX = ".yml";
 
-    private String                  event;
-    private String                  serviceUUID;
-    private String                  resourceUUID;
-    private String                  artifactName;                         // controlName.yml
+    private String event;
+    private String serviceUUID;
+    private String resourceUUID;
+    private String artifactName; // controlName.yml
     private List<CldsModelInstance> instances;
 
     /**
@@ -56,7 +56,7 @@
             return CldsEvent.ACTION_CREATE;
         } else if (event.equalsIgnoreCase(EVENT_DISTRIBUTION)) {
             return CldsEvent.ACTION_DISTRIBUTE;
-        } else if (event.equalsIgnoreCase(EVENT_DEPLOYMENT) && (instances == null || instances.size() == 0)) {
+        } else if (event.equalsIgnoreCase(EVENT_DEPLOYMENT) && (instances == null || instances.isEmpty())) {
             return CldsEvent.ACTION_DEPLOY;
         } else if (event.equalsIgnoreCase(EVENT_DEPLOYMENT)) {
             return CldsEvent.ACTION_DEPLOY;
@@ -83,7 +83,7 @@
             return artifactName.substring(0, artifactName.length() - ARTIFACT_NAME_SUFFIX.length());
         } else {
             throw new BadRequestException("artifactName value not valid (expecting it to end with "
-                    + ARTIFACT_NAME_SUFFIX + "): " + artifactName);
+                + ARTIFACT_NAME_SUFFIX + "): " + artifactName);
         }
     }
 
@@ -96,7 +96,7 @@
 
     /**
      * @param event
-     *            the event to set
+     *        the event to set
      */
     public void setEvent(String event) {
         this.event = event;
@@ -111,7 +111,7 @@
 
     /**
      * @param serviceUUID
-     *            the serviceUUID to set
+     *        the serviceUUID to set
      */
     public void setServiceUUID(String serviceUUID) {
         this.serviceUUID = serviceUUID;
@@ -126,7 +126,7 @@
 
     /**
      * @param resourceUUID
-     *            the resourceUUID to set
+     *        the resourceUUID to set
      */
     public void setResourceUUID(String resourceUUID) {
         this.resourceUUID = resourceUUID;
@@ -141,7 +141,7 @@
 
     /**
      * @param artifactName
-     *            the artifactName to set
+     *        the artifactName to set
      */
     public void setArtifactName(String artifactName) {
         this.artifactName = artifactName;
@@ -154,5 +154,4 @@
     public void setInstances(List<CldsModelInstance> instances) {
         this.instances = instances;
     }
-
 }
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
index 56f9ee6..36947aa 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
@@ -93,8 +93,8 @@
     @PostConstruct
     public void loadConfiguration() throws IOException {
         BlueprintParserMappingConfiguration
-        .createFromJson(appContext.getResource(blueprintMappingFile).getInputStream()).stream()
-        .forEach(e -> bpmnMapping.put(e.getBlueprintKey(), e.getFiles()));
+            .createFromJson(appContext.getResource(blueprintMappingFile).getInputStream()).stream()
+            .forEach(e -> bpmnMapping.put(e.getBlueprintKey(), e.getFiles()));
     }
 
     @Override
@@ -102,8 +102,7 @@
         boolean alreadyInstalled = true;
         for (Entry<String, BlueprintArtifact> blueprint : csar.getMapOfBlueprints().entrySet()) {
             alreadyInstalled = alreadyInstalled
-                && (CldsModel.retrieve(cldsDao, buildModelName(csar, blueprint.getKey()), true).getId() != null)
-                ? true
+                && (CldsModel.retrieve(cldsDao, buildModelName(csar, blueprint.getKey()), true).getId() != null) ? true
                     : false;
         }
         return alreadyInstalled;
@@ -120,8 +119,8 @@
             policyScopePrefix = MODEL_NAME_PREFIX;
         }
         return policyScopePrefix + csar.getSdcCsarHelper().getServiceMetadata().getValue("name") + "_v"
-        + csar.getSdcNotification().getServiceVersion().replace('.', '_') + "_"
-        + resourceInstanceName.replaceAll(" ", "");
+            + csar.getSdcNotification().getServiceVersion().replace('.', '_') + "_"
+            + resourceInstanceName.replaceAll(" ", "");
     }
 
     @Override
@@ -218,9 +217,8 @@
     }
 
     /**
-     * This call must be done when deploying the SDC notification as this call
-     * get the latest version of the artifact (version can be specified to DCAE
-     * call)
+     * This call must be done when deploying the SDC notification as this call get
+     * the latest version of the artifact (version can be specified to DCAE call)
      *
      * @param blueprintArtifact
      * @return The DcaeInventoryResponse object containing the dcae values
@@ -239,23 +237,22 @@
         BlueprintParserFilesConfiguration configFiles) throws IOException, SdcArtifactInstallerException {
         CldsTemplate template = new CldsTemplate();
         template.setBpmnId("Sdc-Generated");
-        template.setBpmnText(
-            IOUtils.toString(appContext.getResource(configFiles.getBpmnXmlFilePath()).getInputStream()));
+        template
+            .setBpmnText(IOUtils.toString(appContext.getResource(configFiles.getBpmnXmlFilePath()).getInputStream()));
         template.setPropText(
             "{\"global\":[{\"name\":\"service\",\"value\":[\"" + blueprintArtifact.getDcaeBlueprint() + "\"]}]}");
-        template.setImageText(
-            IOUtils.toString(appContext.getResource(configFiles.getSvgXmlFilePath()).getInputStream()));
+        template
+            .setImageText(IOUtils.toString(appContext.getResource(configFiles.getSvgXmlFilePath()).getInputStream()));
         template.setName(TEMPLATE_NAME_PREFIX
             + buildModelName(csar, blueprintArtifact.getResourceAttached().getResourceInstanceName()));
         template.save(cldsDao, null);
         logger.info("Fake Clds Template created for blueprint " + blueprintArtifact.getBlueprintArtifactName()
-        + " with name " + template.getName());
+            + " with name " + template.getName());
         return template;
     }
 
     private CldsModel createFakeCldsModel(CsarHandler csar, BlueprintArtifact blueprintArtifact,
-        CldsTemplate cldsTemplate, DcaeInventoryResponse dcaeInventoryResponse)
-            throws SdcArtifactInstallerException {
+        CldsTemplate cldsTemplate, DcaeInventoryResponse dcaeInventoryResponse) throws SdcArtifactInstallerException {
         try {
             CldsModel cldsModel = new CldsModel();
             cldsModel.setName(buildModelName(csar, blueprintArtifact.getResourceAttached().getResourceInstanceName()));
@@ -274,7 +271,7 @@
             cldsModel = cldsModel.save(cldsDao, null);
             cldsModel = setModelPropText(cldsModel, blueprintArtifact, cldsTemplate);
             logger.info("Fake Clds Model created for blueprint " + blueprintArtifact.getBlueprintArtifactName()
-            + " with name " + cldsModel.getName());
+                + " with name " + cldsModel.getName());
             return cldsModel;
         } catch (TransformerException e) {
             throw new SdcArtifactInstallerException("TransformerException when decoding the BpmnText", e);
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java
index 2342e89..8e7785d 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java
@@ -248,15 +248,25 @@
         logger.debug("GET model for  modelName={}", modelName);
         CldsModel cldsModel = CldsModel.retrieve(cldsDao, modelName, false);
         isAuthorizedForVf(cldsModel);
+        // Try an update for DCAE status
         // Checking condition whether our CLDS model can call Inventory Method
-        if (cldsModel.canInventoryCall()) {
-            try {
-                // Method to call dcae inventory and invoke insert event method
+        try {
+            // Method to call dcae inventory and invoke insert event method
+            if (cldsModel.canDcaeInventoryCall()
+                && !cldsModel.getTemplateName().startsWith(CsarInstallerImpl.TEMPLATE_NAME_PREFIX)) {
                 dcaeInventoryServices.setEventInventory(cldsModel, getUserId());
-            } catch (Exception e) {
-                LoggingUtils.setErrorContext("900", "Set event inventory error");
-                logger.error("getModel set event Inventory error:" + e);
             }
+            // This is a blocking call
+            if (cldsModel.getEvent().isActionCd(CldsEvent.ACTION_DEPLOY)
+                && !CldsModel.STATUS_ACTIVE.equals(cldsModel.getStatus()) && cldsModel.getDeploymentId() != null
+                && cldsModel.getDeploymentStatusUrl() != null) {
+                checkDcaeDeploymentStatus(cldsModel, CldsEvent.ACTION_DEPLOY, false);
+                // refresh because new event may have been added
+                cldsModel = CldsModel.retrieve(cldsDao, modelName, false);
+            }
+        } catch (Exception e) {
+            LoggingUtils.setErrorContext("900", "Set event inventory error");
+            logger.error("getModel set event Inventory error:" + e);
         }
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
@@ -279,11 +289,9 @@
         logger.info("PUT bpmnText={}", cldsModel.getBpmnText());
         logger.info("PUT propText={}", cldsModel.getPropText());
         logger.info("PUT imageText={}", cldsModel.getImageText());
-        cldsModel.setName(modelName);
         fillInCldsModel(cldsModel);
-        updateAndInsertNewEvent(cldsModel.getName(), cldsModel.getControlNamePrefix(), cldsModel.getEvent(),
-            CldsEvent.ACTION_MODIFY);
         cldsModel.save(cldsDao, getUserId());
+
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
         auditLogger.info("PUT model completed");
@@ -344,10 +352,10 @@
         throws TransformerException, ParseException {
         util.entering(request, "CldsService: Process model action");
         Date startTime = new Date();
-        CldsModel retrievedModel = null;
         String errorMessage = "";
+        String actionCd = "";
         try {
-            String actionCd = action.toUpperCase();
+            actionCd = action.toUpperCase();
             SecureServicePermission permisionManage = SecureServicePermission.create(cldsPermissionTypeClManage,
                 cldsPermissionInstance, actionCd);
             isAuthorized(permisionManage);
@@ -362,9 +370,9 @@
             logger.info("PUT getTypeId={}", model.getTypeId());
             logger.info("PUT deploymentId={}", model.getDeploymentId());
             this.fillInCldsModel(model);
-            // save model to db
-            updateAndInsertNewEvent(modelName, model.getControlNamePrefix(), model.getEvent(), CldsEvent.ACTION_MODIFY);
+            // save model to db just in case
             model.save(cldsDao, getUserId());
+
             // get vars and format if necessary
             String prop = model.getPropText();
             String bpmn = model.getBpmnText();
@@ -388,54 +396,32 @@
                 logger.info("Starting Camel flow on request, result is: ", result);
             } catch (SdcCommunicationException | PolicyClientException | BadRequestException e) {
                 logger.error("Exception occured during invoking Camel process", e);
-                errorMessage=e.getMessage();
-            }
-            if (actionCd.equalsIgnoreCase(CldsEvent.ACTION_DELETE)) {
-                util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO,
-                    ONAPLogConstants.ResponseStatus.COMPLETED);
-                return new ResponseEntity<>("", HttpStatus.OK);
-            } else {
-                retrievedModel = CldsModel.retrieve(cldsDao, modelName, false);
-            }
-            if (!isTest && errorMessage.isEmpty()
-                && (actionCd.equalsIgnoreCase(CldsEvent.ACTION_SUBMIT)
-                    || actionCd.equalsIgnoreCase(CldsEvent.ACTION_RESUBMIT)
-                    || actionCd.equalsIgnoreCase(CldsEvent.ACTION_SUBMITDCAE))) {
-                if (retrievedModel.getTemplateName().startsWith(CsarInstallerImpl.TEMPLATE_NAME_PREFIX)) {
-                    // SDC artifact case
-                    logger.info("Skipping DCAE inventory call as closed loop has been created from SDC notification");
-                    DcaeEvent dcaeEvent = new DcaeEvent();
-                    dcaeEvent.setArtifactName(retrievedModel.getControlName() + ".yml");
-                    dcaeEvent.setEvent(DcaeEvent.EVENT_DISTRIBUTION);
-                    CldsEvent.insEvent(cldsDao, dcaeEvent.getControlName(), userId, dcaeEvent.getCldsActionCd(),
-                        CldsEvent.ACTION_STATE_RECEIVED, null);
-                } else {
-                    // This should be done only when the call to DCAE
-                    // has not yet been done. When CL comes from SDC
-                    // this is not required as the DCAE inventory call is done
-                    // during the CL deployment.
-                    dcaeInventoryServices.setEventInventory(retrievedModel, getUserId());
-                }
-                retrievedModel.save(cldsDao, getUserId());
+                errorMessage = e.getMessage();
             }
             // audit log
             LoggingUtils.setTimeContext(startTime, new Date());
             auditLogger.info("Process model action completed");
-
         } catch (Exception e) {
             logger.error("Exception occured during putModelAndProcessAction", e);
-            errorMessage=e.getMessage();
+            errorMessage = e.getMessage();
         }
+
         if (!errorMessage.isEmpty()) {
-            if (retrievedModel != null) {
-                retrievedModel.setErrorMessageForUi(errorMessage);
-            }
+            CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), actionCd, CldsEvent.ACTION_STATE_ERROR,
+                null);
+            // Need a refresh as new events have been inserted
+            model = CldsModel.retrieve(cldsDao, modelName, false);
+            model.setErrorMessageForUi(errorMessage);
             util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "putModelAndProcessAction failed", Level.INFO,
                 ONAPLogConstants.ResponseStatus.ERROR);
-            return new ResponseEntity<>(retrievedModel, HttpStatus.INTERNAL_SERVER_ERROR);
+            return new ResponseEntity<>(model, HttpStatus.INTERNAL_SERVER_ERROR);
+        } else {
+            // Need a refresh as new events have been inserted, could have been deleted so
+            // not blocking call
+            model = CldsModel.retrieve(cldsDao, modelName, true);
+            util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+            return new ResponseEntity<>(model, HttpStatus.OK);
         }
-        util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
-        return new ResponseEntity<>(retrievedModel, HttpStatus.OK);
     }
 
     /**
@@ -464,8 +450,8 @@
             instanceCount = dcaeEvent.getInstances().size();
         }
         String msgInfo = "event=" + dcaeEvent.getEvent() + " serviceUUID=" + dcaeEvent.getServiceUUID()
-        + " resourceUUID=" + dcaeEvent.getResourceUUID() + " artifactName=" + dcaeEvent.getArtifactName()
-        + " instance count=" + instanceCount + " isTest=" + isTest;
+            + " resourceUUID=" + dcaeEvent.getResourceUUID() + " artifactName=" + dcaeEvent.getArtifactName()
+            + " instance count=" + instanceCount + " isTest=" + isTest;
         logger.info("POST dcae event {}", msgInfo);
         if (isTest) {
             logger.warn("Ignorning test event from DCAE");
@@ -728,7 +714,7 @@
     public ResponseEntity<CldsModel> deployModel(String modelName, CldsModel model) {
         util.entering(request, "CldsService: Deploy model");
         Date startTime = new Date();
-        String errorMessage="";
+        String errorMessage = "";
         try {
             fillInCldsModel(model);
             String bpmnJson = cldsBpmnTransformer.doXslTransformToString(model.getBpmnText());
@@ -745,37 +731,21 @@
             if (model.getDeploymentId() != null && !model.getDeploymentId().isEmpty()) {
                 deploymentId = model.getDeploymentId();
             } else {
-                deploymentId = "closedLoop_" + UUID.randomUUID() + "_deploymentId";
+                model.setDeploymentId(deploymentId = "closedLoop_" + UUID.randomUUID() + "_deploymentId");
             }
-            String createNewDeploymentStatusUrl = dcaeDispatcherServices.createNewDeployment(deploymentId,
-                model.getTypeId(), modelProp.getGlobal().getDeployParameters());
-            String operationStatus = dcaeDispatcherServices.getOperationStatusWithRetry(createNewDeploymentStatusUrl);
-            if ("succeeded".equalsIgnoreCase(operationStatus)) {
-                String artifactName = model.getControlName();
-                if (artifactName != null) {
-                    artifactName = artifactName + ".yml";
-                }
-                DcaeEvent dcaeEvent = new DcaeEvent();
-                /* set dcae events */
-                dcaeEvent.setArtifactName(artifactName);
-                dcaeEvent.setEvent(DcaeEvent.EVENT_DEPLOYMENT);
-                CldsEvent.insEvent(cldsDao, dcaeEvent.getControlName(), getUserId(), dcaeEvent.getCldsActionCd(),
-                    CldsEvent.ACTION_STATE_RECEIVED, null);
-                model.setDeploymentId(deploymentId);
-                model.save(cldsDao, getUserId());
-            } else {
-                logger.info("Deploy model (" + modelName + ") failed...Operation Status is - " + operationStatus);
-                util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "DeployModel failed", Level.INFO,
-                    ONAPLogConstants.ResponseStatus.ERROR);
-                throw new HttpClientErrorException(HttpStatus.INTERNAL_SERVER_ERROR,
-                    "Deploy model (" + modelName + ") failed...Operation Status is - " + operationStatus);
-            }
-            logger.info("Deploy model (" + modelName + ") succeeded...Deployment Id is - " + deploymentId);
+            model.setDeploymentStatusUrl(dcaeDispatcherServices.createNewDeployment(deploymentId, model.getTypeId(),
+                modelProp.getGlobal().getDeployParameters()));
+            CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), CldsEvent.ACTION_DEPLOY,
+                CldsEvent.ACTION_STATE_INITIATED, null);
+            // This is a blocking call
+            checkDcaeDeploymentStatus(model, CldsEvent.ACTION_DEPLOY, true);
+
+            model.save(cldsDao, getUserId());
             // audit log
             LoggingUtils.setTimeContext(startTime, new Date());
             auditLogger.info("Deploy model completed");
         } catch (Exception e) {
-            errorMessage=e.getMessage();
+            errorMessage = e.getMessage();
             logger.error("Exception occured during deployModel", e);
         }
         if (!errorMessage.isEmpty()) {
@@ -783,9 +753,10 @@
             util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "DeployModel failed", Level.INFO,
                 ONAPLogConstants.ResponseStatus.ERROR);
             return new ResponseEntity<>(model, HttpStatus.INTERNAL_SERVER_ERROR);
+        } else {
+            util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+            return new ResponseEntity<>(model, HttpStatus.OK);
         }
-        util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
-        return new ResponseEntity<>(model, HttpStatus.OK);
     }
 
     public ResponseEntity<CldsModel> unDeployModel(String modelName, CldsModel model) {
@@ -797,30 +768,15 @@
                 cldsPermissionInstance, CldsEvent.ACTION_UNDEPLOY);
             isAuthorized(permisionManage);
             isAuthorizedForVf(model);
-            String operationStatusUndeployUrl = dcaeDispatcherServices.deleteExistingDeployment(model.getDeploymentId(),
-                model.getTypeId());
-            String operationStatus = dcaeDispatcherServices.getOperationStatusWithRetry(operationStatusUndeployUrl);
-            if ("succeeded".equalsIgnoreCase(operationStatus)) {
-                String artifactName = model.getControlName();
-                if (artifactName != null) {
-                    artifactName = artifactName + ".yml";
-                }
-                DcaeEvent dcaeEvent = new DcaeEvent();
-                // set dcae events
-                dcaeEvent.setArtifactName(artifactName);
-                dcaeEvent.setEvent(DcaeEvent.EVENT_UNDEPLOYMENT);
-                CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), dcaeEvent.getCldsActionCd(),
-                    CldsEvent.ACTION_STATE_RECEIVED, null);
-                model.setDeploymentId(null);
-                model.save(cldsDao, getUserId());
-            } else {
-                logger.info("Undeploy model (" + modelName + ") failed...Operation Status is - " + operationStatus);
-                util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "UndeployModel failed", Level.INFO,
-                    ONAPLogConstants.ResponseStatus.ERROR);
-                throw new HttpClientErrorException(HttpStatus.INTERNAL_SERVER_ERROR,
-                    "Undeploy model (" + modelName + ") failed...Operation Status is - " + operationStatus);
-            }
-            logger.info("Undeploy model (" + modelName + ") succeeded.");
+            model.setDeploymentStatusUrl(
+                dcaeDispatcherServices.deleteExistingDeployment(model.getDeploymentId(), model.getTypeId()));
+            CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), CldsEvent.ACTION_UNDEPLOY,
+                CldsEvent.ACTION_STATE_INITIATED, null);
+            // This is a blocking call
+            checkDcaeDeploymentStatus(model, CldsEvent.ACTION_UNDEPLOY, true);
+            // clean the deployment ID
+            model.setDeploymentId(null);
+            model.save(cldsDao, getUserId());
             // audit log
             LoggingUtils.setTimeContext(startTime, new Date());
             auditLogger.info("Undeploy model completed");
@@ -833,9 +789,32 @@
             util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "UndeployModel failed", Level.INFO,
                 ONAPLogConstants.ResponseStatus.ERROR);
             return new ResponseEntity<>(model, HttpStatus.INTERNAL_SERVER_ERROR);
+        } else {
+            util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+            return new ResponseEntity<>(model, HttpStatus.OK);
         }
-        util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
-        return new ResponseEntity<>(model, HttpStatus.OK);
+    }
+
+    private void checkDcaeDeploymentStatus(CldsModel model, String cldsEvent, boolean withRetry)
+        throws InterruptedException {
+        String operationStatus = withRetry
+            ? dcaeDispatcherServices.getOperationStatusWithRetry(model.getDeploymentStatusUrl())
+            : dcaeDispatcherServices.getOperationStatus(model.getDeploymentStatusUrl());
+        if ("succeeded".equalsIgnoreCase(operationStatus)) {
+            logger.info(cldsEvent + " model (" + model.getName() + ") succeeded...Deployment Id is - "
+                + model.getDeploymentId());
+            CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), cldsEvent,
+                CldsEvent.ACTION_STATE_COMPLETED, null);
+        } else {
+            String info = "DCAE " + cldsEvent + " (" + model.getName() + ") failed...Operation Status is - "
+                + operationStatus;
+            logger.info(info);
+            CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), cldsEvent, CldsEvent.ACTION_STATE_ERROR,
+                null);
+            util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "DCAE operation(" + cldsEvent + ") failed",
+                Level.INFO, ONAPLogConstants.ResponseStatus.ERROR);
+            throw new HttpClientErrorException(HttpStatus.INTERNAL_SERVER_ERROR, info);
+        }
     }
 
     private void checkForDuplicateServiceVf(String modelName, String modelPropText) throws IOException {
@@ -853,28 +832,13 @@
                     if (!modelName.equalsIgnoreCase(cldsModelProp.getName()) && service.equalsIgnoreCase(currentService)
                         && resourceVf.get(0).equalsIgnoreCase(currentVf.get(0))) {
                         throw new BadRequestException("Same Service/VF already exists in " + cldsModelProp.getName()
-                        + " model, please select different Service/VF.");
+                            + " model, please select different Service/VF.");
                     }
                 }
             }
         }
     }
 
-    private void updateAndInsertNewEvent(String cldsModelName, String cldsControlNamePrfx, CldsEvent event,
-        String newAction) {
-        // If model action is in submit/resubmit/distributed and user try
-        // to save then we are changing action back to create.
-        if (event != null && (CldsEvent.ACTION_SUBMIT.equalsIgnoreCase(event.getActionCd())
-            || CldsEvent.ACTION_RESUBMIT.equalsIgnoreCase(event.getActionCd())
-            || CldsEvent.ACTION_DISTRIBUTE.equalsIgnoreCase(event.getActionCd()))) {
-            CldsEvent newEvent = new CldsEvent();
-            newEvent.setUserid(getUserId());
-            newEvent.setActionCd(newAction);
-            newEvent.setActionStateCd(CldsEvent.ACTION_STATE_COMPLETED);
-            cldsDao.insEvent(cldsModelName, cldsControlNamePrfx, null, newEvent);
-        }
-    }
-
     // Created for the integration test
     public void setLoggingUtil(LoggingUtils utilP) {
         util = utilP;
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml
index e84c686..2103b4a 100644
--- a/src/main/resources/clds/camel/routes/flexible-flow.xml
+++ b/src/main/resources/clds/camel/routes/flexible-flow.xml
@@ -4,6 +4,7 @@
 				<choice>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'SUBMIT' || ${exchangeProperty.actionCd} == 'RESUBMIT'</simple>
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
 								<to uri="bean:org.onap.clamp.clds.client.TcaPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDelegate" />
 								<delay>
@@ -11,10 +12,11 @@
 								</delay>
 								<to uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
-								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
 						</when>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'DELETE'</simple>
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
 								<to uri="bean:org.onap.clamp.clds.client.TcaPolicyDeleteDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDeleteDelegate" />
 								<delay>
@@ -24,10 +26,11 @@
 										uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.ModelDeleteDelegate" />
-								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
 						</when>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'UPDATE'</simple>
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
 								<to uri="bean:org.onap.clamp.clds.client.TcaPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDelegate" />
 								<delay>
@@ -35,20 +38,22 @@
 								</delay>
 								<to uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
-								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
 						</when>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'STOP'</simple>
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
 								<to
 										uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" />
-								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
 						</when>
 						<when>
 								<simple> ${exchangeProperty.actionCd} == 'RESTART'</simple>
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" />
 								<to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" />
 								<to uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" />
-								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate" />
+								<to uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" />
 						</when>
 				</choice>
 		</route>
diff --git a/src/test/java/org/onap/clamp/clds/model/CldsModelTest.java b/src/test/java/org/onap/clamp/clds/model/CldsModelTest.java
index 6ebdc4b..0a60185 100644
--- a/src/test/java/org/onap/clamp/clds/model/CldsModelTest.java
+++ b/src/test/java/org/onap/clamp/clds/model/CldsModelTest.java
@@ -18,7 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * 
+ *
  */
 
 package org.onap.clamp.clds.model;
@@ -78,14 +78,14 @@
         cldsModel.getEvent().setActionCd(CldsEvent.ACTION_SUBMIT);
         cldsModel.validateAction(CldsEvent.ACTION_RESUBMIT);
         try {
-            cldsModel.validateAction(CldsEvent.ACTION_DEPLOY);
+            cldsModel.validateAction(CldsEvent.ACTION_RESTART);
             fail("Exception should have been sent");
         } catch (IllegalArgumentException e) {
             logger.error("Exception caught IllegalArgumentException as expected", e);
         }
         cldsModel.getEvent().setActionCd(CldsEvent.ACTION_RESUBMIT);
         cldsModel.validateAction(CldsEvent.ACTION_RESUBMIT);
-        cldsModel.validateAction(CldsEvent.ACTION_DEPLOY);
+        cldsModel.validateAction(CldsEvent.ACTION_RESTART);
         fail("Exception should have been sent");
     }
 
