diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java
index 22658c8..b5b3e17 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java
@@ -39,6 +39,8 @@
       config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_NODE_TYPE_ABSTARCT);
   public static String RULE_NODE_TYPE_PREFIX =
       config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_NODE_TYPE_RULE);
+  public static String NODE_TYPE_PREFIX =
+      config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX);
 
   //TOSCA native types
   public static String NATIVE_COMPUTE = "tosca.nodes.Compute";
@@ -80,6 +82,11 @@
   public static String VFC_ABSTRACT_SUBSTITUTE = ABSTRACT_NODE_TYPE_PREFIX + "VFC";
   public static String CONTRAIL_ABSTRACT_SUBSTITUTE =
       ABSTRACT_NODE_TYPE_PREFIX + "contrail.AbstractSubstitute";
-
+  public static String COMPLEX_VFC_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "ComplexVFC";
+  //Questionnaire to Tosca Types
+  public static String VNF_CONFIG_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "VnfConfiguration";
+  public static String MULTIFLAVOR_VFC_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "MultiFlavorVFC";
+  public static String MULTIDEPLOYMENTFLAVOR_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX
+      + "MultiDeploymentFlavor";
 }
 
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java
index 573ce39..0fcaafa 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java
@@ -23,6 +23,7 @@
 import org.openecomp.core.utilities.file.FileContentHandler;
 import org.openecomp.sdc.datatypes.model.AsdcModel;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
+import org.openecomp.sdc.tosca.services.DataModelUtil;
 
 import java.util.Collections;
 import java.util.Map;
@@ -35,6 +36,9 @@
   private Map<String, ServiceTemplate> serviceTemplates;
   private String entryDefinitionServiceTemplate;
 
+  public ToscaServiceModel() {
+  }
+
   /**
    * Instantiates a new Tosca service model.
    *
@@ -60,6 +64,9 @@
     return artifactFiles;
   }
 
+  public void setArtifactFiles(FileContentHandler artifactFiles) {
+    this.artifactFiles = artifactFiles;
+  }
 
   /**
    * Gets service templates.
@@ -96,4 +103,14 @@
   public void setEntryDefinitionServiceTemplate(String entryDefinitionServiceTemplate) {
     this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate;
   }
+
+  /**
+   * Gets cloned service model.
+   *
+   * @param toscaServiceModel the tosca service model
+   * @return the cloned service model
+   */
+  public static ToscaServiceModel getClonedServiceModel(ToscaServiceModel toscaServiceModel) {
+    return ToscaServiceModel.class.cast(DataModelUtil.getClonedObject(toscaServiceModel));
+  }
 }
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ConfigConstants.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ConfigConstants.java
index df6eb19..0e4bc22 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ConfigConstants.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ConfigConstants.java
@@ -25,24 +25,19 @@
   public static final String NAMESPACE = "ToscaModel";
 
   //keys
-  public static final String PREFIX_CAPABILITY_TYPE =
-      "tosca.entity.namespace.prefix.capabilityType";
-  public static final String PREFIX_DATA_TYPE = "tosca.entity.namespace.prefix.dataType";
-  public static final String PREFIX_GROUP_TYPE = "tosca.entity.namespace.prefix.groupType";
-  public static final String PREFIX_POLICY_TYPE = "tosca.entity.namespace.prefix.policyType";
-  public static final String PREFIX_ARTIFACT_TYPE = "tosca.entity.namespace.prefix.artifactType";
-  public static final String PREFIX_RELATIONSHIP_TYPE =
-      "tosca.entity.namespace.prefix.relationshipType";
+  public static final String PREFIX = "tosca.entity.namespace.prefix";
+  public static final String PREFIX_CAPABILITY_TYPE = PREFIX + ".capabilityType";
+  public static final String PREFIX_DATA_TYPE = PREFIX + ".dataType";
+  public static final String PREFIX_GROUP_TYPE = PREFIX + ".groupType";
+  public static final String PREFIX_POLICY_TYPE = PREFIX + ".policyType";
+  public static final String PREFIX_ARTIFACT_TYPE = PREFIX + ".artifactType";
+  public static final String PREFIX_RELATIONSHIP_TYPE = PREFIX + ".relationshipType";
 
