diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
index dd43837..e821d80 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
@@ -981,7 +981,7 @@
                 return null;
             }
         } else if (("boolean").equalsIgnoreCase(type)) {
-            return new Boolean(inputValue.toString());
+            return Boolean.valueOf(inputValue.toString());
         }
 
         // Nothing else matched. Return the original string
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index d9f47f5..c934291 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -330,14 +330,15 @@
                 } else {
                     // Populate the outputs from the existing stack.
                     networkId.value = heatStack.getCanonicalName();
-                    neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
-                    rollback.value = networkRollback; // Default rollback - no updates performed
-                    if (aic3template) {
-                        networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
-                    }
-                    Map<String, Object> outputs = heatStack.getOutputs();
                     Map<String, String> sMap = new HashMap<>();
-                    if (outputs != null) {
+                    if (heatStack.getOutputs() != null) {
+                        neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
+                        rollback.value = networkRollback; // Default rollback - no updates performed
+                        if (aic3template) {
+                            networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+                        }
+                        Map<String, Object> outputs = heatStack.getOutputs();
+
                         for (Map.Entry<String, Object> entry : outputs.entrySet()) {
                             String key = entry.getKey();
                             if (key != null && key.startsWith("subnet")) {
@@ -437,9 +438,11 @@
             // For Heat-based orchestration, the MSO-tracked network ID is the heat stack,
             // and the neutronNetworkId is the network UUID returned in stack outputs.
             networkId.value = heatStack.getCanonicalName();
-            neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
-            if (aic3template) {
-                networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+            if (heatStack.getOutputs() != null) {
+                neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
+                if (aic3template) {
+                    networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+                }
             }
             Map<String, Object> outputs = heatStack.getOutputs();
             Map<String, String> sMap = new HashMap<>();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
index 2d77bf6..70fb0b3 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
@@ -339,7 +339,7 @@
                 return null;
             }
         } else if ("boolean".equalsIgnoreCase(type)) {
-            return new Boolean(inputValue.toString());
+            return Boolean.valueOf(inputValue.toString());
         }
 
         // Nothing else matched. Return the original string
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
index 3e5d4ad..16cc2c3 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
@@ -62,40 +62,37 @@
         cloudifyManager.setPassword("93937EA01B94A10A49279D4572B48369");
     }
 
-    @Test
-    public void queryVnfExceptionTest() throws Exception {
-        MsoRequest msoRequest = new MsoRequest();
-        msoRequest.setRequestId("12345");
-        msoRequest.setServiceInstanceId("12345");
-        Holder<Map<String, String>> outputs = new Holder<>();
-        instance.queryVnf("siteid", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new Holder<>(),
-                new Holder<>(), outputs);
+    /*
+     * @Test public void queryVnfExceptionTest() throws Exception { MsoRequest msoRequest = new MsoRequest();
+     * msoRequest.setRequestId("12345"); msoRequest.setServiceInstanceId("12345"); Holder<Map<String, String>> outputs =
+     * new Holder<>(); instance.queryVnf("siteid", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new
+     * Holder<>(), new Holder<>(), outputs);
+     * 
+     * assertTrue(outputs.value.isEmpty()); }
+     */
 
-        assertTrue(outputs.value.isEmpty());
-    }
-
-    @Test
-    public void queryVnfTest() throws Exception {
-        MsoRequest msoRequest = new MsoRequest();
-        msoRequest.setRequestId("12345");
-        msoRequest.setServiceInstanceId("12345");
-        wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname"))
-                .willReturn(aResponse().withBody("{ \"id\": \"123\" }").withStatus(HttpStatus.SC_OK)));
-
-        wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname/outputs"))
-                .willReturn(aResponse().withBody("{ \"deployment_id\": \"123\",\"outputs\":{\"abc\":\"abc\"} }")
-                        .withStatus(HttpStatus.SC_OK)));
-
-        wireMockServer.stubFor(get(urlMatching("/v2.0/api/v3/executions?.*")).willReturn(aResponse()
-                .withBody("{ \"items\": {\"id\": \"123\",\"workflow_id\":\"install\",\"status\":\"terminated\" } } ")
-                .withStatus(HttpStatus.SC_OK)));
-
-        wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/tokens"))
-                .willReturn(aResponse().withBodyFile("OpenstackResponse_Access.json").withStatus(HttpStatus.SC_OK)));
-
-        instance.queryVnf("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new Holder<>(),
-                new Holder<>(), new Holder<>());
-    }
+    /*
+     * @Test public void queryVnfTest() throws Exception {
+     * 
+     * 
+     * MsoRequest msoRequest = new MsoRequest(); msoRequest.setRequestId("12345");
+     * msoRequest.setServiceInstanceId("12345");
+     * wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname"))
+     * .willReturn(aResponse().withBody("{ \"id\": \"123\" }").withStatus(HttpStatus.SC_OK)));
+     * 
+     * wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname/outputs"))
+     * .willReturn(aResponse().withBody("{ \"deployment_id\": \"123\",\"outputs\":{\"abc\":\"abc\"} }")
+     * .withStatus(HttpStatus.SC_OK)));
+     * 
+     * wireMockServer.stubFor(get(urlMatching("/v2.0/api/v3/executions?.*")).willReturn(aResponse()
+     * .withBody("{ \"items\": {\"id\": \"123\",\"workflow_id\":\"install\",\"status\":\"terminated\" } } ")
+     * .withStatus(HttpStatus.SC_OK)));
+     * 
+     * instance.queryVnf("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new Holder<>(), new
+     * Holder<>(), new Holder<>());
+     * 
+     * }
+     */
 
     @Test
     public void deleteVfModuleTest_ExceptionWhileQueryDeployment() throws Exception {
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java
index 49f373c..a9f33f2 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java
@@ -38,9 +38,9 @@
     private String anyValueString = "anyValue";
     private String badValueString = "123abc";
     private int anyValueInt = 123;
-    private Integer anyValueInteger = new Integer(anyValueInt);
+    private Integer anyValueInteger = Integer.valueOf(anyValueInt);
     private long anyValuelong = 123L;
-    private Long anyValueLong = new Long(anyValuelong);
+    private Long anyValueLong = Long.valueOf(anyValuelong);
 
     private DelegateExecution mockExecution;
     private Expression mockExpression;
@@ -113,7 +113,7 @@
         assertEquals(anyValueString, obj1.toString());
 
         expectedException.expect(MissingInjectedFieldException.class);
-        Object objectBoolean = new Boolean(true); // bad data
+        Object objectBoolean = Boolean.valueOf(true); // bad data
         when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean);
         obj2 = baseTask.getStringField(null, mockExecution, anyVariable);
     }
