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>
