aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql775
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.14.2__AddCloudOwnerColumnToNorthBoundRequest.sql7
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java29
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java55
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java18
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java12
9 files changed, 888 insertions, 28 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
new file mode 100644
index 0000000000..3fdc3c31f9
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
@@ -0,0 +1,775 @@
+use catalogdb;
+
+DELETE FROM northbound_request_ref_lookup;
+DELETE FROM orchestration_flow_reference;
+DELETE FROM rainy_day_handler_macro;
+DELETE FROM building_block_detail;
+DELETE FROM orchestration_status_state_transition_directive;
+
+
+INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE,IS_TOPLEVELFLOW, MIN_API_VERSION, MAX_API_VERSION, CLOUD_OWNER) VALUES
+('Service-Create', 'createInstance', 'Service', true,true, '7','7', 'cloudOwner'),
+('Service-Delete', 'deleteInstance', 'Service', true,true, '7','7', 'cloudOwner'),
+('Service-Macro-Assign', 'assignInstance', 'Service', false,true, '7','7', 'cloudOwner'),
+('Service-Macro-Activate', 'activateInstance', 'Service', false,true, '7','7', 'cloudOwner'),
+('Service-Macro-Unassign', 'unassignInstance', 'Service', false,true, '7','7', 'cloudOwner'),
+('Service-Macro-Create', 'createInstance', 'Service', false,true, '7','7', 'cloudOwner'),
+('Service-Macro-Delete', 'deleteInstance', 'Service', false,true, '7','7', 'cloudOwner'),
+('Network-Create', 'createInstance', 'Network', true,true, '7','7', 'cloudOwner'),
+('Network-Delete', 'deleteInstance', 'Network', true,true, '7','7', 'cloudOwner'),
+('VNF-Macro-Recreate', 'recreateInstance', 'Vnf', false,true, '7','7', 'cloudOwner'),
+('VNF-Macro-Replace', 'replaceInstance', 'Vnf', false,true, '7','7', 'cloudOwner'),
+('VNF-Create', 'createInstance', 'Vnf', true,true, '7', '7', 'cloudOwner'),
+('VNF-Delete', 'deleteInstance', 'Vnf', true,true, '7', '7', 'cloudOwner'),
+('VolumeGroup-Create', 'createInstance', 'VolumeGroup', true,true, '7','7', 'cloudOwner'),
+('VolumeGroup-Delete', 'deleteInstance', 'VolumeGroup', true,true, '7','7', 'cloudOwner'),
+('VFModule-Create', 'createInstance', 'VfModule', true,true, '7','7', 'cloudOwner'),
+('VFModule-Delete', 'deleteInstance', 'VfModule', true,true, '7','7', 'cloudOwner'),
+('NetworkCollection-Macro-Create', 'createInstance', 'NetworkCollection', false,true, '7','7', 'cloudOwner'),
+('NetworkCollection-Macro-Delete', 'deleteInstance', 'NetworkCollection', false,true, '7','7', 'cloudOwner'),
+('VFModule-ScaleOut', 'createInstance', 'VfModule', true, true, '7','7', 'cloudOwner');
+
+
+INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
+('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Create', '2', 'ActivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Delete', '1', 'DeactivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Delete', '2', 'UnassignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Assign', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Assign', '2', 'AssignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Assign', '3', 'AssignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Assign', '4', 'AssignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Assign', '5', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Assign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Activate', '1', 'CreateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Activate', '2', 'ActivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Activate', '3', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Activate', '4', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Activate', '5', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Activate', '6', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Activate', '7', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Activate', '8', 'ActivateServiceInstance', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Activate' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Unassign', '1', 'UnassignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Unassign', '2', 'UnassignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Unassign', '3', 'UnassignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Unassign', '4', 'UnassignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Unassign', '5', 'UnassignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '2', 'CreateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '3', 'AssignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '4', 'AssignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '5', 'AssignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '6', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '7', 'CreateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '8', 'ActivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '9', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '10', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '11', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '12', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '13', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '14', 'ActivateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Create', '15', 'ActivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '3', 'DeactivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '4', 'DeleteVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '5', 'DeactivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '6', 'DeactivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '7', 'DeleteNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '8', 'DeactivateNetworkCollectionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '9', 'DeleteNetworkCollectionBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '10', 'DeactivateServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '11', 'UnassignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '12', 'UnassignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '13', 'UnassignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '14', 'UnassignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Service-Macro-Delete', '15', 'UnassignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Network-Create', '1', 'AssignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Network-Create', '2', 'CreateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Network-Create', '3', 'ActivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Create' and CLOUD_OWNER = 'cloudOwner')),
+('Network-Delete', '1', 'DeactivateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Network-Delete', '2', 'DeleteNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('Network-Delete', '3', 'UnassignNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Create', '1', 'AssignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Create' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Create', '2', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Create' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Delete', '1', 'DeactivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Delete', '2', 'UnassignVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '1', 'AAICheckVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '2', 'AAISetVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '3', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '4', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '5', 'DeactivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '6', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '7', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '8', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '9', 'SDNOVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Recreate', '10', 'AAIUnsetVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Recreate' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '1', 'AAICheckVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '2', 'AAISetVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '5', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '6', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '7', 'DeactivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '8', 'ChangeModelVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '9', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '10', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '13', 'ChangeModelVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '14', 'ActivateVnfBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '15', 'ChangeModelServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '16', 'SDNOVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VNF-Macro-Replace', '17', 'AAIUnsetVnfInMaintBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VNF-Macro-Replace' and CLOUD_OWNER = 'cloudOwner')),
+('VolumeGroup-Create', '1', 'AssignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Create' and CLOUD_OWNER = 'cloudOwner')),
+('VolumeGroup-Create', '2', 'CreateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Create' and CLOUD_OWNER = 'cloudOwner')),
+('VolumeGroup-Create', '3', 'ActivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Create' and CLOUD_OWNER = 'cloudOwner')),
+('VolumeGroup-Delete', '1', 'DeactivateVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VolumeGroup-Delete', '2', 'DeleteVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VolumeGroup-Delete', '3', 'UnassignVolumeGroupBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VolumeGroup-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-Create', '1', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Create' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-Create', '2', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Create' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-Create', '3', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Create' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-Delete', '3', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-Delete', '4', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-Delete', '5', 'UnassignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Create', '1', 'CreateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Create', '2', 'AssignNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Create', '3', 'CreateNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Create', '4', 'ActivateNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Create', '5', 'ActivateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Create' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Delete', '1', 'DeactivateNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Delete', '2', 'DeleteNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Delete', '3', 'UnassignNetworkBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Delete', '4', 'DeactivateNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('NetworkCollection-Macro-Delete', '5', 'DeleteNetworkCollectionBB',1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'NetworkCollection-Macro-Delete' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-ScaleOut', '1', 'GenericVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-ScaleOut', '2', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-ScaleOut', '3', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-ScaleOut', '4', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-ScaleOut', '5', 'ConfigurationScaleOutBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-ScaleOut', '6', 'GenericVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut' and CLOUD_OWNER = 'cloudOwner'));
+
+INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY)
+VALUES
+('ActivateNetworkBB', '*', '*', '*', '*' , 'Rollback'),
+('ActivateNetworkCollectionBB', '*', '*', '*', '*' , 'Rollback'),
+('ActivateServiceInstanceBB', '*', '*', '*', '*' , 'Rollback'),
+('ActivateVfModuleBB', '*', '*', '*', '*' , 'RollbackToAssigned'),
+('ActivateVnfBB', '*', '*', '*', '*' , 'Rollback'),
+('ActivateVolumeGroupBB', '*', '*', '*', '*' , 'Rollback'),
+('AssignNetworkBB', '*', '*', '*', '*' , 'Rollback'),
+('AssignServiceInstanceBB', '*', '*', '*', '*' , 'Rollback'),
+('AssignVfModuleBB', '*', '*', '*', '*' , 'Rollback'),
+('AssignVnfBB', '*', '*', '*', '*' , 'Rollback'),
+('AssignVolumeGroupBB', '*', '*', '*', '*' , 'Rollback'),
+('CreateNetworkBB', '*', '*', '*', '*' , 'Retry'),
+('CreateNetworkCollectionBB', '*', '*', '*', '*' , 'Retry'),
+('CreateVfModuleBB', '*', '*', '*', '*' , 'Retry'),
+('CreateVolumeGroupBB', '*', '*', '*', '*' , 'Retry'),
+('ChangeModelServiceInstanceBB', '*', '*', '*', '*' , 'Abort'),
+('ChangeModelVfModuleBB', '*', '*', '*', '*' , 'Abort'),
+('ChangeModelVnfBB', '*', '*', '*', '*' , 'Abort'),
+('CreateCustomerBB', '*', '*', '*', '*' , 'Abort'),
+('DeactivateNetworkBB', '*', '*', '*', '*' , 'Abort'),
+('DeactivateServiceInstanceBB', '*', '*', '*', '*' , 'Abort'),
+('DeactivateVfModuleBB', '*', '*', '*', '*' , 'Abort'),
+('DeactivateVnfBB', '*', '*', '*', '*' , 'Abort'),
+('DeactivateVolumeGroupBB', '*', '*', '*', '*' , 'Abort'),
+('DeleteNetworkBB', '*', '*', '*', '*' , 'Retry'),
+('DeleteNetworkCollectionBB', '*', '*', '*', '*' , 'Retry'),
+('DeleteVfModuleBB', '*', '*', '*', '*' , 'Retry'),
+('DeleteVolumeGroupBB', '*', '*', '*', '*' , 'Retry'),
+('UnassignNetworkBB', '*', '*', '*', '*' , 'Retry'),
+('UnassignServiceInstanceBB', '*', '*', '*', '*' , 'Retry'),
+('UnassignVfModuleBB', '*', '*', '*', '*' , 'Retry'),
+('UnassignVnfBB', '*', '*', '*', '*' , 'Retry'),
+('UnassignVolumeGroupBB', '*', '*', '*', '*' , 'Retry'),
+('UpdateNetworkBB', '*', '*', '*', '*' , 'Retry'),
+('VnfAdapterBB', '*', '*', '*', '*' , 'Retry'),
+('AAICheckVnfInMaintBB', '*', '*', '*', '*' , 'Abort'),
+('AAISetVnfInMaintBB', '*', '*', '*', '*' , 'Abort'),
+('AAIUnsetVnfInMaintBB', '*', '*', '*', '*' , 'Abort');
+
+
+
+INSERT INTO building_block_detail (building_block_name, resource_type, target_action)
+VALUES
+('AssignServiceInstanceBB', 'SERVICE', 'ASSIGN'),
+('AssignVnfBB', 'VNF', 'ASSIGN'),
+('AssignVolumeGroupBB', 'VOLUME_GROUP', 'ASSIGN'),
+('AssignVfModuleBB', 'VF_MODULE', 'ASSIGN'),
+('AssignNetworkBB', 'NETWORK', 'ASSIGN'),
+
+('UnassignServiceInstanceBB', 'SERVICE', 'UNASSIGN'),
+('UnassignVnfBB', 'VNF', 'UNASSIGN'),
+('UnassignVolumeGroup', 'VOLUME_GROUP', 'UNASSIGN'),
+('UnassignNetworkBB', 'NETWORK', 'UNASSIGN'),
+
+('ActivateServiceInstanceBB', 'SERVICE', 'ACTIVATE'),
+('ActivateVnfBB', 'VNF', 'ACTIVATE'),
+('ActivateVolumeGroupBB', 'VOLUME_GROUP', 'ACTIVATE'),
+('ActivateVfModuleBB', 'VF_MODULE', 'ACTIVATE'),
+('ActivateNetworkBB', 'NETWORK', 'ACTIVATE'),
+('ActivateNetworkCollectionBB', 'NETWORK', 'ACTIVATE'),
+
+('DeactivateServiceInstanceBB', 'SERVICE', 'DEACTIVATE'),
+('DeactivateVnfBB', 'VNF', 'DEACTIVATE'),
+('DeactivateVolumeGroupBB', 'VOLUME_GROUP', 'DEACTIVATE'),
+('DeactivateVfModuleBB', 'VF_MODULE', 'DEACTIVATE'),
+('DeactivateNetworkBB', 'NETWORK', 'DEACTIVATE'),
+
+
+('ChangeModelServiceInstanceBB', 'SERVICE', 'CHANGEMODEL'),
+('ChangeModelVnfBB', 'VNF', 'CHANGEMODEL'),
+('ChangeModelVfModuleBB', 'VF_MODULE', 'CHANGEMODEL'),
+
+
+('CreateVolumeGroupBB', 'VOLUME_GROUP', 'CREATE'),
+('CreateVfModuleBB', 'VF_MODULE', 'CREATE'),
+('CreateNetworkBB', 'NETWORK', 'CREATE'),
+('CreateNetworkCollectionBB', 'NETWORK', 'CREATE'),
+
+('DeleteVolumeGroupBB', 'VOLUME_GROUP', 'DELETE'),
+('DeleteVfModuleBB', 'VF_MODULE', 'DELETE'),
+('DeleteNetworkBB', 'NETWORK', 'DELETE'),
+('DeleteNetworkCollectionBB', 'NETWORK', 'DELETE'),
+
+('ConfigurationScaleOutBB', 'VF_MODULE', 'CREATE'),
+('GenericVnfHealthCheckBB', 'VF_MODULE', 'CREATE');
+
+INSERT INTO orchestration_status_state_transition_directive (resource_type, orchestration_status, target_action, flow_directive)
+VALUES
+
+('SERVICE', 'PRECREATED', 'ASSIGN', 'CONTINUE'),
+('VNF', 'PRECREATED', 'ASSIGN', 'CONTINUE'),
+('VOLUME_GROUP', 'PRECREATED', 'ASSIGN', 'CONTINUE'),
+('VF_MODULE', 'PRECREATED', 'ASSIGN', 'CONTINUE'),
+('NETWORK', 'PRECREATED', 'ASSIGN', 'CONTINUE'),
+
+('SERVICE', 'INVENTORIED', 'ASSIGN', 'CONTINUE'),
+('VNF', 'INVENTORIED', 'ASSIGN', 'CONTINUE'),
+('VOLUME_GROUP', 'INVENTORIED', 'ASSIGN', 'FAIL'),
+('VF_MODULE', 'INVENTORIED', 'ASSIGN', 'CONTINUE'),
+('NETWORK', 'INVENTORIED', 'ASSIGN', 'CONTINUE'),
+
+('SERVICE', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'),
+('VNF', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'),
+('VF_MODULE', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'),
+('NETWORK', 'ASSIGNED', 'ASSIGN', 'SILENT_SUCCESS'),
+
+('SERVICE', 'CREATED', 'ASSIGN', 'SILENT_SUCCESS'),
+('VNF', 'CREATED', 'ASSIGN', 'CONTINUE'),
+('VOLUME_GROUP', 'CREATED', 'ASSIGN', 'FAIL'),
+('VF_MODULE', 'CREATED', 'ASSIGN', 'SILENT_SUCCESS'),
+('NETWORK', 'CREATED', 'ASSIGN', 'SILENT_SUCCESS'),
+
+('SERVICE', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'),
+('VNF', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'),
+('VF_MODULE', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'),
+('NETWORK', 'ACTIVE', 'ASSIGN', 'SILENT_SUCCESS'),
+
+('SERVICE', 'PENDING_CREATE', 'ASSIGN', 'FAIL'),
+('VNF', 'PENDING_CREATE', 'ASSIGN', 'FAIL'),
+('VOLUME_GROUP', 'PENDING_CREATE', 'ASSIGN', 'FAIL'),
+('VF_MODULE', 'PENDING_CREATE', 'ASSIGN', 'CONTINUE'),
+('NETWORK', 'PENDING_CREATE', 'ASSIGN', 'SILENT_SUCCESS'),
+
+('SERVICE', 'PENDING_DELETE', 'ASSIGN', 'SILENT_SUCCESS'),
+('VNF', 'PENDING_DELETE', 'ASSIGN', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'PENDING_DELETE', 'ASSIGN', 'FAIL'),
+('VF_MODULE', 'PENDING_DELETE', 'ASSIGN', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_DELETE', 'ASSIGN', 'SILENT_SUCCESS'),
+
+('SERVICE', 'PENDING_ACTIVATION', 'ASSIGN', 'FAIL'),
+('VNF', 'PENDING_ACTIVATION', 'ASSIGN', 'FAIL'),
+('VOLUME_GROUP', 'PENDING_ACTIVATION', 'ASSIGN', 'FAIL'),
+('VF_MODULE', 'PENDING_ACTIVATION', 'ASSIGN', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_ACTIVATION', 'ASSIGN', 'FAIL'),
+
+('SERVICE', 'PENDING', 'ASSIGN', 'FAIL'),
+('VNF', 'PENDING', 'ASSIGN', 'FAIL'),
+('VOLUME_GROUP', 'PENDING', 'ASSIGN', 'SILENT_SUCCESS'),
+('VF_MODULE', 'PENDING', 'ASSIGN', 'FAIL'),
+('NETWORK', 'PENDING', 'ASSIGN', 'FAIL'),
+
+
+('SERVICE', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'),
+('VNF', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'),
+('VF_MODULE', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'),
+('NETWORK', 'PRECREATED', 'UNASSIGN', 'SILENT_SUCCESS'),
+
+('SERVICE', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'),
+('VNF', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'),
+('VOLUME_GROUP', 'INVENTORIED', 'UNASSIGN', 'FAIL'),
+('VF_MODULE', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'),
+('NETWORK', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'),
+
+('SERVICE', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'),
+('VNF', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'),
+('VOLUME_GROUP', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'),
+('VF_MODULE', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'),
+('NETWORK', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'),
+
+('SERVICE', 'CREATED', 'UNASSIGN', 'CONTINUE'),
+('VNF', 'CREATED', 'UNASSIGN', 'CONTINUE'),
+('VOLUME_GROUP', 'CREATED', 'UNASSIGN', 'FAIL'),
+('VF_MODULE', 'CREATED', 'UNASSIGN', 'FAIL'),
+('NETWORK', 'CREATED', 'UNASSIGN', 'FAIL'),
+
+('SERVICE', 'ACTIVE', 'UNASSIGN', 'FAIL'),
+('VNF', 'ACTIVE', 'UNASSIGN', 'FAIL'),
+('VOLUME_GROUP', 'ACTIVE', 'UNASSIGN', 'FAIL'),
+('VF_MODULE', 'ACTIVE', 'UNASSIGN', 'FAIL'),
+('NETWORK', 'ACTIVE', 'UNASSIGN', 'FAIL'),
+
+('SERVICE', 'PENDING_CREATE', 'UNASSIGN', 'FAIL'),
+('VNF', 'PENDING_CREATE', 'UNASSIGN', 'FAIL'),
+('VOLUME_GROUP', 'PENDING_CREATE', 'UNASSIGN', 'FAIL'),
+('VF_MODULE', 'PENDING_CREATE', 'UNASSIGN', 'CONTINUE'),
+('NETWORK', 'PENDING_CREATE', 'UNASSIGN', 'CONTINUE'),
+
+('SERVICE', 'PENDING_DELETE', 'UNASSIGN', 'CONTINUE'),
+('VNF', 'PENDING_DELETE', 'UNASSIGN', 'CONTINUE'),
+('VOLUME_GROUP', 'PENDING_DELETE', 'UNASSIGN', 'FAIL'),
+('VF_MODULE', 'PENDING_DELETE', 'UNASSIGN', 'CONTINUE'),
+('NETWORK', 'PENDING_DELETE', 'UNASSIGN', 'CONTINUE'),
+
+('SERVICE', 'PENDING_ACTIVATION', 'UNASSIGN', 'FAIL'),
+('VNF', 'PENDING_ACTIVATION', 'UNASSIGN', 'FAIL'),
+('VOLUME_GROUP', 'PENDING_ACTIVATION', 'UNASSIGN', 'FAIL'),
+('VF_MODULE', 'PENDING_ACTIVATION', 'UNASSIGN', 'CONTINUE'),
+('NETWORK', 'PENDING_ACTIVATION', 'UNASSIGN', 'FAIL'),
+
+('SERVICE', 'PENDING', 'UNASSIGN', 'FAIL'),
+('VNF', 'PENDING', 'UNASSIGN', 'FAIL'),
+('VOLUME_GROUP', 'PENDING', 'UNASSIGN', 'CONTINUE'),
+('VF_MODULE', 'PENDING', 'UNASSIGN', 'FAIL'),
+('NETWORK', 'PENDING', 'UNASSIGN', 'FAIL'),
+
+
+('SERVICE', 'PRECREATED', 'ACTIVATE', 'FAIL'),
+('VNF', 'PRECREATED', 'ACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'PRECREATED', 'ACTIVATE', 'FAIL'),
+('VF_MODULE', 'PRECREATED', 'ACTIVATE', 'FAIL'),
+('NETWORK', 'PRECREATED', 'ACTIVATE', 'FAIL'),
+
+('SERVICE', 'INVENTORIED', 'ACTIVATE', 'FAIL'),
+('VNF', 'INVENTORIED', 'ACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'INVENTORIED', 'ACTIVATE', 'FAIL'),
+('VF_MODULE', 'INVENTORIED', 'ACTIVATE', 'FAIL'),
+('NETWORK', 'INVENTORIED', 'ACTIVATE', 'FAIL'),
+
+('SERVICE', 'ASSIGNED', 'ACTIVATE', 'CONTINUE'),
+('VNF', 'ASSIGNED', 'ACTIVATE', 'CONTINUE'),
+('VOLUME_GROUP', 'ASSIGNED', 'ACTIVATE', 'FAIL'),
+('VF_MODULE', 'ASSIGNED', 'ACTIVATE', 'FAIL'),
+('NETWORK', 'ASSIGNED', 'ACTIVATE', 'FAIL'),
+
+('SERVICE', 'CREATED', 'ACTIVATE', 'CONTINUE'),
+('VNF', 'CREATED', 'ACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'CREATED', 'ACTIVATE', 'CONTINUE'),
+('VF_MODULE', 'CREATED', 'ACTIVATE', 'CONTINUE'),
+('NETWORK', 'CREATED', 'ACTIVATE', 'CONTINUE'),
+
+('SERVICE', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'),
+('VNF', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'ACTIVE', 'ACTIVATE', 'SILENT_SUCCESS'),
+
+('SERVICE', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'),
+('VNF', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'),
+('VF_MODULE', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'),
+('NETWORK', 'PENDING_CREATE', 'ACTIVATE', 'FAIL'),
+
+('SERVICE', 'PENDING_DELETE', 'ACTIVATE', 'CONTINUE'),
+('VNF', 'PENDING_DELETE', 'ACTIVATE', 'CONTINUE'),
+('VOLUME_GROUP', 'PENDING_DELETE', 'ACTIVATE', 'FAIL'),
+('VF_MODULE', 'PENDING_DELETE', 'ACTIVATE', 'FAIL'),
+('NETWORK', 'PENDING_DELETE', 'ACTIVATE', 'FAIL'),
+
+('SERVICE', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'),
+('VNF', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'),
+('VF_MODULE', 'PENDING_ACTIVATION', 'ACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_ACTIVATION', 'ACTIVATE', 'FAIL'),
+
+('SERVICE', 'PENDING', 'ACTIVATE', 'FAIL'),
+('VNF', 'PENDING', 'ACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'PENDING', 'ACTIVATE', 'FAIL'),
+('VF_MODULE', 'PENDING', 'ACTIVATE', 'FAIL'),
+('NETWORK', 'PENDING', 'ACTIVATE', 'FAIL'),
+
+('SERVICE', 'PRECREATED', 'DEACTIVATE', 'FAIL'),
+('VNF', 'PRECREATED', 'DEACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'PRECREATED', 'DEACTIVATE', 'FAIL'),
+('VF_MODULE', 'PRECREATED', 'DEACTIVATE', 'FAIL'),
+('NETWORK', 'PRECREATED', 'DEACTIVATE', 'FAIL'),
+
+('SERVICE', 'INVENTORIED', 'DEACTIVATE', 'FAIL'),
+('VNF', 'INVENTORIED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'INVENTORIED', 'DEACTIVATE', 'FAIL'),
+('VF_MODULE', 'INVENTORIED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'INVENTORIED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+
+('SERVICE', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VNF', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'ASSIGNED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+
+('SERVICE', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VNF', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'CREATED', 'DEACTIVATE', 'SILENT_SUCCESS'),
+
+('SERVICE', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'),
+('VNF', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'),
+('VOLUME_GROUP', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'),
+('VF_MODULE', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'),
+('NETWORK', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'),
+
+('SERVICE', 'PENDING_CREATE', 'DEACTIVATE', 'FAIL'),
+('VNF', 'PENDING_CREATE', 'DEACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'PENDING_CREATE', 'DEACTIVATE', 'FAIL'),
+('VF_MODULE', 'PENDING_CREATE', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_CREATE', 'DEACTIVATE', 'SILENT_SUCCESS'),
+
+('SERVICE', 'PENDING_DELETE', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VNF', 'PENDING_DELETE', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VOLUME_GROUP', 'PENDING_DELETE', 'DEACTIVATE', 'FAIL'),
+('VF_MODULE', 'PENDING_DELETE', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_DELETE', 'DEACTIVATE', 'SILENT_SUCCESS'),
+
+('SERVICE', 'PENDING_ACTIVATION', 'DEACTIVATE', 'FAIL'),
+('VNF', 'PENDING_ACTIVATION', 'DEACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'PENDING_ACTIVATION', 'DEACTIVATE', 'FAIL'),
+('VF_MODULE', 'PENDING_ACTIVATION', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_ACTIVATION', 'DEACTIVATE', 'FAIL'),
+
+('SERVICE', 'PENDING', 'DEACTIVATE', 'FAIL'),
+('VNF', 'PENDING', 'DEACTIVATE', 'FAIL'),
+('VOLUME_GROUP', 'PENDING', 'DEACTIVATE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'PENDING', 'DEACTIVATE', 'FAIL'),
+('NETWORK', 'PENDING', 'DEACTIVATE', 'FAIL'),
+
+
+('SERVICE', 'PRECREATED', 'CHANGE_MODEL', 'FAIL'),
+('VNF', 'PRECREATED', 'CHANGE_MODEL', 'FAIL'),
+('VF_MODULE', 'PRECREATED', 'CHANGE_MODEL', 'FAIL'),
+
+('SERVICE', 'INVENTORIED', 'CHANGE_MODEL', 'FAIL'),
+('VNF', 'INVENTORIED', 'CHANGE_MODEL', 'FAIL'),
+('VF_MODULE', 'INVENTORIED', 'CHANGE_MODEL', 'FAIL'),
+
+('SERVICE', 'ASSIGNED', 'CHANGE_MODEL', 'FAIL'),
+('VNF', 'ASSIGNED', 'CHANGE_MODEL', 'CONTINUE'),
+('VF_MODULE', 'ASSIGNED', 'CHANGE_MODEL', 'CONTINUE'),
+
+('SERVICE', 'CREATED', 'CHANGE_MODEL', 'FAIL'),
+('VNF', 'CREATED', 'CHANGE_MODEL', 'FAIL'),
+('VF_MODULE', 'CREATED', 'CHANGE_MODEL', 'FAIL'),
+
+('SERVICE', 'ACTIVE', 'CHANGE_MODEL', 'CONTINUE'),
+('VNF', 'ACTIVE', 'CHANGE_MODEL', 'CONTINUE'),
+('VF_MODULE', 'ACTIVE', 'CHANGE_MODEL', 'CONTINUE'),
+
+('SERVICE', 'PENDING_CREATE', 'CHANGE_MODEL', 'FAIL'),
+('VNF', 'PENDING_CREATE', 'CHANGE_MODEL', 'FAIL'),
+('VF_MODULE', 'PENDING_CREATE', 'CHANGE_MODEL', 'FAIL'),
+
+('SERVICE', 'PENDING_DELETE', 'CHANGE_MODEL', 'FAIL'),
+('VNF', 'PENDING_DELETE', 'CHANGE_MODEL', 'CONTINUE'),
+('VF_MODULE', 'PENDING_DELETE', 'CHANGE_MODEL', 'CONTINUE'),
+
+('SERVICE', 'PENDING_ACTIVATION', 'CHANGE_MODEL', 'FAIL'),
+('VNF', 'PENDING_ACTIVATION', 'CHANGE_MODEL', 'CONTINUE'),
+('VF_MODULE', 'PENDING_ACTIVATION', 'CHANGE_MODEL', 'CONTINUE'),
+
+('SERVICE', 'PENDING', 'CHANGE_MODEL', 'FAIL'),
+('VNF', 'PENDING', 'CHANGE_MODEL', 'FAIL'),
+('VF_MODULE', 'PENDING', 'CHANGE_MODEL', 'FAIL'),
+
+
+('VOLUME_GROUP', 'PRECREATED', 'CREATE', 'FAIL'),
+('VF_MODULE', 'PRECREATED', 'CREATE', 'FAIL'),
+('NETWORK', 'PRECREATED', 'CREATE', 'FAIL'),
+
+('VOLUME_GROUP', 'INVENTORIED', 'CREATE', 'FAIL'),
+('VF_MODULE', 'INVENTORIED', 'CREATE', 'FAIL'),
+('NETWORK', 'INVENTORIED', 'CREATE', 'FAIL'),
+
+('VOLUME_GROUP', 'ASSIGNED', 'CREATE', 'CONTINUE'),
+('VF_MODULE', 'ASSIGNED', 'CREATE', 'CONTINUE'),
+('NETWORK', 'ASSIGNED', 'CREATE', 'CONTINUE'),
+
+('VOLUME_GROUP', 'CREATED', 'CREATE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'CREATED', 'CREATE', 'SILENT_SUCCESS'),
+('NETWORK', 'CREATED', 'CREATE', 'SILENT_SUCCESS'),
+
+('VOLUME_GROUP', 'ACTIVE', 'CREATE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'ACTIVE', 'CREATE', 'SILENT_SUCCESS'),
+('NETWORK', 'ACTIVE', 'CREATE', 'SILENT_SUCCESS'),
+
+('VOLUME_GROUP', 'PENDING_CREATE', 'CREATE', 'FAIL'),
+('VF_MODULE', 'PENDING_CREATE', 'CREATE', 'FAIL'),
+('NETWORK', 'PENDING_CREATE', 'CREATE', 'CONTINUE'),
+
+('VOLUME_GROUP', 'PENDING_DELETE', 'CREATE', 'FAIL'),
+('VF_MODULE', 'PENDING_DELETE', 'CREATE', 'CONTINUE'),
+('NETWORK', 'PENDING_DELETE', 'CREATE', 'CONTINUE'),
+
+('VOLUME_GROUP', 'PENDING_ACTIVATION', 'CREATE', 'FAIL'),
+('VF_MODULE', 'PENDING_ACTIVATION', 'CREATE', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_ACTIVATION', 'CREATE', 'FAIL'),
+
+('VOLUME_GROUP', 'PENDING', 'CREATE', 'CONTINUE'),
+('VF_MODULE', 'PENDING', 'CREATE', 'FAIL'),
+('NETWORK', 'PENDING', 'CREATE', 'FAIL'),
+
+
+('VOLUME_GROUP', 'PRECREATED', 'DELETE', 'FAIL'),
+('VF_MODULE', 'PRECREATED', 'DELETE', 'FAIL'),
+('NETWORK', 'PRECREATED', 'DELETE', 'FAIL'),
+
+('VOLUME_GROUP', 'INVENTORIED', 'DELETE', 'FAIL'),
+('VF_MODULE', 'INVENTORIED', 'DELETE', 'SILENT_SUCCESS'),
+('NETWORK', 'INVENTORIED', 'DELETE', 'SILENT_SUCCESS'),
+
+('VOLUME_GROUP', 'ASSIGNED', 'DELETE', 'CONTINUE'),
+('VF_MODULE', 'ASSIGNED', 'DELETE', 'CONTINUE'),
+('NETWORK', 'ASSIGNED', 'DELETE', 'CONTINUE'),
+
+('VOLUME_GROUP', 'CREATED', 'DELETE', 'CONTINUE'),
+('VF_MODULE', 'CREATED', 'DELETE', 'CONTINUE'),
+('NETWORK', 'CREATED', 'DELETE', 'CONTINUE'),
+
+('VOLUME_GROUP', 'ACTIVE', 'DELETE', 'FAIL'),
+('VF_MODULE', 'ACTIVE', 'DELETE', 'FAIL'),
+('NETWORK', 'ACTIVE', 'DELETE', 'FAIL'),
+
+('VOLUME_GROUP', 'PENDING_CREATE', 'DELETE', 'FAIL'),
+('VF_MODULE', 'PENDING_CREATE', 'DELETE', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_CREATE', 'DELETE', 'SILENT_SUCCESS'),
+
+('VOLUME_GROUP', 'PENDING_DELETE', 'DELETE', 'FAIL'),
+('VF_MODULE', 'PENDING_DELETE', 'DELETE', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_DELETE', 'DELETE', 'SILENT_SUCCESS'),
+
+('VOLUME_GROUP', 'PENDING_ACTIVATION', 'DELETE', 'FAIL'),
+('VF_MODULE', 'PENDING_ACTIVATION', 'DELETE', 'SILENT_SUCCESS'),
+('NETWORK', 'PENDING_ACTIVATION', 'DELETE', 'FAIL'),
+
+('VOLUME_GROUP', 'PENDING', 'DELETE', 'SILENT_SUCCESS'),
+('VF_MODULE', 'PENDING', 'DELETE', 'FAIL'),
+('NETWORK', 'PENDING', 'DELETE', 'FAIL');
+
+UPDATE orchestration_flow_reference SET FLOW_NAME = 'HomingBB' WHERE FLOW_NAME = 'SniroHoming';
+
+UPDATE orchestration_flow_reference
+SET FLOW_NAME = 'ActivateServiceInstanceBB'
+WHERE FLOW_NAME = 'ActivateServiceInstance';
+
+DELETE FROM orchestration_flow_reference
+WHERE FLOW_NAME = 'DeactivateNetworkCollectionBB';
+
+UPDATE orchestration_flow_reference
+SET SEQ_NO = SEQ_NO - 1
+WHERE COMPOSITE_ACTION = 'Service-Macro-Delete' AND SEQ_NO > 8;
+
+UPDATE orchestration_flow_reference
+SET SEQ_NO = SEQ_NO - 1
+WHERE COMPOSITE_ACTION = 'NetworkCollection-Macro-Delete' AND SEQ_NO > 4;
+
+UPDATE building_block_detail
+SET BUILDING_BLOCK_NAME = 'UnassignVolumeGroupBB'
+WHERE BUILDING_BLOCK_NAME = 'UnassignVolumeGroup';
+
+UPDATE building_block_detail
+SET TARGET_ACTION = 'CHANGE_MODEL'
+WHERE TARGET_ACTION = 'CHANGEMODEL';
+
+INSERT INTO building_block_detail(BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION)
+VALUES
+('UnassignVfModuleBB', 'VF_MODULE', 'UNASSIGN'),
+('SniroHoming', 'CUSTOM', 'CUSTOM'),
+('DeactivateAndUnassignVpnBondingLinksBB', 'CUSTOM', 'CUSTOM'),
+('DeactivateNetworkCollectionBB', 'CUSTOM', 'CUSTOM'),
+('AAICheckVnfInMaintBB', 'CUSTOM', 'CUSTOM'),
+('AAISetVnfInMaintBB', 'CUSTOM', 'CUSTOM'),
+('AAIUnsetVnfInMaintBB', 'CUSTOM', 'CUSTOM'),
+('SDNOVnfHealthCheckBB', 'CUSTOM', 'CUSTOM'),
+('VNF-Macro-Replace', 'CUSTOM', 'CUSTOM'),
+('HomingBB', 'CUSTOM', 'CUSTOM');
+
+INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE)
+VALUES
+('CUSTOM', 'ACTIVE', 'CUSTOM', 'CONTINUE'),
+('CUSTOM', 'ASSIGNED', 'CUSTOM', 'CONTINUE'),
+('CUSTOM', 'CREATED', 'CUSTOM', 'CONTINUE'),
+('CUSTOM', 'INVENTORIED', 'CUSTOM', 'CONTINUE'),
+('CUSTOM', 'PENDING', 'CUSTOM', 'CONTINUE'),
+('CUSTOM', 'PENDING_ACTIVATION', 'CUSTOM', 'CONTINUE'),
+('CUSTOM', 'PENDING_CREATE', 'CUSTOM', 'CONTINUE'),
+('CUSTOM', 'PENDING_DELETE', 'CUSTOM', 'CONTINUE'),
+('CUSTOM', 'PRECREATED', 'CUSTOM', 'CONTINUE');
+
+INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, IS_TOPLEVELFLOW, CLOUD_OWNER) VALUES
+('VFModule-DeactivateAndCloudDelete', 'deactivateAndCloudDelete', 'VfModule', true, '7','7', true, 'cloudOwner');
+
+INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
+('VFModule-DeactivateAndCloudDelete', '1', 'DeactivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-DeactivateAndCloudDelete' and CLOUD_OWNER = 'cloudOwner')),
+('VFModule-DeactivateAndCloudDelete', '2', 'DeleteVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-DeactivateAndCloudDelete' and CLOUD_OWNER = 'cloudOwner'));
+
+INSERT INTO northbound_request_ref_lookup (REQUEST_SCOPE, MACRO_ACTION, ACTION, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, IS_TOPLEVELFLOW, CLOUD_OWNER)
+values ( 'Service', 'Service-Macro-Deactivate', 'deactivateInstance', '0', '7', '7', '1', 'cloudOwner');
+
+INSERT INTO orchestration_flow_reference (COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID)
+values ( 'Service-Macro-Deactivate', '1', 'DeactivateServiceInstanceBB', '1', (SELECT id FROM northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Deactivate' and CLOUD_OWNER = 'cloudOwner'));
+
+
+UPDATE northbound_request_ref_lookup SET MIN_API_VERSION = 5 WHERE MACRO_ACTION = 'Service-Macro-Create';
+UPDATE northbound_request_ref_lookup SET MIN_API_VERSION = 5 WHERE MACRO_ACTION = 'Service-Macro-Delete';
+UPDATE northbound_request_ref_lookup SET MIN_API_VERSION = 5 WHERE MACRO_ACTION = 'Service-Macro-Activate';
+
+UPDATE northbound_request_ref_lookup SET MIN_API_VERSION = 5 WHERE MACRO_ACTION = 'Service-Macro-Deactivate';
+
+INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, IS_TOPLEVELFLOW, CLOUD_OWNER) VALUES
+('Network-Update', 'updateInstance', 'Network', true, '7','7','1', 'cloudOwner');
+INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
+('Network-Update', '1', 'UpdateNetworkBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Update' and CLOUD_OWNER = 'cloudOwner'));
+
+INSERT INTO building_block_detail(BUILDING_BLOCK_NAME,RESOURCE_TYPE,TARGET_ACTION) VALUES
+('UpdateNetworkBB','NETWORK','UPDATE');
+
+INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS,TARGET_ACTION,FLOW_DIRECTIVE) VALUES
+('NETWORK','PRECREATED','UPDATE','FAIL'),
+('NETWORK','INVENTORIED','UPDATE','FAIL'),
+('NETWORK','ASSIGNED','UPDATE','FAIL'),
+('NETWORK','CREATED','UPDATE','FAIL'),
+('NETWORK','PENDING_CREATE','UPDATE','FAIL'),
+('NETWORK','PENDING_DELETE','UPDATE','FAIL'),
+('NETWORK','PENDING_ACTIVATION','UPDATE','FAIL'),
+('NETWORK','ACTIVE','UPDATE','CONTINUE');
+
+UPDATE building_block_detail SET RESOURCE_TYPE = 'NETWORK_COLLECTION' WHERE BUILDING_BLOCK_NAME = 'ActivateNetworkCollectionBB';
+UPDATE building_block_detail SET RESOURCE_TYPE = 'NETWORK_COLLECTION' WHERE BUILDING_BLOCK_NAME = 'CreateNetworkCollectionBB';
+UPDATE building_block_detail SET RESOURCE_TYPE = 'NETWORK_COLLECTION' WHERE BUILDING_BLOCK_NAME = 'DeleteNetworkCollectionBB';
+UPDATE building_block_detail SET RESOURCE_TYPE = 'NETWORK_COLLECTION' WHERE BUILDING_BLOCK_NAME = 'DeactivateNetworkCollectionBB';
+UPDATE building_block_detail SET TARGET_ACTION = 'DEACTIVATE' WHERE BUILDING_BLOCK_NAME = 'DeactivateNetworkCollectionBB';
+
+INSERT into orchestration_status_state_transition_directive (RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE) values
+('NETWORK_COLLECTION', 'PRECREATED', 'CREATE', 'CONTINUE'),
+('NETWORK_COLLECTION', 'ASSIGNED', 'CREATE', 'FAIL'),
+('NETWORK_COLLECTION', 'CREATED', 'CREATE', 'FAIL'),
+('NETWORK_COLLECTION', 'ACTIVE', 'CREATE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING_CREATE', 'CREATE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING_DELETE', 'CREATE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING_ACTIVATION', 'CREATE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING', 'CREATE', 'FAIL'),
+('NETWORK_COLLECTION', 'INVENTORIED', 'CREATE', 'SILENT_SUCCESS'),
+
+('NETWORK_COLLECTION', 'PRECREATED', 'DELETE', 'FAIL'),
+('NETWORK_COLLECTION', 'ASSIGNED', 'DELETE', 'FAIL'),
+('NETWORK_COLLECTION', 'CREATED', 'DELETE', 'FAIL'),
+('NETWORK_COLLECTION', 'ACTIVE', 'DELETE', 'CONTINUE'),
+('NETWORK_COLLECTION', 'PENDING_CREATE', 'DELETE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING_DELETE', 'DELETE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING_ACTIVATION', 'DELETE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING', 'DELETE', 'FAIL'),
+('NETWORK_COLLECTION', 'INVENTORIED', 'DELETE', 'CONTINUE'),
+
+('NETWORK_COLLECTION', 'PRECREATED', 'ACTIVE', 'FAIL'),
+('NETWORK_COLLECTION', 'ASSIGNED', 'ACTIVE', 'FAIL'),
+('NETWORK_COLLECTION', 'CREATED', 'ACTIVE', 'FAIL'),
+('NETWORK_COLLECTION', 'ACTIVE', 'ACTIVE', 'SILENT_SUCCESS'),
+('NETWORK_COLLECTION', 'PENDING_CREATE', 'ACTIVE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING_DELETE', 'ACTIVE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING_ACTIVATION', 'ACTIVE', 'FAIL'),
+('NETWORK_COLLECTION', 'PENDING', 'ACTIVE', 'FAIL'),
+('NETWORK_COLLECTION', 'INVENTORIED', 'ACTIVE', 'CONTINUE');
+
+UPDATE orchestration_status_state_transition_directive SET TARGET_ACTION = 'ACTIVATE' WHERE TARGET_ACTION = 'ACTIVE';
+
+INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE)
+VALUES
+('CONFIGURATION', 'PRECREATED', 'UNASSIGN', 'SILENT SUCCESS'),
+('CONFIGURATION', 'INVENTORIED', 'UNASSIGN', 'CONTINUE'),
+('CONFIGURATION', 'ASSIGNED', 'UNASSIGN', 'CONTINUE'),
+('CONFIGURATION', 'CREATED', 'UNASSIGN', 'FAIL'),
+('CONFIGURATION', 'ACTIVE', 'UNASSIGN', 'FAIL'),
+('CONFIGURATION', 'PENDING CREATE', 'UNASSIGN', 'FAIL'),
+('CONFIGURATION', 'PENDING DELETE', 'UNASSIGN', 'FAIL'),
+('CONFIGURATION', 'PENDING ACTIVATION', 'UNASSIGN', 'FAIL'),
+('CONFIGURATION', 'PENDING', 'UNASSIGN', 'FAIL');
+
+UPDATE orchestration_flow_reference
+SET SEQ_NO = SEQ_NO + 2 WHERE COMPOSITE_ACTION = 'SERVICE-MACRO-DELETE';
+
+
+INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE)
+VALUES
+('CONFIGURATION', 'PRECREATED', 'ASSIGN', 'CONTINUE'),
+('CONFIGURATION', 'INVENTORIED', 'ASSIGN', 'CONTINUE'),
+('CONFIGURATION', 'ASSIGNED', 'ASSIGN', 'SILENT SUCCESS'),
+('CONFIGURATION', 'CREATED', 'ASSIGN', 'SILENT SUCCESS'),
+('CONFIGURATION', 'ACTIVE', 'ASSIGN', 'SILENT SUCCESS'),
+('CONFIGURATION', 'PENDING CREATE', 'ASSIGN', 'FAIL'),
+('CONFIGURATION', 'PENDING DELETE', 'ASSIGN', 'FAIL'),
+('CONFIGURATION', 'PENDING ACTIVATION', 'ASSIGN', 'FAIL'),
+('CONFIGURATION', 'PENDING', 'ASSIGN', 'FAIL'),
+
+('CONFIGURATION', 'PRECREATED', 'ACTIVATE', 'FAIL'),
+('CONFIGURATION', 'INVENTORIED', 'ACTIVATE', 'FAIL'),
+('CONFIGURATION', 'ASSIGNED', 'ACTIVATE', 'CONTINUE'),
+('CONFIGURATION', 'CREATED', 'ACTIVATE', 'CONTINUE'),
+('CONFIGURATION', 'ACTIVE', 'ACTIVATE', 'SILENT SUCCESS'),
+('CONFIGURATION', 'PENDING CREATE', 'ACTIVATE', 'FAIL'),
+('CONFIGURATION', 'PENDING DELETE', 'ACTIVATE', 'FAIL'),
+('CONFIGURATION', 'PENDING ACTIVATION', 'ACTIVATE', 'FAIL'),
+('CONFIGURATION', 'PENDING', 'ACTIVATE', 'FAIL'),
+
+('CONFIGURATION', 'PRECREATED', 'DEACTIVATE', 'FAIL'),
+('CONFIGURATION', 'INVENTORIED', 'DEACTIVATE', 'SILENT SUCCESS'),
+('CONFIGURATION', 'ASSIGNED', 'DEACTIVATE', 'SILENT SUCCESS'),
+('CONFIGURATION', 'CREATED', 'DEACTIVATE', 'SILENT SUCCESS'),
+('CONFIGURATION', 'ACTIVE', 'DEACTIVATE', 'CONTINUE'),
+('CONFIGURATION', 'PENDING CREATE', 'DEACTIVATE', 'FAIL'),
+('CONFIGURATION', 'PENDING DELETE', 'DEACTIVATE', 'FAIL'),
+('CONFIGURATION', 'PENDING ACTIVATION', 'DEACTIVATE', 'FAIL'),
+('CONFIGURATION', 'PENDING', 'DEACTIVATE', 'FAIL');
+
+UPDATE orchestration_flow_reference
+SET SEQ_NO = SEQ_NO + 2 WHERE COMPOSITE_ACTION = 'Service-Macro-Create' AND SEQ_NO > 12;
+
+UPDATE orchestration_flow_reference
+SET SEQ_NO = SEQ_NO + 1 WHERE COMPOSITE_ACTION = 'Service-Macro-Activate' AND SEQ_NO > 6;
+
+
+
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE POLICY = 'Rollback';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE POLICY = 'Abort';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Rollback' WHERE FLOW_NAME = 'CreateNetworkBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Rollback' WHERE FLOW_NAME = 'CreateNetworkCollectionBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'RollbackToAssigned' WHERE FLOW_NAME = 'CreateVfModuleBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Rollback' WHERE FLOW_NAME = 'CreateVolumeGroupBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'DeleteNetworkBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'DeleteNetworkCollectionBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'DeleteVfModuleBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'DeleteVolumeGroupBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'UnassignNetworkBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'UnassignServiceInstanceBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'UnassignVfModuleBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'UnassignVnfBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Abort' WHERE FLOW_NAME = 'UnassignVolumeGroupBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Rollback' WHERE FLOW_NAME = 'UpdateNetworkBB';
+UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Rollback' WHERE FLOW_NAME = 'VnfAdapterBB';
+
+
+
+
+INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY)
+VALUES
+('GenericVnfHealthCheckBB', '*', '*', '*', "*" , 'Retry'),
+('ConfigurationScaleOutBB', '*', '*', '*', "*" , 'Retry'); \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.14.2__AddCloudOwnerColumnToNorthBoundRequest.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.14.2__AddCloudOwnerColumnToNorthBoundRequest.sql
new file mode 100644
index 0000000000..664a064bfc
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.14.2__AddCloudOwnerColumnToNorthBoundRequest.sql
@@ -0,0 +1,7 @@
+use catalogdb;
+
+ALTER TABLE northbound_request_ref_lookup ADD COLUMN CLOUD_OWNER varchar(200) NOT NULL;
+ALTER TABLE northbound_request_ref_lookup
+ DROP INDEX UK_northbound_request_ref_lookup;
+ALTER TABLE northbound_request_ref_lookup
+ADD UNIQUE INDEX `UK_northbound_request_ref_lookup` (`MIN_API_VERSION` ASC, `REQUEST_SCOPE` ASC, `ACTION` ASC, `IS_ALACARTE` ASC, `MACRO_ACTION` ASC, `CLOUD_OWNER` ASC);
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
index ec9ad8c29c..e249285867 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
@@ -20,9 +20,15 @@
package org.onap.so.db.catalog.client;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.when;
+
import java.util.List;
import java.util.UUID;
+import javax.ws.rs.core.UriBuilder;
+
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -44,25 +50,31 @@ import org.onap.so.db.catalog.beans.VnfComponentsRecipe;
import org.onap.so.db.catalog.beans.VnfRecipe;
import org.onap.so.db.catalog.beans.VnfResource;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.beans.ExternalServiceToInternalService;
+import org.onap.so.db.catalog.beans.macro.NorthBoundRequest;
import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
@RunWith(SpringRunner.class)
@SpringBootTest(classes = CatalogDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
public class CatalogDbClientTest {
public static final String MTN13 = "mtn13";
+
@LocalServerPort
private int port;
@Value("${mso.db.auth}")
private String msoAdaptersAuth;
-
+
@Autowired
CatalogDbClientPortChanger client;
@@ -446,6 +458,21 @@ public class CatalogDbClientTest {
}
@Test
+ public void testGetNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(){
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setAction("createService");
+ northBoundRequest.setRequestScope("service");
+ northBoundRequest.setIsAlacarte(true);
+ northBoundRequest.setCloudOwner("my-custom-cloud-owner");
+ client.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner("createService", "service", true, "my-custom-cloud-owner");
+ Assert.assertNotNull(northBoundRequest);
+ Assert.assertEquals("createService",northBoundRequest.getAction());
+ Assert.assertEquals("service",northBoundRequest.getRequestScope());
+ Assert.assertEquals(true,northBoundRequest.getIsAlacarte() );
+ Assert.assertEquals("my-custom-cloud-owner", northBoundRequest.getCloudOwner());
+ }
+
+ @Test
public void testFindServiceRecipeByActionAndServiceModelUUID() {
ServiceRecipe serviceRecipe = client.findServiceRecipeByActionAndServiceModelUUID("createInstance","4694a55f-58b3-4f17-92a5-796d6f5ffd0d" );
Assert.assertNotNull(serviceRecipe);
diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
index 4d5105dec6..98d1917050 100644
--- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
+++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
@@ -209,3 +209,11 @@ VALUES
INSERT INTO vnf_components_recipe (VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_MODEL_UUID)
VALUES
('volumeGroup', 'createInstance', '1', 'Gr api recipe to create volume-group', '/mso/async/services/WorkflowActionBB', 180, '20c4431c-246d-11e7-93ae-92361f002671');
+
+
+INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, CLOUD_OWNER) VALUES
+('Service-Create', 'createInstance', 'Service', true, '7','7', 'my-custom-cloud-owner');
+
+
+INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
+('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'my-custom-cloud-owner'));
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index e9dcdade9f..3e1673017e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -89,6 +89,7 @@ public class WorkflowAction {
private static final String G_REQUEST_ID = "mso-request-id";
private static final String G_BPMN_REQUEST = "bpmnRequest";
private static final String G_ALACARTE = "aLaCarte";
+ private static final String CLOUD_OWNER = "cloudOwner";
private static final String G_APIVERSION = "apiVersion";
private static final String G_URI = "requestUri";
private static final String G_ISTOPLEVELFLOW = "isTopLevelFlow";
@@ -133,6 +134,7 @@ public class WorkflowAction {
final String bpmnRequest = (String) execution.getVariable(G_BPMN_REQUEST);
final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE);
final String apiVersion = (String) execution.getVariable(G_APIVERSION);
+ final String cloudOwner = (String) execution.getVariable(CLOUD_OWNER);
final String uri = (String) execution.getVariable(G_URI);
final String vnfType = (String) execution.getVariable(VNF_TYPE);
List<OrchestrationFlow> orchFlows = (List<OrchestrationFlow>) execution.getVariable(G_ORCHESTRATION_FLOW);
@@ -165,7 +167,7 @@ public class WorkflowAction {
if (aLaCarte) {
if (orchFlows == null || orchFlows.isEmpty()) {
- orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte);
+ orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner);
}
orchFlows = filterOrchFlows(orchFlows, resourceType, execution);
String key = "";
@@ -249,7 +251,7 @@ public class WorkflowAction {
logger.info("Found {}", foundObjects);
if (orchFlows == null || orchFlows.isEmpty()) {
- orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte);
+ orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner);
}
flowsToExecute = buildExecuteBuildingBlockList(orchFlows, resourceCounter, requestId, apiVersion, resourceId,
resourceType, requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails);
@@ -943,10 +945,10 @@ public class WorkflowAction {
}
protected List<OrchestrationFlow> queryNorthBoundRequestCatalogDb(DelegateExecution execution, String requestAction,
- WorkflowType resourceName, boolean aLaCarte) {
+ WorkflowType resourceName, boolean aLaCarte, String cloudOwner) {
List<OrchestrationFlow> listToExecute = new ArrayList<>();
NorthBoundRequest northBoundRequest = catalogDbClient
- .getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(requestAction, resourceName.toString(), aLaCarte);
+ .getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(requestAction, resourceName.toString(), aLaCarte, cloudOwner);
if(northBoundRequest == null){
if(aLaCarte){
buildAndThrowException(execution,"The request: ALaCarte " + resourceName + " " + requestAction + " is not supported by GR_API.");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
index 76a807056c..5f4eef3fcc 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
@@ -112,11 +112,12 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", true);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/networks/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("AssignNetwork1802BB","CreateNetworkBB","ActivateNetworkBB");
northBoundRequest.setOrchestrationFlowList(orchFlows);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,true)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,true, "my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"AssignNetwork1802BB","CreateNetworkBB","ActivateNetworkBB");
@@ -133,11 +134,12 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", true);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/networks/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("DeactivateNetworkBB","DeleteNetworkBB","UnassignNetwork1802BB");
northBoundRequest.setOrchestrationFlowList(orchFlows);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,true)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,true,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"DeactivateNetworkBB","DeleteNetworkBB","UnassignNetwork1802BB");
@@ -154,12 +156,13 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", true);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("AssignServiceInstanceBB","ActivateServiceInstanceBB");
northBoundRequest.setOrchestrationFlowList(orchFlows);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,true)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,true,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"AssignServiceInstanceBB","ActivateServiceInstanceBB");
@@ -179,6 +182,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("AssignServiceInstanceBB","AssignNetworkBB","AssignVnfBB","AssignVolumeGroupBB","AssignVfModuleBB");
@@ -205,7 +209,7 @@ public class WorkflowActionTest extends BaseTaskTest {
VfModuleCustomization vfModuleCustomization3 = vfModuleCustomization2;
vfModuleCustomization3.setModelCustomizationUUID("72d9d1cd-f46d-447a-abdb-451d6fb05fa8");
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f")).thenReturn(vfModuleCustomization);
when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("72d9d1cd-f46d-447a-abdb-451d6fb05fa8")).thenReturn(vfModuleCustomization2);
when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("da4d4327-fb7d-4311-ac7a-be7ba60cf969")).thenReturn(vfModuleCustomization3);
@@ -225,6 +229,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/si0");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("CreateNetworkBB","ActivateNetworkBB","CreateVolumeGroupBB","ActivateVolumeGroupBB","CreateVfModuleBB","ActivateVfModuleBB"
@@ -252,7 +257,7 @@ public class WorkflowActionTest extends BaseTaskTest {
doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("si0");
doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"CreateVolumeGroupBB","ActivateVolumeGroupBB","CreateVfModuleBB","CreateVfModuleBB","ActivateVfModuleBB","ActivateVfModuleBB","ActivateVnfBB","ActivateServiceInstanceBB");
@@ -278,12 +283,13 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
-
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
+
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("DeactivateServiceInstanceBB");
northBoundRequest.setOrchestrationFlowList(orchFlows);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEquals(ebbs.get(0).getBuildingBlock().getBpmnFlowName(),"DeactivateServiceInstanceBB");
@@ -300,6 +306,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
northBoundRequest.setIsToplevelflow(true);
@@ -310,7 +317,7 @@ public class WorkflowActionTest extends BaseTaskTest {
Service service = new Service();
doReturn(service).when(catalogDbClient).getServiceByID("3c40d244-808e-42ca-b09a-256d83d19d0a");
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"AssignServiceInstanceBB","ActivateServiceInstanceBB");
@@ -327,6 +334,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
northBoundRequest.setIsToplevelflow(true);
@@ -340,7 +348,7 @@ public class WorkflowActionTest extends BaseTaskTest {
networkCustomization.setModelCustomizationUUID("1234");
service.getNetworkCustomizations().add(networkCustomization);
doReturn(service).when(catalogDbClient).getServiceByID("3c40d244-808e-42ca-b09a-256d83d19d0a");
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"AssignServiceInstanceBB","AssignNetworkBB","CreateNetworkBB","ActivateNetworkBB","ActivateServiceInstanceBB");
@@ -357,6 +365,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
northBoundRequest.setIsToplevelflow(true);
@@ -396,7 +405,7 @@ public class WorkflowActionTest extends BaseTaskTest {
service.getCollectionResourceCustomizations().add(collectionResourceCustomization);
doReturn(service).when(catalogDbClient).getServiceByID("3c40d244-808e-42ca-b09a-256d83d19d0a");
doReturn(collectionResourceCustomization).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("123");
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"AssignServiceInstanceBB","CreateNetworkCollectionBB","AssignNetworkBB","CreateNetworkBB","ActivateNetworkBB","AssignNetworkBB","CreateNetworkBB","ActivateNetworkBB"
@@ -432,6 +441,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("AssignServiceInstanceBB","CreateNetworkCollectionBB","AssignNetworkBB","AssignVnfBB","AssignVolumeGroupBB","AssignVfModuleBB"
@@ -463,7 +473,7 @@ public class WorkflowActionTest extends BaseTaskTest {
VfModuleCustomization vfModuleCustomization3 = vfModuleCustomization2;
vfModuleCustomization3.setModelCustomizationUUID("72d9d1cd-f46d-447a-abdb-451d6fb05fa8");
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f")).thenReturn(vfModuleCustomization);
when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("72d9d1cd-f46d-447a-abdb-451d6fb05fa8")).thenReturn(vfModuleCustomization2);
when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("da4d4327-fb7d-4311-ac7a-be7ba60cf969")).thenReturn(vfModuleCustomization3);
@@ -503,7 +513,8 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
-
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
+
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("DeactivateVfModuleBB","DeleteVfModuleBB","DeactivateVolumeGroupBB","DeleteVolumeGroupBB","DeactivateVnfBB","DeactivateNetworkBB"
,"DeleteNetworkBB","DeleteNetworkCollectionBB","DeactivateServiceInstanceBB","UnassignVfModuleBB","UnassignVolumeGroupBB","UnassignVnfBB","UnassignNetworkBB","UnassignServiceInstanceBB");
@@ -530,7 +541,7 @@ public class WorkflowActionTest extends BaseTaskTest {
doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("123");
doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"DeactivateVfModuleBB","DeactivateVfModuleBB","DeleteVfModuleBB","DeleteVfModuleBB","DeactivateVolumeGroupBB","DeleteVolumeGroupBB","DeactivateVnfBB"
@@ -548,6 +559,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("UnassignVfModuleBB","UnassignVolumeGroupBB","UnassignVnfBB","UnassignNetworkBB","UnassignServiceInstanceBB");
@@ -574,7 +586,7 @@ public class WorkflowActionTest extends BaseTaskTest {
doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("123");
doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"UnassignVfModuleBB","UnassignVfModuleBB","UnassignVolumeGroupBB","UnassignVnfBB","UnassignServiceInstanceBB");
@@ -591,6 +603,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("DeactivateVfModuleBB","DeleteVfModuleBB","DeactivateVolumeGroupBB","DeleteVolumeGroupBB","DeactivateVnfBB","DeactivateNetworkBB"
@@ -613,7 +626,7 @@ public class WorkflowActionTest extends BaseTaskTest {
doReturn(serviceInstanceAAI).when(bbSetupUtils).getAAIServiceInstanceById("123");
doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
assertEqualsBulkFlowName(ebbs,"DeactivateNetworkBB","DeleteNetworkBB","UnassignNetworkBB","DeactivateNetworkBB","DeleteNetworkBB","UnassignNetworkBB","DeleteNetworkCollectionBB"
@@ -632,7 +645,8 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123/networkCollections/123");
-
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
+
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("CreateNetworkCollectionBB","AssignNetworkBB","CreateNetworkBB","ActivateNetworkBB","ActivateNetworkCollectionBB");
northBoundRequest.setOrchestrationFlowList(orchFlows);
@@ -644,7 +658,7 @@ public class WorkflowActionTest extends BaseTaskTest {
collectionResourceCustomization.setCollectionResource(collectionResource);
service.getCollectionResourceCustomizations().add(collectionResourceCustomization);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
when(catalogDbClient.getServiceByID("3c40d244-808e-42ca-b09a-256d83d19d0a")).thenReturn(service);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
@@ -663,6 +677,7 @@ public class WorkflowActionTest extends BaseTaskTest {
execution.setVariable("aLaCarte", false);
execution.setVariable("apiVersion", "7");
execution.setVariable("requestUri", "v6/serviceInstances/123/networkCollections/123");
+ execution.setVariable("cloudOwner", "my-custom-cloud-owner");
NorthBoundRequest northBoundRequest = new NorthBoundRequest();
List<OrchestrationFlow> orchFlows = createFlowList("DeactivateNetworkBB","DeleteNetworkBB","UnassignNetworkBB","DeactivateNetworkCollectionBB","DeleteNetworkCollectionBB");
@@ -675,7 +690,7 @@ public class WorkflowActionTest extends BaseTaskTest {
collectionResourceCustomization.setCollectionResource(collectionResource);
service.getCollectionResourceCustomizations().add(collectionResourceCustomization);
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(gAction,resource,false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
when(catalogDbClient.getServiceByID("3c40d244-808e-42ca-b09a-256d83d19d0a")).thenReturn(service);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
@@ -797,9 +812,9 @@ public class WorkflowActionTest extends BaseTaskTest {
northBoundRequest.setOrchestrationFlowList(orchFlows);
List<OrchestrationFlow> macroFlows = createFlowList("DeactivateVfModuleBB","DeleteVfModuleBB","DeactivateVnfBB","CreateVfModuleBB","ActivateVfModuleBB","ActivateVnfBB");
- when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScope("replaceInstance","Vnf",false)).thenReturn(northBoundRequest);
+ when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner("replaceInstance","Vnf",false,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
when(catalogDbClient.getOrchestrationFlowByAction("VNF-Macro-Replace")).thenReturn(macroFlows);
- List<OrchestrationFlow> flows = workflowAction.queryNorthBoundRequestCatalogDb(execution, "replaceInstance", WorkflowType.VNF, false);
+ List<OrchestrationFlow> flows = workflowAction.queryNorthBoundRequestCatalogDb(execution, "replaceInstance", WorkflowType.VNF, false,"my-custom-cloud-owner");
assertEquals(flows.get(0).getFlowName(),"AAICheckVnfInMaintBB");
assertEquals(flows.get(1).getFlowName(),"AAISetVnfInMaintBB");
assertEquals(flows.get(2).getFlowName(),"DeactivateVfModuleBB");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java
index 5c0a54f7db..4008240203 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java
@@ -144,7 +144,7 @@ public class WorkflowActionUnitTest {
flow.setFlowName("flow x");
List<OrchestrationFlow> flows = Arrays.asList(flow);
- doReturn(Arrays.asList(flow)).when(workflowAction).queryNorthBoundRequestCatalogDb(any(), any(), any(), anyBoolean());
+ doReturn(Arrays.asList(flow)).when(workflowAction).queryNorthBoundRequestCatalogDb(any(), any(), any(), anyBoolean(), any());
workflowAction.selectExecutionList(execution);
verify(workflowAction, times(1)).filterOrchFlows(eq(flows), any(), any());
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
index 0df176c3f8..a7ce2da70d 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java
@@ -83,6 +83,10 @@ public class NorthBoundRequest implements Serializable {
@Column(name = "MAX_API_VERSION")
private Double maxApiVersion;
+ @BusinessKey
+ @Column(name = "CLOUD_OWNER")
+ private String cloudOwner;
+
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest")
private List<OrchestrationFlow> orchestrationFlowList;
@@ -90,7 +94,8 @@ public class NorthBoundRequest implements Serializable {
public String toString() {
return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope)
.append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow)
- .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion).toString();
+ .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion)
+ .append("cloudOwner",cloudOwner).toString();
}
@Override
@@ -102,13 +107,14 @@ public class NorthBoundRequest implements Serializable {
return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope)
.append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow)
.append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion)
+ .append(cloudOwner, castOther.cloudOwner)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow)
- .append(minApiVersion).append(maxApiVersion).toHashCode();
+ .append(minApiVersion).append(maxApiVersion).append(cloudOwner).toHashCode();
}
public Integer getId() {
@@ -174,6 +180,14 @@ public class NorthBoundRequest implements Serializable {
public void setMaxApiVersion(Double maxApiVersion) {
this.maxApiVersion = maxApiVersion;
}
+
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
@LinkedResource
public List<OrchestrationFlow> getOrchestrationFlowList() {
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
index 4f070e71c9..51c55bdfce 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
@@ -118,6 +118,7 @@ public class CatalogDbClient {
private static final String TARGET_ACTION = "targetAction";
private static final String REQUEST_SCOPE = "requestScope";
private static final String IS_ALACARTE = "isALaCarte";
+ private static final String CLOUD_OWNER = "cloudOwner";
private static final String FLOW_NAME = "flowName";
private static final String SERVICE_TYPE = "serviceType";
private static final String VNF_TYPE = "vnfType";
@@ -151,6 +152,7 @@ public class CatalogDbClient {
private String findVnfcInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID";
private String findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID";
private String findOneByActionAndRequestScopeAndIsAlacarte = "/findOneByActionAndRequestScopeAndIsAlacarte";
+ private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner";
private String findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = "/findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep";
private String findByClliAndCloudVersion = "/findByClliAndCloudVersion";
@@ -248,6 +250,7 @@ public class CatalogDbClient {
findVnfcInstanceGroupCustomizationByModelCustomizationUUID = endpoint + VNFC_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findVnfcInstanceGroupCustomizationByModelCustomizationUUID;
findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = endpoint + COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID;
findOneByActionAndRequestScopeAndIsAlacarte = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarte;
+ findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner;
findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = endpoint + RAINY_DAY_HANDLER_MACRO + SEARCH + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep;
findByClliAndCloudVersion = endpoint + CLOUD_SITE + SEARCH + findByClliAndCloudVersion;
@@ -477,6 +480,15 @@ public class CatalogDbClient {
.queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
.queryParam(IS_ALACARTE, aLaCarte).build());
}
+
+ public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(String requestAction,
+ String resourceName, boolean aLaCarte, String cloudOwner) {
+ return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder
+ .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner)
+ .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
+ .queryParam(IS_ALACARTE, aLaCarte)
+ .queryParam(CLOUD_OWNER, cloudOwner).build().toString()));
+ }
public RainyDayHandlerStatus getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
String flowName, String serviceType, String vnfType, String errorCode, String workStep) {