-  public static final String PREFIX_NODE_TYPE_VFC = "tosca.entity.namespace.prefix.nodeType.vfc";
-  public static final String PREFIX_NODE_TYPE_NETWORK =
-      "tosca.entity.namespace.prefix.nodeType.network";
-  public static final String PREFIX_NODE_TYPE_CP =
-      "tosca.entity.namespace.prefix.nodeType.connectionPoint";
-  public static final String PREFIX_NODE_TYPE_ABSTARCT =
-      "tosca.entity.namespace.prefix.nodeType.abstract";
-  public static final String PREFIX_NODE_TYPE_RULE = "tosca.entity.namespace.prefix.nodeType.rule";
-
+  public static final String PREFIX_NODE_TYPE_VFC = PREFIX + ".nodeType.vfc";
+  public static final String PREFIX_NODE_TYPE_NETWORK = PREFIX + ".nodeType.network";
+  public static final String PREFIX_NODE_TYPE_CP = PREFIX + ".nodeType.connectionPoint";
+  public static final String PREFIX_NODE_TYPE_ABSTARCT = PREFIX + ".nodeType.abstract";
+  public static final String PREFIX_NODE_TYPE_RULE = PREFIX + ".nodeType.rule";
 
   private ConfigConstants() {
   }
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
index 49ea45e..d908b2c 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
@@ -23,7 +23,6 @@
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.openecomp.core.utilities.CommonMethods;
-import org.openecomp.core.utilities.yaml.YamlUtil;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
 import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
@@ -32,7 +31,9 @@
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
 import org.openecomp.sdc.logging.types.LoggerErrorDescription;
 import org.openecomp.sdc.logging.types.LoggerTragetServiceName;
+import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
 import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
+import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
 import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.CapabilityType;
@@ -56,8 +57,13 @@
 import org.openecomp.sdc.tosca.errors.InvalidAddActionNullEntityErrorBuilder;
 import org.openecomp.sdc.tosca.errors.InvalidRequirementAssignmentErrorBuilder;
 import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
