+ /*
+ * This method is to create Relation between Parent & Child Services with Node as Composed Resource.
+ *
+ */
+
+ public void updateRelations(BuildingBlockExecution buildingBlockExecution) throws Exception {
+
+ Map<ResourceKey, String> lookupMap = buildingBlockExecution.getLookupMap();
+
+ String childSvcInstanceId = buildingBlockExecution.getVariable(CHILD_SVC_INSTANCE_ID);
+ String parentSvcInstanceId = lookupMap.get(ResourceKey.SERVICE_INSTANCE_ID);
+
+ ComposedResource composedResource = new ComposedResource();
+ composedResource.setId(UUID.randomUUID().toString());
+
+ AAIResourcesClient client = new AAIResourcesClient();
+
+ AAIResourceUri composedResourceURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business()
+ .customer(buildingBlockExecution.getGeneralBuildingBlock().getCustomer().getGlobalCustomerId())
+ .serviceSubscription(buildingBlockExecution.getGeneralBuildingBlock().getRequestContext()
+ .getSubscriptionServiceType())
+ .serviceInstance(parentSvcInstanceId).composedResource(composedResource.getId()));
+
+ client.create(composedResourceURI, composedResource);
+
+ AAIResourceUri childURI =
+ AAIUriFactory.createResourceUri(Types.SERVICE_INSTANCE.getFragment(childSvcInstanceId));
+
+ client.connect(composedResourceURI, childURI);
+
+ }
+