2 * ============LICENSE_START=======================================================
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
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 com.att.bpm.scripts;
23 import groovy.util.Node;
25 import java.util.concurrent.ExecutionException;
27 import org.camunda.bpm.engine.delegate.BpmnError
28 import org.camunda.bpm.engine.runtime.Execution
29 import org.apache.commons.lang3.*
31 import org.openecomp.mso.bpmn.core.WorkflowException
33 public class VfModule implements Serializable {
36 * Class representing a VF Module Node. Fields of this class include indicators
37 * as to whether the VF Module is the only VF Module in its containing Generic VNF
38 * and whether the VF Module is the base VF Module in its containing Generic VNF.
42 private Boolean onlyVfModule
43 private Boolean baseVfModule
48 * @param node Node representing the VF Module xml.
49 * @param onlyVfModule Is this VF Module the only VF Module in its containing Generic VNF?
51 public VfModule(Node node, boolean onlyVfModule) {
53 this.onlyVfModule = onlyVfModule
54 this.baseVfModule = getElementText('is-base-vf-module').equals('true')
58 * Get the Node representing the VF Module xml.
60 * @return the Node representing the VF Module xml.
62 public Node getNode() {
66 public String getElementText(String childNodeName) {
67 def Node childNode = (new MsoUtils()).getChildNode(node, childNodeName)
68 if (childNode == null) {
71 return childNode.text()
76 * Is this VF Module the only VF Module in its containing Generic VNF?
78 * @return true if this VF Module is the only VF Module in its containing Generic VNF;
81 public boolean isOnlyVfModule() {
86 * Is this VF Module the base VF Module in its containing Generic VNF?
88 * @return true if this VF Module is the base VF Module in its containing Generic VNF;
91 public boolean isBaseVfModule() {