-import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -1365,6 +1371,26 @@
   }
 
   /**
+   * Gets substitution mappings in a service template.
+   *
+   * @param serviceTemplate the service template
+   * @return the substitution mappings
+   */
+  public static SubstitutionMapping getSubstitutionMappings(ServiceTemplate serviceTemplate) {
+    mdcDataDebugMessage.debugEntryMessage(null, null);
+
+    if (serviceTemplate == null
+        || serviceTemplate.getTopology_template() == null
+        || serviceTemplate.getTopology_template().getSubstitution_mappings() == null) {
+      return null;
+    }
+
+    mdcDataDebugMessage.debugExitMessage(null, null);
+    return serviceTemplate.getTopology_template().getSubstitution_mappings();
+  }
+
+
+  /**
    * Compare two requirement assignment objects for equality.
    *
    * @param first  the first requirement assignement object
@@ -1380,4 +1406,173 @@
     }
     return false;
   }
+
+  /**
+   * Gets a deep copy clone of the input object.
+   *
+   * @param <T>         the type parameter
+   * @param objectValue the object value
+   * @param clazz       the clazz
+   * @return the cloned object
+   */
+  public static <T> Object getClonedObject(Object objectValue, Class<T> clazz) {
+    YamlUtil yamlUtil = new ToscaExtensionYamlUtil();
+    Object clonedObjectValue;
+    String objectToYaml = yamlUtil.objectToYaml(objectValue);
+    clonedObjectValue = yamlUtil.yamlToObject(objectToYaml, clazz);
+    return clonedObjectValue;
+  }
+
+  /**
+   * Gets a deep copy clone of the input object.
+   *
+   * @param obj the object to be cloned
+   * @return the cloned object
+   */
+  public static Object getClonedObject(Object obj) {
+    Object clonedObjectValue;
+    try {
+      //Serialize object
+      ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+      ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
+      objectOutputStream.writeObject(obj);
+      //Deserialize object
+      ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream
+          .toByteArray());
+      ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
+      clonedObjectValue = objectInputStream.readObject();
+    } catch (NotSerializableException ex) {
+      return getClonedObject(obj, obj.getClass());
+    } catch (IOException | ClassNotFoundException ex) {
+      return null;
+    }
+    return clonedObjectValue;
+  }
+
+  /**
+   * Add substitution filtering property.
+   *
+   * @param templateName the substitution service template name
+   * @param nodeTemplate the node template
+   * @param count        the count
+   */
+  public static void addSubstitutionFilteringProperty(String templateName,
+                                                      NodeTemplate nodeTemplate, int count) {
+    Map<String, Object> serviceTemplateFilterPropertyValue = new HashMap<>();
+    Map<String, Object> properties = nodeTemplate.getProperties();
+    serviceTemplateFilterPropertyValue.put(ToscaConstants
+        .SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME, templateName);
+    serviceTemplateFilterPropertyValue.put(ToscaConstants.COUNT_PROPERTY_NAME, count);
+    properties.put(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME,
+        serviceTemplateFilterPropertyValue);
+    nodeTemplate.setProperties(properties);
+  }
+
+  /**
+   * Adding binding requirement from port node template to compute node template.
+   *
+   * @param computeNodeTemplateId compute node template id
+   * @param portNodeTemplate      port node template
+   */
+  public static void addBindingReqFromPortToCompute(String computeNodeTemplateId,
+                                                    NodeTemplate portNodeTemplate) {
+
+
+    mdcDataDebugMessage.debugEntryMessage(null, null);
+    RequirementAssignment requirementAssignment = new RequirementAssignment();
+    requirementAssignment.setCapability(ToscaCapabilityType.NATIVE_NETWORK_BINDABLE);
+    requirementAssignment.setRelationship(ToscaRelationshipType.NATIVE_NETWORK_BINDS_TO);
+    requirementAssignment.setNode(computeNodeTemplateId);
+    addRequirementAssignment(portNodeTemplate, ToscaConstants.BINDING_REQUIREMENT_ID,
+        requirementAssignment);
+    mdcDataDebugMessage.debugExitMessage(null, null);
+  }
+
+  public static SubstitutionMapping createSubstitutionTemplateSubMapping(
+      String nodeTypeKey,
+      NodeType substitutionNodeType,
+      Map<String, Map<String, List<String>>> mapping) {
+    mdcDataDebugMessage.debugEntryMessage(null, null);
+    SubstitutionMapping substitutionMapping = new SubstitutionMapping();
+    substitutionMapping.setNode_type(nodeTypeKey);
+    substitutionMapping.setCapabilities(
+        manageCapabilityMapping(substitutionNodeType.getCapabilities(), mapping.get("capability")));
+    substitutionMapping.setRequirements(
+        manageRequirementMapping(substitutionNodeType.getRequirements(),
+            mapping.get("requirement")));
+
+    mdcDataDebugMessage.debugExitMessage(null, null);
+    return substitutionMapping;
+  }
+
+  private static Map<String, List<String>> manageRequirementMapping(
+      List<Map<String, RequirementDefinition>> requirementList,
+      Map<String, List<String>> requirementSubstitutionMapping) {
+    mdcDataDebugMessage.debugEntryMessage(null, null);
+
+    if (requirementList == null) {
+      return null;
+    }
+    Map<String, List<String>> requirementMapping = new HashMap<>();
+    String requirementKey;
+    List<String> requirementMap;
+    for (Map<String, RequirementDefinition> requirementDefMap : requirementList) {
+      for (Map.Entry<String, RequirementDefinition> entry : requirementDefMap.entrySet()) {
+        requirementKey = entry.getKey();
+        requirementMap = requirementSubstitutionMapping.get(requirementKey);
+        requirementMapping.put(requirementKey, requirementMap);
+      }
+    }
+
+    mdcDataDebugMessage.debugExitMessage(null, null);
+    return requirementMapping;
+  }
+
+  private static Map<String, List<String>> manageCapabilityMapping(
+      Map<String, CapabilityDefinition> capabilities,
+      Map<String, List<String>> capabilitySubstitutionMapping) {
+    mdcDataDebugMessage.debugEntryMessage(null, null);
+
+    if (capabilities == null) {
+      mdcDataDebugMessage.debugExitMessage(null, null);
+      return null;
+    }
+
+    Map<String, List<String>> capabilityMapping = new HashMap<>();
+    String capabilityKey;
+    List<String> capabilityMap;
+    for (Map.Entry<String, CapabilityDefinition> entry : capabilities.entrySet()) {
+      capabilityKey = entry.getKey();
+      capabilityMap = capabilitySubstitutionMapping.get(capabilityKey);
+      capabilityMapping.put(capabilityKey, capabilityMap);
+    }
+
+    mdcDataDebugMessage.debugExitMessage(null, null);
+    return capabilityMapping;
+  }
+
+  public static void addSubstitutionNodeTypeRequirements(NodeType substitutionNodeType,
+                                                         List<Map<String, RequirementDefinition>>
+                                                             requirementsList,
+                                                         String templateName) {
+    mdcDataDebugMessage.debugEntryMessage(null, null);
+
+    if (requirementsList == null || requirementsList.size() == 0) {
+      return;
+    }
+
+    if (substitutionNodeType.getRequirements() == null) {
+      substitutionNodeType.setRequirements(new ArrayList<>());
+    }
+
+    for (Map<String, RequirementDefinition> requirementDef : requirementsList) {
+      for (Map.Entry<String, RequirementDefinition> entry : requirementDef.entrySet()) {
+        Map<String, RequirementDefinition> requirementMap = new HashMap<>();
+        requirementMap.put(entry.getKey() + "_" + templateName, entry.getValue().clone());
+        substitutionNodeType.getRequirements().add(requirementMap);
+      }
+    }
+
+    mdcDataDebugMessage.debugExitMessage(null, null);
+  }
 }
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java
index ac7cab6..c4c154e 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java
@@ -22,10 +22,12 @@
 
 import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
 import org.openecomp.sdc.tosca.datatypes.model.NodeType;
 import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 
 import java.util.Collection;
