2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 Huawei Technologies Co., Ltd. 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.bpmn.infrastructure.scripts
23 import com.google.gson.Gson
24 import com.google.gson.reflect.TypeToken
25 import org.camunda.bpm.engine.delegate.BpmnError
26 import org.camunda.bpm.engine.delegate.DelegateExecution
27 import org.onap.aai.domain.yang.*
28 import org.onap.so.beans.nsmf.NSSI
29 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
30 import org.onap.so.bpmn.common.scripts.ExceptionUtil
31 import org.onap.so.bpmn.common.scripts.MsoUtils
32 import org.onap.so.bpmn.common.scripts.RequestDBUtil
33 import org.onap.so.bpmn.core.WorkflowException
34 import org.onap.so.bpmn.core.json.JsonUtils
35 import org.onap.so.client.aai.AAIObjectType
36 import org.onap.so.client.aai.AAIResourcesClient
37 import org.onap.so.client.aai.entities.AAIResultWrapper
38 import org.onap.so.client.aai.entities.uri.AAIResourceUri
39 import org.onap.so.client.aai.entities.uri.AAIUriFactory
40 import org.onap.so.db.request.beans.OperationStatus
41 import org.onap.logging.filter.base.ErrorCode
42 import org.onap.so.logger.LoggingAnchor
43 import org.onap.so.logger.MessageEnum
44 import org.slf4j.Logger
45 import org.slf4j.LoggerFactory
47 import javax.ws.rs.NotFoundException
48 import java.lang.reflect.Type
50 import static org.apache.commons.lang3.StringUtils.isBlank
53 * This groovy class supports the <class>ActivateSliceService.bpmn</class> process.
54 * AlaCarte flow for 1702 slice service activate
58 class ActivateSliceService extends AbstractServiceTaskProcessor {
61 String Prefix = "ACTSS_"
63 ExceptionUtil exceptionUtil = new ExceptionUtil()
65 JsonUtils jsonUtil = new JsonUtils()
67 RequestDBUtil requestDBUtil = new RequestDBUtil()
69 private static final Logger logger = LoggerFactory.getLogger(ActivateSliceService.class)
71 void preProcessRequest(DelegateExecution execution) {
72 logger.debug(Prefix + "preProcessRequest Start")
73 execution.setVariable("prefix", Prefix)
77 // check for incoming json message/input
78 String siRequest = execution.getVariable("bpmnRequest")
79 logger.debug(siRequest)
81 String requestId = execution.getVariable("mso-request-id")
82 execution.setVariable("msoRequestId", requestId)
83 logger.info("Input Request:" + siRequest + " reqId:" + requestId)
85 String serviceInstanceId = execution.getVariable("serviceInstanceId")
86 if (isBlank(serviceInstanceId)) {
87 msg = "Input serviceInstanceId' is null"
88 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
90 String source = jsonUtil.getJsonValue(siRequest, "source")
91 execution.setVariable("source", source)
94 String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "globalSubscriberId")
95 if (isBlank(globalSubscriberId)) {
96 msg = "Input globalSubscriberId' is null"
99 execution.setVariable("globalSubscriberId", globalSubscriberId)
103 String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "serviceType")
104 if (isBlank(subscriptionServiceType)) {
105 msg = "Input subscriptionServiceType is null"
107 //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
109 execution.setVariable("subscriptionServiceType", subscriptionServiceType)
111 String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
112 execution.setVariable("operationId", operationId)
114 execution.getVariable("operationType")
115 logger.info("operationType is " + execution.getVariable("operationType") )
116 } catch (BpmnError e) {
118 } catch (Exception ex) {
119 msg = "Exception in preProcessRequest " + ex.getMessage()
121 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
123 logger.debug(Prefix + "preProcessRequest Exit")
127 def sendSyncResponse = { DelegateExecution execution ->
128 logger.debug(Prefix + "sendSyncResponse Start")
130 String operationId = execution.getVariable("operationId")
131 // RESTResponse for API Handler (APIH) Reply Task
132 String Activate5GsliceServiceRestRequest = """{"operationId":"${operationId}"}""".trim()
133 logger.debug(" sendSyncResponse to APIH:" + "\n" + Activate5GsliceServiceRestRequest)
134 sendWorkflowResponse(execution, 202, Activate5GsliceServiceRestRequest)
135 execution.setVariable("sentSyncResponse", true)
136 } catch (Exception ex) {
137 String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
139 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
141 logger.debug(Prefix + "sendSyncResponse Exit")
145 public sendSyncError = { DelegateExecution execution ->
146 logger.debug("sendSyncError Start")
149 if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
150 WorkflowException wfe = execution.getVariable("WorkflowException") as WorkflowException
151 errorMessage = wfe.getErrorMessage()
153 errorMessage = "Sending Sync Error."
156 String buildWorkflowException =
157 """<aetgt:WorkflowException xmlns:aetgt="http://org.onap/so/workflow/schema/v1">
158 <aetgt:ErrorMessage>${MsoUtils.xmlEscape(errorMessage)}</aetgt:ErrorMessage>
159 <aetgt:ErrorCode>7000</aetgt:ErrorCode>
160 </aetgt:WorkflowException>"""
162 logger.debug(buildWorkflowException)
163 sendWorkflowResponse(execution, 500, buildWorkflowException)
165 } catch (Exception ex) {
166 logger.debug("Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
168 logger.debug(Prefix + "sendSyncError Exit")
172 def prepareCompletionRequest = { DelegateExecution execution ->
173 logger.debug(Prefix + "prepareCompletionRequest Start")
174 String serviceId = execution.getVariable("serviceInstanceId")
175 String operationId = execution.getVariable("operationId")
176 String userId = execution.getVariable("globalSubscriberId")
177 //String result = execution.getVariable("result")
178 String result = "finished"
179 String progress = "100"
181 String operationContent = execution.getVariable("operationContent")
182 String operationType = execution.getVariable("operationType")
184 OperationStatus initStatus = new OperationStatus()
185 initStatus.setServiceId(serviceId)
186 initStatus.setOperationId(operationId)
187 initStatus.setOperation(operationType)
188 initStatus.setUserId(userId)
189 initStatus.setResult(result)
190 initStatus.setProgress(progress)
191 initStatus.setReason(reason)
192 initStatus.setOperationContent(operationContent)
194 requestDBUtil.prepareUpdateOperationStatus(execution, initStatus)
196 logger.debug(Prefix + "prepareCompletionRequest Exit")
201 * Init the service Operation Status
203 def prepareInitServiceOperationStatus = { DelegateExecution execution ->
204 logger.debug(Prefix + "prepareActivateServiceOperationStatus Start")
206 String serviceId = execution.getVariable("serviceInstanceId")
207 String operationId = execution.getVariable("operationId")
208 String operationType = execution.getVariable("operationType")
209 String userId = execution.getVariable("globalSubscriberId")
210 String result = "processing"
211 String progress = "0"
213 String operationContent = "Prepare service activation"
215 execution.setVariable("e2eserviceInstanceId", serviceId)
216 execution.setVariable("operationType", operationType)
218 OperationStatus initStatus = new OperationStatus()
219 initStatus.setServiceId(serviceId)
220 initStatus.setOperationId(operationId)
221 initStatus.setOperation(operationType)
222 initStatus.setUserId(userId)
223 initStatus.setResult(result)
224 initStatus.setProgress(progress)
225 initStatus.setReason(reason)
226 initStatus.setOperationContent(operationContent)
228 requestDBUtil.prepareUpdateOperationStatus(execution, initStatus)
230 } catch (Exception e) {
231 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
232 "Exception Occured Processing prepareInitServiceOperationStatus.", "BPMN",
233 ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
234 execution.setVariable("CVFMI_ErrorResponse",
235 "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
237 logger.debug(Prefix + "prepareInitServiceOperationStatus Exit")
241 private getSNSSIStatusByNsi = { DelegateExecution execution, String NSIServiceId ->
243 logger.debug(Prefix + "getSNSSIStatusByNsi Start")
244 String globalSubscriberId = execution.getVariable("globalSubscriberId")
245 String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
247 AAIResourcesClient client = new AAIResourcesClient()
248 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
249 globalSubscriberId, subscriptionServiceType, NSIServiceId)
250 if (!client.exists(uri)) {
251 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service Instance was not found in aai")
253 AAIResultWrapper wrapper = client.get(uri, NotFoundException.class)
254 Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
255 if (si.isPresent()) {
257 List<Relationship> relatedList = si.get().getRelationshipList().getRelationship()
258 for (Relationship relationship : relatedList) {
259 String relatedTo = relationship.getRelatedTo()
260 if (relatedTo.toLowerCase() == "allotted-resource") {
261 //get snssi from allotted resource in list by nsi
262 List<String> SNSSIList = new ArrayList<>()
263 List<RelationshipData> relationshipDataList = relationship.getRelationshipData()
264 for (RelationshipData relationshipData : relationshipDataList) {
265 if (relationshipData.getRelationshipKey() == "service-instance.service-instance-id") {
266 SNSSIList.add(relationshipData.getRelationshipValue())
269 for (String snssi : SNSSIList) {
270 AAIResourcesClient client01 = new AAIResourcesClient()
271 AAIResourceUri uri01 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
272 globalSubscriberId, subscriptionServiceType, snssi)
273 if (!client.exists(uri01)) {
274 exceptionUtil.buildAndThrowWorkflowException(execution, 2500,
275 "Service Instance was not found in aai")
277 AAIResultWrapper wrapper01 = client01.get(uri01, NotFoundException.class)
278 Optional<ServiceInstance> nssiSi = wrapper01.asBean(ServiceInstance.class)
279 if (nssiSi.isPresent()) {
280 return nssiSi.get().getOrchestrationStatus() == "deactivated"
288 logger.debug(Prefix + "getSNSSIStatusByNsi Exit")
292 def updateStatusSNSSAIandNSIandNSSI = { DelegateExecution execution ->
293 logger.debug(Prefix + "updateStatusSNSSAIandNSIandNSSI Start")
294 logger.debug(" ***** update SNSSAI NSI NSSI slicing ***** ")
295 String e2eserviceInstanceId = execution.getVariable("e2eserviceInstanceId")
296 String NSIserviceInstanceId = execution.getVariable("NSIserviceid")
298 String globalCustId = execution.getVariable("globalSubscriberId")
299 String serviceType = execution.getVariable("serviceType")
300 String operationType = execution.getVariable("operationType")
302 String nssiMap = execution.getVariable("nssiMap")
303 Type type = new TypeToken<HashMap<String, NSSI>>() {}.getType()
304 Map<String, NSSI> activateNssiMap = new Gson().fromJson(nssiMap, type)
305 //update tn/cn/an nssi
306 for (Map.Entry<String, NSSI> entry : activateNssiMap.entrySet()) {
307 NSSI nssi = entry.getValue()
308 String nssiid = nssi.getNssiId()
309 updateStratus(execution, globalCustId, serviceType, nssiid, operationType)
311 if (operationType == "activation") {
313 updateStratus(execution, globalCustId, serviceType, e2eserviceInstanceId, operationType)
315 updateStratus(execution, globalCustId, serviceType, NSIserviceInstanceId, operationType)
318 updateStratus(execution, globalCustId, serviceType, e2eserviceInstanceId, operationType)
319 boolean flag = getSNSSIStatusByNsi(execution, NSIserviceInstanceId)
322 updateStratus(execution, globalCustId, serviceType, NSIserviceInstanceId, operationType)
324 logger.error("Service's status update failed")
325 String msg = "Service's status update failed"
326 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
329 logger.debug(Prefix + "updateStatusSNSSAIandNSIandNSSI Exit")
333 def updateStratus = { DelegateExecution execution, String globalCustId,
334 String serviceType, String serviceId, String operationType ->
335 logger.debug(Prefix + "updateStratus Start")
338 AAIResourcesClient client = new AAIResourcesClient()
339 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
340 globalCustId, serviceType, serviceId)
341 if (!client.exists(uri)) {
342 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service Instance was not found in aai")
344 AAIResultWrapper wrapper = client.get(uri, NotFoundException.class)
345 Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
347 if (si.isPresent()) {
348 if (operationType == "activation") {
349 if (si.get().getOrchestrationStatus() == "deactivated") {
350 si.get().setOrchestrationStatus("activated")
351 client.update(uri, si.get())
354 if (si.get().getOrchestrationStatus() == "activated") {
355 si.get().setOrchestrationStatus("deactivated")
356 client.update(uri, si.get())
361 } catch (Exception e) {
362 logger.info("Service is already in active state")
363 String msg = "Service is already in active state, " + e.getMessage()
364 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
367 logger.debug(Prefix + "updateStratus Exit")
371 def prepareActivation = { DelegateExecution execution ->
372 logger.debug(Prefix + "prepareActivation Start")
374 logger.debug(" ***** prepare active NSI/AN/CN/TN slice ***** ")
375 String NSIserviceInstanceId = execution.getVariable("NSIserviceid")
377 String globalSubscriberId = execution.getVariable("globalSubscriberId")
378 String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
380 Map<String, NSSI> nssiMap = new HashMap<>()
382 List<String> activationSequence = new ArrayList<>(Arrays.asList("an", "tn", "cn"))
384 def activationCount = activationSequence.size()
386 execution.setVariable("activationIndex", "0")
388 execution.setVariable("activationCount", activationCount)
390 //get the TN NSSI id by NSI id, active NSSI TN slicing
391 AAIResourcesClient client = new AAIResourcesClient()
392 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
393 globalSubscriberId, subscriptionServiceType, NSIserviceInstanceId)
394 if (!client.exists(uri)) {
395 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service Instance was not found in aai")
397 AAIResultWrapper wrapper = client.get(uri, NotFoundException.class)
398 Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
399 if (si.isPresent()) {
401 List<Relationship> relatedList = si.get().getRelationshipList().getRelationship()
402 for (Relationship relationship : relatedList) {
403 String relatedTo = relationship.getRelatedTo()
404 if (relatedTo.toLowerCase() == "service-instance") {
405 String relatioshipurl = relationship.getRelatedLink()
406 String nssiserviceid =
407 relatioshipurl.substring(relatioshipurl.lastIndexOf("/") + 1, relatioshipurl.length())
409 AAIResourcesClient client01 = new AAIResourcesClient()
410 AAIResourceUri uri01 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
411 globalSubscriberId, subscriptionServiceType, nssiserviceid)
412 if (!client.exists(uri01)) {
413 exceptionUtil.buildAndThrowWorkflowException(execution, 2500,
414 "Service Instance was not found in aai")
416 AAIResultWrapper wrapper01 = client01.get(uri01, NotFoundException.class)
417 Optional<ServiceInstance> nssiSi = wrapper01.asBean(ServiceInstance.class)
418 if (nssiSi.isPresent()) {
419 if (nssiSi.get().getEnvironmentContext().toLowerCase().contains("an")
420 || nssiSi.get().getEnvironmentContext().toLowerCase().contains("cn")
421 || nssiSi.get().getEnvironmentContext().toLowerCase().contains("tn")) {
422 nssiMap.put(nssiSi.get().getEnvironmentContext(),
423 new NSSI(nssiSi.get().getServiceInstanceId(),
424 nssiSi.get().getModelInvariantId(), nssiSi.get().getModelVersionId()))
432 } catch (Exception e) {
433 String msg = "Requested service does not exist:" + e.getMessage()
434 logger.info("Service doesnt exist")
435 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
438 if (nssiMap.size() > 0) {
439 execution.setVariable("isNSSIActivate", "true")
440 String nssiMap01 = mapToJsonStr(nssiMap)
441 execution.setVariable("nssiMap", nssiMap01)
442 execution.setVariable("operation_type", "activate")
443 execution.setVariable("activationCount", nssiMap.size())
444 logger.info("the nssiMap01 is :" + nssiMap01)
446 execution.setVariable("isNSSIActivate", "false")
449 logger.debug(Prefix + "prepareActivation Exit")
453 private mapToJsonStr = { HashMap<String, NSSI> stringNSSIHashMap ->
454 HashMap<String, NSSI> map = new HashMap<String, NSSI>()
455 for (Map.Entry<String, NSSI> child : stringNSSIHashMap.entrySet()) {
456 map.put(child.getKey(), child.getValue())
458 return new Gson().toJson(map)
462 def checkAAIOrchStatusofslice = { DelegateExecution execution ->
463 logger.debug(Prefix + "CheckAAIOrchStatus Start")
466 String serviceInstanceId = execution.getVariable("serviceInstanceId")
467 String globalSubscriberId = execution.getVariable("globalSubscriberId")
468 String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
469 String operationType = execution.getVariable("operationType")
471 logger.debug("serviceInstanceId: " + serviceInstanceId)
473 //check the e2e slice status
476 AAIResourcesClient client = new AAIResourcesClient()
477 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
478 globalSubscriberId, subscriptionServiceType, serviceInstanceId)
479 if (!client.exists(uri)) {
480 exceptionUtil.buildAndThrowWorkflowException(execution, 2500,
481 "Service Instance was not found in aai")
483 AAIResultWrapper wrapper = client.get(uri, NotFoundException.class)
484 Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
485 if (si.isPresent()) {
486 if (si.get().getOrchestrationStatus().toLowerCase() == "activated" &&
487 operationType == "deactivation") {
488 logger.info("Service is in active state")
489 execution.setVariable("e2eservicestatus", "activated")
490 execution.setVariable("isContinue", "true")
491 String snssai = si.get().getEnvironmentContext()
492 execution.setVariable("snssai", snssai)
493 } else if ((si.get().getOrchestrationStatus().toLowerCase() == "deactivated" ||
494 si.get().getOrchestrationStatus().toLowerCase() == "created") &&
495 operationType == "activation") {
496 logger.info("Service is in de-activated state")
497 execution.setVariable("e2eservicestatus", "deactivated")
498 execution.setVariable("isContinue", "true")
499 String snssai = si.get().getEnvironmentContext()
500 execution.setVariable("snssai", snssai)
502 execution.setVariable("isContinue", "false")
505 } catch (Exception e) {
506 msg = "Requested e2eservice does not exist"
507 logger.info("e2eservice doesnt exist")
508 execution.setVariable("isContinue", "false")
509 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
512 //check the NSI is exist or the status of NSI is active or de-active
515 //get the allotted-resources by e2e slice id
516 AAIResourcesClient client_allotted = new AAIResourcesClient()
517 AAIResourceUri uri_allotted = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE_ALL,
518 globalSubscriberId, subscriptionServiceType, serviceInstanceId)
519 if (!client_allotted.exists(uri_allotted)) {
520 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service Instance was not found in aai")
522 AAIResultWrapper wrapper_allotted = client_allotted.get(uri_allotted, NotFoundException.class)
523 Optional<AllottedResources> all_allotted = wrapper_allotted.asBean(AllottedResources.class)
525 if (all_allotted.isPresent() && all_allotted.get().getAllottedResource()) {
526 List<AllottedResource> AllottedResourceList = all_allotted.get().getAllottedResource()
527 AllottedResource ar = AllottedResourceList.first()
528 String relatedLink = ar.getRelationshipList().getRelationship().first().getRelatedLink()
529 String nsiserviceid = relatedLink.substring(relatedLink.lastIndexOf("/") + 1, relatedLink.length())
530 execution.setVariable("NSIserviceid", nsiserviceid)
531 logger.info("the NSI ID is:" + nsiserviceid)
533 //Query nsi by nsi id
535 //get the NSI id by e2e slice id
536 AAIResourcesClient client = new AAIResourcesClient()
537 AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
538 globalSubscriberId, subscriptionServiceType, nsiserviceid)
539 if (!client.exists(uri)) {
540 exceptionUtil.buildAndThrowWorkflowException(execution, 2500,
541 "Service Instance was not found in aai")
543 AAIResultWrapper wrapper = client.get(uri, NotFoundException.class)
544 Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
546 if (si.isPresent()) {
547 if (si.get().getServiceRole().toLowerCase() == "nsi") {
548 if (si.get().getOrchestrationStatus() == "activated") {
549 logger.info("NSI services is in activated state")
550 execution.setVariable("NSIservicestatus", "activated")
552 logger.info("NSI services is in deactivated state")
553 execution.setVariable("NSIservicestatus", "deactivated")
556 logger.info("the service id" + si.get().getServiceInstanceId() + "is " +
557 si.get().getServiceRole())
558 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
561 } catch (Exception e) {
562 msg = "Requested NSI service does not exist:" + e.getMessage()
563 logger.info("NSI service doesnt exist")
564 execution.setVariable("isContinue", "false")
565 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
568 } catch (Exception e) {
569 msg = "Requested service does not exist: " + e.getMessage()
570 logger.info("NSI Service doesnt exist")
571 execution.setVariable("isActivate", "false")
572 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
574 } catch (BpmnError e) {
576 } catch (Exception ex) {
577 msg = "Exception in org.onap.so.bpmn.common.scripts.CompleteMsoProcess.CheckAAIOrchStatus " + ex.getMessage()
579 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
582 logger.debug(Prefix + "CheckAAIOrchStatus Exit")