Merge "Add the query to AAI for SI with customer info"
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / bpmn / infrastructure / aai / tasks / AAICreateTasks.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.bpmn.infrastructure.aai.tasks;
22
23 import java.util.Arrays;
24 import java.util.List;
25 import java.util.stream.Collectors;
26
27 import org.camunda.bpm.engine.delegate.BpmnError;
28 import org.onap.so.bpmn.common.BuildingBlockExecution;
29 import org.onap.so.bpmn.core.UrnPropertiesReader;
30 import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
31 import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection;
32 import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
33 import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
34 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
35 import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
36 import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
37 import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness;
38 import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity;
39 import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform;
40 import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
41 import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
42 import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
43 import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
44 import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
45 import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
46 import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
47 import org.onap.so.client.exception.BBObjectNotFoundException;
48 import org.onap.so.client.exception.ExceptionBuilder;
49 import org.onap.so.client.orchestration.AAIConfigurationResources;
50 import org.onap.so.client.orchestration.AAINetworkResources;
51 import org.onap.so.client.orchestration.AAIServiceInstanceResources;
52 import org.onap.so.client.orchestration.AAIVfModuleResources;
53 import org.onap.so.client.orchestration.AAIVnfResources;
54 import org.onap.so.client.orchestration.AAIVolumeGroupResources;
55 import org.onap.so.client.orchestration.AAIVpnBindingResources;
56 import org.onap.so.db.catalog.beans.OrchestrationStatus;
57 import org.onap.so.logger.MessageEnum;
58 import org.onap.so.logger.MsoLogger;
59 import org.springframework.beans.factory.annotation.Autowired;
60 import org.springframework.core.env.Environment;
61 import org.springframework.stereotype.Component;
62
63 @Component
64 public class AAICreateTasks {
65
66         private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAICreateTasks.class);
67         private static final String networkTypeProvider = "PROVIDER";
68         private static String NETWORK_COLLECTION_NAME = "networkCollectionName";
69         @Autowired
70         private AAIServiceInstanceResources aaiSIResources;
71         @Autowired
72         private AAIVnfResources aaiVnfResources;
73         @Autowired
74         private ExceptionBuilder exceptionUtil;
75         @Autowired
76         private ExtractPojosForBB extractPojosForBB;
77         @Autowired
78         private AAIVolumeGroupResources aaiVolumeGroupResources;
79         @Autowired
80         private AAIVfModuleResources aaiVfModuleResources;
81         @Autowired
82         private AAINetworkResources aaiNetworkResources;
83         @Autowired
84         private AAIVpnBindingResources aaiVpnBindingResources;
85         @Autowired
86         private AAIConfigurationResources aaiConfigurationResources;
87         @Autowired
88         private Environment env;
89
90         public void createServiceInstance(BuildingBlockExecution execution) {
91                 try {
92                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
93                         Customer customer = execution.getGeneralBuildingBlock().getCustomer();
94                         aaiSIResources.createServiceInstance(serviceInstance, customer);
95                 } catch (Exception ex) {
96                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
97                 }
98         }
99
100     public void createServiceSubscription(BuildingBlockExecution execution){
101         try{
102             ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution,
103                     ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
104             Customer customer = execution.getGeneralBuildingBlock().getCustomer();
105             if (null == customer) {
106                 String errorMessage = "Exception in creating ServiceSubscription. Customer not present for ServiceInstanceID: "
107                         + serviceInstance.getServiceInstanceId();
108                 msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, errorMessage, "BPMN", MsoLogger.getServiceName(),
109                         MsoLogger.ErrorCode.UnknownError, errorMessage);
110                 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, errorMessage);
111             }
112             aaiSIResources.createServiceSubscription(customer);
113         } catch (BpmnError ex) {
114             throw ex;
115         }
116         catch (Exception ex) {
117             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
118         }
119     }
120
121         public void createProject(BuildingBlockExecution execution) {
122                 try {
123                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
124                         Project project = serviceInstance.getProject();
125                         if(project != null) {
126                                 if (project.getProjectName() == null || "".equals(project.getProjectName())) {
127                                         msoLogger.info("ProjectName is null in input. Skipping create project...");
128                                 } else {
129                                         aaiSIResources.createProjectandConnectServiceInstance(project, serviceInstance);
130                                 }
131                         }
132                 } catch (Exception ex) {
133                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
134                 }
135         }
136
137         public void createOwningEntity(BuildingBlockExecution execution) {
138                 try {
139                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
140                         OwningEntity owningEntity = serviceInstance.getOwningEntity();
141                         String owningEntityId = owningEntity.getOwningEntityId();
142                         String owningEntityName = owningEntity.getOwningEntityName();
143                         if (owningEntityId == null || "".equals(owningEntityId)) {
144                                 String msg = "Exception in AAICreateOwningEntity. OwningEntityId is null.";
145                                 execution.setVariable("ErrorCreateOEAAI", msg);
146                                 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
147                         } else {
148                                 if (aaiSIResources.existsOwningEntity(owningEntity)) {
149                                         aaiSIResources.connectOwningEntityandServiceInstance(owningEntity, serviceInstance);
150                                 } else {
151                                         if (owningEntityName == null || "".equals(owningEntityName)) {
152                                                 String msg = "Exception in AAICreateOwningEntity. Can't create an owningEntity with no owningEntityName.";
153                                                 msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),
154                                                                 MsoLogger.ErrorCode.UnknownError, msg);
155                                                 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
156                                         } else {
157                                                 if(aaiSIResources.existsOwningEntityName(owningEntityName)){
158                                                         String msg = "Exception in AAICreateOwningEntity. Can't create OwningEntity as name already exists in AAI associated with a different owning-entity-id (name must be unique)";
159                                                         msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),
160                                                                         MsoLogger.ErrorCode.UnknownError, msg);
161                                                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
162                                                 }else{
163                                                         aaiSIResources.createOwningEntityandConnectServiceInstance(owningEntity, serviceInstance);
164                                                 }
165                                         }
166                                 }
167                         }
168                 } catch (Exception ex) {
169                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
170                 }
171         }
172
173         public void createVnf(BuildingBlockExecution execution) {
174                 try {
175                         GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
176                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
177                         execution.setVariable("callHoming", Boolean.TRUE.equals(vnf.isCallHoming()));
178                         aaiVnfResources.createVnfandConnectServiceInstance(vnf, serviceInstance);
179                 } catch (Exception ex) {
180                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
181                 }
182         }
183         
184         public void createPlatform(BuildingBlockExecution execution) {
185                 try {
186                         GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
187                         Platform platform = vnf.getPlatform();
188                         if(platform != null) {
189                                 if (platform.getPlatformName() == null || "".equals(platform.getPlatformName())) {
190                                         msoLogger.debug("PlatformName is null in input. Skipping create platform...");
191                                 } else {
192                                         aaiVnfResources.createPlatformandConnectVnf(platform,vnf);
193                                 }
194                         }
195                 } catch (Exception ex) {
196                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
197                 }
198
199         }
200         
201         public void createLineOfBusiness(BuildingBlockExecution execution) {
202                 try {
203                         GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
204                         LineOfBusiness lineOfBusiness = vnf.getLineOfBusiness();
205                         if(lineOfBusiness != null) {
206                                 if (lineOfBusiness.getLineOfBusinessName() == null || "".equals(lineOfBusiness.getLineOfBusinessName())) {
207                                         msoLogger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness...");
208                                 } else {
209                                         aaiVnfResources.createLineOfBusinessandConnectVnf(lineOfBusiness,vnf);
210                                 }
211                         }
212                 } catch (Exception ex) {
213                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
214                 }
215         }
216
217         public void createVolumeGroup(BuildingBlockExecution execution) {
218                 try {
219                         GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
220                         
221                         GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
222                         VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID));
223                         CloudRegion cloudRegion = gBBInput.getCloudRegion();
224                         aaiVolumeGroupResources.createVolumeGroup(volumeGroup, cloudRegion);
225                         aaiVolumeGroupResources.connectVolumeGroupToVnf(genericVnf, volumeGroup, cloudRegion);
226                         aaiVolumeGroupResources.connectVolumeGroupToTenant(volumeGroup,cloudRegion);
227                 } catch (Exception ex) {
228                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
229                 }
230         }
231         
232         public void createVfModule(BuildingBlockExecution execution) {
233                 try {
234                         GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
235                         VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID, execution.getLookupMap().get(ResourceKey.VF_MODULE_ID));
236                         aaiVfModuleResources.createVfModule(vfModule, vnf);
237                 } catch (Exception ex) {                        
238                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
239                 }       
240         }
241         
242         /**
243          * BPMN access method to establish relationships in AAI
244          * @param execution
245          * @throws Exception
246          */
247         public void connectVfModuleToVolumeGroup(BuildingBlockExecution execution) {
248                 try {
249                         GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
250                         VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID, execution.getLookupMap().get(ResourceKey.VF_MODULE_ID));
251                         VolumeGroup volumeGroup = null;
252                         try{
253                                 volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID));
254                         } catch (BBObjectNotFoundException e){
255                                 msoLogger.info("VolumeGroup not found. Skipping Connect between VfModule and VolumeGroup");
256                         }
257                         if (volumeGroup != null) {
258                                 aaiVfModuleResources.connectVfModuleToVolumeGroup(vnf, vfModule, volumeGroup, execution.getGeneralBuildingBlock().getCloudRegion());
259                         }
260                 } catch (Exception ex) {
261                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
262                 }       
263         }
264         
265         /**
266          * BPMN access method to execute Create L3Network operation (PUT )in AAI
267          * @param execution
268          * @throws Exception
269          */
270         public void createNetwork(BuildingBlockExecution execution) {
271                 try {
272                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
273                         L3Network l3network =  extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
274                         //set default to false. ToBe updated by SDNC
275                         l3network.setIsBoundToVpn(false);
276                         //define is bound to vpn flag as true if NEUTRON_NETWORK_TYPE is PROVIDER
277                         if (l3network.getModelInfoNetwork().getNeutronNetworkType().equalsIgnoreCase(networkTypeProvider))
278                                 l3network.setIsBoundToVpn(true);
279                         //put network shell in AAI
280                         aaiNetworkResources.createNetworkConnectToServiceInstance(l3network, serviceInstance);
281                 } catch (Exception ex) {
282                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
283                 }       
284         }
285         public void createCustomer(BuildingBlockExecution execution) throws Exception {
286                 try {
287                         Customer customer = execution.getGeneralBuildingBlock().getCustomer();
288                         
289                         aaiVpnBindingResources.createCustomer(customer);
290                 } catch(Exception ex) {
291                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
292                 }
293         }
294         
295         /**
296          * BPMN access method to execute NetworkCollection operation (PUT) in AAI
297          * @param execution
298          * @throws Exception
299          */
300         public void createNetworkCollection(BuildingBlockExecution execution) {
301                 try {
302                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
303                         Collection networkCollection =  serviceInstance.getCollection();
304                         //pass name generated for NetworkCollection/NetworkCollectionInstanceGroup in previous step of the BB flow
305                         //put shell in AAI
306                         networkCollection.setName(execution.getVariable(NETWORK_COLLECTION_NAME));
307                         aaiNetworkResources.createNetworkCollection(networkCollection);
308                 } catch (Exception ex) {
309                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
310                 }       
311         }
312         
313         /**
314          * BPMN access method to execute NetworkCollectionInstanceGroup operation (PUT) in AAI
315          * @param execution
316          * @throws Exception
317          */
318         public void createNetworkCollectionInstanceGroup(BuildingBlockExecution execution) {
319                 try {
320                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
321                         InstanceGroup instanceGroup =  serviceInstance.getCollection().getInstanceGroup();
322                         //set name generated for NetworkCollection/NetworkCollectionInstanceGroup in previous step of the BB flow
323                         instanceGroup.setInstanceGroupName(execution.getVariable(NETWORK_COLLECTION_NAME));
324                         //put shell in AAI
325                         aaiNetworkResources.createNetworkInstanceGroup(instanceGroup);
326                 } catch (Exception ex) {
327                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
328                 }       
329         }
330         
331         
332         /**
333          * BPMN access method to establish relationships in AAI
334          * @param execution
335          * @throws Exception
336          */
337         public void connectNetworkToTenant(BuildingBlockExecution execution) {
338                 try {
339                         L3Network l3network =  extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
340                         aaiNetworkResources.connectNetworkToTenant(l3network, execution.getGeneralBuildingBlock().getCloudRegion());
341                 } catch (Exception ex) {
342                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
343                 }       
344         }
345         
346         /**
347          * BPMN access method to establish relationships in AAI
348          * @param execution
349          * @throws Exception
350          */
351         public void connectNetworkToCloudRegion(BuildingBlockExecution execution) {
352                 try {
353                         L3Network l3network =  extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
354                         aaiNetworkResources.connectNetworkToCloudRegion(l3network, execution.getGeneralBuildingBlock().getCloudRegion());
355                 } catch (Exception ex) {
356                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
357                 }       
358         }
359         
360         /**
361          * BPMN access method to establish relationships in AAI
362          * @param execution
363          * @throws Exception
364          */
365         public void connectVnfToCloudRegion(BuildingBlockExecution execution) {
366                 try {
367                         boolean cloudRegionsToSkip = false;
368                         String[] cloudRegions = env.getProperty("mso.bpmn.cloudRegionIdsToSkipAddingVnfEdgesTo", String[].class);
369                         if (cloudRegions != null){
370                                 cloudRegionsToSkip = Arrays.stream(cloudRegions).anyMatch(execution.getGeneralBuildingBlock().getCloudRegion().getLcpCloudRegionId()::equals);
371                         }
372                         if(!cloudRegionsToSkip) {
373                                 GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
374                                 aaiVnfResources.connectVnfToCloudRegion(vnf, execution.getGeneralBuildingBlock().getCloudRegion());
375                         }
376                 } catch (Exception ex) {
377                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
378                 }       
379         }
380         
381         /**
382          * BPMN access method to establish relationships in AAI
383          * @param execution
384          * @throws Exception
385          */
386         public void connectVnfToTenant(BuildingBlockExecution execution) {
387                 try {
388                         GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
389                         aaiVnfResources.connectVnfToTenant(vnf, execution.getGeneralBuildingBlock().getCloudRegion());
390                 } catch (Exception ex) {
391                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
392                 }       
393         }
394         
395         /**
396          * BPMN access method to establish relationships in AAI
397          * @param execution
398          * @throws Exception
399          */
400         public void connectNetworkToNetworkCollectionServiceInstance(BuildingBlockExecution execution) {
401                 try {
402                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
403                         L3Network l3network =  extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
404                         aaiNetworkResources.connectNetworkToNetworkCollectionServiceInstance(l3network, serviceInstance);
405                 } catch (Exception ex) {
406                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
407                 }       
408         }
409         
410         /**
411          * BPMN access method to establish relationships in AAI
412          * @param execution
413          * @throws Exception
414          */
415         public void connectNetworkToNetworkCollectionInstanceGroup(BuildingBlockExecution execution) {
416                 try {
417                         ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
418                         L3Network l3network =  extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID));
419                         //connect network only if Instance Group / Collection objects exist
420                         if (serviceInstance.getCollection() != null && serviceInstance.getCollection().getInstanceGroup() != null)
421                                 aaiNetworkResources.connectNetworkToNetworkCollectionInstanceGroup(l3network, serviceInstance.getCollection().getInstanceGroup());
422                 } catch (Exception ex) {
423                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
424                 }       
425         }
426         
427         public void createConfiguration(BuildingBlockExecution execution){
428                 try{
429                         Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID, execution.getLookupMap().get(ResourceKey.CONFIGURATION_ID));
430                         aaiConfigurationResources.createConfiguration(configuration);
431                 } catch (Exception ex) {
432                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
433                 }
434         }
435 }