diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/AbstractControllerExecution.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/AbstractControllerExecution.java
new file mode 100644
index 0000000..f3b767a
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/AbstractControllerExecution.java
@@ -0,0 +1,174 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl;
+
+import com.google.common.base.Strings;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * Abstract class of the controller execution, it should be extended for the controller execution task.
+ * 
+ * @param <T> execution context type, e.g., BuildingBlockExecution or DelegateExecution
+ */
+public abstract class AbstractControllerExecution<T> {
+
+    /**
+     * parameters from the execution context.
+     */
+    protected static final String CONTROLLER_ACTOR_PARAM = "actor";
+    protected static final String CONTROLLER_ACTION_PARAM = "action";
+    protected static final String CONTROLLER_SCOPE_PARAM = "scope";
+    protected static final String RESOURCE_CUSTOMIZATION_UUID_PARAM = "resource_customization_uuid";
+    protected static final String RESOURCE_TYPE_PARAM = "resource_type";
+
+    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    protected List<ControllerRunnable<T>> availableControllerRunnables;
+
+    @Autowired
+    protected ExceptionBuilder exceptionBuilder;
+
+    /**
+     * Find the {@ref ControllerRunnable} instances understanding the {@ref ControllerContext}.
+     *
+     * Only one instance should be able to understand the context. if more than one or none instances found, return
+     * null.
+     *
+     * @param context controller context
+     * @return Optional of ControllerRunnable instance
+     */
+    protected Optional<ControllerRunnable> getController(ControllerContext<T> context) {
+        List<ControllerRunnable<T>> satisfiedControllers = availableControllerRunnables.stream()
+                .filter(controllerRunnable -> controllerRunnable.understand(context)).collect(Collectors.toList());
+
+        if (logger.isDebugEnabled()) {
+            for (ControllerRunnable<T> satisfiedController : satisfiedControllers) {
+                logger.debug("{} controllerRunnable understands the context", satisfiedController.getClass().getName());
+            }
+        }
+
+        /**
+         * Make sure only one {@ref ControllerRunnable} instance understands the context or else return Null.
+         */
+        if (satisfiedControllers.size() == 1) {
+            return Optional.of(satisfiedControllers.get(0));
+        } else if (satisfiedControllers.isEmpty()) {
+            logger.warn("Can NOT find any ControllerRunnable for context: {}", context);
+        } else if (satisfiedControllers.size() > 1) {
+            logger.warn(
+                    "Found {} instances understanding the context: {}, please make sure only 1 instance understands it",
+                    satisfiedControllers.size(), context);
+        }
+
+        return Optional.empty();
+    }
+
+    /**
+     * Build the {@ref ControllerContext} context based on execution context.
+     * 
+     * @param t execution context instance, e.g., BuildingBlockExecution or DelegateExecution instance
+     * @return controller context instance of the execution context type
+     */
+    protected ControllerContext<T> buildControllerContext(final T t) {
+        String controllerAction = getParameterFromExecution(t, CONTROLLER_ACTION_PARAM);
+        String controllerScope = getParameterFromExecution(t, CONTROLLER_SCOPE_PARAM);
+        String resourceCustomizationUuid = getParameterFromExecution(t, RESOURCE_CUSTOMIZATION_UUID_PARAM);
+        String controllerActor = getControllerActor(t, controllerScope, resourceCustomizationUuid, controllerAction);
+        ControllerContext<T> controllerContext = new ControllerContext<>();
+        controllerContext.setExecution(t);
+        controllerContext.setControllerAction(controllerAction);
+        controllerContext.setControllerActor(controllerActor);
+        controllerContext.setControllerScope(controllerScope);
+        return controllerContext;
+    }
+
+    /**
+     * Retrieve the controller actor.
+     * 
+     * @param t execution context instance, e.g., BuildingBlockExecution or DelegateExecution instance
+     * @param controllerScope controller scope, e.g, pnf, vnf, vfModule
+     * @param resourceCustomizationUuid resource customization UUID, e.g, pnfCustomizationUuid, vnfCustomizationUuid
+     * @param controllerAction controller action, e.g, configAssign, configDeploy
+     * @return controller actor
+     */
+    protected abstract String getControllerActor(T t, String controllerScope, String resourceCustomizationUuid,
+            String controllerAction);
+
+    /**
+     * Controller execution based on the Controller Context.
+     * 
+     * @param controllerContext ControllerContext object
+     */
+    public abstract void controllerExecute(final ControllerContext<T> controllerContext);
+
+    /**
+     * Retrieve the parameter value as String from the execution context.
+     * 
+     * @param t execution context instance, e.g., BuildingBlockExecution or DelegateExecution instance
+     * @param parameterName parameter name to be retrieved
+     * @return String value of the parameter
+     */
+    protected abstract String getParameterFromExecution(final T t, String parameterName);
+
+    /**
+     * Check whether the controller actor value is SO ref value, i.e, equals to SO-REF-DATA.
+     * 
+     * @param controllerActor controller actor, e.g, SO-REF-DATA, SDNC, CDS
+     * @return true if the controller actor is SO-REF-DATA, else return false
+     */
+    protected boolean isSoRefControllerActor(final String controllerActor) {
+        return !Strings.isNullOrEmpty(controllerActor) && controllerActor.equalsIgnoreCase("SO-REF-DATA");
+    }
+
+    /**
+     * Check whether the controller scope is PNF resource related.
+     * 
+     * @param controllerScope controller scope, e.g, pnf, vnf, vfModule
+     * @return true if the controller scope is pnf, else return false
+     */
+    protected boolean isPnfResourceScope(final String controllerScope) {
+        return ("pnf").equalsIgnoreCase(controllerScope);
+    }
+
+    /**
+     * Check whether the controller scope is VNF resource related.
+     * 
+     * @param controllerScope controller scope, e.g, pnf, vnf, vfModule
+     * @return true if the controller scope is vnf or vfModule, else return false
+     */
+    protected boolean isVnfResourceScope(final String controllerScope) {
+        if (Strings.isNullOrEmpty(controllerScope)) {
+            return false;
+        }
+        if (controllerScope.toLowerCase().startsWith("vnf") || controllerScope.equalsIgnoreCase("vfmodule")) {
+            return true;
+        }
+        return false;
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBB.java
new file mode 100644
index 0000000..39a695b
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBB.java
@@ -0,0 +1,152 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock;
+
+import com.google.common.base.Strings;
+import java.util.Optional;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.onap.so.bpmn.infrastructure.decisionpoint.impl.AbstractControllerExecution;
+import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This class is used for {@ref BuildingBlockExecution} API based execution.
+ *
+ * it decides which controller implementation to use based on the parameters, like actor, scope, action.
+ *
+ * The following parameters are expected in the {@ref BuildingBlockExecution} context,
+ * <ul>
+ * <li>action: action to be executed</li>
+ * <li>scope: type of the resource, i.e, pnf, vnf, vf</li>
+ * <li>resource_customization_uuid: resource customization UUID</li>
+ * <li>resource_type: resource type, optional. It's used to find the controller from controller_selection_reference
+ * table. Same as VNF_TYPE in the table</li>
+ * </ul>
+ */
+@Component
+public class ControllerExecutionBB extends AbstractControllerExecution<BuildingBlockExecution> {
+
+    @Autowired
+    protected CatalogDbClient catalogDbClient;
+
+    public void execute(final BuildingBlockExecution execution) {
+        ControllerContext<BuildingBlockExecution> controllerContext = buildControllerContext(execution);
+        controllerExecute(controllerContext);
+    }
+
+    @Override
+    protected String getParameterFromExecution(BuildingBlockExecution execution, String parameterName) {
+        Object object = execution.getVariable(parameterName);
+        if (object != null) {
+            String paramValue = String.valueOf(object);
+            logger.debug("parameterName: {}, parameterValue: {}", parameterName, paramValue);
+            return paramValue;
+        }
+        return "";
+    }
+
+    /**
+     * this method is used to get the controller actor, there could be few places to get the actor(ordered by priority),
+     *
+     * <ol>
+     * <li>Execution Context, i.e, BuildingBlockExecution</li>
+     * <li>Resource customization table, pnf_resource_customization for PNF or vnf_resource_customization for VNF</li>
+     * <li>controller_selection_reference, resource_type and action will be used to fetch from this table</li>
+     * </ol>
+     *
+     * @param execution BuildingBlockExecution instance
+     * @param controllerScope controller scope, e.g, pnf, vnf, vfModule
+     * @param resourceCustomizationUuid resource customization UUID, e.g, pnfCustomizationUuid, vnfCustomizationUuid
+     * @param controllerAction controller action, e.g, configAssign, configDeploy
+     * @return controller actor name
+     */
+    @Override
+    protected String getControllerActor(BuildingBlockExecution execution, String controllerScope,
+            String resourceCustomizationUuid, String controllerAction) {
+
+        /**
+         * Firstly, check the execution context for actor parameter.
+         */
+        String controllerActor = getParameterFromExecution(execution, CONTROLLER_ACTOR_PARAM);
+
+        /**
+         * If no meaningful controller actor value found in the execution context and the value is not SO-REF-DATA.
+         */
+        if (Strings.isNullOrEmpty(controllerActor) && !isSoRefControllerActor(controllerActor)) {
+
+            /**
+             * For BuildingBlockExecution, we should try to get the resource information from Cached metadata.
+             *
+             * As the current cached metadata doesn't support controller actor, we use the
+             * {@link org.onap.so.db.catalog.client.CatalogDbClient} to fetch information. Once the change is done in
+             * cached metadata, this part should be refactored as well.
+             */
+            if (isPnfResourceScope(controllerScope)) {
+                PnfResourceCustomization pnfResourceCustomization =
+                        catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(resourceCustomizationUuid);
+                controllerActor = pnfResourceCustomization.getControllerActor();
+            } else if (isVnfResourceScope(controllerScope)) {
+                VnfResourceCustomization vnfResourceCustomization =
+                        catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(resourceCustomizationUuid);
+                controllerActor = vnfResourceCustomization.getControllerActor();
+            } else {
+                logger.warn("Unrecognized scope: {}", controllerScope);
+            }
+        }
+
+        /**
+         * Lastly, can NOT find the controller actor information from resource customization table or the return value
+         * is SO-REF-DATA.
+         */
+        if (Strings.isNullOrEmpty(controllerActor) || isSoRefControllerActor(controllerActor)) {
+            String resourceType = getParameterFromExecution(execution, RESOURCE_TYPE_PARAM);
+            ControllerSelectionReference reference = catalogDbClient
+                    .getControllerSelectionReferenceByVnfTypeAndActionCategory(resourceType, controllerAction);
+
+            controllerActor = reference.getControllerName();
+        }
+        return controllerActor;
+    }
+
+    @Override
+    public void controllerExecute(ControllerContext<BuildingBlockExecution> controllerContext) {
+        Optional<ControllerRunnable> optional = getController(controllerContext);
+        if (optional.isPresent()) {
+            ControllerRunnable controller = optional.get();
+            if (controller.ready(controllerContext)) {
+                controller.prepare(controllerContext);
+                controller.run(controllerContext);
+            } else {
+                exceptionBuilder.buildAndThrowWorkflowException(controllerContext.getExecution(), 9001,
+                        "Controller is NOT Ready for the action", ONAPComponents.SO);
+            }
+        } else {
+            exceptionBuilder.buildAndThrowWorkflowException(controllerContext.getExecution(), 9000,
+                    "Unable to find the controller implementation", ONAPComponents.SO);
+        }
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/LcmControllerBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/LcmControllerBB.java
new file mode 100644
index 0000000..d7f6808
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/LcmControllerBB.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller;
+
+import java.util.List;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.client.appc.ApplicationControllerAction;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * This class should be extended by LCM api based controllers.
+ */
+public abstract class LcmControllerBB implements ControllerRunnable<BuildingBlockExecution> {
+
+    protected Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    protected ExceptionBuilder exceptionUtil;
+
+    @Autowired(required = false)
+    protected List<ControllerPreparable<BuildingBlockExecution>> prepareList;
+
+    @Autowired
+    protected ApplicationControllerAction client;
+
+    @Override
+    public void prepare(ControllerContext<BuildingBlockExecution> context) {
+        prepareList.stream().filter(prepare -> prepare.understand(context))
+                .forEach(prepare -> prepare.prepare(context));
+    }
+
+    @Override
+    public void run(ControllerContext<BuildingBlockExecution> context) {
+        callLcmClient(context);
+    }
+
+    /**
+     * This method is used to execute the LCM action by calling LCM client, appc Client or SDNC client.
+     *
+     * @return error code
+     */
+    protected abstract int callLcmClient(ControllerContext<BuildingBlockExecution> context);
+
+    protected abstract int getErrorCode();
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/appc/AppcControllerBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/appc/AppcControllerBB.java
new file mode 100644
index 0000000..8650994
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/appc/AppcControllerBB.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller.appc;
+
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller.LcmControllerBB;
+import org.onap.so.client.appc.ApplicationControllerAction;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This implementation of {@link ControllerRunnable} is created to demonstrate how to support Appc based controller.
+ */
+@Component
+public class AppcControllerBB extends LcmControllerBB {
+
+    private static final int APPC_ERROR_CODE = 1002;
+
+    @Autowired
+    private ApplicationControllerAction client;
+
+    @Override
+    public Boolean understand(ControllerContext<BuildingBlockExecution> context) {
+        return context.getControllerActor().equalsIgnoreCase("appc");
+    }
+
+    @Override
+    public Boolean ready(ControllerContext<BuildingBlockExecution> context) {
+        return true;
+    }
+
+    /**
+     * This method is left empty intentionally. If you are planning to use the Appc Controller, please implement here.
+     *
+     * You can use the {@ref ApplicationControllerAction}, {@ref ApplicationControllerOrchestrator},
+     * {@ref ApplicationControllerClient} or create your own Appc Client proxy.
+     */
+    @Override
+    protected int callLcmClient(ControllerContext<BuildingBlockExecution> context) {
+        return 0;
+    }
+
+    @Override
+    protected int getErrorCode() {
+        return APPC_ERROR_CODE;
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/SdncControllerBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/SdncControllerBB.java
new file mode 100644
index 0000000..6baf881
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/SdncControllerBB.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller.sdnc;
+
+import java.util.Arrays;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller.LcmControllerBB;
+import org.springframework.stereotype.Component;
+
+/**
+ * This implementation of {@link ControllerRunnable} is created to demonstrate how to support SDNC based controller.
+ *
+ * For demo purpose, the following actions are supported, UpgradePreCheck UpgradeSoftware UpgradePostCheck, all of these
+ * actions are appc based actions and they need to be refactored to proper SDNC LCM actions.
+ */
+@Component
+public class SdncControllerBB extends LcmControllerBB {
+
+    private static final String[] supportedActions = new String[] {};
+
+    private static final int SDNC_ERROR_CODE = 1002;
+
+    @Override
+    public Boolean understand(ControllerContext<BuildingBlockExecution> context) {
+        return context.getControllerActor().equalsIgnoreCase("sdnc");
+    }
+
+    private boolean isActionSupported(ControllerContext<BuildingBlockExecution> context) {
+        return Arrays.stream(supportedActions).anyMatch(action -> action.equals(context.getControllerAction()));
+    }
+
+    @Override
+    public Boolean ready(ControllerContext<BuildingBlockExecution> context) {
+        return true;
+    }
+
+    /**
+     * This method is left empty intentionally. If you are planning to use the SDNC Controller, please implement here.
+     *
+     * You can use the Appc Client proxy, like, {@ref ApplicationControllerAction}
+     * {@ref ApplicationControllerOrchestrator} {@ref ApplicationControllerClient}
+     *
+     * Or create your own SDNC Client proxy.
+     */
+    @Override
+    protected int callLcmClient(ControllerContext<BuildingBlockExecution> context) {
+        return 0;
+    }
+
+    @Override
+    protected int getErrorCode() {
+        return SDNC_ERROR_CODE;
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/prepare/PrepareSdncBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/prepare/PrepareSdncBB.java
new file mode 100644
index 0000000..dd75107
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/prepare/PrepareSdncBB.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller.sdnc.prepare;
+
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * This abstract class should be extended by all the SDNC based {@ControllerPreparable}. It defines some common
+ * behavior.
+ */
+public abstract class PrepareSdncBB implements ControllerPreparable<BuildingBlockExecution> {
+
+    protected Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    protected ExceptionBuilder exceptionUtil;
+
+    @Autowired
+    protected ExtractPojosForBB extractPojosForBB;
+
+    public boolean understand(final ControllerContext<BuildingBlockExecution> controllerContext) {
+        return controllerContext.getControllerActor().equalsIgnoreCase("sdnc");
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/prepare/PrepareSdncUpgradePreCheckPnfBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/prepare/PrepareSdncUpgradePreCheckPnfBB.java
new file mode 100644
index 0000000..c659290
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/prepare/PrepareSdncUpgradePreCheckPnfBB.java
@@ -0,0 +1,60 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * ================================================================================ 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller.sdnc.prepare;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.springframework.stereotype.Component;
+
+/**
+ * This class is used to prepare the {@ref ControllerContext} for SDNC UpgradePreCheck action.
+ */
+@Component
+public class PrepareSdncUpgradePreCheckPnfBB extends PrepareSdncBB {
+
+    @Override
+    public boolean understand(ControllerContext<BuildingBlockExecution> controllerContext) {
+        return super.understand(controllerContext) && controllerContext.getControllerAction().equals("UpgradePreCheck")
+                && controllerContext.getControllerScope().equalsIgnoreCase("pnf");
+    }
+
+    @Override
+    public void prepare(ControllerContext<BuildingBlockExecution> controllerContext) {
+
+        String payload = controllerContext.getExecution().getVariable("payload");
+        String actualPayLoad = constructPayload(payload, controllerContext.getControllerAction());
+
+        controllerContext.getExecution().setVariable("payload", actualPayLoad);
+    }
+
+    private String constructPayload(String payload, String action) {
+
+        JSONObject jsonObject = new JSONObject(payload);
+        if (jsonObject.has("action")) {
+            JSONArray jsonArray = jsonObject.getJSONArray("action");
+
+            for (int i = 0; i < jsonArray.length(); i++) {
+                JSONObject jsonObject1 = jsonArray.getJSONObject(i);
+                if (jsonObject1.has(action)) {
+                    return jsonObject1.toString();
+                }
+            }
+        }
+        return payload;
+    }
+}
+
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDE.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDE.java
new file mode 100644
index 0000000..0458d3c
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDE.java
@@ -0,0 +1,148 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda;
+
+import com.google.common.base.Strings;
+import java.util.Optional;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.onap.so.bpmn.infrastructure.decisionpoint.impl.AbstractControllerExecution;
+import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This class is used for camunda {@ref DelegateExecution} API based controller execution.
+ *
+ * The following parameters are expected in the {@ref DelegateExecution} context,
+ *
+ * <ul>
+ * <li>action: action to be executed</li>
+ * <li>scope: type of the resource, i.e, pnf, vnf, vf</li>
+ * <li>resource_customization_uuid: resource customization UUID</li>
+ * <li>resource_type: resource type, optional. It's used to find the controller from controller_selection_reference
+ * table. Same as VNF_TYPE in the table</li>
+ * </ul>
+ */
+@Component
+public class ControllerExecutionDE extends AbstractControllerExecution<DelegateExecution> implements JavaDelegate {
+
+    @Autowired
+    protected CatalogDbClient catalogDbClient;
+
+    @Override
+    public void execute(final DelegateExecution execution) {
+        ControllerContext<DelegateExecution> controllerContext = buildControllerContext(execution);
+        controllerExecute(controllerContext);
+    }
+
+    /**
+     * this method is used to get the controller actor, there could be few places to get the actor(ordered by priority),
+     *
+     * <ol>
+     * <li>Execution Context, i.e, DelegateExecution</li>
+     * <li>Resource customization table, pnf_resource_customization for PNF or vnf_resource_customization for VNF</li>
+     * <li>controller_selection_reference, resource_type and action will be used to fetch from this table</li>
+     * </ol>
+     *
+     * @param execution DelegateExecution instance
+     * @param controllerScope controller scope, e.g, pnf, vnf, vfModule
+     * @param resourceCustomizationUuid resource customization UUID, e.g, pnfCustomizationUuid, vnfCustomizationUuid
+     * @param controllerAction controller action, e.g, configAssign, configDeploy
+     * @return controller actor
+     */
+    protected String getControllerActor(DelegateExecution execution, String controllerScope,
+            String resourceCustomizationUuid, String controllerAction) {
+
+        /**
+         * Firstly, check the execution context for actor parameter.
+         */
+        String controllerActor = getParameterFromExecution(execution, CONTROLLER_ACTOR_PARAM);
+
+        /**
+         * If no meaningful controller actor value found in the execution context and the value is not SO-REF-DATA.
+         */
+        if (Strings.isNullOrEmpty(controllerActor) && !isSoRefControllerActor(controllerActor)) {
+
+            /**
+             * secondly, if no meaningful actor from execution context, getting from resource table in database.
+             */
+            if (isPnfResourceScope(controllerScope)) {
+                PnfResourceCustomization pnfResourceCustomization =
+                        catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(resourceCustomizationUuid);
+                controllerActor = pnfResourceCustomization.getControllerActor();
+            } else if (isVnfResourceScope(controllerScope)) {
+                VnfResourceCustomization vnfResourceCustomization =
+                        catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(resourceCustomizationUuid);
+                controllerActor = vnfResourceCustomization.getControllerActor();
+            } else {
+                logger.warn("Unrecognized scope: {}", controllerScope);
+            }
+        }
+
+        /**
+         * Lastly, can NOT find the controller actor information from resource customization table or value is
+         * SO-REF-DATA
+         */
+        if (Strings.isNullOrEmpty(controllerActor) || isSoRefControllerActor(controllerActor)) {
+            String resourceType = getParameterFromExecution(execution, RESOURCE_TYPE_PARAM);
+            ControllerSelectionReference reference = catalogDbClient
+                    .getControllerSelectionReferenceByVnfTypeAndActionCategory(resourceType, controllerAction);
+            controllerActor = reference.getControllerName();
+        }
+
+        return controllerActor;
+    }
+
+    @Override
+    public void controllerExecute(ControllerContext<DelegateExecution> controllerContext) {
+        Optional<ControllerRunnable> optional = getController(controllerContext);
+
+        if (optional.isPresent()) {
+            ControllerRunnable controller = optional.get();
+            if (controller.ready(controllerContext)) {
+                controller.prepare(controllerContext);
+                controller.run(controllerContext);
+            } else {
+                exceptionBuilder.buildAndThrowWorkflowException(controllerContext.getExecution(), 9001,
+                        "Controller is NOT Ready for the action", ONAPComponents.SO);
+            }
+        } else {
+            exceptionBuilder.buildAndThrowWorkflowException(controllerContext.getExecution(), 9000,
+                    "Unable to find the controller implementation", ONAPComponents.SO);
+        }
+    }
+
+    @Override
+    protected String getParameterFromExecution(DelegateExecution execution, String parameterName) {
+        if (execution.hasVariable(parameterName)) {
+            String paramValue = String.valueOf(execution.getVariable(parameterName));
+            logger.debug("parameterName: {}, parameterValue: {}", parameterName, paramValue);
+            return paramValue;
+        } else {
+            return "";
+        }
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/LcmControllerDE.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/LcmControllerDE.java
new file mode 100644
index 0000000..95e270a
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/LcmControllerDE.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller;
+
+import java.util.List;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.client.appc.ApplicationControllerAction;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * This abstract class implements {@link ControllerRunnable} used for {@link DelegateExecution} API based LCM
+ * controller.
+ */
+public abstract class LcmControllerDE implements ControllerRunnable<DelegateExecution> {
+
+    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    protected ExceptionBuilder exceptionUtil;
+
+    @Autowired
+    protected List<ControllerPreparable<DelegateExecution>> prepareList;
+
+    @Autowired
+    protected ApplicationControllerAction client;
+
+    @Override
+    public void prepare(ControllerContext<DelegateExecution> context) {
+        prepareList.stream().filter(prepare -> prepare.understand(context))
+                .forEach(prepare -> prepare.prepare(context));
+    }
+
+    @Override
+    public void run(ControllerContext<DelegateExecution> context) {
+        callLcmClient(context);
+    }
+
+    /**
+     * This method is used to execute the LCM action by calling LCM client, appc Client or SDNC client.
+     *
+     * @return error code
+     */
+    protected abstract int callLcmClient(ControllerContext<DelegateExecution> context);
+
+    protected abstract int getErrorCode();
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/appc/AppcControllerDE.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/appc/AppcControllerDE.java
new file mode 100644
index 0000000..7ebd16e
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/appc/AppcControllerDE.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.appc;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.LcmControllerDE;
+import org.springframework.stereotype.Component;
+
+/**
+ * This class is created to demonstrate how to support {@link DelegateExecution} API based APPC controller.
+ *
+ * Function wise, it's similar as {@ref AppcClient} groovy code.
+ */
+@Component
+public class AppcControllerDE extends LcmControllerDE {
+
+    private static final int APPC_DELEGATE_EXECUTION_ERROR_CODE = 1102;
+
+    @Override
+    public Boolean understand(ControllerContext<DelegateExecution> context) {
+        return context.getControllerActor().equalsIgnoreCase("appc");
+    }
+
+    @Override
+    public Boolean ready(ControllerContext<DelegateExecution> context) {
+        return true;
+    }
+
+    /**
+     * This method is left empty intentionally. If you are planning to use the Appc Controller, please implement here.
+     *
+     * You can use the {@ref ApplicationControllerAction}, {@ref ApplicationControllerOrchestrator},
+     * {@ref ApplicationControllerClient} or create your own Appc Client proxy.
+     */
+    @Override
+    protected int callLcmClient(ControllerContext<DelegateExecution> context) {
+        return 0;
+    }
+
+    @Override
+    protected int getErrorCode() {
+        return APPC_DELEGATE_EXECUTION_ERROR_CODE;
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/CdsControllerDE.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/CdsControllerDE.java
new file mode 100644
index 0000000..6b0cbc0
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/CdsControllerDE.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.cds;
+
+import java.util.List;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.client.cds.AbstractCDSProcessingBBUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This implementation of {@ref ControllerRunnable} is used for Self service, i.e, blueprint based Controller.
+ */
+@Component
+public class CdsControllerDE extends AbstractCDSProcessingBBUtils implements ControllerRunnable<DelegateExecution> {
+
+    @Autowired(required = false)
+    private List<ControllerPreparable<DelegateExecution>> prepareList;
+
+    @Override
+    public Boolean understand(ControllerContext<DelegateExecution> context) {
+        return context.getControllerActor().equalsIgnoreCase("cds");
+    }
+
+    @Override
+    public Boolean ready(ControllerContext<DelegateExecution> context) {
+        return true;
+    }
+
+    @Override
+    public void prepare(ControllerContext<DelegateExecution> context) {
+        prepareList.stream().filter(prepare -> prepare.understand(context))
+                .forEach(prepare -> prepare.prepare(context));
+    }
+
+    @Override
+    public void run(ControllerContext<DelegateExecution> context) {
+        DelegateExecution execution = context.getExecution();
+        constructExecutionServiceInputObject(execution);
+        sendRequestToCDSClient(execution);
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/prepare/PreparePnfConfigAssignDE.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/prepare/PreparePnfConfigAssignDE.java
new file mode 100644
index 0000000..b0da075
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/prepare/PreparePnfConfigAssignDE.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.cds.prepare;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.bpmn.infrastructure.pnf.delegate.PrepareConfigAssignDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This class implements {@link ControllerPreparable} interface and is used to set up the context for PNF config-assign
+ * action.
+ */
+@Component
+public class PreparePnfConfigAssignDE implements ControllerPreparable<DelegateExecution> {
+
+    @Autowired
+    private PrepareConfigAssignDelegate prepareConfigAssignDelegate;
+
+    @Override
+    public boolean understand(ControllerContext<DelegateExecution> controllerContext) {
+        return controllerContext.getControllerActor().equalsIgnoreCase("cds")
+                && controllerContext.getControllerAction().equalsIgnoreCase("config-assign")
+                && controllerContext.getControllerScope().equalsIgnoreCase("pnf");
+    }
+
+    @Override
+    public void prepare(ControllerContext<DelegateExecution> controllerContext) {
+        prepareConfigAssignDelegate.execute(controllerContext.getExecution());
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/prepare/PreparePnfConfigDeployDE.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/prepare/PreparePnfConfigDeployDE.java
new file mode 100644
index 0000000..b88da2e
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/prepare/PreparePnfConfigDeployDE.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.cds.prepare;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.bpmn.infrastructure.pnf.delegate.PrepareConfigDeployDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This class implements {@link ControllerPreparable} interface and is used to set up the context for PNF config-deploy
+ * action.
+ */
+@Component
+public class PreparePnfConfigDeployDE implements ControllerPreparable<DelegateExecution> {
+
+    @Autowired
+    private PrepareConfigDeployDelegate prepareConfigDeployDelegate;
+
+    @Override
+    public boolean understand(ControllerContext<DelegateExecution> controllerContext) {
+        return controllerContext.getControllerActor().equalsIgnoreCase("cds")
+                && controllerContext.getControllerAction().equalsIgnoreCase("config-deploy")
+                && controllerContext.getControllerScope().equalsIgnoreCase("pnf");
+    }
+
+    @Override
+    public void prepare(ControllerContext<DelegateExecution> controllerContext) {
+        prepareConfigDeployDelegate.execute(controllerContext.getExecution());
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/sdnc/SdncControllerDE.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/sdnc/SdncControllerDE.java
new file mode 100644
index 0000000..db0d402
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/sdnc/SdncControllerDE.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.sdnc;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.LcmControllerDE;
+import org.springframework.stereotype.Component;
+
+/**
+ * This class is created to demonstrate how to support {@link DelegateExecution} API based SDNC controller.
+ *
+ * Function wise, it's similar to the Appc Controller, like in the AppcClient groovy code.
+ */
+@Component
+public class SdncControllerDE extends LcmControllerDE {
+
+    private static final int SDNC_DELEGATE_EXECUTION_ERROR_CODE = 1103;
+
+    @Override
+    public Boolean understand(ControllerContext<DelegateExecution> context) {
+        return context.getControllerActor().equalsIgnoreCase("sdnc");
+    }
+
+    @Override
+    public Boolean ready(ControllerContext<DelegateExecution> context) {
+        return true;
+    }
+
+    /**
+     * This method is left empty intentionally. If you are planning to use the SDNC Controller, please implement here.
+     *
+     * You can use the {@ref ApplicationControllerAction}, {@ref ApplicationControllerOrchestrator},
+     * {@ref ApplicationControllerClient} or create your own SDNC Client proxy.
+     */
+    @Override
+    protected int callLcmClient(ControllerContext<DelegateExecution> context) {
+        return 0;
+    }
+
+    @Override
+    protected int getErrorCode() {
+        return SDNC_DELEGATE_EXECUTION_ERROR_CODE;
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
new file mode 100644
index 0000000..e089da6
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
@@ -0,0 +1,113 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so;
+
+import io.grpc.ServerBuilder;
+import io.grpc.stub.StreamObserver;
+import io.grpc.testing.GrpcCleanupRule;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+import javax.annotation.PostConstruct;
+import org.junit.Rule;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.Status;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class GrpcNettyServer extends BluePrintProcessingServiceImplBase {
+
+    private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class);
+
+    @Value("${cds.endpoint}")
+    private String host;
+
+    @Value("${cds.port}")
+    private String port;
+
+    @Rule
+    public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule();
+
+    private final CountDownLatch allRequestsDelivered = new CountDownLatch(1);
+    private final AtomicReference<StreamObserver<ExecutionServiceOutput>> responseObserverRef = new AtomicReference<>();
+    private final List<ExecutionServiceInput> detailedMessages = new ArrayList<>();
+
+    @PostConstruct
+    public void start() throws IOException {
+
+        final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() {
+            @Override
+            public StreamObserver<ExecutionServiceInput> process(
+                    StreamObserver<ExecutionServiceOutput> responseObserver) {
+
+                responseObserverRef.set(responseObserver);
+
+                StreamObserver<ExecutionServiceInput> requestObserver = new StreamObserver<ExecutionServiceInput>() {
+                    @Override
+                    public void onNext(ExecutionServiceInput message) {
+                        detailedMessages.add(message);
+                        logger.info("Message received: {}", message);
+                        ExecutionServiceOutput executionServiceOutput = ExecutionServiceOutput.newBuilder()
+                                .setActionIdentifiers(message.getActionIdentifiers())
+                                .setStatus(Status.newBuilder().setEventType(EventType.EVENT_COMPONENT_EXECUTED).build())
+                                .build();
+
+                        responseObserverRef.get().onNext(executionServiceOutput);
+                        logger.info("Message sent: {}", executionServiceOutput);
+                    }
+
+                    @Override
+                    public void onError(Throwable t) {
+                        responseObserverRef.get().onError(t);
+                    }
+
+                    @Override
+                    public void onCompleted() {
+                        allRequestsDelivered.countDown();
+                        responseObserverRef.get().onCompleted();
+                    }
+                };
+
+                return requestObserver;
+            }
+        };
+        grpcCleanup.register(ServerBuilder.forPort(Integer.valueOf(port)).directExecutor()
+                .addService(blueprintPrcessorImpl).build().start());
+
+    }
+
+    public List<ExecutionServiceInput> getDetailedMessages() {
+        return this.detailedMessages;
+    }
+
+    public void cleanMessage() {
+        this.detailedMessages.clear();
+    }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBBTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBBTest.java
new file mode 100644
index 0000000..0f9b4d9
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBBTest.java
@@ -0,0 +1,160 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.MockControllerBB.TEST_ACTION;
+import static org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.MockControllerBB.TEST_ACTOR;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {ControllerExecutionBB.class, MockControllerBB.class, ExceptionBuilder.class})
+public class ControllerExecutionBBTest {
+
+    private static final String ACTOR_PARAM = "actor";
+    private static final String ACTION_PARAM = "action";
+    private static final String RESOURCE_TYPE_PARAM = "resource_type";
+
+    private static final String TEST_RESOURCE_CUSTOMIZATION_UUID = "68dc9a92-214c-11e7-93ae-92361f002680";
+    private static final String TEST_CATALOGDB_CONTROLLER_ACTOR = "cds";
+    private static final String TEST_RESOURCE_TYPE = "Firewall";
+    private static final String TEST_CONTROLLER_REFERENCE_ACTOR = "sdnc";
+    private static final String TEST_SCOPE = "pnf";
+
+    @Autowired
+    private ControllerExecutionBB controllerExecutionBB;
+
+    @MockBean
+    private BuildingBlockExecution execution;
+
+    @MockBean
+    private CatalogDbClient client;
+
+    @MockBean
+    private PnfResourceCustomization pnfResourceCustomization;
+
+    @MockBean
+    private VnfResourceCustomization vnfResourceCustomization;
+
+    @MockBean
+    private ControllerSelectionReference controllerSelectionReference;
+
+    @Before
+    public void setUp() {
+        when(execution.getVariable(ACTOR_PARAM)).thenReturn(TEST_ACTOR);
+        when(execution.getVariable(ACTION_PARAM)).thenReturn(MockControllerBB.TEST_ACTION);
+
+        when(pnfResourceCustomization.getControllerActor()).thenReturn(TEST_CATALOGDB_CONTROLLER_ACTOR);
+        when(client.getPnfResourceCustomizationByModelCustomizationUUID(TEST_RESOURCE_CUSTOMIZATION_UUID))
+                .thenReturn(pnfResourceCustomization);
+
+        when(execution.getVariable(RESOURCE_TYPE_PARAM)).thenReturn(TEST_RESOURCE_TYPE);
+        when(controllerSelectionReference.getControllerName()).thenReturn(TEST_CONTROLLER_REFERENCE_ACTOR);
+        when(client.getControllerSelectionReferenceByVnfTypeAndActionCategory(TEST_RESOURCE_TYPE, TEST_ACTION))
+                .thenReturn(controllerSelectionReference);
+    }
+
+    @Test
+    public void testExecution_validInput_expectedOutput() {
+        controllerExecutionBB.execute(execution);
+        verify(execution).setVariable("stage", "ready");
+        verify(execution).setVariable("stage", "prepare");
+        verify(execution).setVariable("stage", "run");
+    }
+
+    @Test
+    public void testGetController_availableInExecutionContext_returnFromExecutionContext() {
+        String controllerActor = controllerExecutionBB.getControllerActor(execution, TEST_SCOPE, "", TEST_ACTION);
+        assertEquals(TEST_ACTOR, controllerActor);
+    }
+
+    @Test
+    public void testGetController_soRefDataInExecutionContext_returnFromControllerReference() {
+        when(execution.getVariable(ACTOR_PARAM)).thenReturn("so-ref-data");
+        String controllerActor = controllerExecutionBB.getControllerActor(execution, TEST_SCOPE, "", TEST_ACTION);
+        assertEquals(TEST_CONTROLLER_REFERENCE_ACTOR, controllerActor);
+    }
+
+    @Test
+    public void testGetController_notAvailableInExecutionContext_returnFromCatalogdb() {
+        when(execution.getVariable(ACTOR_PARAM)).thenReturn("");
+        String controllerActor = controllerExecutionBB.getControllerActor(execution, TEST_SCOPE,
+                TEST_RESOURCE_CUSTOMIZATION_UUID, TEST_ACTION);
+        assertEquals("The controller actor should be the same as in the catalogdb", TEST_CATALOGDB_CONTROLLER_ACTOR,
+                controllerActor);
+    }
+
+    @Test
+    public void testGetController_notAvailableInExecutionContextAndSoRefDataInCatalogdb_returnFromControllerReference() {
+        when(execution.getVariable(ACTOR_PARAM)).thenReturn("");
+        when(pnfResourceCustomization.getControllerActor()).thenReturn("SO-REF-DATA");
+        String controllerActor = controllerExecutionBB.getControllerActor(execution, TEST_SCOPE,
+                TEST_RESOURCE_CUSTOMIZATION_UUID, TEST_ACTION);
+        assertEquals("The controller actor should be the same as in the catalogdb", TEST_CONTROLLER_REFERENCE_ACTOR,
+                controllerActor);
+    }
+
+    @Test
+    public void testGetController_notAvailableInExecutionContextAndCatalogdb_returnFromControllerReference() {
+        when(execution.getVariable(ACTOR_PARAM)).thenReturn("");
+        when(pnfResourceCustomization.getControllerActor()).thenReturn("");
+
+        String controllerActor = controllerExecutionBB.getControllerActor(execution, TEST_SCOPE,
+                TEST_RESOURCE_CUSTOMIZATION_UUID, TEST_ACTION);
+        assertEquals("The controller actor should be the same as in the controller reference table",
+                TEST_CONTROLLER_REFERENCE_ACTOR, controllerActor);
+    }
+
+    @Test
+    public void testGetController_notAvailableInExecutionContextVnfType_returnFromCatalogdb() {
+        when(execution.getVariable(ACTOR_PARAM)).thenReturn("");
+
+        String expectedVnfControllerActor = "appc";
+
+        String[] controllerScopeArray = new String[] {"vnf", "vfModule"};
+
+        for (String controllerScope : controllerScopeArray) {
+
+            when(vnfResourceCustomization.getControllerActor()).thenReturn(expectedVnfControllerActor);
+            when(client.getVnfResourceCustomizationByModelCustomizationUUID(TEST_RESOURCE_CUSTOMIZATION_UUID))
+                    .thenReturn(vnfResourceCustomization);
+
+            String controllerActor = controllerExecutionBB.getControllerActor(execution, controllerScope,
+                    TEST_RESOURCE_CUSTOMIZATION_UUID, TEST_ACTION);
+
+            assertEquals("The controller actor should be the same as in the catalogdb for scope: " + controllerScope,
+                    expectedVnfControllerActor, controllerActor);
+        }
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBBTestIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBBTestIT.java
new file mode 100644
index 0000000..5eef671
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/ControllerExecutionBBTestIT.java
@@ -0,0 +1,194 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.AssertionsForClassTypes.fail;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MODEL_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MSO_REQUEST_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_VERSION;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
+import com.google.protobuf.Struct;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Optional;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.onap.appc.client.lcm.model.Action;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
+import org.onap.so.BaseIntegrationTest;
+import org.onap.so.GrpcNettyServer;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class ControllerExecutionBBTestIT extends BaseIntegrationTest {
+
+    private Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private ControllerExecutionBB controllerExecutionBB;
+
+    @Autowired
+    private GrpcNettyServer grpcNettyServer;
+
+    private GenericVnf genericVnf;
+
+    private static String TEST_MODEL_UUID = "6bc0b04d-1873-4721-b53d-6615225b2a28";
+    private static String TEST_SERVICE_INSTANCE_ID = "test_service_id";
+    private static String TEST_PROCESS_KEY = "processKey1";
+    private static String TEST_MSO_REQUEST_ID = "ff874603-4222-11e7-9252-005056850d2e";
+
+    private static String TEST_CDS_ACTION = "config-assign";
+    private static String TEST_APPC_ACTION = "HealthCheck";
+
+    private static String TEST_PNF_RESOURCE_INSTANCE_NAME = "PNF_demo_resource";
+    private static String TEST_PNF_CORRELATION_ID = "PNFDemo";
+    private static String TEST_PNF_RESOURCE_BLUEPRINT_NAME = "blueprintOnap";
+    private static String TEST_PNF_RESOURCE_BLUEPRINT_VERSION = "1.0.1";
+    private static String TEST_PNF_RESOURCE_CUSTOMIZATION_UUID = "9acb3a83-8a52-412c-9a45-901764938144";
+    private static String TEST_PNF_UUID = "5df8b6de-2083-11e7-93ae-92361f002671";
+
+    @Before
+    public void setUp() {
+        execution.setVariable(MODEL_UUID, TEST_MODEL_UUID);
+        execution.setVariable(SERVICE_INSTANCE_ID, TEST_SERVICE_INSTANCE_ID);
+        execution.setVariable(MSO_REQUEST_ID, TEST_MSO_REQUEST_ID);
+        execution.setVariable("testProcessKey", TEST_PROCESS_KEY);
+
+        grpcNettyServer.cleanMessage();
+    }
+
+    @Test
+    @Ignore
+    // TODO: re-activate this test case after the SO-CDS generic buildingblock implementation in place
+    public void testExecution_cdsConfigAssign_actionExecuted() {
+
+        configureCdsConfigAssign();
+
+        controllerExecutionBB.execute(execution);
+        List<ExecutionServiceInput> detailedMessages = grpcNettyServer.getDetailedMessages();
+        assertThat(detailedMessages).hasSize(1);
+        try {
+            checkConfigAssign(detailedMessages.get(0));
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail("ConfigAssign request exception", e);
+        }
+    }
+
+    @Test
+    @Ignore
+    // TODO: re-activate this test case after the SDNC controller is fully implemented.
+    public void testExecution_sdncUpgradeHealthCheck_actionExecuted() {
+        configureSdncUpgrade();
+        controllerExecutionBB.execute(execution);
+
+        verify(appCClient, times(1)).runAppCCommand(eq(Action.UpgradePreCheck), eq(TEST_MSO_REQUEST_ID), eq(null),
+                any(Optional.class), any(HashMap.class), eq("sdnc"));
+    }
+
+    private void configureSdncUpgrade() {
+        execution.setVariable("actor", "sdnc");
+        execution.setVariable("action", "UpgradePreCheck");
+        execution.setVariable("payload", "{ \n" + "   \"action\":[ \n" + "      { \n"
+                + "         \"UpgradePreCheck\":{ \n" + "            \"payload\":{ \n"
+                + "               \"pnf-flag\":\"true\",\n" + "               \"pnf-name\":\"5gDU0001\",\n"
+                + "               \"pnfId\":\"5gDU0001\",\n"
+                + "               \"ipaddress-v4-oam\":\"192.168.35.83\",\n"
+                + "               \"oldSwVersion\":\"v1\",\n" + "               \"targetSwVersion\":\"v2\",\n"
+                + "               \"ruleName\":\"r001\",\n" + "               \"Id\":\"10\",\n"
+                + "               \"additionalData\":\"{}\"\n" + "            }\n" + "         }\n" + "      },\n"
+                + "      { \n" + "         \"UpgradeSoftware\":{ \n" + "            \"payload\":{ \n"
+                + "               \"pnf-flag\":\"true\",\n" + "               \"pnfId\":\"5gDU0001\",\n"
+                + "               \"ipaddress-v4-oam\":\"192.168.35.83\",\n"
+                + "               \"swToBeDownloaded\":[ \n" + "                  { \n"
+                + "                     \"swLocation\":\"http://192.168.35.96:10080/ran_du_pkg1-v2.zip\",\n"
+                + "                     \"swFileSize\":353,\n" + "                     \"swFileCompression\":\"ZIP\",\n"
+                + "                     \"swFileFormat\":\"zip\"\n" + "                  }\n" + "               ]\n"
+                + "            }\n" + "         }\n" + "      }\n" + "   ]\n" + "}");
+
+        setServiceInstance();
+        genericVnf = setGenericVnf();
+
+        RequestContext requestContext = setRequestContext();
+        requestContext.setMsoRequestId(TEST_MSO_REQUEST_ID);
+        gBBInput.setRequestContext(requestContext);
+    }
+
+    private void configureCdsConfigAssign() {
+        execution.setVariable("actor", "cds");
+        execution.setVariable("scope", "pnf");
+        execution.setVariable("action", TEST_CDS_ACTION);
+
+        execution.setVariable(PNF_CORRELATION_ID, TEST_PNF_CORRELATION_ID);
+        execution.setVariable(PNF_UUID, TEST_PNF_UUID);
+        execution.setVariable(PRC_INSTANCE_NAME, TEST_PNF_RESOURCE_INSTANCE_NAME);
+        execution.setVariable(PRC_CUSTOMIZATION_UUID, TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+        execution.setVariable(PRC_BLUEPRINT_NAME, TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+        execution.setVariable(PRC_BLUEPRINT_VERSION, TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+    }
+
+    private void checkConfigAssign(ExecutionServiceInput executionServiceInput) {
+
+        logger.info("Checking the configAssign request");
+        ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
+
+        /**
+         * the fields of actionIdentifiers should match the one in the
+         * response/createVcpeResCustServiceSimplifiedTest_catalogdb.json.
+         */
+        assertThat(actionIdentifiers.getBlueprintName()).isEqualTo(TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+        assertThat(actionIdentifiers.getBlueprintVersion()).isEqualTo(TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+        assertThat(actionIdentifiers.getActionName()).isEqualTo(TEST_CDS_ACTION);
+        assertThat(actionIdentifiers.getMode()).isEqualTo("sync");
+
+        CommonHeader commonHeader = executionServiceInput.getCommonHeader();
+        assertThat(commonHeader.getOriginatorId()).isEqualTo("SO");
+        assertThat(commonHeader.getRequestId()).isEqualTo(TEST_MSO_REQUEST_ID);
+
+        Struct payload = executionServiceInput.getPayload();
+        Struct requeststruct = payload.getFieldsOrThrow("config-assign-request").getStructValue();
+
+        assertThat(requeststruct.getFieldsOrThrow("resolution-key").getStringValue())
+                .isEqualTo(TEST_PNF_CORRELATION_ID);
+        Struct propertiesStruct = requeststruct.getFieldsOrThrow("config-assign-properties").getStructValue();
+
+        assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).isEqualTo(TEST_PNF_CORRELATION_ID);
+        assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue()).isEqualTo(TEST_MODEL_UUID);
+        assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue())
+                .isEqualTo(TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+    }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/MockControllerBB.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/MockControllerBB.java
new file mode 100644
index 0000000..06fd01d
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/MockControllerBB.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock;
+
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MockControllerBB implements ControllerRunnable<BuildingBlockExecution> {
+
+    public static final String TEST_ACTOR = "test-controller";
+    public static final String TEST_ACTION = "configuration";
+
+    @Override
+    public Boolean understand(ControllerContext<BuildingBlockExecution> context) {
+        return context.getControllerAction().equalsIgnoreCase(TEST_ACTION)
+                && context.getControllerActor().equalsIgnoreCase(TEST_ACTOR);
+    }
+
+    @Override
+    public Boolean ready(ControllerContext<BuildingBlockExecution> context) {
+        context.getExecution().setVariable("stage", "ready");
+        return true;
+    }
+
+    @Override
+    public void prepare(ControllerContext<BuildingBlockExecution> context) {
+        context.getExecution().setVariable("stage", "prepare");
+    }
+
+    @Override
+    public void run(ControllerContext<BuildingBlockExecution> context) {
+        context.getExecution().setVariable("stage", "run");
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/appc/AppcControllerBBTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/appc/AppcControllerBBTest.java
new file mode 100644
index 0000000..46cb818
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/appc/AppcControllerBBTest.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller.appc;
+
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.mockito.Mockito.when;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.client.appc.ApplicationControllerAction;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {AppcControllerBB.class, ExceptionBuilder.class})
+public class AppcControllerBBTest {
+
+    @Autowired
+    private AppcControllerBB appcControllerBB;
+
+    @MockBean
+    private ControllerContext controllerContext;
+
+    @MockBean
+    protected ApplicationControllerAction client;
+
+    @Before
+    public void setUp() {
+        when(controllerContext.getControllerActor()).thenReturn("appc");
+    }
+
+    @Test
+    public void testUnderstand_validContext_TrueReturned() {
+        assertTrue(appcControllerBB.understand(controllerContext));
+    }
+
+    @Test
+    public void testUnderstand_invalidContext_FalseReturned() {
+        when(controllerContext.getControllerActor()).thenReturn("sdnc");
+        assertFalse(appcControllerBB.understand(controllerContext));
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/SdncControllerBBTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/SdncControllerBBTest.java
new file mode 100644
index 0000000..5c3b439
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/buildingblock/controller/sdnc/SdncControllerBBTest.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.controller.sdnc;
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.mockito.Mockito.when;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.client.appc.ApplicationControllerAction;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {SdncControllerBB.class, ExceptionBuilder.class})
+public class SdncControllerBBTest {
+
+    @Autowired
+    private SdncControllerBB sSdncControllerBB;
+
+    @MockBean
+    private ControllerContext controllerContext;
+
+    @MockBean
+    protected ApplicationControllerAction client;
+
+    @Before
+    public void setUp() {
+        when(controllerContext.getControllerActor()).thenReturn("sdnc");
+    }
+
+    @Test
+    public void testUnderstand_validContext_TrueReturned() {
+        assertTrue(sSdncControllerBB.understand(controllerContext));
+    }
+
+    @Test
+    public void testUnderstand_invalidContext_FalseReturned() {
+        when(controllerContext.getControllerActor()).thenReturn("cds");
+        assertFalse(sSdncControllerBB.understand(controllerContext));
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDETest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDETest.java
new file mode 100644
index 0000000..15a1a1e
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDETest.java
@@ -0,0 +1,160 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.MockControllerDE.TEST_ACTION;
+import static org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.MockControllerDE.TEST_ACTOR;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {ControllerExecutionDE.class, MockControllerDE.class, ExceptionBuilder.class})
+public class ControllerExecutionDETest {
+
+    private static final String ACTOR_PARAM = "actor";
+    private static final String ACTION_PARAM = "action";
+    private static final String RESOURCE_TYPE_PARAM = "resource_type";
+
+    private static final String TEST_RESOURCE_CUSTOMIZATION_UUID = "68dc9a92-214c-11e7-93ae-92361f002680";
+    private static final String TEST_CATALOGDB_CONTROLLER_ACTOR = "cds";
+    private static final String TEST_RESOURCE_TYPE = "Firewall";
+    private static final String TEST_CONTROLLER_REFERENCE_ACTOR = "sdnc";
+    private static final String TEST_SCOPE = "pnf";
+
+    @Autowired
+    private ControllerExecutionDE controllerExecutionDE;
+
+    @MockBean
+    private CatalogDbClient client;
+
+    @MockBean
+    private PnfResourceCustomization pnfResourceCustomization;
+
+    @MockBean
+    private VnfResourceCustomization vnfResourceCustomization;
+
+    @MockBean
+    private ControllerSelectionReference controllerSelectionReference;
+
+    private DelegateExecution execution = new DelegateExecutionFake();
+
+    @Before
+    public void setUp() {
+        execution.setVariable(ACTION_PARAM, TEST_ACTION);
+        execution.setVariable(ACTOR_PARAM, TEST_ACTOR);
+
+        when(pnfResourceCustomization.getControllerActor()).thenReturn(TEST_CATALOGDB_CONTROLLER_ACTOR);
+        when(client.getPnfResourceCustomizationByModelCustomizationUUID(TEST_RESOURCE_CUSTOMIZATION_UUID))
+                .thenReturn(pnfResourceCustomization);
+
+        execution.setVariable(RESOURCE_TYPE_PARAM, TEST_RESOURCE_TYPE);
+        when(controllerSelectionReference.getControllerName()).thenReturn(TEST_CONTROLLER_REFERENCE_ACTOR);
+        when(client.getControllerSelectionReferenceByVnfTypeAndActionCategory(TEST_RESOURCE_TYPE, TEST_ACTION))
+                .thenReturn(controllerSelectionReference);
+    }
+
+    @Test
+    public void testExecution_validInput_expectedOutput() {
+        controllerExecutionDE.execute(execution);
+        assertTrue((Boolean) execution.getVariable("ready"));
+        assertTrue((Boolean) execution.getVariable("prepare"));
+        assertTrue((Boolean) execution.getVariable("run"));
+    }
+
+    @Test
+    public void testGetController_availableInExecutionContext_returnFromExecutionContext() {
+        String controllerActor = controllerExecutionDE.getControllerActor(execution, TEST_SCOPE, "", TEST_ACTION);
+        assertEquals(TEST_ACTOR, controllerActor);
+    }
+
+    @Test
+    public void testGetController_soRefDataInExecutionContext_returnFromExecutionContext() {
+        execution.setVariable(ACTOR_PARAM, "so-ref-data");
+        String controllerActor = controllerExecutionDE.getControllerActor(execution, TEST_SCOPE, "", TEST_ACTION);
+        assertEquals(TEST_CONTROLLER_REFERENCE_ACTOR, controllerActor);
+    }
+
+    @Test
+    public void testGetController_notAvailableInExecutionContext_returnFromCatalogdb() {
+        execution.setVariable(ACTOR_PARAM, "");
+        String controllerActor = controllerExecutionDE.getControllerActor(execution, TEST_SCOPE,
+                TEST_RESOURCE_CUSTOMIZATION_UUID, TEST_ACTION);
+        assertEquals("The controller actor should be the same as in the catalogdb", TEST_CATALOGDB_CONTROLLER_ACTOR,
+                controllerActor);
+    }
+
+    @Test
+    public void testGetController_notAvailableInExecutionContextAndSoRefDataInCatalogdb_returnFromControllerReference() {
+        execution.setVariable(ACTOR_PARAM, "");
+        when(pnfResourceCustomization.getControllerActor()).thenReturn("SO-REF-DATA");
+        String controllerActor = controllerExecutionDE.getControllerActor(execution, TEST_SCOPE,
+                TEST_RESOURCE_CUSTOMIZATION_UUID, TEST_ACTION);
+        assertEquals("The controller actor should be the same as in the catalogdb", TEST_CONTROLLER_REFERENCE_ACTOR,
+                controllerActor);
+    }
+
+    @Test
+    public void testGetController_notAvailableInExecutionContextAndCatalogdb_returnFromControllerReference() {
+        execution.setVariable(ACTOR_PARAM, "");
+        when(pnfResourceCustomization.getControllerActor()).thenReturn("");
+
+        String controllerActor = controllerExecutionDE.getControllerActor(execution, TEST_SCOPE,
+                TEST_RESOURCE_CUSTOMIZATION_UUID, TEST_ACTION);
+        assertEquals("The controller actor should be the same as in the controller reference table",
+                TEST_CONTROLLER_REFERENCE_ACTOR, controllerActor);
+    }
+
+    @Test
+    public void testGetController_notAvailableInExecutionContextVnfType_returnFromCatalogdb() {
+        execution.setVariable(ACTOR_PARAM, "");
+
+        String expectedVnfControllerActor = "appc";
+
+        String[] controllerScopeArray = new String[] {"vnf", "vfModule"};
+
+        for (String controllerScope : controllerScopeArray) {
+
+            when(vnfResourceCustomization.getControllerActor()).thenReturn(expectedVnfControllerActor);
+            when(client.getVnfResourceCustomizationByModelCustomizationUUID(TEST_RESOURCE_CUSTOMIZATION_UUID))
+                    .thenReturn(vnfResourceCustomization);
+
+            String controllerActor = controllerExecutionDE.getControllerActor(execution, controllerScope,
+                    TEST_RESOURCE_CUSTOMIZATION_UUID, TEST_ACTION);
+
+            assertEquals("The controller actor should be the same as in the catalogdb for scope: " + controllerScope,
+                    expectedVnfControllerActor, controllerActor);
+        }
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDETestIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDETestIT.java
new file mode 100644
index 0000000..860780a
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/ControllerExecutionDETestIT.java
@@ -0,0 +1,144 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.AssertionsForClassTypes.fail;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MODEL_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MSO_REQUEST_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_VERSION;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
+import com.google.protobuf.Struct;
+import java.util.List;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
+import org.onap.so.BaseIntegrationTest;
+import org.onap.so.GrpcNettyServer;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class ControllerExecutionDETestIT extends BaseIntegrationTest {
+
+    private Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    @Autowired
+    private ControllerExecutionDE controllerExecutionDE;
+
+    @Autowired
+    private GrpcNettyServer grpcNettyServer;
+
+    private GenericVnf genericVnf;
+
+    private static String TEST_MODEL_UUID = "6bc0b04d-1873-4721-b53d-6615225b2a28";
+    private static String TEST_SERVICE_INSTANCE_ID = "test_service_id";
+    private static String TEST_PROCESS_KEY = "processKey1";
+    private static String TEST_MSO_REQUEST_ID = "ff874603-4222-11e7-9252-005056850d2e";
+
+    private static String TEST_CDS_ACTION = "config-assign";
+    private static String TEST_APPC_ACTION = "HealthCheck";
+
+    private static String TEST_PNF_RESOURCE_INSTANCE_NAME = "PNF_demo_resource";
+    private static String TEST_PNF_CORRELATION_ID = "PNFDemo";
+    private static String TEST_PNF_RESOURCE_BLUEPRINT_NAME = "blueprintOnap";
+    private static String TEST_PNF_RESOURCE_BLUEPRINT_VERSION = "1.0.1";
+    private static String TEST_PNF_RESOURCE_CUSTOMIZATION_UUID = "9acb3a83-8a52-412c-9a45-901764938144";
+    private static String TEST_PNF_UUID = "5df8b6de-2083-11e7-93ae-92361f002671";
+
+    @Before
+    public void setUp() {
+        delegateExecution.setVariable(MODEL_UUID, TEST_MODEL_UUID);
+        delegateExecution.setVariable(SERVICE_INSTANCE_ID, TEST_SERVICE_INSTANCE_ID);
+        delegateExecution.setVariable(MSO_REQUEST_ID, TEST_MSO_REQUEST_ID);
+        delegateExecution.setVariable("testProcessKey", TEST_PROCESS_KEY);
+
+        grpcNettyServer.cleanMessage();
+    }
+
+    @Test
+    public void testExecution_cdsConfigAssign_actionExecuted() {
+
+        configureCdsConfigAssign();
+
+        controllerExecutionDE.execute(delegateExecution);
+        List<ExecutionServiceInput> detailedMessages = grpcNettyServer.getDetailedMessages();
+        assertThat(detailedMessages).hasSize(1);
+        try {
+            checkConfigAssign(detailedMessages.get(0));
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail("ConfigAssign request exception", e);
+        }
+    }
+
+    private void configureCdsConfigAssign() {
+        delegateExecution.setVariable("actor", "cds");
+        delegateExecution.setVariable("action", TEST_CDS_ACTION);
+        delegateExecution.setVariable("scope", "pnf");
+
+        delegateExecution.setVariable(PNF_CORRELATION_ID, TEST_PNF_CORRELATION_ID);
+        delegateExecution.setVariable(PNF_UUID, TEST_PNF_UUID);
+        delegateExecution.setVariable(PRC_INSTANCE_NAME, TEST_PNF_RESOURCE_INSTANCE_NAME);
+        delegateExecution.setVariable(PRC_CUSTOMIZATION_UUID, TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+        delegateExecution.setVariable(PRC_BLUEPRINT_NAME, TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+        delegateExecution.setVariable(PRC_BLUEPRINT_VERSION, TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+    }
+
+    private void checkConfigAssign(ExecutionServiceInput executionServiceInput) {
+
+        logger.info("Checking the configAssign request");
+        ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
+
+        /**
+         * the fields of actionIdentifiers should match the one in the
+         * response/createVcpeResCustServiceSimplifiedTest_catalogdb.json.
+         */
+        assertThat(actionIdentifiers.getBlueprintName()).isEqualTo(TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+        assertThat(actionIdentifiers.getBlueprintVersion()).isEqualTo(TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+        assertThat(actionIdentifiers.getActionName()).isEqualTo(TEST_CDS_ACTION);
+        assertThat(actionIdentifiers.getMode()).isEqualTo("sync");
+
+        CommonHeader commonHeader = executionServiceInput.getCommonHeader();
+        assertThat(commonHeader.getOriginatorId()).isEqualTo("SO");
+        assertThat(commonHeader.getRequestId()).isEqualTo(TEST_MSO_REQUEST_ID);
+
+        Struct payload = executionServiceInput.getPayload();
+        Struct requeststruct = payload.getFieldsOrThrow("config-assign-request").getStructValue();
+
+        assertThat(requeststruct.getFieldsOrThrow("resolution-key").getStringValue())
+                .isEqualTo(TEST_PNF_CORRELATION_ID);
+        Struct propertiesStruct = requeststruct.getFieldsOrThrow("config-assign-properties").getStructValue();
+
+        assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).isEqualTo(TEST_PNF_CORRELATION_ID);
+        assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue()).isEqualTo(TEST_MODEL_UUID);
+        assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue())
+                .isEqualTo(TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+    }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/MockControllerDE.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/MockControllerDE.java
new file mode 100644
index 0000000..c66fefd
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/MockControllerDE.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerRunnable;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MockControllerDE implements ControllerRunnable<DelegateExecution> {
+
+    public static final String TEST_ACTOR = "test-controller";
+    public static final String TEST_ACTION = "configuration";
+
+    @Override
+    public Boolean understand(ControllerContext<DelegateExecution> context) {
+        return context.getControllerAction().equalsIgnoreCase(TEST_ACTION)
+                && context.getControllerActor().equalsIgnoreCase(TEST_ACTOR);
+    }
+
+    @Override
+    public Boolean ready(ControllerContext<DelegateExecution> context) {
+        context.getExecution().setVariable("ready", true);
+        return true;
+    }
+
+    @Override
+    public void prepare(ControllerContext<DelegateExecution> context) {
+        context.getExecution().setVariable("prepare", true);
+    }
+
+    @Override
+    public void run(ControllerContext<DelegateExecution> context) {
+        context.getExecution().setVariable("run", true);
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/appc/AppcControllerDETest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/appc/AppcControllerDETest.java
new file mode 100644
index 0000000..3b7a863
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/appc/AppcControllerDETest.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.appc;
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.mockito.Mockito.when;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.client.appc.ApplicationControllerAction;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {AppcControllerDE.class, ExceptionBuilder.class})
+public class AppcControllerDETest {
+
+    @Autowired
+    private AppcControllerDE appcControllerDE;
+
+    @MockBean
+    private ControllerContext controllerContext;
+
+    @MockBean
+    private ControllerPreparable<DelegateExecution> preparable;
+
+    @MockBean
+    protected ApplicationControllerAction client;
+
+    @Before
+    public void setUp() {
+        when(controllerContext.getControllerActor()).thenReturn("appc");
+    }
+
+    @Test
+    public void testUnderstand_validContext_TrueReturned() {
+        assertTrue(appcControllerDE.understand(controllerContext));
+    }
+
+    @Test
+    public void testUnderstand_invalidContext_FalseReturned() {
+        when(controllerContext.getControllerActor()).thenReturn("sdnc");
+        assertFalse(appcControllerDE.understand(controllerContext));
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/CdsControllerDETest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/CdsControllerDETest.java
new file mode 100644
index 0000000..79bce8a
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/cds/CdsControllerDETest.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.cds;
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.mockito.Mockito.when;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {CdsControllerDE.class, ExceptionBuilder.class})
+public class CdsControllerDETest {
+
+    @Autowired
+    private CdsControllerDE cdsControllerDE;
+
+    @MockBean
+    private ControllerContext controllerContext;
+
+    @MockBean
+    private ControllerPreparable<DelegateExecution> preparable;
+
+    @Before
+    public void setUp() {
+        when(controllerContext.getControllerActor()).thenReturn("cds");
+    }
+
+    @Test
+    public void testUnderstand_validContext_TrueReturned() {
+        assertTrue(cdsControllerDE.understand(controllerContext));
+    }
+
+    @Test
+    public void testUnderstand_invalidContext_FalseReturned() {
+        when(controllerContext.getControllerActor()).thenReturn("appc");
+        assertFalse(cdsControllerDE.understand(controllerContext));
+    }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/sdnc/SdncControllerDETest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/sdnc/SdncControllerDETest.java
new file mode 100644
index 0000000..6741676
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/decisionpoint/impl/camunda/controller/sdnc/SdncControllerDETest.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix
+ *  ================================================================================
+ *  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.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.sdnc;
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.mockito.Mockito.when;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.ControllerContext;
+import org.onap.so.bpmn.infrastructure.decisionpoint.api.controller.ControllerPreparable;
+import org.onap.so.client.appc.ApplicationControllerAction;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {SdncControllerDE.class, ExceptionBuilder.class})
+public class SdncControllerDETest {
+
+    @Autowired
+    private SdncControllerDE sdncControllerDE;
+
+    @MockBean
+    private ControllerContext controllerContext;
+
+    @MockBean
+    private ControllerPreparable<DelegateExecution> preparable;
+
+    @MockBean
+    protected ApplicationControllerAction client;
+
+    @Before
+    public void setUp() {
+        when(controllerContext.getControllerActor()).thenReturn("sdnc");
+    }
+
+    @Test
+    public void testUnderstand_validContext_TrueReturned() {
+        assertTrue(sdncControllerDE.understand(controllerContext));
+    }
+
+    @Test
+    public void testUnderstand_invalidContext_FalseReturned() {
+        when(controllerContext.getControllerActor()).thenReturn("cds");
+        assertFalse(sdncControllerDE.understand(controllerContext));
+    }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml b/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml
index fed2aa6..199274e 100644
--- a/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml
+++ b/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml
@@ -215,3 +215,9 @@
     metrics:
       enabled: false
       db-reporter-activate: false
+# CDSProcessingClient
+cds:
+  endpoint: localhost
+  port: 11012
+  auth: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
+  timeout: 60