@@ -80,4 +82,12 @@
 
   public Map<String, PropertyDefinition> manageSubstitutionNodeTypeProperties(
       ServiceTemplate substitutionServiceTemplate);
+
+  public Map<String, CapabilityDefinition> calculateExposedCapabilities(
+      Map<String, CapabilityDefinition> nodeTypeCapabilitiesDefinition,
+      Map<String, Map<String, RequirementAssignment>> fullFilledRequirementsDefinitionMap);
+
+  public List<Map<String, RequirementDefinition>> calculateExposedRequirements(
+      List<Map<String, RequirementDefinition>> nodeTypeRequirementsDefinitionList,
+      Map<String, RequirementAssignment> nodeTemplateRequirementsAssignment);
 }
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
index eaf3fb4..dc2ed6c 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
@@ -25,6 +25,7 @@
 import org.openecomp.core.utilities.CommonMethods;
 import org.openecomp.sdc.common.errors.CoreException;
 import org.openecomp.sdc.datatypes.error.ErrorLevel;
+import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
 import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
 import org.openecomp.sdc.logging.types.LoggerConstants;
 import org.openecomp.sdc.logging.types.LoggerErrorCode;
@@ -34,6 +35,7 @@
 import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
 import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition;
+import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.CapabilityType;
 import org.openecomp.sdc.tosca.datatypes.model.Import;
 import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
@@ -42,6 +44,7 @@
 import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.PropertyType;
 import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
+import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition;
 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.openecomp.sdc.tosca.errors.ToscaInvalidEntryNotFoundErrorBuilder;
 import org.openecomp.sdc.tosca.errors.ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder;
@@ -51,7 +54,7 @@
 import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
 import org.openecomp.sdc.tosca.services.ToscaConstants;
 import org.openecomp.sdc.tosca.services.ToscaUtil;