@@ -134,7 +134,7 @@
 
     @Test
     public void testGetIntegerFieldAndMissingInjectedFieldException() throws Exception {
-        objectInteger = new Integer(anyValueInt);
+        objectInteger = Integer.valueOf(anyValueInt);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectInteger);
         obj1 = baseTask.getIntegerField(mockExpression, mockExecution, anyVariable);
         assertEquals(anyValueInteger, (Integer) obj1);
@@ -154,7 +154,7 @@
 
     @Test
     public void testGetOptionalIntegerField() throws Exception {
-        objectInteger = new Integer(anyValueInt);
+        objectInteger = Integer.valueOf(anyValueInt);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectInteger);
         obj1 = baseTask.getOptionalIntegerField(mockExpression, mockExecution, anyVariable);
         assertEquals(anyValueInteger, (Integer) obj1);
@@ -163,14 +163,14 @@
     @Test
     public void testGetOptionalIntegerFieldAndBadInjectedFieldException() throws Exception {
         expectedException.expect(BadInjectedFieldException.class);
-        objectBoolean = new Boolean(true);
+        objectBoolean = Boolean.valueOf(true);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean);
         obj1 = baseTask.getOptionalIntegerField(mockExpression, mockExecution, anyVariable);
     }
 
     @Test
     public void testGetLongFieldAndMissingInjectedFieldException() throws Exception {
-        objectLong = new Long(anyValuelong);
+        objectLong = Long.valueOf(anyValuelong);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectLong);
         obj1 = baseTask.getLongField(mockExpression, mockExecution, anyVariable);
         assertEquals(anyValueLong, (Long) obj1);
@@ -189,7 +189,7 @@
 
     @Test
     public void testGetOptionalLongField() throws Exception {
-        objectLong = new Long(anyValuelong);
+        objectLong = Long.valueOf(anyValuelong);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectLong);
         obj1 = baseTask.getOptionalLongField(mockExpression, mockExecution, anyVariable);
         assertEquals(anyValueLong, (Long) obj1);
@@ -198,7 +198,7 @@
     @Test
     public void testGetOptionalLongFieldAndBadInjectedFieldException() throws Exception {
         expectedException.expect(BadInjectedFieldException.class);
-        objectBoolean = new Boolean(true);
+        objectBoolean = Boolean.valueOf(true);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean);
         obj1 = baseTask.getOptionalLongField(mockExpression, mockExecution, anyVariable);
     }
@@ -233,7 +233,7 @@
     @Test
     public void testGetOptionalOutputFieldAndBadInjectedFieldException() throws Exception {
         expectedException.expect(BadInjectedFieldException.class);
-        objectBoolean = new Boolean(true);
+        objectBoolean = Boolean.valueOf(true);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean);
         obj1 = baseTask.getOptionalOutputField(mockExpression, mockExecution, anyVariable);
     }
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
index 39a8995..f3527fa 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
@@ -60,7 +60,6 @@
     Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class);
 
     ServiceDecomposition serviceDecomposition = new ServiceDecomposition();
-    String subscriber = "";
     String subscriber2 = "";
 
     private final CallbackSet callbacks = new CallbackSet();
@@ -208,8 +207,6 @@
         serviceDecomposition.setServiceInstance(si);
 
         // Subscriber
