diff --git a/appc-dg/appc-dg-shared/appc-dg-common/pom.xml b/appc-dg/appc-dg-shared/appc-dg-common/pom.xml
index 6ad4591..ae59b07 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/pom.xml
+++ b/appc-dg/appc-dg-shared/appc-dg-common/pom.xml
@@ -17,18 +17,25 @@
 		</dependency>
 		<dependency>
 			<groupId>org.openecomp.appc</groupId>
-			<artifactId>appc-dmaap-adapter-bundle</artifactId>
+			<artifactId>appc-message-adapter-api</artifactId>
 			<version>${project.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.openecomp.appc</groupId>
+			<artifactId>appc-message-adapter-factory</artifactId>
+			<version>${project.version}</version>
+			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.openecomp.sdnc.core</groupId>
 			<artifactId>sli-common</artifactId>
-			<scope>compile</scope>
+			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.openecomp.sdnc.core</groupId>
 			<artifactId>sli-provider</artifactId>
-			<scope>compile</scope>
+			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>junit</groupId>
@@ -43,13 +50,11 @@
 		<dependency>
 			<groupId>org.powermock</groupId>
 			<artifactId>powermock-api-mockito</artifactId>
-			<version>1.6.2</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.powermock</groupId>
 			<artifactId>powermock-module-junit4</artifactId>
-			<version>1.6.2</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
@@ -57,6 +62,31 @@
 			<artifactId>powermock-api-easymock</artifactId>
 			<version>1.6.2</version>
 		</dependency>
+		<dependency>
+			<groupId>org.openecomp.appc</groupId>
+			<artifactId>appc-dg-dependency-model</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.openecomp.appc</groupId>
+			<artifactId>appc-ranking-framework-lib</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.openecomp.appc</groupId>
+			<artifactId>appc-data-access-lib</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+   		<dependency>
+			<groupId>equinoxSDK381</groupId>
+			<artifactId>org.eclipse.osgi</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.openecomp.appc</groupId>
+			<artifactId>appc-dg-mdsal-store</artifactId>
+			<version>${project.version}</version>
+		</dependency>
 	</dependencies>
 
 	<build>
@@ -70,8 +100,11 @@
 						<Bundle-SymbolicName>appc-dg-common</Bundle-SymbolicName>
 						<Export-Package>org.openecomp.appc.dg.common,org.openecomp.appc.dg.common.objects,org.openecomp.appc.dg.common.utils</Export-Package>
 						<Private-Package>org.openecomp.appc.dg.common.impl.*</Private-Package>
-						<Import-Package>!org.apache.log,!org.apache.commons.logging,!groovy.lang,!javax.jms,!org.codehaus.commons.compiler,!org.codehaus.groovy.*,!org.codehaus.janino,!com.ibm.icu.*,!com.sun.faces.*,!org.jasypt.*,*;resolution:=optional</Import-Package>
-						<Embed-Dependency>appc-common,eelf-core,logback-core,logback-classic;scope=compile|runtime;inline=false</Embed-Dependency>
+						<Import-Package>org.openecomp.appc.adapter.message.*,org.openecomp.appc.adapter.factory.*,org.openecomp.appc.adapter.messaging.*,
+							*;resolution:=optional</Import-Package>
+						<Embed-Dependency>appc-dg-mdsal-store,appc-dg-domain-model-lib,appc-dg-dependency-model,jackson-dataformat-yaml,jackson-databind;scope=compile|runtime;inline=false;artifactId=!org.eclipse.osgi</Embed-Dependency>
+
+						<!--Embed-Dependency>eelf-core,logback-core,logback-classic;scope=compile|runtime;inline=false</Embed-Dependency-->
 						<Embed-Transitive>true</Embed-Transitive>
 					</instructions>
 				</configuration>
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/DgResolverPlugin.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/DgResolverPlugin.java
new file mode 100644
index 0000000..e2fabaa
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/DgResolverPlugin.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common;
+
+import org.openecomp.appc.exceptions.APPCException;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
+
+import java.util.Map;
+
+public interface DgResolverPlugin extends SvcLogicJavaPlugin {
+    void resolveDg(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/IntermediateMessageSender.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/IntermediateMessageSender.java
new file mode 100644
index 0000000..f391c36
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/IntermediateMessageSender.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common;
+
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
+
+import java.util.Map;
+
+/**
+ * This interface provides api for sending intermediate messages from DG to initiator
+ */
+public interface IntermediateMessageSender extends SvcLogicJavaPlugin{
+
+    /**
+     * DG plugin which sends intermediate messages generated from DG to the initiator
+     * @param params expects 1. code, (mandatory)
+     *                       2. message, (mandatory)
+     *                       3. payload,
+     *                       4. prefix
+     * @param context expects 1. input.common-header.timestamp,
+     *                2. input.common-header.api-ver,
+     *                3. input.common-header.originator-id,
+     *                4. input.common-header.request-id, (mandatory)
+     *                5. input.common-header.sub-request-id,
+     *                6. input.action
+     */
+    void sendMessage(Map<String, String> params, SvcLogicContext context);
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/JsonDgUtil.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/JsonDgUtil.java
index 2b3fbf7..ecdaea0 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/JsonDgUtil.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/JsonDgUtil.java
@@ -30,4 +30,22 @@
 
 public interface JsonDgUtil extends SvcLogicJavaPlugin {
     void flatAndAddToContext(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
+
+    void generateOutputPayloadFromContext(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
+
+    /**
+     * Creates filename and content in Json format.
+     * @param params
+     * @param ctx
+     * @throws APPCException
+     */
+    void cvaasFileNameAndFileContentToContext(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
+
+    /**
+     * Checks if a file is created.
+     * @param params
+     * @param ctx
+     * @throws APPCException
+     */
+    void checkFileCreated(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
 }
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/OutputMessagePlugin.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/OutputMessagePlugin.java
new file mode 100644
index 0000000..35e7b22
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/OutputMessagePlugin.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common;
+
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
+
+import java.util.Map;
+
+import org.openecomp.appc.exceptions.APPCException;
+
+public interface OutputMessagePlugin extends SvcLogicJavaPlugin {
+
+      void outputMessageBuilder(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
+
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VNFCDgResolverPlugin.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VNFCDgResolverPlugin.java
new file mode 100644
index 0000000..0dd7999
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VNFCDgResolverPlugin.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common;
+
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
+
+import java.util.Map;
+
+import org.openecomp.appc.exceptions.APPCException;
+
+
+public interface VNFCDgResolverPlugin extends SvcLogicJavaPlugin {
+    void resolveVNFCDg(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VNFConfigurator.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VNFConfigurator.java
new file mode 100644
index 0000000..57acf52
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VNFConfigurator.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common;
+
+import org.openecomp.appc.exceptions.APPCException;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
+
+import java.util.Map;
+/**
+ * DG plugin created for VNF configuration operation to store data in MD-SAL store
+ **/
+public interface VNFConfigurator extends SvcLogicJavaPlugin{
+    /**
+     * it is invoked from the DG, and it performs following operations
+     * 1. checks whether given yang module is present in the MD-SAL store
+     * 2. if it is absent, loads it into MD-SAL store
+     * 3. Stores the VNF configuration into MD-SAL store
+     * @param params should have 1. uniqueId, 2. yang, 3.configJSON, 4.requestId
+     * @param context - DG context
+     * @throws APPCException
+     */
+    void storeConfig(Map<String, String> params, SvcLogicContext context) throws APPCException;
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VnfExecutionFlow.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VnfExecutionFlow.java
new file mode 100644
index 0000000..f69985f
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/VnfExecutionFlow.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common;
+
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
+
+import java.util.Map;
+
+public interface VnfExecutionFlow extends SvcLogicJavaPlugin {
+    void getVnfExecutionFlowData(Map<String,String> params, SvcLogicContext context);
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/AbstractResolver.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/AbstractResolver.java
new file mode 100644
index 0000000..1d7766f
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/AbstractResolver.java
@@ -0,0 +1,114 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.rankingframework.RankedAttributesResolver;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+abstract class AbstractResolver {
+
+    private static final EELFLogger logger = EELFManager.getInstance().getLogger(AbstractResolver.class);
+
+    private long interval;
+
+    private volatile long lastUpdate = 0l;
+    private volatile boolean isUpdateInProgress = false;
+    private volatile RankedAttributesResolver<FlowKey> dgResolver;
+
+    private final ReentrantLock INIT_LOCK = new ReentrantLock();
+
+    AbstractResolver(int interval) {
+        this.interval = interval * 1000;
+    }
+
+    private RankedAttributesResolver<FlowKey> createResolver(String resolverType) {
+        AbstractResolverDataReader reader = ResolverDataReaderFactory.createResolverDataReader(resolverType);
+        return reader.read();
+    }
+
+    private boolean isExpired() {
+        return (System.currentTimeMillis() - lastUpdate) > interval;
+    }
+
+    protected RankedAttributesResolver<FlowKey> resolver(String resolverType) {
+
+        /*
+         * In general case, the method implementation is non-blocking. The first
+         * thread that identifies data expiration will be used to refresh it. In
+         * meanwhile, any other thread will get the old instance without waiting
+         * for the updated one. The only exception is the very first time when
+         * previous instance doesn't exist - in such a cases all the threads
+         * will be waiting on INIT_LOCK while one of them initializes the
+         * resolver instance. NOTE: The initialization is intentionally
+         * implemented in lazy manner to make sure the bundle is initialized
+         * properly on startup regardless whether or not the data is correct.
+         * Afterwards, the resolver may be instantiated as many times as needed.
+         */
+
+        try {
+
+            if (dgResolver == null) {
+                INIT_LOCK.lock();
+                if (dgResolver != null) {
+                    INIT_LOCK.unlock();
+                }
+            }
+
+            if (!isUpdateInProgress && isExpired()) {
+
+                boolean doUpgrade = false;
+
+                synchronized (this) {
+                    if (!isUpdateInProgress) {
+                        isUpdateInProgress = true;
+                        doUpgrade = true;
+                    }
+                }
+
+                if (doUpgrade) {
+
+                    logger.info("DG resolver configuration data has expired - initiating refresh");
+
+                    try {
+                        RankedAttributesResolver<FlowKey> temp = createResolver(resolverType);
+                        dgResolver = temp;
+                        lastUpdate = System.currentTimeMillis();
+
+                        logger.info("DG resolver configuration data has been refreshed successfully");
+                    } finally {
+                        isUpdateInProgress = false;
+                    }
+                }
+            }
+        } finally {
+            if (INIT_LOCK.isHeldByCurrentThread()) {
+                INIT_LOCK.unlock();
+            }
+        }
+
+        return dgResolver;
+    }
+    protected abstract FlowKey resolve(final String...args);
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/AbstractResolverDataReader.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/AbstractResolverDataReader.java
new file mode 100644
index 0000000..edfc8f4
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/AbstractResolverDataReader.java
@@ -0,0 +1,127 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.dao.util.DBUtils;
+import org.openecomp.appc.rankingframework.AbstractRankedAttributesResolverFactory;
+import org.openecomp.appc.rankingframework.ConfigurationEntry;
+import org.openecomp.appc.rankingframework.ConfigurationSet;
+import org.openecomp.appc.rankingframework.RankedAttributesResolver;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.Iterator;
+
+abstract class AbstractResolverDataReader {
+
+    private  class ConfigurationSetAdaptor implements ConfigurationSet<FlowKey> {
+
+        private final ResultSet resultSet;
+
+        private class ResultSetIterator implements Iterator<ConfigurationEntry<FlowKey>>, ConfigurationEntry<FlowKey> {
+            @Override
+            public boolean hasNext() {
+                try {
+                    return resultSet.next();
+                } catch (SQLException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+
+            @Override
+            public ConfigurationEntry<FlowKey> next() {
+                return this;
+            }
+
+            @Override
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+
+            @Override
+            public Object getAttributeValue(String name) {
+                try {
+                    return resultSet.getObject(name);
+                } catch (SQLException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+
+            @Override
+            public FlowKey getResult() {
+                try {
+                    return new FlowKey(resultSet.getString("dg_name"), resultSet.getString("dg_version"), resultSet.getString("dg_module"));
+                } catch (SQLException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
+
+        ConfigurationSetAdaptor(ResultSet resultSet) {
+            this.resultSet = resultSet;
+        }
+
+        @Override
+        public Iterable<ConfigurationEntry<FlowKey>> getEntries() {
+            return new Iterable<ConfigurationEntry<FlowKey>>() {
+
+                @Override
+                public Iterator<ConfigurationEntry<FlowKey>> iterator() {
+                    return new ResultSetIterator();
+                }
+            };
+        }
+
+        @Override
+        public Collection<String> getRankedAttributeNames() {
+            return getAttributeNames();
+        }
+    }
+
+    protected abstract Collection<String> getAttributeNames();
+    protected abstract String getQueryStmt();
+
+
+
+    RankedAttributesResolver<FlowKey> read() {
+        try {
+            try (Connection conn = DBUtils.getConnection("sdnctl")) {
+                try (PreparedStatement stmt = conn.prepareStatement(getQueryStmt())) {
+                    try (ResultSet res = stmt.executeQuery()) {
+                        if (res.next()) {
+                            res.beforeFirst();
+                            ConfigurationSet<FlowKey> resolverConfig = new ConfigurationSetAdaptor(res);
+                            return AbstractRankedAttributesResolverFactory.getInstance().create(resolverConfig);
+                        } else {
+                            throw new IllegalStateException();
+                        }
+                    }
+                }
+            }
+        } catch (SQLException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/Constants.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/Constants.java
index 92d23e3..3a5bb91 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/Constants.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/Constants.java
@@ -27,15 +27,35 @@
 
     public static final String DG_ERROR_FIELD_NAME = "org.openecomp.appc.dg.error";
     public static final String DG_OUTPUT_STATUS_MESSAGE = "output.status.message";
+    public static final String EVENT_MESSAGE = "event-message";
+    public static final String ATTRIBUTE_ERROR_MESSAGE = "error-message";
+    public static final String ATTRIBUTE_SUCCESS_MESSAGE = "success-message";
+    public static final String DG_ERROR_CODE = "output.status.dgerror.code";
     public static final String API_VERSION_FIELD_NAME = "org.openecomp.appc.apiversion";
     public static final String REQ_ID_FIELD_NAME = "org.openecomp.appc.reqid";
     public static final String PAYLOAD = "payload";
+    public static final String OUTPUT_PAYLOAD = "output.payload";
+
+    //Added for VnfExecution Flow
+    public static final String FLOW_STRATEGY = "FlowStrategy" ;
+    public static final String DEPENDENCY_TYPE = "DependencyType";
+    public static final String VNF_TYPE = "vnfType";
+    public static final String VNF_VERION = "vnfVersion";
+
+
+    public static final String APPC_INSTANCE_ID= "appc-instance-id";
+
+    //Added for Cvaas
+    public static final String CVAAS_DIRECTORY_PATH = "cvaas-directory-path";
+    public static final String CVAAS_FILE_NAME = "cvaas-file-name";
+    public static final String CVAAS_FILE_CONTENT = "cvaas-file-content";
 
     enum LegacyAttributes {
         Action("org.openecomp.appc.action"),
         VMID("org.openecomp.appc.vmid"),
         IdentityURL("org.openecomp.appc.identity.url"),
-        TenantID("org.openecomp.appc.tenant.id");
+        TenantID("org.openecomp.appc.tenant.id"),
+        SkipHypervisorCheck("org.openecomp.appc.skiphypervisorcheck");
 
         private String value;
         LegacyAttributes(String value) {this.value = value;}
@@ -47,11 +67,30 @@
         Payload("input.payload"),
         VMID("vm-id"),
         IdentityURL("identity-url"),
-        TenantID("tenant.id");
+        TenantID("tenant.id"),
+        SkipHypervisorCheck("skip-hypervisor-check");
 
         private String value;
         LCMAttributes(String value) {this.value = value;}
         String getValue() {return value;}
     };
 
+    // DG Resolver Constants
+    public static final String IN_PARAM_VNF_TYPE = "vnfType";
+    public static final String IN_PARAM_VNFC_TYPE = "vnfcType";
+    public static final String IN_PARAM_ACTION = "action";
+    public static final String IN_PARAM_API_VERSION = "api-ver";
+
+    public static final String OUT_PARAM_DG_NAME = "dg_name";
+    public static final String OUT_PARAM_DG_VERSION= "dg_version";
+    public static final String OUT_PARAM_DG_MODULE = "dg_module";
+
+    public static final String TABLE_NAME = "VNFC_DG_MAPPING";
+    public static final String TABLE_COLUMN_VNF_TYPE = "VNF_TYPE";
+    public static final String TABLE_COLUMN_VNFC_TYPE = "VNFC_TYPE";
+    public static final String TABLE_COLUMN_ACTION = "ACTION";
+    public static final String TABLE_COLUMN_API_VERSION = "API_VERSION";
+    public static final String TABLE_COLUMN_DG_NAME = "DG_NAME";
+    public static final String TABLE_COLUMN_DG_VERSION= "DG_VERSION";
+    public static final String TABLE_COLUMN_DG_MODULE = "DG_MODULE";
 }
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/DCAEReporterPluginImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/DCAEReporterPluginImpl.java
index 4458de1..8081a6f 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/DCAEReporterPluginImpl.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/DCAEReporterPluginImpl.java
@@ -22,11 +22,11 @@
 package org.openecomp.appc.dg.common.impl;
 
 import org.apache.commons.lang3.StringUtils;
-import org.openecomp.appc.adapter.dmaap.EventSender;
-import org.openecomp.appc.adapter.dmaap.DmaapDestination;
-import org.openecomp.appc.adapter.dmaap.event.EventHeader;
-import org.openecomp.appc.adapter.dmaap.event.EventMessage;
-import org.openecomp.appc.adapter.dmaap.event.EventStatus;
+import org.openecomp.appc.adapter.message.EventSender;
+import org.openecomp.appc.adapter.message.MessageDestination;
+import org.openecomp.appc.adapter.message.event.EventHeader;
+import org.openecomp.appc.adapter.message.event.EventMessage;
+import org.openecomp.appc.adapter.message.event.EventStatus;
 import org.openecomp.appc.dg.common.DCAEReporterPlugin;
 import org.openecomp.appc.exceptions.APPCException;
 import org.openecomp.sdnc.sli.SvcLogicContext;
@@ -48,74 +48,108 @@
 
     @Override
     public void report(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
-        Integer errorReportCode = 501;
-        boolean bwcMode = Boolean.parseBoolean(ctx.getAttribute("isBwcMode"));
         String errorDescription,apiVersion,eventId ;
-        errorDescription = getErrorDescriptionAndAddToCtx(bwcMode,params,ctx);
-        if(!bwcMode){
-            apiVersion = ctx.getAttribute("input.common-header.api-ver");
-            eventId = ctx.getAttribute("input.common-header.request-id");
-        }else {
-            apiVersion = ctx.getAttribute(Constants.API_VERSION_FIELD_NAME);
-            eventId = ctx.getAttribute(Constants.REQ_ID_FIELD_NAME);
-        }
 
-        EventMessage eventMessage = new EventMessage(new EventHeader((new java.util.Date()).toString(), apiVersion, eventId), new EventStatus(errorReportCode, errorDescription));
-        eventSender.sendEvent(DmaapDestination.DCAE, eventMessage);
-    }
-
-    private String getErrorDescriptionAndAddToCtx(boolean bwcMode, Map<String, String> params, SvcLogicContext ctx) {
-        String errorDescription;
-        if(!bwcMode) {
-            errorDescription = params.get(Constants.DG_OUTPUT_STATUS_MESSAGE);
-            if(StringUtils.isEmpty(errorDescription)) {
-                errorDescription = ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE);
-            }else {
-                addToContextIfNotContains(bwcMode,errorDescription,ctx);
-            }
-        }else{
-            errorDescription = params.get(Constants.DG_ERROR_FIELD_NAME);
-            if(StringUtils.isEmpty(errorDescription)) {
-                errorDescription = ctx.getAttribute("org.openecomp.appc.dg.error");
-            }else {
-                addToContextIfNotContains(bwcMode, errorDescription,ctx);
-            }
-        }
+        Integer errorCode = readErrorCode(params,ctx);
+        errorDescription = params.get(Constants.EVENT_MESSAGE);
 
         if(StringUtils.isEmpty(errorDescription)) {
-            errorDescription = "Unknown";
-        }
-        return errorDescription;
-    }
+            reportLegacy(params , ctx);
+        }else{
+        apiVersion = ctx.getAttribute("input.common-header.api-ver");
+        eventId = ctx.getAttribute("input.common-header.request-id");
 
-    private void addToContextIfNotContains(boolean bwcMode, String errorDescription, SvcLogicContext ctx) {
-        String errorDescriptionFromCtx;
-        if(!StringUtils.isEmpty(errorDescription)) {
-            String outputStatusMessageProperty = bwcMode ? "org.openecomp.appc.dg.error" : Constants.DG_OUTPUT_STATUS_MESSAGE;
-            errorDescriptionFromCtx = ctx.getAttribute(outputStatusMessageProperty);
-            if(StringUtils.isEmpty(errorDescriptionFromCtx)){
-                ctx.setAttribute(outputStatusMessageProperty, errorDescription);
-            }else if  (!errorDescriptionFromCtx.contains(errorDescription)){
-                ctx.setAttribute(outputStatusMessageProperty, errorDescriptionFromCtx+ " | "+ errorDescription);
+            EventMessage eventMessage = new EventMessage(new EventHeader((new java.util.Date()).toString(), apiVersion, eventId), new EventStatus(errorCode, errorDescription));
+            String eventWriteTopic = params.get("event-topic-name");
+            if(!StringUtils.isEmpty(eventWriteTopic) && eventWriteTopic!=null){
+                eventSender.sendEvent(MessageDestination.DCAE, eventMessage,eventWriteTopic);
+            }else {
+                eventSender.sendEvent(MessageDestination.DCAE, eventMessage);
             }
         }
     }
 
+    private Integer readErrorCode(Map<String, String> params, SvcLogicContext ctx) {
+        Integer errorReportCode = 501;
+        String errorCodeStr = params.get(Constants.DG_ERROR_CODE);
+        errorCodeStr = StringUtils.isEmpty(errorCodeStr)?
+                ctx.getAttribute(Constants.DG_ERROR_CODE):errorCodeStr;
+        try{
+            errorReportCode =  Integer.parseInt(errorCodeStr);
+        }
+        catch (NumberFormatException e){
+            // Ignore Exception
+        }
+        return errorReportCode;
+    }
 
     @Override
     public void reportSuccess(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
         Integer successReportCode = 500;
         String successDescription, apiVersion, eventId;
-        successDescription = params.get(Constants.DG_OUTPUT_STATUS_MESSAGE);
+        successDescription = params.get(Constants.EVENT_MESSAGE);
+
+        if(StringUtils.isEmpty(successDescription)) {
+            successDescription = params.get(Constants.DG_OUTPUT_STATUS_MESSAGE);
+        }
+
         apiVersion = ctx.getAttribute("input.common-header.api-ver");
         eventId = ctx.getAttribute("input.common-header.request-id");
-        ctx.setAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE, successDescription);
 
         if (null == successDescription) {
             successDescription = "Success";
         }
         EventMessage eventMessage = new EventMessage(new EventHeader((new java.util.Date()).toString(), apiVersion, eventId), new EventStatus(successReportCode, successDescription));
-        eventSender.sendEvent(DmaapDestination.DCAE, eventMessage);
+        String eventWriteTopic = params.get("event-topic-name");
+        if(!StringUtils.isEmpty(eventWriteTopic) && eventWriteTopic!=null){
+            eventSender.sendEvent(MessageDestination.DCAE, eventMessage,eventWriteTopic);
+        }else {
+            eventSender.sendEvent(MessageDestination.DCAE, eventMessage);
+        }
+    }
+
+    private void reportLegacy(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
+        String errorDescription,apiVersion,eventId ;
+
+        Integer errorCode = readErrorCode(params,ctx);
+        errorDescription = getErrorDescriptionAndAddToCtx(params,ctx);
+
+        apiVersion = ctx.getAttribute("input.common-header.api-ver");
+        eventId = ctx.getAttribute("input.common-header.request-id");
+
+        EventMessage eventMessage = new EventMessage(new EventHeader((new java.util.Date()).toString(), apiVersion, eventId), new EventStatus(errorCode, errorDescription));
+        String eventWriteTopic = params.get("event-topic-name");
+        if(!StringUtils.isEmpty(eventWriteTopic) && eventWriteTopic!=null){
+            eventSender.sendEvent(MessageDestination.DCAE, eventMessage,eventWriteTopic);
+        }else {
+            eventSender.sendEvent(MessageDestination.DCAE, eventMessage);
+        }
+    }
+
+    private String getErrorDescriptionAndAddToCtx(Map<String, String> params, SvcLogicContext ctx) {
+        String errorDescription;
+        errorDescription = params.get(Constants.DG_OUTPUT_STATUS_MESSAGE);
+        if(StringUtils.isEmpty(errorDescription)) {
+            errorDescription = ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE);
+        }
+        if(StringUtils.isEmpty(errorDescription)) {
+            errorDescription = "Unknown";
+        }
+        addToContextIfNotContains(errorDescription,ctx);
+        return errorDescription;
+    }
+
+    private void addToContextIfNotContains(String errorDescription, SvcLogicContext ctx) {
+        String errorDescriptionFromCtx;
+        errorDescriptionFromCtx = ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE);
+        if(StringUtils.isEmpty(errorDescriptionFromCtx)){
+            errorDescriptionFromCtx = ctx.getAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE);
+        }
+        if(StringUtils.isEmpty(errorDescriptionFromCtx)){
+            ctx.setAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE, errorDescription);
+        }else if  (!errorDescriptionFromCtx.contains(errorDescription)){
+            ctx.setAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE, errorDescriptionFromCtx+ " | "+ errorDescription);
+        }
     }
 
 }
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/DgResolverPluginImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/DgResolverPluginImpl.java
new file mode 100644
index 0000000..497cb7f
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/DgResolverPluginImpl.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.exceptions.APPCException;
+import org.openecomp.appc.i18n.Msg;
+import com.att.eelf.i18n.EELFResourceManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+
+import java.util.Map;
+
+import org.openecomp.appc.dg.common.DgResolverPlugin;
+
+public class DgResolverPluginImpl implements DgResolverPlugin {
+
+    @Override
+    public void resolveDg(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
+
+        String DGName, DGVersion, DGModule = null;
+        String prefix = params.containsKey("prefix") ? params.get("prefix") + "." : "";
+        AbstractResolver resolver = ResolverFactory.createResolver(params.get("DGResolutionType"));
+        FlowKey flowKey = null;
+        try {
+
+            if(params.get("DGResolutionType").equalsIgnoreCase("VNFC")) {
+                 flowKey = resolver.resolve(params.get(Constants.IN_PARAM_ACTION), params.get(Constants.IN_PARAM_VNF_TYPE), params.get(Constants.IN_PARAM_VNFC_TYPE), params.get(Constants.IN_PARAM_API_VERSION));
+            }else if(params.get("DGResolutionType").equalsIgnoreCase("VNF")){
+                 flowKey = resolver.resolve(params.get(Constants.IN_PARAM_ACTION), params.get(Constants.IN_PARAM_VNF_TYPE), params.get("vnfVersion"), params.get(Constants.IN_PARAM_API_VERSION));
+            }
+            if (flowKey != null) {
+                DGName = flowKey.name();
+                ctx.setAttribute(prefix + Constants.OUT_PARAM_DG_NAME, DGName);
+                DGVersion = flowKey.version();
+                ctx.setAttribute(prefix + Constants.OUT_PARAM_DG_VERSION, DGVersion);
+                DGModule = flowKey.module();
+                ctx.setAttribute(prefix + Constants.OUT_PARAM_DG_MODULE, DGModule);
+            } else {
+                throw new RuntimeException(params.get("DGResolutionType")+ " DG not found for vnf type :" + params.get(Constants.IN_PARAM_VNF_TYPE)
+                        + " vnfc type : " + params.get(Constants.IN_PARAM_VNFC_TYPE)
+                        + " action : " + params.get(Constants.IN_PARAM_ACTION)
+                        + " api version : " + params.get(Constants.IN_PARAM_API_VERSION));
+            }
+        } catch (Exception e) {
+            String msg = EELFResourceManager.format(Msg.FAILURE_RETRIEVE_VNFC_DG,params.get(Constants.IN_PARAM_VNFC_TYPE), e.getMessage());
+            ctx.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE,msg);
+            throw new RuntimeException(e);
+        }
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/FlowKey.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/FlowKey.java
new file mode 100644
index 0000000..416f907
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/FlowKey.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+class FlowKey {
+    private final String name;
+    private final String version;
+    private final String module;
+
+    FlowKey(String name, String version, String module) {
+        this.name = name;
+        this.version = version;
+        this.module = module;
+    }
+
+    String name() {
+        return name;
+    }
+
+    String version() {
+        return version;
+    }
+
+    String module() {
+        return module;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder buff = new StringBuilder(128);
+        buff.append("{");
+        buff.append("module = ").append(module);
+        buff.append(", ");
+        buff.append("name = ").append(name);
+        buff.append(", ");
+        buff.append("version = ").append(version);
+        buff.append("}");
+        return buff.toString();
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/IntermediateMessageSenderImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/IntermediateMessageSenderImpl.java
new file mode 100644
index 0000000..3732ded
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/IntermediateMessageSenderImpl.java
@@ -0,0 +1,169 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.appc.adapter.message.MessageAdapterFactory;
+import org.openecomp.appc.adapter.message.Producer;
+import org.openecomp.appc.configuration.Configuration;
+import org.openecomp.appc.configuration.ConfigurationFactory;
+import org.openecomp.appc.dg.common.IntermediateMessageSender;
+import org.openecomp.appc.exceptions.APPCException;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+public class IntermediateMessageSenderImpl implements IntermediateMessageSender {
+
+
+    private Producer producer;
+
+    private Configuration configuration;
+
+    private final EELFLogger logger = EELFManager.getInstance().getLogger(IntermediateMessageSenderImpl.class);
+
+    private static final String STATUS = "STATUS";
+    private static final String FAILURE = "FAILURE";
+    private static final String SUCCESS = "SUCCESS";
+    private static final String ERROR_MESSAGE = "ERROR_MESSAGE";
+
+    private static final String RESPONSE = "response";
+    private static final String MSO = "MSO";
+
+    public void init(){
+        configuration = ConfigurationFactory.getConfiguration();
+        Properties properties=configuration.getProperties();
+
+        String writeTopic = properties.getProperty("appc.LCM.topic.write");
+        String apiKey = properties.getProperty("appc.LCM.client.key");
+        String apiSecret = properties.getProperty("appc.LCM.client.secret");
+        String hostNames = properties.getProperty("appc.LCM.poolMembers");
+
+        logger.debug("Configuration Read : writeTopic = " + writeTopic +", " +
+                                            "hostNames = " + hostNames);
+
+        Set<String> pool = new HashSet<>();
+        if (!StringUtils.isEmpty(hostNames)) {
+            for (String name : hostNames.split(",")) {
+                pool.add(name);
+            }
+        }
+
+        BundleContext ctx = FrameworkUtil.getBundle(IntermediateMessageSenderImpl.class).getBundleContext();
+        if (ctx != null) {
+            ServiceReference svcRef = ctx.getServiceReference(MessageAdapterFactory.class.getName());
+            if (svcRef != null) {
+                producer = ((MessageAdapterFactory) ctx.getService(svcRef)).createProducer(pool, writeTopic,apiKey, apiSecret);
+            }
+        }
+    }
+
+    @Override
+    public void sendMessage(Map<String, String> params, SvcLogicContext context) {
+        String prefix = params.get("prefix");
+        prefix = StringUtils.isEmpty(prefix)? "":prefix+".";
+        try{
+            validateInputs(params,context);
+            String jsonMessage = getJsonMessage(params, context);
+            logger.debug("Constructed JSON Message : " + jsonMessage);
+            producer.post("",jsonMessage);
+            context.setAttribute(prefix + STATUS, SUCCESS);
+        }
+        catch(Exception e){
+            String errorMessage = "Error sending intermediate message to initiator " + e.getMessage();
+            context.setAttribute(prefix + STATUS, FAILURE);
+            context.setAttribute(prefix + ERROR_MESSAGE, errorMessage);
+            logger.error(errorMessage,e);
+        }
+    }
+
+    private void validateInputs(Map<String, String> params, SvcLogicContext context) throws APPCException {
+        String code = params.get("code");
+        String message = params.get("message");
+        if(StringUtils.isEmpty(code) || StringUtils.isEmpty(message)){
+            throw new APPCException("code or message is empty");
+        }
+        String requestId = context.getAttribute("input.common-header.request-id");
+        if(StringUtils.isEmpty(requestId)){
+            throw new APPCException("requestId is empty");
+        }
+    }
+
+    private String getJsonMessage(Map<String, String> params, SvcLogicContext context) {
+        ObjectMapper objectMapper = new ObjectMapper();
+
+        ObjectNode commonHeader = getCommonHeader(context);
+        ObjectNode status = getStatus(params);
+
+        ObjectNode output = objectMapper.createObjectNode();
+        output.put("common-header",commonHeader);
+        output.put("status",status);
+
+        ObjectNode body =  objectMapper.createObjectNode();
+        body.put("output",output);
+
+        ObjectNode root = objectMapper.createObjectNode();
+        root.put("type", RESPONSE);
+        root.put("rpc-name",context.getAttribute("input.action"));
+        root.put("cambria.partition", MSO);
+        root.put("correlation-id",getCorrelationId(context));
+        root.put("body",body);
+
+        return root.toString();
+    }
+
+    private String getCorrelationId(SvcLogicContext context) {
+        String requestId = context.getAttribute("input.common-header.request-id");
+        String subRequestId = context.getAttribute("input.common-header.sub-request-id");
+        return requestId + (StringUtils.isEmpty(subRequestId)?"":("-"+subRequestId));
+    }
+
+    private ObjectNode getStatus(Map<String,String> params) {
+        ObjectMapper objectMapper = new ObjectMapper();
+        ObjectNode status =  objectMapper.createObjectNode();
+        status.put("code",params.get("code"));
+        status.put("message",params.get("message"));
+        return status;
+    }
+
+    private ObjectNode getCommonHeader(SvcLogicContext context) {
+        ObjectMapper objectMapper = new ObjectMapper();
+        ObjectNode commonHeader =  objectMapper.createObjectNode();
+        commonHeader.put("api-ver",context.getAttribute("input.common-header.api-ver"));
+        commonHeader.put("timestamp",context.getAttribute("input.common-header.timestamp"));
+        commonHeader.put("originator-id",context.getAttribute("input.common-header.originator-id"));
+        commonHeader.put("request-id",context.getAttribute("input.common-header.request-id"));
+        commonHeader.put("sub-request-id",context.getAttribute("input.common-header.sub-request-id"));
+        return commonHeader;
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/JsonDgUtilImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/JsonDgUtilImpl.java
index 9519113..1ba2b5b 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/JsonDgUtilImpl.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/JsonDgUtilImpl.java
@@ -21,21 +21,36 @@
 
 package org.openecomp.appc.dg.common.impl;
 
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.commons.lang.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.openecomp.appc.dg.common.JsonDgUtil;
 import org.openecomp.appc.exceptions.APPCException;
+import org.openecomp.appc.i18n.Msg;
 import org.openecomp.appc.util.JsonUtil;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
 import org.openecomp.sdnc.sli.SvcLogicContext;
 
-import java.util.Map;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.att.eelf.i18n.EELFResourceManager;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 
 
 public class JsonDgUtilImpl implements JsonDgUtil {
     private static final EELFLogger logger = EELFManager.getInstance().getLogger(JsonDgUtilImpl.class);
 
+    private static final ThreadLocal<SimpleDateFormat> DATE_TIME_PARSER_THREAD_LOCAL = new ThreadLocal<SimpleDateFormat>() {
+        protected SimpleDateFormat initialValue() {
+            return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        }
+    };
+
     @Override
     public void flatAndAddToContext(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
 
@@ -59,8 +74,123 @@
             }
         } catch (Exception e) {
             logger.error(e.toString());
+            String msg = EELFResourceManager.format(Msg.INPUT_PAYLOAD_PARSING_FAILED,params.get(Constants.PAYLOAD));
+            ctx.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE, msg);
+            throw new APPCException(e);
+        }
+    }
+
+    @Override
+    public void generateOutputPayloadFromContext(Map<String, String> params, SvcLogicContext ctx) throws APPCException{
+        if (logger.isTraceEnabled()) {
+            logger.trace("Entering to generateOutputPayloadFromContext with SvcLogicContext = "+ObjectUtils.toString(ctx));
+        }
+
+        try {
+            Set<String> keys = ctx.getAttributeKeySet();
+            ObjectMapper objectMapper = new ObjectMapper();
+            ObjectNode JsonNode = objectMapper.createObjectNode();
+            for (String key : keys) {
+                if(key.startsWith(Constants.OUTPUT_PAYLOAD+".")){
+                    String objkey=  key.replaceFirst(Constants.OUTPUT_PAYLOAD + ".", "");
+                    if(objkey.contains("[") && objkey.contains("]")){
+                        ArrayNode arrayNode;
+                        String arrayKey = objkey.substring(0,objkey.indexOf('['));
+                        int arrayIndex = Integer.parseInt(objkey.substring(objkey.indexOf('[')+1,objkey.indexOf(']')));
+                        if(JsonNode.has(arrayKey)){
+                            arrayNode = (ArrayNode)JsonNode.get(arrayKey);
+                            arrayNode.insert(arrayIndex,ctx.getAttribute(key));
+                        }else {
+                            arrayNode = objectMapper.createArrayNode();
+                            arrayNode.insert(arrayIndex,ctx.getAttribute(key));
+                            JsonNode.put(arrayKey,arrayNode);
+                        }
+                    }else {
+                        JsonNode.put(objkey, ctx.getAttribute(key));
+                    }
+                }
+            }
+            if(JsonNode.size()>0) {
+                ctx.setAttribute(Constants.OUTPUT_PAYLOAD, objectMapper.writeValueAsString(JsonNode));
+            }
+        } catch (Exception e) {
+            logger.error(e.toString());
             ctx.setAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE, e.toString());
             throw new APPCException(e);
         }
+
+    }
+
+    @Override
+    public void cvaasFileNameAndFileContentToContext(Map<String, String> params, SvcLogicContext ctx)
+            throws APPCException {
+
+        if (logger.isTraceEnabled()) {
+            logger.trace("Entering to caasFileNameAndFileContentToContext with SvcLogicContext = "
+                    + ObjectUtils.toString(ctx));
+        }
+
+        String vnfId = null;
+        try {
+            String cvassDirectoryPath = params.get(Constants.CVAAS_DIRECTORY_PATH);
+            String appcInstanceId = params.get(Constants.APPC_INSTANCE_ID);
+
+			/*
+			 * File name
+			 */
+            vnfId = params.get("vnf-id");
+            long timestampAsLongRepresentingFileCreationTime = System.currentTimeMillis();
+
+            ctx.setAttribute(Constants.CVAAS_FILE_NAME, cvassDirectoryPath + File.separator + vnfId + "_"
+                    + timestampAsLongRepresentingFileCreationTime + "_" + appcInstanceId + ".json");
+
+			/*
+			 * File content
+			 */
+
+            String uploadDate = ctx.getAttribute("running-config.upload-date");
+            long epochUploadTimestamp = DATE_TIME_PARSER_THREAD_LOCAL.get().parse(uploadDate).getTime();
+
+            ObjectMapper objectMapper = new ObjectMapper();
+            ObjectNode jsonNode = objectMapper.createObjectNode();
+            jsonNode.put("UPLOAD_CONFIG_ID", ctx.getAttribute("running-config.upload-config-id"));
+            jsonNode.put("REQUEST_ID", ctx.getAttribute("running-config.request-id"));
+            jsonNode.put("ORIGINATOR_ID", ctx.getAttribute("running-config.originator-id"));
+            jsonNode.put("SERVICE_DESCRIPTION", ctx.getAttribute("running-config.service-description"));
+            jsonNode.put("ACTION", ctx.getAttribute("running-config.action"));
+            jsonNode.put("UPLOAD_TIMESTAMP", epochUploadTimestamp);
+            jsonNode.put("UPLOAD_DATE", uploadDate);
+            jsonNode.put("VNF_ID", vnfId);
+            jsonNode.put("VNF_NAME", ctx.getAttribute("running-config.vnf-name"));
+            jsonNode.put("VM_NAME", ctx.getAttribute("running-config.vm-name"));
+            jsonNode.put("VNF_TYPE", ctx.getAttribute("running-config.vnf-type"));
+            jsonNode.put("VNFC_TYPE", ctx.getAttribute("running-config.vnfc-type"));
+            jsonNode.put("HOST_IP_ADDRESS", ctx.getAttribute("running-config.host-ip-address"));
+            jsonNode.put("CONFIG_INDICATOR", ctx.getAttribute("running-config.config-indicator"));
+            jsonNode.put("PENDING_DELETE", ctx.getAttribute("running-config.pending-delete"));
+            jsonNode.put("CONTENT", ctx.getAttribute("running-config.content"));
+
+            ctx.setAttribute(Constants.CVAAS_FILE_CONTENT,
+                    objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonNode));
+
+        } catch (Exception e) {
+            String errorMessage = "Failed to parse create cvass file for vnf with id : " + vnfId;
+            logger.error(errorMessage, e);
+            ctx.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE, errorMessage);
+            throw new APPCException(e);
+        }
+    }
+
+    @Override
+    public void checkFileCreated(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
+        String filePath = ctx.getAttribute(Constants.CVAAS_FILE_NAME);
+        File file = new File(filePath);
+
+        if (!file.exists()) {
+            String vnfId = params.get("vnf-id");
+            String errorMessage = "Cvass file could not be created for vnf with id : " + vnfId;
+            ctx.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE, errorMessage);
+            throw new APPCException(errorMessage);
+        }
     }
 }
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/LegacyUtilImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/LegacyUtilImpl.java
index 6354b20..3ab8ee2 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/LegacyUtilImpl.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/LegacyUtilImpl.java
@@ -37,11 +37,13 @@
 
         String payloadStr = ctx.getAttribute(Constants.LCMAttributes.Payload.getValue());
         Map<String,String> payloads = JSONUtil.extractPlainValues(payloadStr,
-                        Constants.LCMAttributes.VMID.getValue(), Constants.LCMAttributes.IdentityURL.getValue(), Constants.LCMAttributes.TenantID.getValue());
+                        Constants.LCMAttributes.VMID.getValue(), Constants.LCMAttributes.IdentityURL.getValue(), Constants.LCMAttributes.TenantID.getValue(), 
+                        Constants.LCMAttributes.SkipHypervisorCheck.getValue());
 
         ctx.setAttribute(Constants.LegacyAttributes.VMID.getValue(), payloads.get(Constants.LCMAttributes.VMID.getValue()));
         ctx.setAttribute(Constants.LegacyAttributes.IdentityURL.getValue(), payloads.get(Constants.LCMAttributes.IdentityURL.getValue()));
         ctx.setAttribute(Constants.LegacyAttributes.TenantID.getValue(), payloads.get(Constants.LCMAttributes.TenantID.getValue()));
+        ctx.setAttribute(Constants.LegacyAttributes.SkipHypervisorCheck.getValue(), payloads.get(Constants.LCMAttributes.SkipHypervisorCheck.getValue()));
 
     }
 
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/OutputMessagePluginImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/OutputMessagePluginImpl.java
new file mode 100644
index 0000000..c70c754
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/OutputMessagePluginImpl.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.sdnc.sli.SvcLogicContext;
+
+import java.util.Map;
+
+import org.openecomp.appc.dg.common.OutputMessagePlugin;
+import org.openecomp.appc.exceptions.APPCException;
+
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+
+public class OutputMessagePluginImpl implements OutputMessagePlugin {
+
+    @Override
+    public void outputMessageBuilder(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
+        String errorDescription, eventDescription;
+
+        //making output.status.message
+        errorDescription = params.get(Constants.ATTRIBUTE_ERROR_MESSAGE);
+        eventDescription = params.get(Constants.EVENT_MESSAGE);
+
+        addToContextIfNotContains(errorDescription , eventDescription, ctx);
+
+        //making event-message
+
+        if (!isEmpty(eventDescription)) {
+            ctx.setAttribute(Constants.EVENT_MESSAGE, eventDescription);
+        } else {
+            ctx.setAttribute(Constants.EVENT_MESSAGE, ctx.getAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE));
+        }
+    }
+
+    public static void addToContextIfNotContains(String errorDescription, String eventDescription, SvcLogicContext ctx) {
+        if (!isEmpty(errorDescription)){
+            if (isEmpty(ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE))) {
+                ctx.setAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE, errorDescription);
+            }else if (!ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE).contains(errorDescription)) {
+                ctx.setAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE, ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE) + " | " + errorDescription);
+            }
+        }
+        if (!isEmpty(eventDescription)){
+            if (isEmpty(ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE))) {
+                ctx.setAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE, eventDescription);
+            }else if (!ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE).contains(eventDescription)) {
+                ctx.setAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE, ctx.getAttribute(Constants.DG_OUTPUT_STATUS_MESSAGE) + " | " + eventDescription);
+            }
+        }
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/ResolverDataReaderFactory.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/ResolverDataReaderFactory.java
new file mode 100644
index 0000000..9dc43ab
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/ResolverDataReaderFactory.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.configuration.Configuration;
+import org.openecomp.appc.configuration.ConfigurationFactory;
+
+public class ResolverDataReaderFactory {
+    private static final Configuration configuration = ConfigurationFactory.getConfiguration();
+    private static class ReferenceHolder{
+        private static final AbstractResolverDataReader VNFC_RESOLVER_DATA_READER = new VNFCResolverDataReader();
+
+        private static final AbstractResolverDataReader VNF_RESOLVER_DATA_READER = new VNFResolverDataReader();
+    }
+
+    public static AbstractResolverDataReader createResolverDataReader(String resolverType){
+        if(resolverType.equalsIgnoreCase("VNF")){
+            return ReferenceHolder.VNF_RESOLVER_DATA_READER;
+        }else if(resolverType.equalsIgnoreCase("VNFC")){
+            return ReferenceHolder.VNFC_RESOLVER_DATA_READER;
+        }else {
+            return null;
+        }
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/ResolverFactory.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/ResolverFactory.java
new file mode 100644
index 0000000..afc7907
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/ResolverFactory.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.configuration.Configuration;
+import org.openecomp.appc.configuration.ConfigurationFactory;
+
+public class ResolverFactory {
+    private static final Configuration configuration = ConfigurationFactory.getConfiguration();
+    private static class ReferenceHolder{
+        private static final AbstractResolver VNFC_RESOLVER = new VNFCResolver(configuration.getIntegerProperty("org.openecomp.appc.workflow.resolver.refresh_interval", 300));
+        private static final AbstractResolver VNF_RESOLVER = new VNFResolver(configuration.getIntegerProperty("org.openecomp.appc.workflow.resolver.refresh_interval", 300));
+    }
+
+    public static AbstractResolver createResolver(String resolverType){
+        if(resolverType.equalsIgnoreCase("VNF")){
+            return ReferenceHolder.VNF_RESOLVER;
+        }else if(resolverType.equalsIgnoreCase("VNFC")){
+            return ReferenceHolder.VNFC_RESOLVER;
+        }else {
+            return null;
+        }
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCDgResolverPluginImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCDgResolverPluginImpl.java
new file mode 100644
index 0000000..404d908
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCDgResolverPluginImpl.java
@@ -0,0 +1,36 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.exceptions.APPCException;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+
+import java.util.Map;
+
+public class VNFCDgResolverPluginImpl implements org.openecomp.appc.dg.common.VNFCDgResolverPlugin {
+    @Override
+    public void resolveVNFCDg(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
+        DgResolverPluginImpl dgResolverPlugin = new DgResolverPluginImpl();
+        params.put("DGResolutionType" , "VNFC");
+        dgResolverPlugin.resolveDg(params,ctx);
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCResolver.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCResolver.java
new file mode 100644
index 0000000..7c90b57
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCResolver.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.rankingframework.RankedAttributesContext;
+
+
+public class VNFCResolver extends AbstractResolver {
+    VNFCResolver(int interval) {
+        super(interval);
+    }
+
+    @Override
+    protected FlowKey resolve(String... args) {
+        if(args.length !=4){
+            throw new IllegalStateException(args.toString());
+        }
+        return resolve(args[0],args[1],args[2],args[3]);
+    }
+
+    protected FlowKey resolve(final String action, final String vnfType, final String vnfcType, final String apiVersion) {
+        RankedAttributesContext context = new RankedAttributesContext() {
+            @Override
+            public Object getAttributeValue(String name) {
+                switch (name) {
+                    case "action":
+                        return action;
+                    case "api_version":
+                        return apiVersion;
+                    case "vnf_type":
+                        return vnfType;
+                    case "vnfc_type":
+                        return vnfcType;
+                    default:
+                        throw new IllegalStateException(name);
+                }
+            }
+        };
+
+        FlowKey wfKey = resolver("VNFC").resolve(context);
+
+        return wfKey;
+    }
+}
+
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCResolverDataReader.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCResolverDataReader.java
new file mode 100644
index 0000000..b49d1fa
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFCResolverDataReader.java
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+public class VNFCResolverDataReader extends AbstractResolverDataReader {
+    @Override
+    protected Collection<String> getAttributeNames() {
+        return Arrays.asList("action","api_version", "vnf_type", "vnfc_type");
+    }
+
+    @Override
+    protected String getQueryStmt() {
+        return "select vnf_type,vnfc_type,api_version,action,dg_name,dg_version,dg_module FROM VNFC_DG_MAPPING";
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFConfiguratorImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFConfiguratorImpl.java
new file mode 100644
index 0000000..1691143
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFConfiguratorImpl.java
@@ -0,0 +1,112 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.Constants;
+import org.openecomp.appc.dg.common.VNFConfigurator;
+import org.openecomp.appc.exceptions.APPCException;
+import org.openecomp.appc.mdsal.MDSALStore;
+import org.openecomp.appc.mdsal.exception.MDSALStoreException;
+import org.openecomp.appc.mdsal.impl.MDSALStoreFactory;
+import org.openecomp.appc.mdsal.objects.BundleInfo;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.apache.commons.lang.StringUtils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+
+
+public class VNFConfiguratorImpl implements VNFConfigurator {
+
+    private static final EELFLogger logger = EELFManager.getInstance().getLogger(VNFConfiguratorImpl.class);
+    private static final String STATUS = "STATUS";
+    private static final String FAILURE = "FAILURE";
+    private static final String SUCCESS = "SUCCESS";
+    private static final String ERROR_MESSAGE = "ERROR_MESSAGE";
+
+    @Override
+    public void storeConfig(Map<String, String> params, SvcLogicContext context) throws APPCException {
+        String uniqueId = params.get("uniqueId");
+        String yang = params.get("yang");
+        String configJSON = params.get("configJSON");
+        String requestId = params.get("requestId");
+        String prefix = params.get("prefix");
+        prefix = StringUtils.isEmpty(prefix)? "":prefix+".";
+
+        MDSALStore store = MDSALStoreFactory.createMDSALStore();
+
+        logger.debug("Inputs Received : uniqueId = " + uniqueId +
+                                        " , yang = " + yang +
+                                        " , configJSON = " + configJSON +
+                                        " , requestId = " + requestId +
+                                        " , prefix = " +prefix);
+
+        try {
+
+            if(StringUtils.isEmpty(uniqueId)
+                    ||StringUtils.isEmpty(yang)
+                    || StringUtils.isEmpty(configJSON)
+                    || StringUtils.isEmpty(requestId)){
+                throw new APPCException("One or more input parameters are empty : uniqueId = " + uniqueId + " " +
+                        ", yang = " + yang +
+                        " , configJSON = " + configJSON +
+                        " , requestId = " + requestId);
+            }
+
+            Date revision = new SimpleDateFormat(Constants.YANG_REVISION_FORMAT).parse(Constants.YANG_REVISION);
+
+            boolean isYangAlreadyLoaded = store.isModulePresent(uniqueId,revision);
+
+            if(!isYangAlreadyLoaded){
+                BundleInfo bundleInfo = getBundleInfo(uniqueId);
+                store.storeYangModule(yang,bundleInfo);
+            }
+            store.storeJson(uniqueId, requestId , configJSON);
+            context.setAttribute(prefix + STATUS, SUCCESS);
+        } catch (ParseException e) {
+            String errorMessage ="Error parsing the date : " + Constants.YANG_REVISION + " into format " + Constants.YANG_REVISION_FORMAT;
+            logger.error(errorMessage,e);
+            context.setAttribute(prefix + STATUS, FAILURE);
+            context.setAttribute(prefix + ERROR_MESSAGE, errorMessage);
+            throw new APPCException(e.getMessage());
+        }catch (MDSALStoreException e){
+            String errorMessage = "Error while adding yang to MD-SAL store." + e.getMessage();
+            logger.error(errorMessage,e);
+            context.setAttribute(prefix + STATUS,FAILURE);
+            context.setAttribute(prefix + ERROR_MESSAGE, errorMessage);
+            throw new APPCException(e.getMessage());
+        }
+
+    }
+
+    private BundleInfo getBundleInfo(String uniqueId) {
+        BundleInfo bundleInfo = new BundleInfo();
+        bundleInfo.setDescription(uniqueId);
+        bundleInfo.setName(uniqueId);
+        bundleInfo.setLocation(uniqueId);
+        return bundleInfo;
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFResolver.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFResolver.java
new file mode 100644
index 0000000..b6002c6
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFResolver.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.rankingframework.RankedAttributesContext;
+
+public class VNFResolver extends AbstractResolver {
+    VNFResolver(int interval) {
+        super(interval);
+    }
+
+    @Override
+    protected FlowKey resolve(String... args) {
+        return resolve(args[0],args[1],args[2],args[3]);
+    }
+
+
+    protected FlowKey resolve(final String action, final String vnfType, final String vnfVersion, final String apiVersion) {
+        RankedAttributesContext context = new RankedAttributesContext() {
+            @Override
+            public Object getAttributeValue(String name) {
+                switch (name) {
+                    case "action":
+                        return action;
+                    case "api_version":
+                        return apiVersion;
+                    case "vnf_type":
+                        return vnfType;
+                    case "vnf_version":
+                        return vnfVersion;
+                    default:
+                        throw new IllegalStateException(name);
+                }
+            }
+        };
+
+        FlowKey wfKey = resolver("VNF").resolve(context);
+
+        return wfKey;
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFResolverDataReader.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFResolverDataReader.java
new file mode 100644
index 0000000..7d91bee
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VNFResolverDataReader.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+/**
+ * @since January 19,2017
+ */
+public class VNFResolverDataReader extends AbstractResolverDataReader {
+    @Override
+    protected Collection<String> getAttributeNames() {
+        return Arrays.asList("action","api_version", "vnf_type", "vnf_version");
+    }
+
+    @Override
+    protected String getQueryStmt() {
+        return "select vnf_type,vnf_version,api_version,action,dg_name,dg_version,dg_module FROM VNF_DG_MAPPING";
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VnfExecutionFlowImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VnfExecutionFlowImpl.java
new file mode 100644
index 0000000..e8975da
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/java/org/openecomp/appc/dg/common/impl/VnfExecutionFlowImpl.java
@@ -0,0 +1,268 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.att.eelf.i18n.EELFResourceManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+
+import java.util.*;
+
+import org.openecomp.appc.dg.common.VnfExecutionFlow;
+import org.openecomp.appc.dg.dependencymanager.DependencyManager;
+import org.openecomp.appc.dg.dependencymanager.exception.DependencyModelNotFound;
+import org.openecomp.appc.dg.dependencymanager.impl.DependencyModelFactory;
+import org.openecomp.appc.dg.flowbuilder.FlowBuilder;
+import org.openecomp.appc.dg.flowbuilder.exception.InvalidDependencyModel;
+import org.openecomp.appc.dg.flowbuilder.impl.FlowBuilderFactory;
+import org.openecomp.appc.dg.objects.*;
+import org.openecomp.appc.domainmodel.Vnf;
+import org.openecomp.appc.domainmodel.Vnfc;
+import org.openecomp.appc.domainmodel.Vserver;
+import org.openecomp.appc.i18n.Msg;
+import org.openecomp.appc.metadata.objects.DependencyModelIdentifier;
+
+public class VnfExecutionFlowImpl implements VnfExecutionFlow {
+
+    private static final EELFLogger logger = EELFManager.getInstance().getLogger(VnfExecutionFlowImpl.class);
+
+    public VnfExecutionFlowImpl(){
+
+    }
+
+    @Override
+    public void getVnfExecutionFlowData(Map<String, String> params, SvcLogicContext context) {
+        String dependencyType = params.get(Constants.DEPENDENCY_TYPE);
+        String flowStrategy = params.get(Constants.FLOW_STRATEGY);
+        DependencyModelIdentifier modelIdentifier = readDependencyModelIdentifier(params);
+        VnfcDependencyModel dependencyModel = null;
+        try {
+            validateInput(dependencyType, flowStrategy, params);
+
+            if (logger.isTraceEnabled()) {
+                logger.trace("Input received from DG Node : dependencyType = " + dependencyType +
+                        " , flowStrategy = " + flowStrategy +
+                        ", DependencyModelIdentifier = " + modelIdentifier.toString());
+            }
+
+            DependencyManager dependencyManager = DependencyModelFactory.createDependencyManager();
+
+
+            dependencyModel = dependencyManager.getVnfcDependencyModel(
+                    modelIdentifier, DependencyTypes.findByString(dependencyType));
+        } catch (DependencyModelNotFound e) {
+            String msg = EELFResourceManager.format(Msg.DEPENDENCY_MODEL_NOT_FOUND,params.get(Constants.VNF_TYPE), e.getMessage());
+            logger.error(msg);
+            context.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE,msg);
+            context.setAttribute("dependencyModelFound","false");
+            return;
+        } catch (InvalidDependencyModel e){
+            String msg = EELFResourceManager.format(Msg.INVALID_DEPENDENCY_MODEL,params.get(Constants.VNF_TYPE), e.getMessage());
+            logger.error(msg);
+            context.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE,msg);
+            throw e;
+        }catch (RuntimeException e){
+            logger.error(e.getMessage());
+            context.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE,e.getMessage());
+            throw e;
+        }
+
+
+        context.setAttribute("dependencyModelFound","true");
+        if(logger.isDebugEnabled()){
+            logger.debug("Dependency Model = " +dependencyModel);
+        }
+        logger.info("Building Inventory Model from DG context");
+        InventoryModel inventoryModel = readInventoryModel(context);
+        if(logger.isDebugEnabled()){
+            logger.debug("Inventory Model = " +inventoryModel);
+        }
+
+        if(logger.isDebugEnabled()){
+            logger.debug("Validating inventory model with dependency model");
+        }
+        try {
+            validateInventoryModelWithDependencyModel(dependencyModel, inventoryModel);
+        }catch (RuntimeException e){
+            logger.error(e.getMessage());
+            context.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE,e.getMessage());
+            throw e;
+        }
+        logger.info("Creating flow builder");
+        FlowBuilder flowBuilder = FlowBuilderFactory.getInstance().getFlowBuilder(
+                FlowStrategies.findByString(flowStrategy));
+
+        logger.info("Building Vnf flow model");
+        VnfcFlowModel flowModel = null;
+        try{
+            flowModel = flowBuilder.buildFlowModel(dependencyModel,inventoryModel);
+        }
+        catch (InvalidDependencyModel e){
+            String msg = EELFResourceManager.format(Msg.INVALID_DEPENDENCY_MODEL,params.get(Constants.VNF_TYPE), e.getMessage());
+            logger.error(msg);
+            context.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE,msg);
+            throw e;
+        }
+
+        // remove VNFCs from the flow model where vserver list is empty
+        reconcileFlowModel(flowModel);
+        populateContext(flowModel,context);
+        if(logger.isDebugEnabled()){
+            logContext(context);
+        }
+        String msg = EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE, "GetVnfExecutionFlowData","VNF ID " + params.get(Constants.VNF_TYPE));
+        context.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE, msg);
+    }
+
+    private void validateInput(String dependencyType, String flowStrategy, Map<String, String> params) {
+        DependencyTypes dependencyTypes = DependencyTypes.findByString(dependencyType);
+        if(dependencyTypes == null){
+            throw new RuntimeException("Dependency type from the input : " + dependencyType +" is invalid.");
+        }
+        FlowStrategies flowStrategies = FlowStrategies.findByString(flowStrategy);
+        if(flowStrategies == null){
+            throw new RuntimeException("Flow Strategy from the input : " + flowStrategy +" is invalid.");
+        }
+        String vnfType = params.get(Constants.VNF_TYPE);
+        if(vnfType ==null || vnfType.length() ==0){
+            throw new RuntimeException("Vnf Type is not passed in the input");
+        }
+        String vnfVersion = params.get(Constants.VNF_VERION);
+        if(vnfVersion == null || vnfVersion.length() ==0){
+            throw new RuntimeException("Vnf Version not found");
+        }
+    }
+
+    private void logContext(SvcLogicContext context) {
+        for(String key:context.getAttributeKeySet()){
+            logger.debug(key + " = " + context.getAttribute(key) + "\n" );
+        }
+    }
+
+    private void populateContext(VnfcFlowModel flowModel, SvcLogicContext context) {
+        int flowIndex=0;
+        Iterator<List<Vnfc>> iterator = flowModel.getModelIterator();
+        while (iterator.hasNext()){
+            for(Vnfc vnfc:iterator.next()){
+                context.setAttribute("vnfcFlow["+flowIndex+"].vnfcName",vnfc.getVnfcName());
+                context.setAttribute("vnfcFlow["+flowIndex+"].vnfcType",vnfc.getVnfcType());
+                context.setAttribute("vnfcFlow["+flowIndex+"].resilienceType",vnfc.getResilienceType());
+                context.setAttribute("vnfcFlow["+flowIndex+"].vmCount",Integer.toString(vnfc.getVserverList().size()));
+                int vmIndex =0;
+                for(Vserver vm :vnfc.getVserverList()){
+                    context.setAttribute("vnfcFlow["+flowIndex+"].vm["+vmIndex+"].url",vm.getUrl());
+                    vmIndex++;
+                }
+                flowIndex++;
+            }
+        }
+        context.setAttribute("vnfcFlowCount",Integer.toString(flowIndex));
+    }
+
+    private InventoryModel readInventoryModel(SvcLogicContext context) {
+        String vnfId = context.getAttribute("input.action-identifiers.vnf-id");
+        String vnfType = context.getAttribute("vnf.type");
+        String vnfVersion = context.getAttribute("vnf.version");
+        String vnfcCountStr = context.getAttribute("vnf.vnfcCount");
+        Integer vnfcCount = Integer.parseInt(vnfcCountStr);
+
+        Vnf vnf = new Vnf(vnfId,vnfType,vnfVersion);
+
+        for(Integer i=0;i<vnfcCount;i++){
+            String vnfcName = context.getAttribute("vnf.vnfc["+ i+"].name");
+            String vnfcType = context.getAttribute("vnf.vnfc["+ i+"].type");
+            String vmCountStr = context.getAttribute("vnf.vnfc["+ i+"].vm_count");
+            if(vnfcType ==null || vnfcType.length() ==0){
+                throw new RuntimeException("Could not retrieve VNFC Type from DG Context for vnf.vnfc["+ i+"].type");
+            }
+            Integer vmCount = Integer.parseInt(vmCountStr);
+            Vnfc vnfc = new Vnfc(vnfcType,null,vnfcName);
+            for(Integer j=0;j<vmCount;j++){
+                String vmURL = context.getAttribute("vnf.vnfc["+i+"].vm["+j+"].url");
+                Vserver vm = new Vserver(vmURL);
+                vnfc.addVm(vm);
+            }
+            vnf.addVnfc(vnfc);
+        }
+        return new InventoryModel(vnf);
+    }
+
+    private DependencyModelIdentifier readDependencyModelIdentifier(Map<String, String> params) {
+        String vnfType = params.get(Constants.VNF_TYPE);
+        String catalogVersion = params.get(Constants.VNF_VERION);
+        return new DependencyModelIdentifier(vnfType,catalogVersion);
+    }
+
+    private void validateInventoryModelWithDependencyModel(VnfcDependencyModel dependencyModel, InventoryModel inventoryModel) {
+        Set<String> dependencyModelVnfcSet = new HashSet<String>();
+        Set<String> dependencyModelMandatoryVnfcSet = new HashSet<String>();
+        Set<String> inventoryModelVnfcsSet = new HashSet<String>();
+
+        for (Node<Vnfc> node : dependencyModel.getDependencies()) {
+            dependencyModelVnfcSet.add(node.getChild().getVnfcType().toLowerCase());
+            if (node.getChild().isMandatory()) {
+                dependencyModelMandatoryVnfcSet.add(node.getChild().getVnfcType().toLowerCase());
+            }
+        }
+
+        for (Vnfc vnfc : inventoryModel.getVnf().getVnfcs()) {
+            inventoryModelVnfcsSet.add(vnfc.getVnfcType().toLowerCase());
+        }
+
+        // if dependency model and inventory model contains same set of VNFCs, validation succeed and hence return
+        if (dependencyModelVnfcSet.equals(inventoryModelVnfcsSet)) {
+            return;
+        }
+
+        if (inventoryModelVnfcsSet.size() >= dependencyModelVnfcSet.size()) {
+            Set<String> difference = new HashSet<String>(inventoryModelVnfcsSet);
+            difference.removeAll(dependencyModelVnfcSet);
+            logger.error("Dependency model is missing following vnfc type(s): " + difference);
+            throw new RuntimeException("Dependency model is missing following vnfc type(s): " + difference);
+        } else {
+            Set<String> difference = new HashSet<String>(dependencyModelVnfcSet);
+            difference.removeAll(inventoryModelVnfcsSet);
+            difference.retainAll(dependencyModelMandatoryVnfcSet);
+            if (difference.size() > 0) {
+                logger.error("Inventory model is missing following mandatory vnfc type(s): " + difference);
+                throw new RuntimeException("Inventory model is missing following mandatory vnfc type(s): " + difference);
+            }
+        }
+    }
+
+    private void reconcileFlowModel(VnfcFlowModel flowModel) {
+        Iterator<List<Vnfc>> flowIterator = flowModel.getModelIterator();
+        while (flowIterator.hasNext()) {
+            Iterator<Vnfc> vnfcIterator = flowIterator.next().iterator();
+            while (vnfcIterator.hasNext()) {
+                Vnfc vnfc = vnfcIterator.next();
+                if (vnfc.getVserverList().size() == 0) {
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("No vservers present for Vnfc type: " + vnfc.getVnfcType() + ". Hence, removing it from the flow model.");
+                    }
+                    vnfcIterator.remove();
+                }
+            }
+        }
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/appc-dg/appc-dg-shared/appc-dg-common/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index 53b5367..fcbaaf7 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -30,12 +30,35 @@
 	<bean id="JsonDgUtilBean" class="org.openecomp.appc.dg.common.impl.JsonDgUtilImpl"/>
     <service id="JsonDgUtil" interface="org.openecomp.appc.dg.common.JsonDgUtil" ref="JsonDgUtilBean"/>
 
-    <reference id="eventSenderRef" availability="mandatory" activation="eager" interface="org.openecomp.appc.adapter.dmaap.EventSender" />
+    <!-- <reference id="eventSenderRef" availability="mandatory" activation="eager" interface="org.openecomp.appc.adapter.message.EventSender" /> -->
 
 	<bean id="DCAEReporterPluginBean" class="org.openecomp.appc.dg.common.impl.DCAEReporterPluginImpl" scope="singleton"/>
 	<service id="DCAEReporterPlugin" interface="org.openecomp.appc.dg.common.DCAEReporterPlugin" ref="DCAEReporterPluginBean"/>
 
+	<bean id="OutputMessagePluginBean" class="org.openecomp.appc.dg.common.impl.OutputMessagePluginImpl" scope="singleton"/>
+	<service id="OutputMessagePlugin" interface="org.openecomp.appc.dg.common.OutputMessagePlugin" ref="OutputMessagePluginBean"/>
+
 	<bean id="legacyUtilBean" class="org.openecomp.appc.dg.common.impl.LegacyUtilImpl" scope="singleton"/>
 	<service id="legacyUtil" interface="org.openecomp.appc.dg.common.LegacyUtil" ref="legacyUtilBean"/>
 
+	<bean id="DgResolverPluginBean" class="org.openecomp.appc.dg.common.impl.DgResolverPluginImpl" scope="singleton">
+	</bean>
+
+	<service id="DgResolverPlugin" interface="org.openecomp.appc.dg.common.DgResolverPlugin" ref="DgResolverPluginBean"/>
+
+	<bean id="vnfExecutionFlowBean" class="org.openecomp.appc.dg.common.impl.VnfExecutionFlowImpl" scope="singleton"/>
+	<service id="vnfExecutionFlowService" interface="org.openecomp.appc.dg.common.VnfExecutionFlow" ref="vnfExecutionFlowBean"/>
+
+	<bean id="VNFCDgResolverPluginBean" class="org.openecomp.appc.dg.common.impl.VNFCDgResolverPluginImpl" scope="singleton">
+	</bean>
+
+	<service id="VNFCDgResolverPlugin" interface="org.openecomp.appc.dg.common.VNFCDgResolverPlugin" ref="VNFCDgResolverPluginBean"/>
+
+	<bean id="vnfConfiguratorBean" class="org.openecomp.appc.dg.common.impl.VNFConfiguratorImpl" scope="singleton"/>
+
+	<service id="vnfConfigurationService" interface="org.openecomp.appc.dg.common.VNFConfigurator" ref="vnfConfiguratorBean"/>
+
+	<bean id="interimMessageSender" class="org.openecomp.appc.dg.common.impl.IntermediateMessageSenderImpl" init-method="init" scope="singleton"/>
+	<service id="interimMessageSenderService" ref="interimMessageSender" interface="org.openecomp.appc.dg.common.IntermediateMessageSender"/>
+
 </blueprint>
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/DCAEReporterPluginImplTest.java b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/DCAEReporterPluginImplTest.java
index 834bd86..44b71fb 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/DCAEReporterPluginImplTest.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/DCAEReporterPluginImplTest.java
@@ -24,10 +24,9 @@
 import org.junit.*;
 import org.junit.runner.RunWith;
 import org.mockito.*;
-import org.openecomp.appc.adapter.dmaap.EventSender;
-import org.openecomp.appc.adapter.dmaap.DmaapDestination;
-import org.openecomp.appc.adapter.dmaap.event.EventMessage;
-import org.openecomp.appc.dg.common.impl.Constants;
+import org.openecomp.appc.adapter.message.EventSender;
+import org.openecomp.appc.adapter.message.MessageDestination;
+import org.openecomp.appc.adapter.message.event.EventMessage;
 import org.openecomp.appc.dg.common.impl.DCAEReporterPluginImpl;
 import org.openecomp.appc.exceptions.APPCException;
 import org.openecomp.sdnc.sli.SvcLogicContext;
@@ -44,7 +43,6 @@
 
 @RunWith(PowerMockRunner.class)
 @PrepareForTest({DCAEReporterPluginImpl.class, FrameworkUtil.class})
-@Ignore
 public class DCAEReporterPluginImplTest {
     private SvcLogicContext ctx;
     private Map<String, String> params;
@@ -75,39 +73,11 @@
 
 
 
-
-    @Test
-    public void testReportBwcTrue() throws Exception {
-
-        ctx = new SvcLogicContext();
-        params = new HashMap<>();
-        ctx.setAttribute("isBwcMode", "true");
-        params.put(Constants.DG_ERROR_FIELD_NAME, error);
-        ctx.setAttribute(Constants.API_VERSION_FIELD_NAME, apiVer);
-        ctx.setAttribute(Constants.REQ_ID_FIELD_NAME, requestId);
-
-            positiveAssert();
-    }
-
-    @Test
-    public void testReportErrorDescriptionNullBwcModeTrue() throws Exception {
-
-        ctx = new SvcLogicContext();
-        params = new HashMap<>();
-        ctx.setAttribute("isBwcMode", "true");
-        params.put(Constants.DG_ERROR_FIELD_NAME, null);
-        ctx.setAttribute(Constants.API_VERSION_FIELD_NAME, apiVer);
-        ctx.setAttribute(Constants.REQ_ID_FIELD_NAME, requestId);
-
-        errorReasonNullAssert();
-    }
-
     @Test
     public void testReportErrorDescriptionNullBwcModeFalse() throws Exception {
 
         ctx = new SvcLogicContext();
         params = new HashMap<>();
-        ctx.setAttribute("isBwcMode", "false");
         params.put("output.status.message", null);
         ctx.setAttribute("input.common-header.api-ver", apiVer);
         ctx.setAttribute("input.common-header.request-id", requestId);
@@ -118,7 +88,7 @@
 
     private void errorReasonNullAssert() throws APPCException {
         dcaeReporterPlugin.report(params, ctx);
-        DmaapDestination destination = eventSender.getDestination();
+        MessageDestination destination = eventSender.getDestination();
         EventMessage msg = eventSender.getMsg();
         Assert.assertEquals("wrong API version", apiVer, msg.getEventHeader().getApiVer());
         Assert.assertEquals("wrong requestId", requestId, msg.getEventHeader().getEventId());
@@ -130,7 +100,7 @@
 
     private void positiveAssert() throws APPCException {
         dcaeReporterPlugin.report(params, ctx);
-        DmaapDestination destination = eventSender.getDestination();
+        MessageDestination destination = eventSender.getDestination();
         EventMessage msg = eventSender.getMsg();
         Assert.assertEquals("wrong API version", apiVer, msg.getEventHeader().getApiVer());
         Assert.assertEquals("wrong requestId", requestId, msg.getEventHeader().getEventId());
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/EventSenderMock.java b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/EventSenderMock.java
index 0e6b165..8653292 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/EventSenderMock.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/EventSenderMock.java
@@ -23,19 +23,19 @@
 
 import java.util.Map;
 
-import org.openecomp.appc.adapter.dmaap.EventSender;
-import org.openecomp.appc.adapter.dmaap.DmaapDestination;
-import org.openecomp.appc.adapter.dmaap.event.EventMessage;
+import org.openecomp.appc.adapter.message.EventSender;
+import org.openecomp.appc.adapter.message.MessageDestination;
+import org.openecomp.appc.adapter.message.event.EventMessage;
 import org.openecomp.appc.exceptions.APPCException;
 import org.openecomp.sdnc.sli.SvcLogicContext;
 
 
 public class EventSenderMock implements EventSender {
     EventMessage msg;
-    DmaapDestination destination;
+    MessageDestination destination;
 
     @Override
-    public boolean sendEvent(DmaapDestination destination, EventMessage msg) {
+    public boolean sendEvent(MessageDestination destination, EventMessage msg) {
         if (destination != null && msg != null){
             this.msg = msg;
             this.destination = destination;
@@ -47,7 +47,12 @@
     }
 
     @Override
-    public boolean sendEvent(DmaapDestination destination, Map<String, String> params, SvcLogicContext ctx) throws APPCException {
+    public boolean sendEvent(MessageDestination destination, EventMessage msg, String eventTopicName) {
+        return false;
+    }
+
+    @Override
+    public boolean sendEvent(MessageDestination destination, Map<String, String> params, SvcLogicContext ctx) throws APPCException {
         return false;
     }
 
@@ -55,7 +60,7 @@
         return msg;
     }
 
-    public DmaapDestination getDestination() {
+    public MessageDestination getDestination() {
         return destination;
     }
 }
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/JsonDgUtilImplTest.java b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/JsonDgUtilImplTest.java
index 7053487..0a49d53 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/JsonDgUtilImplTest.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/JsonDgUtilImplTest.java
@@ -32,7 +32,6 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.junit.Assert.*;
 import static org.mockito.Mockito.mock;
 
 public class JsonDgUtilImplTest {
@@ -83,7 +82,7 @@
         } catch (APPCException e) {
             Assert.assertNull(ctx.getAttribute(testValueKey));
             Assert.assertNull(ctx.getAttribute(testValueKey2));
-            Assert.assertNotNull(ctx.getAttribute("output.status.message"));
+            Assert.assertNotNull(ctx.getAttribute("error-message"));
         }
 
 
@@ -142,4 +141,29 @@
         Assert.assertNull(ctx.getAttribute(testValueKey));
         Assert.assertNull(ctx.getAttribute(testValueKey2));
     }
+
+
+    @Test
+    public void testGenerateOutputPayloadFromContext() throws Exception {
+
+        JsonDgUtilImpl jsonDgUtil = new JsonDgUtilImpl();
+        String key = "output.payload";
+        String key1 = "output.payload.test-key[0]";
+        String key2 = "output.payload.test-key[1]";
+        String testValueKey1 = "value1";
+        String testValueKey2 = "value2";
+
+        String key3 = "output.payload.test-key3";
+        String testValueKey3 = "value3";
+
+        SvcLogicContext ctx = new SvcLogicContext();
+        Map<String, String> params = new HashMap<>();
+        ctx.setAttribute(key1, testValueKey1);
+        ctx.setAttribute(key2, testValueKey2);
+        ctx.setAttribute(key3, testValueKey3);
+        jsonDgUtil.generateOutputPayloadFromContext(params, ctx);
+
+        Assert.assertNotNull(ctx.getAttribute(key));
+
+    }
 }
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/TestVNFConfiguratorImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/TestVNFConfiguratorImpl.java
new file mode 100644
index 0000000..0ee0636
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/TestVNFConfiguratorImpl.java
@@ -0,0 +1,105 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import org.openecomp.appc.dg.common.VNFConfigurator;
+import org.openecomp.appc.exceptions.APPCException;
+import org.openecomp.appc.mdsal.MDSALStore;
+import org.openecomp.appc.mdsal.impl.MDSALStoreFactory;
+import org.openecomp.appc.mdsal.impl.MDSALStoreImpl;
+import org.openecomp.appc.mdsal.objects.BundleInfo;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Matchers;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({MDSALStoreImpl.class,MDSALStoreFactory.class})
+public class TestVNFConfiguratorImpl {
+
+    private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestVNFConfiguratorImpl.class);
+
+    @Before
+    public void setUp() {
+        logger.setLevel(EELFLogger.Level.DEBUG);
+    }
+
+    @Test(expected = APPCException.class)
+    public void testValidations() throws APPCException {
+        VNFConfigurator configurator = new VNFConfiguratorImpl();
+        Map<String,String> params = new HashMap<String, String>();
+        params.put("uniqueId","uniqueId");
+        params.put("yang","yang");
+        params.put("configJSON","configJSON");
+        configurator.storeConfig(params,new SvcLogicContext());
+    }
+
+    @Test
+    public void testYangPresentScenario() throws APPCException {
+
+        VNFConfigurator configurator = new VNFConfiguratorImpl();
+        PowerMockito.mockStatic(MDSALStoreFactory.class);
+        MDSALStore mdsalStore = PowerMockito.mock(MDSALStoreImpl.class);
+        PowerMockito.when(MDSALStoreFactory.createMDSALStore()).thenReturn(mdsalStore);
+        PowerMockito.when(mdsalStore.isModulePresent(Matchers.anyString(),(Date) Matchers.anyObject())).thenReturn(true);
+
+        Map<String,String> params = new HashMap<String, String>();
+        params.put("uniqueId","uniqueId");
+        params.put("yang","yang");
+        params.put("configJSON","configJSON");
+        params.put("requestId","requestId");
+        configurator.storeConfig(params,new SvcLogicContext());
+    }
+
+    @Test
+    public void testYangAbsentScenario() throws Exception {
+
+        VNFConfigurator configurator = new VNFConfiguratorImpl();
+        PowerMockito.mockStatic(MDSALStoreFactory.class);
+
+        MDSALStore mdsalStore = PowerMockito.mock(MDSALStoreImpl.class);
+
+        PowerMockito.when(MDSALStoreFactory.createMDSALStore()).thenReturn(mdsalStore);
+
+        PowerMockito.when(mdsalStore.isModulePresent(Matchers.anyString(),(Date) Matchers.anyObject())).thenReturn(false);
+
+        PowerMockito.doNothing().when(mdsalStore).storeYangModule(Matchers.anyString(),(BundleInfo)Matchers.anyObject());
+
+        Map<String,String> params = new HashMap<>();
+        params.put("uniqueId","uniqueId");
+        params.put("yang","yang");
+        params.put("configJSON","configJSON");
+        params.put("requestId","requestId");
+        configurator.storeConfig(params,new SvcLogicContext());
+
+    }
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/TestVnfExecutionFlowImpl.java b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/TestVnfExecutionFlowImpl.java
new file mode 100644
index 0000000..773b6b6
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/openecomp/appc/dg/common/impl/TestVnfExecutionFlowImpl.java
@@ -0,0 +1,417 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : APP-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * 						reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.dg.common.impl;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.openecomp.sdnc.sli.SvcLogicContext;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Matchers;
+import org.openecomp.appc.dg.common.VnfExecutionFlow;
+import org.openecomp.appc.dg.common.impl.Constants;
+import org.openecomp.appc.dg.common.impl.VnfExecutionFlowImpl;
+import org.openecomp.appc.dg.dependencymanager.DependencyManager;
+import org.openecomp.appc.dg.dependencymanager.exception.DependencyModelNotFound;
+import org.openecomp.appc.dg.dependencymanager.impl.DependencyModelFactory;
+import org.openecomp.appc.dg.flowbuilder.exception.InvalidDependencyModel;
+import org.openecomp.appc.dg.objects.DependencyTypes;
+import org.openecomp.appc.dg.objects.Node;
+import org.openecomp.appc.dg.objects.VnfcDependencyModel;
+import org.openecomp.appc.domainmodel.Vnfc;
+import org.openecomp.appc.metadata.objects.DependencyModelIdentifier;
+import org.osgi.framework.FrameworkUtil;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({TestVnfExecutionFlowImpl.class, FrameworkUtil.class,DependencyManager.class,DependencyModelFactory.class})
+public class TestVnfExecutionFlowImpl {
+
+    private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestVnfExecutionFlowImpl.class);
+
+    @Before
+    public void setUp() {
+        logger.setLevel(EELFLogger.Level.DEBUG);
+    }
+
+    @Test
+    public void testPositiveFlow() throws DependencyModelNotFound {
+        Map<String, String> params = prepareParams();
+        SvcLogicContext context = prepareContext();
+        VnfcDependencyModel dependencyModel = readDependencyModel();
+
+        PowerMockito.mockStatic(DependencyModelFactory.class);
+        DependencyManager dependencyManager = PowerMockito.mock(DependencyManager.class);
+
+        PowerMockito.when(DependencyModelFactory.createDependencyManager()).thenReturn(dependencyManager);
+        PowerMockito.when(dependencyManager.getVnfcDependencyModel((
+                DependencyModelIdentifier) Matchers.any(),(DependencyTypes) Matchers.any()))
+                .thenReturn(dependencyModel);
+
+        VnfExecutionFlow vnfExecutionFlow = new VnfExecutionFlowImpl();
+        vnfExecutionFlow.getVnfExecutionFlowData(params,context);
+    }
+
+    @Test
+    public void testComplexFlow() throws DependencyModelNotFound {
+        Map<String, String> params = prepareParams();
+        SvcLogicContext context = prepareContextForComplexDependency();
+        VnfcDependencyModel dependencyModel = readComplexDependencyModel();
+
+        PowerMockito.mockStatic(DependencyModelFactory.class);
+        DependencyManager dependencyManager = PowerMockito.mock(DependencyManager.class);
+
+        PowerMockito.when(DependencyModelFactory.createDependencyManager()).thenReturn(dependencyManager);
+        PowerMockito.when(dependencyManager.getVnfcDependencyModel((
+                DependencyModelIdentifier) Matchers.any(),(DependencyTypes) Matchers.any()))
+                .thenReturn(dependencyModel);
+
+        VnfExecutionFlow vnfExecutionFlow = new VnfExecutionFlowImpl();
+        vnfExecutionFlow.getVnfExecutionFlowData(params,context);
+    }
+
+    @Test(expected = InvalidDependencyModel.class)
+    public void testCycleFlow() throws DependencyModelNotFound {
+        Map<String, String> params = prepareParams();
+        SvcLogicContext context = prepareContextForComplexDependency();
+        VnfcDependencyModel dependencyModel = readCyclicDependencyModel();
+        PowerMockito.mockStatic(DependencyModelFactory.class);
+        DependencyManager dependencyManager = PowerMockito.mock(DependencyManager.class);
+
+        PowerMockito.when(DependencyModelFactory.createDependencyManager()).thenReturn(dependencyManager);
+        PowerMockito.when(dependencyManager.getVnfcDependencyModel((
+                DependencyModelIdentifier) Matchers.any(),(DependencyTypes) Matchers.any()))
+                .thenReturn(dependencyModel);
+
+        VnfExecutionFlow vnfExecutionFlow = new VnfExecutionFlowImpl();
+        vnfExecutionFlow.getVnfExecutionFlowData(params,context);
+    }
+
+    private VnfcDependencyModel readCyclicDependencyModel() {
+
+        Vnfc a = new Vnfc("A","Active-Passive",null);
+        Vnfc b = new Vnfc("B","Active-Active",null);
+        Vnfc c = new Vnfc("C","Active-Active",null);
+        Vnfc d = new Vnfc("D","Active-Active",null);
+        Vnfc e = new Vnfc("E","Active-Active",null);
+        Vnfc f = new Vnfc("F","Active-Active",null);
+        Vnfc g = new Vnfc("G","Active-Active",null);
+
+        Node aNode = new Node(a);
+        Node bNode = new Node(b);
+        Node cNode = new Node(c);
+        Node dNode = new Node(d);
+        Node eNode = new Node(e);
+        Node fNode = new Node(f);
+        Node gNode = new Node(g);
+
+        bNode.addParent(a);
+        cNode.addParent(a);
+        cNode.addParent(b);
+
+        bNode.addParent(d);
+        dNode.addParent(c);
+
+        Set<Node<Vnfc>> dependencies = new HashSet<>();
+        dependencies.add(aNode);
+        dependencies.add(bNode);
+        dependencies.add(cNode);
+        dependencies.add(dNode);
+        dependencies.add(eNode);
+        dependencies.add(fNode);
+        dependencies.add(gNode);
+
+        return new VnfcDependencyModel(dependencies);
+
+    }
+
+    private SvcLogicContext prepareContextForComplexDependency() {
+        SvcLogicContext context = new SvcLogicContext();
+        context.setAttribute("input.action-identifiers.vnf-id","1");
+        context.setAttribute("vnf.type","vSCP");
+        context.setAttribute("vnf.vnfcCount","7");
+
+        context.setAttribute("vnf.vnfc[0].name","A");
+        context.setAttribute("vnf.vnfc[0].type","A");
+        context.setAttribute("vnf.vnfc[0].vm_count","2");
+        context.setAttribute("vnf.vnfc[0].vm[0].url","A1");
+        context.setAttribute("vnf.vnfc[0].vm[1].url","A2");
+
+        context.setAttribute("vnf.vnfc[1].name","B");
+        context.setAttribute("vnf.vnfc[1].type","B");
+        context.setAttribute("vnf.vnfc[1].vm_count","5");
+        context.setAttribute("vnf.vnfc[1].vm[0].url","B1");
+        context.setAttribute("vnf.vnfc[1].vm[1].url","B2");
+        context.setAttribute("vnf.vnfc[1].vm[2].url","B3");
+        context.setAttribute("vnf.vnfc[1].vm[3].url","B4");
+        context.setAttribute("vnf.vnfc[1].vm[4].url","B5");
+
+        context.setAttribute("vnf.vnfc[2].name","C");
+        context.setAttribute("vnf.vnfc[2].type","C");
+        context.setAttribute("vnf.vnfc[2].vm_count","4");
+        context.setAttribute("vnf.vnfc[2].vm[0].url","C1");
+        context.setAttribute("vnf.vnfc[2].vm[1].url","C2");
+        context.setAttribute("vnf.vnfc[2].vm[2].url","C3");
+        context.setAttribute("vnf.vnfc[2].vm[3].url","C4");
+
+        context.setAttribute("vnf.vnfc[3].name","D");
+        context.setAttribute("vnf.vnfc[3].type","D");
+        context.setAttribute("vnf.vnfc[3].vm_count","3");
+        context.setAttribute("vnf.vnfc[3].vm[0].url","D1");
+        context.setAttribute("vnf.vnfc[3].vm[1].url","D2");
+        context.setAttribute("vnf.vnfc[3].vm[2].url","D3");
+
+        context.setAttribute("vnf.vnfc[4].name","E");
+        context.setAttribute("vnf.vnfc[4].type","E");
+        context.setAttribute("vnf.vnfc[4].vm_count","2");
+        context.setAttribute("vnf.vnfc[4].vm[0].url","E1");
+        context.setAttribute("vnf.vnfc[4].vm[1].url","E2");
+
+        context.setAttribute("vnf.vnfc[5].name","F");
+        context.setAttribute("vnf.vnfc[5].type","F");
+        context.setAttribute("vnf.vnfc[5].vm_count","1");
+        context.setAttribute("vnf.vnfc[5].vm[0].url","F1");
+
+        context.setAttribute("vnf.vnfc[6].name","G");
+        context.setAttribute("vnf.vnfc[6].type","G");
+        context.setAttribute("vnf.vnfc[6].vm_count","1");
+        context.setAttribute("vnf.vnfc[6].vm[0].url","G1");
+
+
+        return context;
+    }
+
+    private VnfcDependencyModel readComplexDependencyModel() {
+        Vnfc a = new Vnfc("A","Active-Passive",null);
+        Vnfc b = new Vnfc("B","Active-Active",null);
+        Vnfc c = new Vnfc("C","Active-Active",null);
+        Vnfc d = new Vnfc("D","Active-Active",null);
+        Vnfc e = new Vnfc("E","Active-Active",null);
+        Vnfc f = new Vnfc("F","Active-Active",null);
+        Vnfc g = new Vnfc("G","Active-Active",null);
+
+
+        Node aNode = new Node(a);
+        Node bNode = new Node(b);
+        Node cNode = new Node(c);
+        Node dNode = new Node(d);
+        Node eNode = new Node(e);
+        Node fNode = new Node(f);
+        Node gNode = new Node(g);
+
+        bNode.addParent(a);
+        cNode.addParent(a);
+
+        dNode.addParent(b);
+        eNode.addParent(b);
+        gNode.addParent(b);
+
+        fNode.addParent(c);
+
+        gNode.addParent(f);
+
+        Set<Node<Vnfc>> dependencies = new HashSet<>();
+        dependencies.add(aNode);
+        dependencies.add(bNode);
+        dependencies.add(cNode);
+        dependencies.add(dNode);
+        dependencies.add(eNode);
+        dependencies.add(fNode);
+        dependencies.add(gNode);
+
+        return new VnfcDependencyModel(dependencies);
+    }
+
+    private VnfcDependencyModel readDependencyModel() {
+
+        Vnfc smp = new Vnfc("SMP","Active-Passive",null);
+        Vnfc be = new Vnfc("BE","Active-Active",null);
+        Vnfc fe = new Vnfc("FE","Active-Active",null);
+
+
+        Node smpNode = new Node(smp);
+        Node beNode = new Node(be);
+        Node feNode = new Node(fe);
+
+        beNode.addParent(smp);
+        feNode.addParent(be);
+//        smpNode.addParent(fe);
+
+        Set<Node<Vnfc>> dependencies = new HashSet<>();
+        dependencies.add(smpNode);
+        dependencies.add(feNode);
+        dependencies.add(beNode);
+
+        return new VnfcDependencyModel(dependencies);
+    }
+
+    private Map<String, String> prepareParams() {
+        Map<String,String> params = new HashMap<>();
+        params.put(Constants.DEPENDENCY_TYPE,"RESOURCE");
+        params.put(Constants.FLOW_STRATEGY,"FORWARD");
+
+        params.put(Constants.VNF_TYPE,"vSCP");
+        params.put(Constants.VNF_VERION,"1.00");
+        return params;
+    }
+
+    private SvcLogicContext prepareContext() {
+        SvcLogicContext context = new SvcLogicContext();
+        context.setAttribute("input.action-identifiers.vnf-id","1");
+        context.setAttribute("vnf.type","vSCP");
+        context.setAttribute("vnf.vnfcCount","3");
+
+        context.setAttribute("vnf.vnfc[0].name","SMPname");
+        context.setAttribute("vnf.vnfc[0].type","SMP");
+        context.setAttribute("vnf.vnfc[0].vm_count","2");
+        context.setAttribute("vnf.vnfc[0].vm[0].url","SMP_URL1");
+        context.setAttribute("vnf.vnfc[0].vm[1].url","SMP_URL2");
+
+        context.setAttribute("vnf.vnfc[1].name","BEname");
+        context.setAttribute("vnf.vnfc[1].type","BE");
+        context.setAttribute("vnf.vnfc[1].vm_count","5");
+        context.setAttribute("vnf.vnfc[1].vm[0].url","BE_URL1");
+        context.setAttribute("vnf.vnfc[1].vm[1].url","BE_URL2");
+        context.setAttribute("vnf.vnfc[1].vm[2].url","BE_URL3");
+        context.setAttribute("vnf.vnfc[1].vm[3].url","BE_URL4");
+        context.setAttribute("vnf.vnfc[1].vm[4].url","BE_URL5");
+
+        context.setAttribute("vnf.vnfc[2].name","FEname");
+        context.setAttribute("vnf.vnfc[2].type","FE");
+        context.setAttribute("vnf.vnfc[2].vm_count","2");
+        context.setAttribute("vnf.vnfc[2].vm[0].url","FE_URL1");
+        context.setAttribute("vnf.vnfc[2].vm[1].url","FE_URL2");
+
+        return context;
+    }
+
+    @Test(expected = RuntimeException.class)
+    public void testMissingVnfcTypeInDependencyModel() throws DependencyModelNotFound {
+        Map<String, String> params = prepareParams();
+        SvcLogicContext context = prepareContext();
+        context.setAttribute("vnf.vnfc[3].name","XEname");
+        context.setAttribute("vnf.vnfc[3].type","XE");
+        context.setAttribute("vnf.vnfc[3].vm_count","2");
+        context.setAttribute("vnf.vnfc[3].vm[0].url","XE_URL1");
+        context.setAttribute("vnf.vnfc[3].vm[1].url","XE_URL2");
+        context.setAttribute("vnf.vnfcCount","4");
+
+        VnfcDependencyModel dependencyModel = readDependencyModel();
+
+        PowerMockito.mockStatic(DependencyModelFactory.class);
+        DependencyManager dependencyManager = PowerMockito.mock(DependencyManager.class);
+
+        PowerMockito.when(DependencyModelFactory.createDependencyManager()).thenReturn(dependencyManager);
+        PowerMockito.when(dependencyManager.getVnfcDependencyModel((
+                DependencyModelIdentifier) Matchers.any(),(DependencyTypes) Matchers.any()))
+                .thenReturn(dependencyModel);
+
+        VnfExecutionFlow vnfExecutionFlow = new VnfExecutionFlowImpl();
+        vnfExecutionFlow.getVnfExecutionFlowData(params,context);
+    }
+
+    @Test(expected = RuntimeException.class)
+    public void testMissingMandatoryVnfcTypeInInventoryModel() throws DependencyModelNotFound {
+        Map<String, String> params = prepareParams();
+        SvcLogicContext context = prepareContext();
+        VnfcDependencyModel dependencyModel = readDependencyModel();
+
+        Vnfc xe = new Vnfc("XE","Active-Active",null, true);
+        Node xeNode = new Node(xe);
+        dependencyModel.getDependencies().add(xeNode);
+
+        PowerMockito.mockStatic(DependencyModelFactory.class);
+        DependencyManager dependencyManager = PowerMockito.mock(DependencyManager.class);
+
+        PowerMockito.when(DependencyModelFactory.createDependencyManager()).thenReturn(dependencyManager);
+        PowerMockito.when(dependencyManager.getVnfcDependencyModel((
+                DependencyModelIdentifier) Matchers.any(),(DependencyTypes) Matchers.any()))
+                .thenReturn(dependencyModel);
+
+        VnfExecutionFlow vnfExecutionFlow = new VnfExecutionFlowImpl();
+        vnfExecutionFlow.getVnfExecutionFlowData(params,context);
+    }
+
+    @Test
+    public void testMissingOptionalVnfcTypeInInventoryModel() throws DependencyModelNotFound {
+        Map<String, String> params = prepareParams();
+        SvcLogicContext context = prepareContext();
+        VnfcDependencyModel dependencyModel = readDependencyModel();
+
+        Vnfc xe = new Vnfc("XE","Active-Active",null, false);
+        Node xeNode = new Node(xe);
+        dependencyModel.getDependencies().add(xeNode);
+
+        PowerMockito.mockStatic(DependencyModelFactory.class);
+        DependencyManager dependencyManager = PowerMockito.mock(DependencyManager.class);
+
+        PowerMockito.when(DependencyModelFactory.createDependencyManager()).thenReturn(dependencyManager);
+        PowerMockito.when(dependencyManager.getVnfcDependencyModel((
+                DependencyModelIdentifier) Matchers.any(),(DependencyTypes) Matchers.any()))
+                .thenReturn(dependencyModel);
+
+        VnfExecutionFlow vnfExecutionFlow = new VnfExecutionFlowImpl();
+        vnfExecutionFlow.getVnfExecutionFlowData(params,context);
+    }
+
+    @Test
+    public void testMissingOptionalVnfcTypeInInventoryModelWithDependentChild() throws DependencyModelNotFound {
+        Map<String, String> params = prepareParams();
+        SvcLogicContext context = prepareContext();
+        context.setAttribute("vnf.vnfc[3].name","YEname");
+        context.setAttribute("vnf.vnfc[3].type","YE");
+        context.setAttribute("vnf.vnfc[3].vm_count","2");
+        context.setAttribute("vnf.vnfc[3].vm[0].url","YE_URL1");
+        context.setAttribute("vnf.vnfc[3].vm[1].url","YE_URL2");
+        context.setAttribute("vnf.vnfcCount","4");
+
+        VnfcDependencyModel dependencyModel = readDependencyModel();
+
+        Vnfc xe = new Vnfc("XE","Active-Active",null, false);
+        Vnfc ye = new Vnfc("YE","Active-Active",null, true);
+        Node xeNode = new Node(xe);
+        Node yeNode = new Node(ye);
+        yeNode.addParent(xe);
+
+        dependencyModel.getDependencies().add(yeNode);
+        dependencyModel.getDependencies().add(xeNode);
+
+        PowerMockito.mockStatic(DependencyModelFactory.class);
+        DependencyManager dependencyManager = PowerMockito.mock(DependencyManager.class);
+
+        PowerMockito.when(DependencyModelFactory.createDependencyManager()).thenReturn(dependencyManager);
+        PowerMockito.when(dependencyManager.getVnfcDependencyModel((
+                DependencyModelIdentifier) Matchers.any(),(DependencyTypes) Matchers.any()))
+                .thenReturn(dependencyModel);
+
+        VnfExecutionFlow vnfExecutionFlow = new VnfExecutionFlowImpl();
+        vnfExecutionFlow.getVnfExecutionFlowData(params,context);
+    }
+}