-import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil;
+import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -64,9 +67,133 @@
 import java.util.Set;
 
 public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService {
+
+  protected static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+
+  public List<Map<String, RequirementDefinition>> calculateExposedRequirements(
+      List<Map<String, RequirementDefinition>> nodeTypeRequirementsDefinitionList,
+      Map<String, RequirementAssignment> nodeTemplateRequirementsAssignment) {
+    mdcDataDebugMessage.debugEntryMessage(null, null);
+
+    if (nodeTypeRequirementsDefinitionList == null) {
+      return null;
+    }
+    for (Map.Entry<String, RequirementAssignment> entry : nodeTemplateRequirementsAssignment
+        .entrySet()) {
+      if (entry.getValue().getNode() != null) {
+        Optional<RequirementDefinition> requirementDefinition =
+            DataModelUtil.getRequirementDefinition(nodeTypeRequirementsDefinitionList, entry
+                .getKey());
+        RequirementDefinition cloneRequirementDefinition;
+        if (requirementDefinition.isPresent()) {
+          cloneRequirementDefinition = requirementDefinition.get().clone();
+          if (!evaluateRequirementFulfillment(cloneRequirementDefinition)) {
+            CommonMethods.mergeEntryInList(entry.getKey(), cloneRequirementDefinition,
+                nodeTypeRequirementsDefinitionList);
+          } else {
+            DataModelUtil.removeRequirementsDefinition(nodeTypeRequirementsDefinitionList, entry
+                .getKey());
+          }
+        }
+      } else {
+        for (Map<String, RequirementDefinition> nodeTypeRequirementsMap :
+            nodeTypeRequirementsDefinitionList) {
+          Object max = nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences() != null
+              && nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences().length > 0
+              ? nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences()[1] : 1;
+          Object min = nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences() != null
+              && nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences().length > 0
+              ? nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences()[0] : 1;
+          nodeTypeRequirementsMap.get(entry.getKey()).setOccurrences(new Object[]{min, max});
+        }
+      }
+    }
+
+    mdcDataDebugMessage.debugExitMessage(null, null);
+    return nodeTypeRequirementsDefinitionList;
+  }
+
+  private static boolean evaluateRequirementFulfillment(RequirementDefinition
+                                                            requirementDefinition) {
+    Object[] occurrences = requirementDefinition.getOccurrences();
+    if (occurrences == null) {
+      requirementDefinition.setOccurrences(new Object[]{1, 1});
+      return false;
+    }
+    if (occurrences[1].equals(ToscaConstants.UNBOUNDED)) {
+      return false;
+    }
+
+    if (occurrences[1].equals(1)) {
+      return true;
+    }
+    occurrences[1] = (Integer) occurrences[1] - 1;
+    return false;
+  }
+
+  public Map<String, CapabilityDefinition> calculateExposedCapabilities(
+      Map<String, CapabilityDefinition> nodeTypeCapabilitiesDefinition,
+      Map<String, Map<String, RequirementAssignment>> fullFilledRequirementsDefinitionMap) {
+
+
+    mdcDataDebugMessage.debugEntryMessage(null, null);
+
+    String capabilityKey;
+    String capability;
+    String node;
+    for (Map.Entry<String, Map<String, RequirementAssignment>> entry :
+        fullFilledRequirementsDefinitionMap.entrySet()) {
+      for (Map.Entry<String, RequirementAssignment> fullFilledEntry : entry.getValue().entrySet()) {
+
+        capability = fullFilledEntry.getValue().getCapability();
+        fullFilledEntry.getValue().getOccurrences();
+        node = fullFilledEntry.getValue().getNode();
+        capabilityKey = capability + "_" + node;
+        CapabilityDefinition capabilityDefinition = nodeTypeCapabilitiesDefinition.get(
+            capabilityKey);
+        if (capabilityDefinition != null) {
+          CapabilityDefinition clonedCapabilityDefinition = capabilityDefinition.clone();
+          nodeTypeCapabilitiesDefinition.put(capabilityKey, capabilityDefinition.clone());
+          if (evaluateCapabilityFulfillment(clonedCapabilityDefinition)) {
+            nodeTypeCapabilitiesDefinition.remove(capabilityKey);
+          } else {
+            nodeTypeCapabilitiesDefinition.put(capabilityKey, clonedCapabilityDefinition);
+          }
+        }
+      }
+    }
+
+    Map<String, CapabilityDefinition> exposedCapabilitiesDefinition = new HashMap<>();
+    for (Map.Entry<String, CapabilityDefinition> entry : nodeTypeCapabilitiesDefinition
+        .entrySet()) {
+      exposedCapabilitiesDefinition.put(entry.getKey(), entry.getValue());
+    }
+
+    mdcDataDebugMessage.debugExitMessage(null, null);
+    return exposedCapabilitiesDefinition;
+  }
+
+  private static boolean evaluateCapabilityFulfillment(CapabilityDefinition capabilityDefinition) {
+
+    Object[] occurrences = capabilityDefinition.getOccurrences();
+    if (occurrences == null) {
+      capabilityDefinition.setOccurrences(new Object[]{1, ToscaConstants.UNBOUNDED});
+      return false;
+    }
+    if (occurrences[1].equals(ToscaConstants.UNBOUNDED)) {
+      return false;
+    }
+
+    if (occurrences[1].equals(1)) {
+      return true;
+    }
+    occurrences[1] = (Integer) occurrences[1] - 1;
+    return false;
+  }
+
   /*
-  node template with type equal to node type or derived from node type
-   */
+    node template with type equal to node type or derived from node type
+     */
   @Override
   public Map<String, NodeTemplate> getNodeTemplatesByType(ServiceTemplate serviceTemplate,
                                                           String nodeType,
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java
deleted file mode 100644
index 2b806fb..0000000
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * 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.sdc.tosca.services.yamlutil;
-
-import org.openecomp.core.utilities.yaml.YamlUtil;
-import org.yaml.snakeyaml.constructor.Constructor;
-import org.yaml.snakeyaml.introspector.Property;
-import org.yaml.snakeyaml.introspector.PropertyUtils;
-import org.yaml.snakeyaml.nodes.MappingNode;
-import org.yaml.snakeyaml.nodes.NodeId;
-
-import java.beans.IntrospectionException;
-
-public class ToscaExtensionYamlUtil extends YamlUtil {
-
-  @Override
-  public <T> Constructor getConstructor(Class<T> typClass) {
-    return new ToscaWithHeatExtensionConstructor(typClass);
-  }
-
-  @Override
-  protected PropertyUtils getPropertyUtils() {
-    return new ToscaPropertyUtilsWithHeatExtension();
-  }
-
-  public class ToscaPropertyUtilsWithHeatExtension extends MyPropertyUtils {
-    @Override
-    public Property getProperty(Class<? extends Object> type, String name)
-        throws IntrospectionException {
-      try {
-        if (type
-            .equals(Class.forName("org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition"))) {
-          type = Class
-              .forName("org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt");
-        }
-      } catch (ClassNotFoundException ex) {
-        throw new RuntimeException(ex);
-      }
-      return super.getProperty(type, name);
-    }
-  }
-
-  protected class ToscaWithHeatExtensionConstructor extends StrictMapAppenderConstructor {
-    public ToscaWithHeatExtensionConstructor(Class<?> theRoot) {
-      super(theRoot);
-      yamlClassConstructors.put(NodeId.mapping, new MyPersistentObjectConstruct());
-    }
-
-    class MyPersistentObjectConstruct extends ConstructMapping {
-      @Override
-      protected Object constructJavaBean2ndStep(MappingNode node, Object object) {
-        Class type = node.getType();
-        try {
-          if (type.equals(
-              Class.forName("org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition"))) {
-            Class extendHeatClass = Class.forName(
-                "org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt");
-            Object extendHeatObject = extendHeatClass.newInstance();
-            // create JavaBean
-            return super.constructJavaBean2ndStep(node, extendHeatObject);
-          } else {
-            // create JavaBean
-            return super.constructJavaBean2ndStep(node, object);
-          }
-        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
-          throw new RuntimeException(ex);
-        }
-      }
-    }
-  }
-}
-
-
-
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/resources/config.properties b/openecomp-be/lib/openecomp-tosca-lib/src/main/resources/config.properties
index cf7596c..d4149db 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/resources/config.properties
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/resources/config.properties
@@ -4,7 +4,7 @@
 tosca.entity.namespace.prefix.groupType=${tosca.entity.namespace.prefix}groups.
 tosca.entity.namespace.prefix.policyType=${tosca.entity.namespace.prefix}policies.
 tosca.entity.namespace.prefix.relationshipType=${tosca.entity.namespace.prefix}relationships.
-tosca.entity.namespace.prefix.artifactType=${tosca.entity.namespace.prefix}artifacts.
+tosca.entity.namespace.prefix.monitoringUploadType=${tosca.entity.namespace.prefix}artifacts.
 
 tosca.entity.namespace.prefix.nodeType.vfc=${tosca.entity.namespace.prefix}resource.vfc.nodes.
 tosca.entity.namespace.prefix.nodeType.network=${tosca.entity.namespace.prefix}resource.vl.nodes.