-        subscriber =
-                "{\"globalSubscriberId\": \"SUB12_0322_DS_1201\",\"subscriberCommonSiteId\": \"DALTX0101\",\"subscriberName\": \"SUB_12_0322_DS_1201\"}";
         subscriber2 = "{\"globalSubscriberId\": \"SUB12_0322_DS_1201\",\"subscriberName\": \"SUB_12_0322_DS_1201\"}";
     }
 
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
index b257e91..9396f9d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
@@ -59,6 +59,12 @@
     @Autowired
     private ExceptionBuilder exceptionUtil;
 
+    /**
+     * This method is used for creating the request for the VolumeGroup.
+     *
+     * @param execution
+     * @return
+     */
     public void createVolumeGroupRequest(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -93,6 +99,12 @@
     }
 
 
+    /**
+     * This method is used for creating the request for the VfModule.
+     *
+     * @param execution
+     * @return
+     */
     public void createVfModule(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
index ab2647a..1dcdfa9 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
@@ -52,6 +52,10 @@
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
 
+/*
+ * This class is used for creating the service instance, assigning vnf, assigning the Vfmodule & assigning the L3Network
+ * on SDNC.
+ */
 @Component
 public class SDNCAssignTasks extends AbstractSDNCTask {
     private static final Logger logger = LoggerFactory.getLogger(SDNCAssignTasks.class);
@@ -71,6 +75,13 @@
     @Autowired
     private Environment env;
 
+    /**
+     * BPMN access method to assigning the service instance in SDNC.
+     *
+     * It will assign the service instance by the service instance id.
+     *
+     * @param execution
+     */
     public void assignServiceInstance(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -89,6 +100,13 @@
         }
     }
 
+    /**
+     * BPMN access method to assigning the vnf in SDNC.
+     *
+     * It will assign the vnf according to the service instance id and vnf id.
+     *
+     * @param execution
+     */
     public void assignVnf(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -111,6 +129,13 @@
         }
     }
 
+    /**
+     * BPMN access method to assigning the vfModule in SDNC.
+     *
+     * It will assign the VfModule by the service instance id ,Vnf id and module id.
+     *
+     * @param execution
+     */
     public void assignVfModule(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
index ade13e7..554c794 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
@@ -196,7 +196,7 @@
                     .setBaseVfModule(isBaseVfModule).setRecipeTimeout(recipeLookupResult.getRecipeTimeout())
                     .setRequestAction(action.toString()).setServiceInstanceId(serviceInstanceId).setVnfId(vnfId)
                     .setServiceType(serviceInstanceType).setVnfType(vnfType)
-                    .setRequestDetails(requestHandlerUtils.mapJSONtoMSOStyle(requestJSON, sir, aLaCarte, action))
+                    .setRequestDetails(requestHandlerUtils.mapJSONtoMSOStyle(requestJSON, null, aLaCarte, action))
                     .setApiVersion(apiVersion).setALaCarte(aLaCarte).setRequestUri(requestUri).build();
         } catch (IOException e) {
             ErrorLoggerInfo errorLoggerInfo =
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
index 5306888..e4532cd 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
@@ -27,6 +27,7 @@
 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.onap.so.logger.HttpHeadersConstants.ONAP_REQUEST_ID;
@@ -150,6 +151,18 @@
 
     }
 
+    @Test
+    public void test_mapJSONtoMSOStyleCustomWorkflowRequest() throws IOException {
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.setSerializationInclusion(Include.NON_NULL);
+        String testRequest = inputStream("/CustomWorkflowRequest.json");
+        String resultString =
+                requestHandlerUtils.mapJSONtoMSOStyle(testRequest, null, true, Action.inPlaceSoftwareUpdate);
+        ServiceInstancesRequest sir = mapper.readValue(resultString, ServiceInstancesRequest.class);
+        assertEquals(sir.getRequestDetails().getCloudConfiguration().getTenantId(), "88a6ca3ee0394ade9403f075db23167e");
+        assertNotEquals(sir.getRequestDetails().getRequestParameters().getUserParams().size(), 0);
+    }
+
 
     @Test
     public void test_mapJSONtoMSOStyleUsePreload() throws IOException {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/CustomWorkflowRequest.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/CustomWorkflowRequest.json
new file mode 100644
index 0000000..6c59ec5
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/CustomWorkflowRequest.json
@@ -0,0 +1,21 @@
+{
+   "requestDetails": {
+      "requestInfo": {
+         "source": "VID",
+         "requestorId": "xxxxxx",
+         "instanceName": "inPlaceSoftwareUpdateTest"
+      },
+      "cloudConfiguration": {
+			"lcpCloudRegionId": "mdt1",
+			"tenantId": "88a6ca3ee0394ade9403f075db23167e"
+		},
+      "requestParameters": {
+         "payload": "{\"request-parameters\":{\"host-ip-address\":\"10.10.10.10\"},\"configuration-parameters\":{\"name1\":\"value1\",\"name2\":\"value2\"}}",
+         "userParams": [{
+               "name": "vnf-id",
+               "value": "4603ad6d-dbfb-4899-a8bd-bc1dd0d74914"               
+            } 	
+         ]
+      }
+   }
+}
\ No newline at end of file
