2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
7 * ================================================================================
8 * Modifications Copyright (c) 2019 Samsung
9 * ================================================================================
10 * Licensed under the Apache License, Version 2.0 (the "License")
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 * ============LICENSE_END=========================================================
23 package org.onap.so.bpmn.infrastructure.scripts
25 import static org.apache.commons.lang3.StringUtils.*
26 import javax.ws.rs.NotFoundException
27 import org.camunda.bpm.engine.delegate.BpmnError
28 import org.camunda.bpm.engine.delegate.DelegateExecution
29 import org.onap.aai.domain.yang.Relationship
30 import org.onap.aai.domain.yang.ServiceInstance
31 import org.onap.aaiclient.client.aai.AAIObjectType
32 import org.onap.aaiclient.client.aai.AAIResourcesClient
33 import org.onap.aaiclient.client.aai.entities.AAIResultWrapper
34 import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
35 import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
36 import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
37 import org.onap.logging.filter.base.ErrorCode
38 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
39 import org.onap.so.bpmn.common.scripts.ExceptionUtil
40 import org.onap.so.bpmn.common.scripts.MsoUtils
41 import org.onap.so.bpmn.core.RollbackData
42 import org.onap.so.bpmn.core.UrnPropertiesReader
43 import org.onap.so.bpmn.core.WorkflowException
44 import org.onap.so.bpmn.core.domain.Resource
45 import org.onap.so.bpmn.core.domain.ServiceDecomposition
46 import org.onap.so.bpmn.core.json.JsonUtils
47 import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
48 import org.onap.so.logger.LoggingAnchor
49 import org.onap.so.logger.MessageEnum
50 import org.slf4j.Logger
51 import org.slf4j.LoggerFactory
52 import org.springframework.web.util.UriUtils
53 import com.fasterxml.jackson.databind.ObjectMapper
54 import com.fasterxml.jackson.databind.SerializationFeature
57 * This groovy class supports the <class>DoCreateServiceInstance.bpmn</class> process.
60 * @param - msoRequestId
61 * @param - globalSubscriberId
62 * @param - subscriptionServiceType
63 * @param - serviceInstanceId
64 * @param - serviceInstanceName - O
65 * @param - serviceModelInfo
66 * @param - productFamilyId
67 * @param - disableRollback
68 * @param - failExists - TODO
69 * @param - serviceInputParams (should contain aic_zone for serviceTypes TRANSPORT,ATM)
70 * @param - sdncVersion ("1610")
71 * @param - serviceDecomposition - Decomposition for R1710
72 * (if macro provides serviceDecompsition then serviceModelInfo, serviceInstanceId & serviceInstanceName will be ignored)
75 * @param - rollbackData (localRB->null)
76 * @param - rolledBack (no localRB->null, localRB F->false, localRB S->true)
77 * @param - WorkflowException
78 * @param - serviceInstanceName - (GET from AAI if null in input)
81 public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
82 private static final Logger logger = LoggerFactory.getLogger( DoCreateE2EServiceInstance.class)
85 String Prefix="DCRESI_"
86 ExceptionUtil exceptionUtil = new ExceptionUtil()
87 JsonUtils jsonUtil = new JsonUtils()
89 public void preProcessRequest (DelegateExecution execution) {
91 logger.trace("preProcessRequest ")
94 execution.setVariable("prefix", Prefix)
96 //requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology
97 String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
98 logger.info(" ***** globalSubscriberId *****" + globalSubscriberId)
99 //requestDetails.requestParameters. for AAI PUT & SDNC assignTopology
100 String serviceType = execution.getVariable("serviceType")
101 logger.info(" ***** serviceType *****" + serviceType)
102 //requestDetails.requestParameters. for SDNC assignTopology
103 String productFamilyId = execution.getVariable("productFamilyId") //AAI productFamilyId
105 if (isBlank(globalSubscriberId)) {
106 msg = "Input globalSubscriberId is null"
108 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
111 if (isBlank(serviceType)) {
112 msg = "Input serviceType is null"
114 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
117 if (productFamilyId == null) {
118 execution.setVariable("productFamilyId", "")
121 String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback", execution)
122 if (isBlank(sdncCallbackUrl)) {
123 msg = "URN_mso_workflow_sdncadapter_callback is null"
125 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
127 execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
128 logger.info("SDNC Callback URL: " + sdncCallbackUrl)
130 //requestDetails.modelInfo.for AAI PUT servieInstanceData
131 //requestDetails.requestInfo. for AAI GET/PUT serviceInstanceData
132 String serviceInstanceName = execution.getVariable("serviceInstanceName")
133 String serviceInstanceId = execution.getVariable("serviceInstanceId")
134 String uuiRequest = execution.getVariable("uuiRequest")
135 String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
136 String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
137 String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")
138 execution.setVariable("serviceModelName", serviceModelName)
139 //aai serviceType and Role can be setted as fixed value now.
140 String aaiServiceType = "E2E Service"
141 String aaiServiceRole = "E2E Service"
143 execution.setVariable("modelInvariantUuid", modelInvariantUuid)
144 execution.setVariable("modelUuid", modelUuid)
147 String oStatus = execution.getVariable("initialStatus") ?: ""
148 if ("TRANSPORT".equalsIgnoreCase(serviceType))
153 org.onap.aai.domain.yang.ServiceInstance si = new org.onap.aai.domain.yang.ServiceInstance()
154 si.setServiceInstanceName(serviceInstanceName)
155 si.setServiceType(aaiServiceType)
156 si.setServiceRole(aaiServiceRole)
157 si.setOrchestrationStatus(oStatus)
158 si.setModelInvariantId(modelInvariantUuid)
159 si.setModelVersionId(modelUuid)
160 si.setInputParameters(uuiRequest)
161 execution.setVariable("serviceInstanceData", si)
163 } catch (BpmnError e) {
165 } catch (Exception ex){
166 msg = "Exception in preProcessRequest " + ex.getMessage()
168 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
170 logger.trace("Exit preProcessRequest ")
173 public void prepareDecomposeService(DelegateExecution execution) {
175 logger.trace("Inside prepareDecomposeService of create generic e2e service ")
176 String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
177 String modelUuid = execution.getVariable("modelUuid")
178 //here modelVersion is not set, we use modelUuid to decompose the service.
179 String serviceModelInfo = """{
180 "modelInvariantUuid":"${modelInvariantUuid}",
181 "modelUuid":"${modelUuid}",
184 execution.setVariable("serviceModelInfo", serviceModelInfo)
186 logger.trace("Completed prepareDecomposeService of create generic e2e service ")
187 } catch (Exception ex) {
188 // try error in method block
189 String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
190 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
194 public void processDecomposition(DelegateExecution execution) {
195 logger.trace("Inside processDecomposition() of create generic e2e service flow ")
197 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
198 } catch (Exception ex) {
199 String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage()
200 logger.debug(exceptionMessage)
201 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
205 public void doServicePreOperation(DelegateExecution execution){
206 //we need a service plugin platform here.
207 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
208 String uuiRequest = execution.getVariable("uuiRequest")
209 String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest)
210 execution.setVariable("uuiRequest", newUuiRequest)
213 public void doServiceHoming(DelegateExecution execution) {
214 //we need a service plugin platform here.
215 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
216 String uuiRequest = execution.getVariable("uuiRequest")
217 String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest)
218 execution.setVariable("uuiRequest", newUuiRequest)
221 public void postProcessAAIGET(DelegateExecution execution) {
222 logger.trace("postProcessAAIGET ")
226 String serviceInstanceName = execution.getVariable("serviceInstanceName")
227 boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
229 logger.info("Error getting Service-instance from AAI", + serviceInstanceName)
230 WorkflowException workflowException = execution.getVariable("WorkflowException")
231 logger.debug("workflowException: " + workflowException)
232 if(workflowException != null){
233 exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
237 msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
239 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
244 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
246 logger.info("Found Service-instance in AAI")
247 msg = "ServiceInstance already exists in AAI:" + serviceInstanceName
249 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
252 } catch (BpmnError e) {
254 } catch (Exception ex) {
255 msg = "Exception in DoCreateServiceInstance.postProcessAAIGET. " + ex.getMessage()
257 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
259 logger.trace("Exit postProcessAAIGET ")
262 //TODO use create if not exist
263 public void createServiceInstance(DelegateExecution execution) {
264 logger.trace("createServiceInstance ")
266 String serviceInstanceId = execution.getVariable("serviceInstanceId")
268 org.onap.aai.domain.yang.ServiceInstance si = execution.getVariable("serviceInstanceData")
270 AAIResourcesClient client = new AAIResourcesClient()
271 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("serviceType")).serviceInstance(serviceInstanceId))
272 client.create(uri, si)
274 } catch (BpmnError e) {
276 } catch (Exception ex) {
277 //start rollback set up
278 RollbackData rollbackData = new RollbackData()
279 def disableRollback = execution.getVariable("disableRollback")
280 rollbackData.put("SERVICEINSTANCE", "disableRollback", disableRollback.toString())
281 rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true")
282 rollbackData.put("SERVICEINSTANCE", "serviceInstanceId", serviceInstanceId)
283 rollbackData.put("SERVICEINSTANCE", "subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
284 rollbackData.put("SERVICEINSTANCE", "globalSubscriberId", execution.getVariable("globalSubscriberId"))
285 execution.setVariable("rollbackData", rollbackData)
287 msg = "Exception in DoCreateServiceInstance.createServiceInstance. " + ex.getMessage()
289 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
291 logger.trace("Exit createServiceInstance ")
294 public void createCustomRelationship(DelegateExecution execution) {
295 logger.trace("createCustomRelationship ")
298 String uuiRequest = execution.getVariable("uuiRequest")
299 String vpnName = isNeedProcessCustomRelationship(uuiRequest)
302 logger.debug("fetching resource-link information for the given sotnVpnName:"+vpnName)
303 // fetch the service instance to link the relationship
304 AAIResourcesClient client = new AAIResourcesClient()
305 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.NODES_QUERY).queryParam("search-node-type","service-instance").queryParam("filter","service-instance-name:EQUALS:"+vpnName)
306 AAIResultWrapper aaiResult = client.get(uri,NotFoundException.class)
307 Map<String, Object> result = aaiResult.asMap()
308 List<Object> resources =
309 (List<Object>) result.getOrDefault("result-data", Collections.emptyList())
310 if(resources.size()>0) {
311 String relationshipUrl = ((Map<String, Object>) resources.get(0)).get("resource-link")
313 final Relationship body = new Relationship()
314 body.setRelatedLink(relationshipUrl)
316 createRelationShipInAAI(execution, body)
318 logger.warn("No resource-link found for the given sotnVpnName:"+vpnName)
322 logger.error("VPNName not found in request input")
327 } catch (BpmnError e) {
329 } catch (Exception ex) {
331 msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage()
333 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
335 logger.trace("Exit createCustomRelationship ")
338 private void createRelationShipInAAI(DelegateExecution execution, final Relationship relationship){
339 logger.trace("createRelationShipInAAI ")
342 String serviceInstanceId = execution.getVariable("serviceInstanceId")
343 AAIResourcesClient client = new AAIResourcesClient()
344 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("serviceType")).serviceInstance(serviceInstanceId)).relationshipAPI()
345 client.create(uri, relationship)
347 } catch (BpmnError e) {
349 } catch (Exception ex) {
351 msg = "Exception in DoCreateE2EServiceInstance.createRelationShipInAAI. " + ex.getMessage()
353 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
355 logger.trace("Exit createRelationShipInAAI ")
359 private String isNeedProcessCustomRelationship(String uuiRequest) {
360 String requestInput = jsonUtil.getJsonValue(uuiRequest, "service.parameters.requestInputs")
361 Map<String, String> requestInputObject = getJsonObject(requestInput, Map.class)
362 if (requestInputObject == null) {
366 Optional<Map.Entry> firstKey =
367 requestInputObject.entrySet()
369 .filter({entry -> entry.getKey().toString().contains("_sotnVpnName")})
371 if (firstKey.isPresent()) {
372 return firstKey.get().getValue()
378 private static <T> T getJsonObject(String jsonstr, Class<T> type) {
379 ObjectMapper mapper = new ObjectMapper()
380 mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true)
382 return mapper.readValue(jsonstr, type)
383 } catch (IOException e) {
384 logger.error("{} {} fail to unMarshal json", MessageEnum.RA_NS_EXC.toString(),
385 ErrorCode.BusinessProcessError.getValue(), e)
392 * Gets the service instance and its relationships from aai
394 public void getServiceInstance(DelegateExecution execution) {
396 String serviceInstanceId = execution.getVariable('serviceInstanceId')
397 String globalSubscriberId = execution.getVariable('globalSubscriberId')
398 String serviceType = execution.getVariable('subscriptionServiceType')
400 AAIResourcesClient resourceClient = new AAIResourcesClient()
401 AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(globalSubscriberId).serviceSubscription(serviceType).serviceInstance(serviceInstanceId))
402 AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class)
404 Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
405 execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName())
407 }catch(BpmnError e) {
409 }catch(Exception ex) {
410 String msg = "Internal Error in getServiceInstance: " + ex.getMessage()
411 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
415 public void postProcessAAIGET2(DelegateExecution execution) {
416 logger.trace("postProcessAAIGET2 ")
420 String serviceInstanceName = execution.getVariable("serviceInstanceName")
421 boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
423 logger.info("Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName)
424 WorkflowException workflowException = execution.getVariable("WorkflowException")
425 logger.debug("workflowException: " + workflowException)
426 if(workflowException != null){
427 exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
431 msg = "Failure in postProcessAAIGET2 GENGS_SuccessIndicator:" + succInAAI
433 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
438 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
440 String aaiService = execution.getVariable("GENGS_service")
441 if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) {
442 execution.setVariable("serviceInstanceName", utils.getNodeText(aaiService, "service-instance-name"))
443 logger.info("Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"))
447 } catch (BpmnError e) {
449 } catch (Exception ex) {
450 msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()
452 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
454 logger.trace("Exit postProcessAAIGET2 ")
457 public void preProcessRollback (DelegateExecution execution) {
458 logger.trace("preProcessRollback ")
461 Object workflowException = execution.getVariable("WorkflowException")
463 if (workflowException instanceof WorkflowException) {
464 logger.info("Prev workflowException: " + workflowException.getErrorMessage())
465 execution.setVariable("prevWorkflowException", workflowException)
466 //execution.setVariable("WorkflowException", null)
468 } catch (BpmnError e) {
469 logger.info("BPMN Error during preProcessRollback")
470 } catch(Exception ex) {
471 String msg = "Exception in preProcessRollback. " + ex.getMessage()
474 logger.trace("Exit preProcessRollback ")
477 public void postProcessRollback (DelegateExecution execution) {
478 logger.trace("postProcessRollback ")
481 Object workflowException = execution.getVariable("prevWorkflowException")
482 if (workflowException instanceof WorkflowException) {
483 logger.info("Setting prevException to WorkflowException: ")
484 execution.setVariable("WorkflowException", workflowException)
486 execution.setVariable("rollbackData", null)
487 } catch (BpmnError b) {
488 logger.info("BPMN Error during postProcessRollback")
490 } catch(Exception ex) {
491 msg = "Exception in postProcessRollback. " + ex.getMessage()
494 logger.trace("Exit postProcessRollback ")
497 public void preInitResourcesOperStatus(DelegateExecution execution){
498 logger.trace("STARTED preInitResourcesOperStatus Process ")
500 String serviceId = execution.getVariable("serviceInstanceId")
501 String operationId = execution.getVariable("operationId")
502 String operationType = execution.getVariable("operationType")
503 String resourceTemplateUUIDs = ""
504 String result = "processing"
505 String progress = "0"
507 String operationContent = "Prepare service creation"
508 logger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
509 serviceId = UriUtils.encode(serviceId,"UTF-8")
510 execution.setVariable("serviceInstanceId", serviceId)
511 execution.setVariable("operationId", operationId)
512 execution.setVariable("operationType", operationType)
513 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
514 List<Resource> resourceList = serviceDecomposition.getServiceResources()
516 for(Resource resource : resourceList){
517 resourceTemplateUUIDs = resourceTemplateUUIDs + resource.getModelInfo().getModelCustomizationUuid() + ":"
520 def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.db.endpoint")
521 execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
522 logger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
525 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
526 xmlns:ns="http://org.onap.so/requestsdb">
529 <ns:initResourceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
530 <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
531 <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
532 <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
533 <resourceTemplateUUIDs>${MsoUtils.xmlEscape(resourceTemplateUUIDs)}</resourceTemplateUUIDs>
534 </ns:initResourceOperationStatus>
536 </soapenv:Envelope>"""
538 payload = utils.formatXml(payload)
539 execution.setVariable("CVFMI_initResOperStatusRequest", payload)
540 logger.info("Outgoing initResourceOperationStatus: \n" + payload)
541 logger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
544 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
545 "Exception Occured Processing preInitResourcesOperStatus.", "BPMN",
546 ErrorCode.UnknownError.getValue(), e)
547 execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
549 logger.trace("COMPLETED preInitResourcesOperStatus Process ")
552 // if site location is in local Operator, create all resources in local ONAP
553 // if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP
554 public void doProcessSiteLocation(DelegateExecution execution){
555 logger.trace("======== Start doProcessSiteLocation Process ======== ")
556 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
557 String uuiRequest = execution.getVariable("uuiRequest")
558 uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest)
559 execution.setVariable("uuiRequest", uuiRequest)
560 execution.setVariable("serviceDecomposition", serviceDecomposition)
562 logger.trace("======== COMPLETED doProcessSiteLocation Process ======== ")
565 // Allocate cross link TPs(terminal points) for sotn network only
566 public void doTPResourcesAllocation(DelegateExecution execution){
567 logger.trace("======== Start doTPResourcesAllocation Process ======== ")
568 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
569 String uuiRequest = execution.getVariable("uuiRequest")
570 uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest)
571 execution.setVariable("uuiRequest", uuiRequest)
572 logger.trace("======== COMPLETED doTPResourcesAllocation Process ======== ")
575 // prepare input param for using DoCreateResources.bpmn
576 public void preProcessForAddResource(DelegateExecution execution) {
577 logger.trace("STARTED preProcessForAddResource Process ")
579 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
580 List<Resource> addResourceList = serviceDecomposition.getServiceResources()
581 execution.setVariable("addResourceList", addResourceList)
583 boolean isCreateResourceListValid = true
584 if (addResourceList == null || addResourceList.isEmpty()) {
585 isCreateResourceListValid = false
588 execution.setVariable("isCreateResourceListValid", isCreateResourceListValid)
590 logger.trace("COMPLETED preProcessForAddResource Process ")
593 public void postProcessForAddResource(DelegateExecution execution) {