diff options
383 files changed, 10254 insertions, 24296 deletions
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/Readme.txt b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/Readme.txt index aaad60320d..aaad60320d 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/Readme.txt +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/Readme.txt diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/pom.xml new file mode 100644 index 0000000000..85024edee0 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/pom.xml @@ -0,0 +1,86 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-adapter</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <artifactId>etsi-sol003-adapter-application</artifactId> + <name>ETSI SOL003 Application Jar</name> + <build> + <finalName>${project.artifactId}-${project.version}</finalName> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <mainClass>org.onap.so.adapters.etsi.sol003.adapter.VnfmAdapterApplication</mainClass> + </configuration> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <id>original</id> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <so.log.level>DEBUG</so.log.level> + </systemPropertyVariables> + <rerunFailingTestsCount>2</rerunFailingTestsCount> + <parallel>suites</parallel> + <useUnlimitedThreads>false</useUnlimitedThreads> + <threadCount>1</threadCount> + </configuration> + </plugin> + </plugins> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + <excludes> + <exclude>**/*.p12</exclude> + <exclude>**/*.jks</exclude> + </excludes> + </resource> + <resource> + <directory>src/main/resources</directory> + <filtering>false</filtering> + <includes> + <include>**/*.p12</include> + <include>**/*.jks</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-lcm-adapter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-package-management-adapter</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmAdapterApplication.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/VnfmAdapterApplication.java index 405bf896ef..6fe76db5e4 100755 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmAdapterApplication.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/VnfmAdapterApplication.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsi.sol003.adapter; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.rest.VnfmAdapterController; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.VnfmAdapterController; import org.slf4j.Logger; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmBasicHttpSecurityConfigurer.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/VnfmBasicHttpSecurityConfigurer.java index f1815054e3..cfc4ef02d7 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmBasicHttpSecurityConfigurer.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/VnfmBasicHttpSecurityConfigurer.java @@ -20,8 +20,9 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsi.sol003.adapter; +import org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants; import org.onap.so.security.HttpSecurityConfigurer; import org.onap.so.security.SoUserCredentialConfiguration; import org.springframework.beans.factory.annotation.Autowired; @@ -52,7 +53,7 @@ public class VnfmBasicHttpSecurityConfigurer implements HttpSecurityConfigurer { http.csrf().disable().authorizeRequests().anyRequest().permitAll(); } else { http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll() - .antMatchers(HttpMethod.GET, Constants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL).permitAll() + .antMatchers(HttpMethod.GET, CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL).permitAll() .antMatchers("/**") .hasAnyRole(StringUtils.collectionToDelimitedString(soUserCredentialConfiguration.getRoles(), ",")) .and().httpBasic(); diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-aaf.yaml b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/application-aaf.yaml index e69de29bb2..e69de29bb2 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-aaf.yaml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/application-aaf.yaml diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-basic.yaml b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/application-basic.yaml index e69de29bb2..e69de29bb2 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application-basic.yaml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/application-basic.yaml diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/application.yaml index 57dc08f3b5..57dc08f3b5 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/application.yaml diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/org.onap.so.trust.jks b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/org.onap.so.trust.jks Binary files differindex 1f0d8a550a..1f0d8a550a 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/org.onap.so.trust.jks +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/org.onap.so.trust.jks diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/so-vnfm-adapter.p12 b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/so-vnfm-adapter.p12 Binary files differindex ae4fddc684..ae4fddc684 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/so-vnfm-adapter.p12 +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/resources/so-vnfm-adapter.p12 diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/pom.xml new file mode 100644 index 0000000000..9c88f6a546 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/pom.xml @@ -0,0 +1,24 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-adapter</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <artifactId>etsi-sol003-adapter-common</artifactId> + <name>ETSI SOL003 Adapter Common</name> + + <dependencies> + <dependency> + <groupId>org.springframework.security.oauth</groupId> + <artifactId>spring-security-oauth2</artifactId> + <version>${spring-security-oauth2-version}</version> + </dependency> + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>common</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/Constants.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/CommonConstants.java index d798267918..dbe4dac321 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/Constants.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/CommonConstants.java @@ -18,33 +18,30 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsi.sol003.adapter.common; /** - * VNFM Adapter constants + * VNFM Adapter Common constants * - * @author Ronan Kenny (ronan.kenny@est.tech) + * @author Waqas Ikram (waqas.ikram@est.tech) * @author Gareth Roper (gareth.roper@est.tech) */ -public class Constants { +public class CommonConstants { public static final String SERVICE_NAME = "vnfm-adapter"; public static final String SERVICE_VERSION = "v1"; public static final String BASE_URL = "/so/" + SERVICE_NAME + "/" + SERVICE_VERSION; + public static final String PACKAGE_MANAGEMENT_BASE_URL = BASE_URL + "/vnfpkgm/v1"; + public static final String ETSI_CATALOG_MANAGER_BASE_ENDPOINT = "/etsicatalogmanager"; public static final String ETSI_SUBSCRIPTION_NOTIFICATION_ENDPOINT = "/notification"; public static final String ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL = BASE_URL + ETSI_CATALOG_MANAGER_BASE_ENDPOINT; public static final String ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL = ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL + ETSI_SUBSCRIPTION_NOTIFICATION_ENDPOINT; - public static final String APPLICATION_ZIP = "application/zip"; - public static final String OPERATION_NOTIFICATION_ENDPOINT = "/lcn/VnfLcmOperationOccurrenceNotification"; - /** - * Name of the subscription cache - */ - public static final String PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE = "PackageManagementSubscriptionCache"; + public static final String OPERATION_NOTIFICATION_ENDPOINT = "/lcn/VnfLcmOperationOccurrenceNotification"; - private Constants() {} + private CommonConstants() {} } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmAdapterUrlProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/VnfmAdapterUrlProvider.java index 411a57069f..855b5a454f 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmAdapterUrlProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/VnfmAdapterUrlProvider.java @@ -17,12 +17,12 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsi.sol003.adapter.common; -import static org.onap.so.adapters.vnfmadapter.Constants.BASE_URL; -import static org.onap.so.adapters.vnfmadapter.Constants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; -import static org.onap.so.adapters.vnfmadapter.Constants.OPERATION_NOTIFICATION_ENDPOINT; -import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.OPERATION_NOTIFICATION_ENDPOINT; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; import static org.slf4j.LoggerFactory.getLogger; import java.net.URI; import java.security.GeneralSecurityException; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/configuration/MessageConverterConfiguration.java index bb2730bd2b..25c37b9016 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/configuration/MessageConverterConfiguration.java @@ -17,26 +17,19 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsi.sol003.adapter.common.configuration; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import java.util.ArrayList; import java.util.Collection; -import org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003.PkgChangeNotificationConverter; -import org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003.PkgOnboardingNotificationConverter; -import org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003.VnfPkgInfoConverter; -import org.onap.so.adapters.vnfmadapter.converters.sol003.etsicatalog.PkgmSubscriptionRequestConverter; -import org.onap.so.adapters.vnfmadapter.oauth.OAuth2AccessTokenAdapter; -import org.springframework.beans.factory.annotation.Autowired; +import org.onap.so.adapters.etsi.sol003.adapter.oauth.configuration.OAuth2AccessTokenAdapter; import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.core.convert.ConversionService; -import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.security.oauth2.common.OAuth2AccessToken; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; /** * Configures message converter @@ -44,23 +37,6 @@ import org.springframework.security.oauth2.common.OAuth2AccessToken; @Configuration public class MessageConverterConfiguration { - private final VnfmAdapterUrlProvider vnfmAdapterUrlProvider; - - @Autowired - public MessageConverterConfiguration(final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { - this.vnfmAdapterUrlProvider = vnfmAdapterUrlProvider; - } - - @Bean - public ConversionService conversionService() { - final DefaultConversionService service = new DefaultConversionService(); - service.addConverter(new VnfPkgInfoConverter(vnfmAdapterUrlProvider)); - service.addConverter(new PkgmSubscriptionRequestConverter()); - service.addConverter(new PkgChangeNotificationConverter()); - service.addConverter(new PkgOnboardingNotificationConverter()); - return service; - } - @Bean public HttpMessageConverters customConverters() { final Collection<HttpMessageConverter<?>> messageConverters = new ArrayList<>(); diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/AuthorizationServerConfig.java index 7f71b2e9d6..3a3287535e 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/AuthorizationServerConfig.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.oauth; +package org.onap.so.adapters.etsi.sol003.adapter.oauth.configuration; import org.onap.so.utils.CryptoUtils; import org.springframework.beans.factory.annotation.Value; @@ -46,7 +46,7 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap @Override public void configure(final ClientDetailsServiceConfigurer clients) throws Exception { final String[] decrypedAuth = CryptoUtils.decrypt(vnfmAdapterAuth, msoEncryptionKey).split(":"); - BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + final BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); clients.inMemory().withClient(decrypedAuth[0]).secret(passwordEncoder.encode(decrypedAuth[1])) .authorizedGrantTypes("client_credentials").scopes("write").accessTokenValiditySeconds(ONE_DAY) .refreshTokenValiditySeconds(ONE_DAY); diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2AccessTokenAdapter.java index 2f51406e23..4be5b8a86a 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2AccessTokenAdapter.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.oauth; +package org.onap.so.adapters.etsi.sol003.adapter.oauth.configuration; import com.google.gson.JsonArray; import com.google.gson.JsonElement; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2ResourceServer.java index 1f0594e811..2dcfea4045 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2ResourceServer.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.oauth; +package org.onap.so.adapters.etsi.sol003.adapter.oauth.configuration; import javax.servlet.http.HttpServletRequest; -import org.onap.so.adapters.vnfmadapter.Constants; +import org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; @@ -38,7 +38,8 @@ public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter { @Override public void configure(final HttpSecurity http) throws Exception { http.requestMatcher(new OAuth2ResourceServerRequestMatcher()).authorizeRequests() - .antMatchers(Constants.BASE_URL + "/grants/**", Constants.BASE_URL + "/lcn/**").authenticated(); + .antMatchers(CommonConstants.BASE_URL + "/grants/**", CommonConstants.BASE_URL + "/lcn/**") + .authenticated(); } private static class OAuth2ResourceServerRequestMatcher implements RequestMatcher { diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/pom.xml index 66b1d2e12e..560cd87bee 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/pom.xml @@ -3,44 +3,15 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-adapter</artifactId> + <artifactId>etsi-sol003-lcm</artifactId> <version>1.6.0-SNAPSHOT</version> </parent> - <artifactId>mso-vnfm-etsi-adapter</artifactId> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - </properties> - <name>mso-vnfm-etsi-adapter</name> - <description>MSO ETSI compliant VNFM Adapter</description> + <artifactId>etsi-sol003-lcm-adapter</artifactId> + <name>ETSI SOL003 Life Cycle Management Adapter</name> <build> - <finalName>${project.artifactId}-${project.version}</finalName> <plugins> <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <configuration> - <mainClass>org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication</mainClass> - </configuration> - <executions> - <execution> - <goals> - <goal>repackage</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <executions> - <execution> - <id>original</id> - </execution> - </executions> - </plugin> - <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> </plugin> @@ -58,24 +29,6 @@ </configuration> </plugin> </plugins> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - <excludes> - <exclude>**/*.p12</exclude> - <exclude>**/*.jks</exclude> - </excludes> - </resource> - <resource> - <directory>src/main/resources</directory> - <filtering>false</filtering> - <includes> - <include>**/*.p12</include> - <include>**/*.jks</include> - </includes> - </resource> - </resources> </build> <dependencies> <dependency> @@ -108,23 +61,23 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.springframework.security.oauth</groupId> - <artifactId>spring-security-oauth2</artifactId> - <version>2.3.6.RELEASE</version> + <groupId>org.onap.so</groupId> + <artifactId>common</artifactId> + <version>${project.version}</version> </dependency> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-adapters-rest-interface</artifactId> + <artifactId>etsi-sol003-adapter-common</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-adapter-api</artifactId> + <artifactId>etsi-sol003-lcm-api</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-adapter-ext-clients</artifactId> + <artifactId>etsi-sol003-lcm-ext-clients</artifactId> <version>${project.version}</version> </dependency> <dependency> @@ -136,13 +89,8 @@ <artifactId>jersey-common</artifactId> </dependency> <dependency> - <groupId>org.glassfish.jersey.core</groupId> - <artifactId>jersey-client</artifactId> - </dependency> - <dependency> <groupId>org.glassfish.jersey.inject</groupId> <artifactId>jersey-hk2</artifactId> - <version>2.26</version> </dependency> <dependency> <groupId>org.glassfish.jersey.media</groupId> @@ -151,7 +99,11 @@ <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> - <version>1.23</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> </dependency> </dependencies> -</project> +</project>
\ No newline at end of file diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/LifeCycleManagementConstants.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/LifeCycleManagementConstants.java new file mode 100644 index 0000000000..ec82c17971 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/LifeCycleManagementConstants.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.etsi.sol003.adapter.lcm; + +/** + * ETSI SOL003 Life Cycle Management Adapter constants + * + * @author Waqas Ikram (waqas.ikram@est.tech) + */ +public class LifeCycleManagementConstants { + + public static final String OPERATION_NOTIFICATION_ENDPOINT = "/lcn/VnfLcmOperationOccurrenceNotification"; + + private LifeCycleManagementConstants() {} +} diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/NvfmAdapterUtils.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/NvfmAdapterUtils.java index db34cbf3f2..2132108ca2 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/NvfmAdapterUtils.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/NvfmAdapterUtils.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsi.sol003.adapter.lcm; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/AbstractServiceProviderConfiguration.java index 8f6d853997..84dd549d61 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/AbstractServiceProviderConfiguration.java @@ -18,15 +18,15 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients; -import com.google.gson.Gson; import java.util.Iterator; -import org.onap.vnfmadapter.v1.JSON; +import org.onap.etsi.sol003.adapter.lcm.v1.JSON; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; +import com.google.gson.Gson; /** * A base class that can be extended by classes for configuring HttpRestServiceProvider classes. Provides common methods diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/SdcPackageProvider.java index 735e1f9d42..907a15d3bc 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/SdcPackageProvider.java @@ -20,7 +20,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients; import static com.google.common.base.Splitter.on; import static com.google.common.collect.Iterables.filter; @@ -28,10 +28,10 @@ import static com.google.common.io.ByteStreams.toByteArray; import static java.lang.String.format; import static org.apache.http.HttpHeaders.ACCEPT; import static org.apache.http.HttpHeaders.AUTHORIZATION; -import static org.onap.so.adapters.vnfmadapter.NvfmAdapterUtils.abortOperation; -import static org.onap.so.adapters.vnfmadapter.NvfmAdapterUtils.child; -import static org.onap.so.adapters.vnfmadapter.NvfmAdapterUtils.childElement; -import static org.onap.so.adapters.vnfmadapter.NvfmAdapterUtils.children; +import static org.onap.so.adapters.etsi.sol003.adapter.lcm.NvfmAdapterUtils.abortOperation; +import static org.onap.so.adapters.etsi.sol003.adapter.lcm.NvfmAdapterUtils.child; +import static org.onap.so.adapters.etsi.sol003.adapter.lcm.NvfmAdapterUtils.childElement; +import static org.onap.so.adapters.etsi.sol003.adapter.lcm.NvfmAdapterUtils.children; import static org.slf4j.LoggerFactory.getLogger; import static org.springframework.http.MediaType.APPLICATION_OCTET_STREAM_VALUE; import com.google.common.io.ByteStreams; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiClientProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiClientProvider.java index 674314d9da..f12ff4c89b 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiClientProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiClientProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai; import org.onap.so.client.aai.AAIResourcesClient; import org.springframework.context.annotation.Bean; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiHelper.java index fc9efef947..806193fc5f 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiHelper.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai; import java.util.Collections; import java.util.HashMap; @@ -32,10 +32,10 @@ import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.Vserver; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.TenantNotFoundException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.etsi.sol003.adapter.lcm.v1.model.Tenant; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.TenantNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.VnfmNotFoundException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiPropertiesImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiPropertiesImpl.java index cfaad3fd04..cc1af3d215 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiPropertiesImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiPropertiesImpl.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai; import org.onap.so.client.aai.AAIProperties; import org.onap.so.client.aai.AAIVersion; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiServiceProvider.java index d19190d88e..68a8405c0a 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiServiceProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai; import org.onap.aai.domain.yang.EsrSystemInfoList; import org.onap.aai.domain.yang.EsrVnfm; @@ -26,7 +26,7 @@ import org.onap.aai.domain.yang.EsrVnfmList; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Vserver; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.etsi.sol003.adapter.lcm.v1.model.Tenant; /** * Provides methods for invoking REST calls to AAI. diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiServiceProviderImpl.java index 6dc6020834..140d0370e0 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/AaiServiceProviderImpl.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai; import org.onap.aai.domain.yang.EsrSystemInfoList; import org.onap.aai.domain.yang.EsrVnfm; @@ -26,10 +26,10 @@ import org.onap.aai.domain.yang.EsrVnfmList; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Vserver; +import org.onap.etsi.sol003.adapter.lcm.v1.model.Tenant; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.entities.uri.AAIUriFactory; import org.onap.so.client.graphinventory.entities.uri.Depth; -import org.onap.vnfmadapter.v1.model.Tenant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/OamIpAddressSource.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/OamIpAddressSource.java index 311c4de8bd..25bacce705 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/OamIpAddressSource.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/aai/OamIpAddressSource.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai; /** * Represents the source of the value to use as the AAI OAM IP address of a VNF diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/AccessInfo.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vim/model/AccessInfo.java index 9ab7618ee3..b557acd892 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/AccessInfo.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vim/model/AccessInfo.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vim.model; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vim.model; import java.util.Objects; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/InterfaceInfo.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vim/model/InterfaceInfo.java index ae28ea589c..af11e35e80 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/InterfaceInfo.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vim/model/InterfaceInfo.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vim.model; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vim.model; import java.util.Objects; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/VimCredentials.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vim/model/VimCredentials.java index 63b00b4ef2..6927d38757 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/VimCredentials.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vim/model/VimCredentials.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vim.model; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vim.model; import java.util.Objects; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHelper.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmHelper.java index fabf8839a6..e2f673b6c4 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHelper.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmHelper.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm; import java.security.GeneralSecurityException; import java.util.ArrayList; @@ -26,26 +26,26 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import org.onap.aai.domain.yang.EsrSystemInfo; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vim.model.AccessInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vim.model.InterfaceInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vim.model.VimCredentials; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201VimConnections; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthenticationParamsBasic; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsFilter; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsFilter.NotificationTypesEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsFilterVnfInstanceSubscriptionFilter; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateExtVirtualLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; +import org.onap.etsi.sol003.adapter.lcm.v1.model.Tenant; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vim.model.AccessInfo; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vim.model.InterfaceInfo; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vim.model.VimCredentials; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsAuthenticationParamsBasic; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsFilter; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsFilter.NotificationTypesEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsFilterVnfInstanceSubscriptionFilter; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateExtVirtualLinks; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.InlineResponse201VimConnections; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmServiceProvider.java index cb8c7c4e56..d4ce8c8484 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmServiceProvider.java @@ -18,17 +18,17 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm; -import com.google.common.base.Optional; import org.onap.aai.domain.yang.EsrVnfm; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.CreateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse2001; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.TerminateVnfRequest; +import com.google.common.base.Optional; /** * Provides methods for invoking REST calls to a VNFM. diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java index eaaa8d8544..231d19a6aa 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm; import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; import java.io.IOException; @@ -39,7 +39,7 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContextBuilder; import org.onap.aai.domain.yang.EsrSystemInfo; import org.onap.aai.domain.yang.EsrVnfm; -import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.AbstractServiceProviderConfiguration; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; import org.onap.so.rest.service.HttpRestServiceProviderImpl; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmServiceProviderImpl.java index d898de3ad0..6adbde2eae 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmServiceProviderImpl.java @@ -18,20 +18,19 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm; -import com.google.common.base.Optional; import org.onap.aai.domain.yang.EsrVnfm; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmRequestFailureException; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.CreateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse2001; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.TerminateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.VnfmRequestFailureException; import org.onap.so.rest.exceptions.RestProcessingException; import org.onap.so.rest.service.HttpRestServiceProvider; import org.slf4j.Logger; @@ -40,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import com.google.common.base.Optional; @Service public class VnfmServiceProviderImpl implements VnfmServiceProvider { diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmUrlProvider.java index 9c760b44b1..a88086ff00 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/extclients/vnfm/VnfmUrlProvider.java @@ -18,14 +18,14 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm; import static org.slf4j.LoggerFactory.getLogger; import java.net.URI; import org.onap.aai.domain.yang.EsrSystemInfo; import org.onap.aai.domain.yang.EsrSystemInfoList; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.VnfmNotFoundException; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/jobmanagement/JobManager.java index 3de94ebe05..84d1022424 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/jobmanagement/JobManager.java @@ -18,25 +18,25 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.jobmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.jobmanagement; import static org.slf4j.LoggerFactory.getLogger; -import com.google.common.base.Optional; -import com.google.common.collect.Maps; import java.util.Map; import java.util.UUID; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.JobNotFoundException; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStatusRetrievalStatusEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.VnfmServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.JobNotFoundException; import org.onap.so.rest.exceptions.HttpResouceNotFoundException; -import org.onap.vnfmadapter.v1.model.OperationEnum; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.OperationStatusRetrievalStatusEnum; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import com.google.common.base.Optional; +import com.google.common.collect.Maps; /** * Manages jobs enabling the status of jobs to be queried. A job is associated with an operation on a VNFM. @@ -134,11 +134,11 @@ public class JobManager { final InlineResponse200 operationResponse) { switch (vnfmOperation.getNotificationStatus()) { case NOTIFICATION_PROCESSING_PENDING: - return org.onap.vnfmadapter.v1.model.OperationStateEnum.PROCESSING; + return org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum.PROCESSING; case NOTIFICATION_PROCEESING_SUCCESSFUL: - return org.onap.vnfmadapter.v1.model.OperationStateEnum.COMPLETED; + return org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum.COMPLETED; case NOTIFICATION_PROCESSING_FAILED: - return org.onap.vnfmadapter.v1.model.OperationStateEnum.FAILED; + return org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum.FAILED; default: if (operationResponse == null || operationResponse.getOperationState() == null) return null; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/VnfmOperation.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/jobmanagement/VnfmOperation.java index 3bfe48af12..f28eeb9ebc 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/VnfmOperation.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/jobmanagement/VnfmOperation.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.jobmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.jobmanagement; /** * Represents an operation on a VNFM. diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/lifecycle/LifecycleManager.java index a885721b76..74c6571c3d 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/lifecycle/LifecycleManager.java @@ -18,36 +18,36 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.lifecycle; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.lifecycle; -import com.google.common.base.Optional; import java.util.Map; import org.onap.aai.domain.yang.EsrVnfm; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; -import org.onap.so.adapters.vnfmadapter.extclients.SdcPackageProvider; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource.OamIpAddressType; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmHelper; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest.TerminationTypeEnum; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfNotFoundException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmRequestFailureException; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.SdcPackageProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.OamIpAddressSource; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.OamIpAddressSource.OamIpAddressType; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.VnfmHelper; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.VnfmServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.TerminateVnfRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.TerminateVnfRequest.TerminationTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.VnfNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.VnfmNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.VnfmRequestFailureException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import com.google.common.base.Optional; /** * Manages lifecycle operations towards the VNFMs. @@ -155,8 +155,8 @@ public class LifecycleManager { private InlineResponse201 sendCreateRequestToVnfm(final CreateVnfRequest aaiRequest, final GenericVnf genericVnf, final String vnfIdInAai, final EsrVnfm vnfm) { logger.debug("Sending a create request to SVNFM " + aaiRequest); - final org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest vnfmRequest = - new org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest(); + final org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.CreateVnfRequest vnfmRequest = + new org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.CreateVnfRequest(); final String vnfdId = packageProvider.getVnfdId(genericVnf.getModelVersionId()); vnfmRequest.setVnfdId(vnfdId); diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/notificationhandling/NotificationHandler.java index 63ec4ccc57..43a8c352ff 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/notificationhandling/NotificationHandler.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.notificationhandling; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.notificationhandling; import static org.slf4j.LoggerFactory.getLogger; import java.util.HashMap; @@ -29,18 +29,18 @@ import org.json.JSONObject; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.Vserver; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource.OamIpAddressType; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.OamIpAddressSource; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.OamIpAddressSource.OamIpAddressType; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.VnfmServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201VimConnectionInfo; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; import org.slf4j.Logger; /** diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantController.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/Sol003GrantController.java index 21b20b0134..a9682964d8 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/Sol003GrantController.java @@ -18,22 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest; -import static org.onap.so.adapters.vnfmadapter.Constants.BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.BASE_URL; import java.util.ArrayList; import java.util.List; import java.util.UUID; import javax.ws.rs.core.MediaType; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmHelper; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201AddResources; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201VimConnections; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.etsi.sol003.adapter.lcm.v1.model.Tenant; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.VnfmHelper; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.GrantRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.GrantsAddResources; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.InlineResponse201AddResources; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.InlineResponse201VimConnections; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/Sol003LcnContoller.java index f97822a0cd..26ba1fffcf 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/Sol003LcnContoller.java @@ -18,27 +18,27 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest; -import static org.onap.so.adapters.vnfmadapter.Constants.BASE_URL; -import static org.onap.so.adapters.vnfmadapter.Constants.OPERATION_NOTIFICATION_ENDPOINT; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.lcm.LifeCycleManagementConstants.OPERATION_NOTIFICATION_ENDPOINT; import static org.slf4j.LoggerFactory.getLogger; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import javax.ws.rs.core.MediaType; import org.onap.aai.domain.yang.EsrVnfm; import org.onap.aai.domain.yang.GenericVnf; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfIdentifierCreationNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfIdentifierDeletionNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; -import org.onap.so.adapters.vnfmadapter.notificationhandling.NotificationHandler; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.VnfmServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfIdentifierCreationNotification; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfIdentifierDeletionNotification; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.notificationhandling.NotificationHandler; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterController.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/VnfmAdapterController.java index 8eccc476d2..9b571af81e 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/VnfmAdapterController.java @@ -18,16 +18,18 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest; -import io.swagger.annotations.ApiParam; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.BASE_URL; +import javax.validation.Valid; +import javax.ws.rs.core.MediaType; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; -import org.onap.so.adapters.vnfmadapter.lifecycle.LifecycleManager; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lifecycle.LifecycleManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; @@ -42,9 +44,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; -import javax.validation.Valid; -import javax.ws.rs.core.MediaType; -import static org.onap.so.adapters.vnfmadapter.Constants.BASE_URL; +import io.swagger.annotations.ApiParam; /** * Controller for handling requests to the VNFM (Virtual Network Function Manager) adapter REST API. diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/JobNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/JobNotFoundException.java index bc7c569231..a5fac29ec7 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/JobNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/JobNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/TenantNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/TenantNotFoundException.java index 215e68adcf..d120f7e81a 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/TenantNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/TenantNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions; /** * Exception for Tenant not found. diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/VnfNotFoundException.java index 9b73293020..31ea91ae72 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/VnfNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/VnfmNotFoundException.java index 4e494c14c6..d4107616c3 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/VnfmNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmRequestFailureException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/VnfmRequestFailureException.java index 9f50a2cee1..c2add907fe 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmRequestFailureException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/exceptions/VnfmRequestFailureException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions; /** * Exception indicating a request to a VNFM failed. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties new file mode 100644 index 0000000000..1d13643147 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties @@ -0,0 +1 @@ +org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiPropertiesImpl
\ No newline at end of file diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/HealthCheckTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/HealthCheckTest.java index 07c471ec87..8b3c7f3ce7 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/HealthCheckTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/HealthCheckTest.java @@ -18,11 +18,12 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest; +import static org.junit.Assert.assertEquals; +import java.net.URI; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; @@ -31,11 +32,9 @@ import org.springframework.http.RequestEntity; import org.springframework.http.ResponseEntity; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; -import java.net.URI; -import static org.junit.Assert.assertEquals; @RunWith(SpringRunner.class) -@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") public class HealthCheckTest { diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/Sol003GrantControllerTest.java index 69223d7922..d15693ddfc 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/Sol003GrantControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -42,15 +42,14 @@ import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantRequest.OperationEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsAddResources.TypeEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.GrantsLinksVnfLcmOpOcc; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model.InlineResponse201VimConnections; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.GrantRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.GrantRequest.OperationEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.GrantsAddResources; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.GrantsAddResources.TypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.GrantsLinks; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.GrantsLinksVnfLcmOpOcc; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model.InlineResponse201VimConnections; import org.onap.so.client.aai.AAIResourcesClient; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.springframework.beans.factory.annotation.Autowired; @@ -63,11 +62,10 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.web.client.RestTemplate; @RunWith(SpringRunner.class) -@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") public class Sol003GrantControllerTest { @@ -82,7 +80,6 @@ public class Sol003GrantControllerTest { @Autowired @Qualifier(CONFIGURABLE_REST_TEMPLATE) private RestTemplate testRestTemplate; - private MockRestServiceServer mockRestServer; @MockBean private AAIResourcesClient aaiResourcesClient; @@ -92,7 +89,6 @@ public class Sol003GrantControllerTest { @Before public void setUp() throws Exception { - mockRestServer = MockRestServiceServer.bindTo(testRestTemplate).build(); setUpVimInMockAai(); } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/Sol003LcnControllerTest.java index cd92d987d7..ec35099469 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/Sol003LcnControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; @@ -30,7 +30,6 @@ import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; -import com.google.gson.Gson; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; @@ -54,26 +53,24 @@ import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; import org.onap.aai.domain.yang.Vserver; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource.OamIpAddressType; -import org.onap.so.adapters.vnfmadapter.extclients.vim.model.AccessInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationComputeResource; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfIdentifierCreationNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201Links; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.OamIpAddressSource; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.aai.OamIpAddressSource.OamIpAddressType; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vim.model.AccessInfo; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201Links; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201LinksSelf; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201VimConnectionInfo; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationComputeResource; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinks; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfIdentifierCreationNotification; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; import org.onap.so.client.aai.AAIResourcesClient; -import org.onap.so.client.aai.AAIVersion; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -88,9 +85,10 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.web.client.RestTemplate; +import com.google.gson.Gson; @RunWith(SpringRunner.class) -@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") public class Sol003LcnControllerTest { diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/TestApplication.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/TestApplication.java new file mode 100755 index 0000000000..9c2453db85 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/TestApplication.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; +import org.springframework.cache.annotation.EnableCaching; + +@EnableCaching +@SpringBootApplication(scanBasePackages = {"org.onap.so"}) +@EnableAutoConfiguration(exclude = {JacksonAutoConfiguration.class}) +public class TestApplication { + + public static void main(final String[] args) { + new SpringApplication(TestApplication.class).run(args); + } + +} diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/VnfmAdapterControllerTest.java index fca50ea6f2..4280e579be 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/lcm/rest/VnfmAdapterControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.lcm.rest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -33,7 +33,6 @@ import static org.springframework.test.web.client.match.MockRestRequestMatchers. import static org.springframework.test.web.client.response.MockRestResponseCreators.withBadRequest; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; -import com.google.gson.Gson; import java.net.URI; import java.util.Optional; import org.hamcrest.BaseMatcher; @@ -52,26 +51,25 @@ import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; -import org.onap.so.adapters.vnfmadapter.extclients.SdcPackageProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201Links; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.Tenant; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.SdcPackageProvider; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse2001; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201Links; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201LinksSelf; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.JSON; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.rest.exceptions.VnfmNotFoundException; import org.onap.so.client.aai.AAIResourcesClient; import org.onap.so.client.aai.AAIVersion; import org.onap.so.client.aai.entities.uri.AAIResourceUri; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.OperationEnum; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; -import org.onap.vnfmadapter.v1.model.Tenant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; @@ -90,11 +88,11 @@ import org.springframework.web.client.RestTemplate; import org.threeten.bp.LocalDateTime; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.ZoneOffset; +import com.google.gson.Gson; @RunWith(SpringRunner.class) -@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") - public class VnfmAdapterControllerTest { private static final OffsetDateTime JAN_1_2019_12_00 = @@ -153,14 +151,14 @@ public class VnfmAdapterControllerTest { .location(new URI("http://vnfm2:8080/vnf_lcm_op_occs/123456"))); final InlineResponse200 firstOperationQueryResponse = createOperationQueryResponse( - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE, - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING); + org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE, + org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING); mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_lcm_op_occs/123456")) .andRespond(withSuccess(gson.toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON)); final InlineResponse200 secondOperationQueryReponse = createOperationQueryResponse( - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE, - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED); + org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE, + org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED); mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_lcm_op_occs/123456")) .andRespond(withSuccess(gson.toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON)); @@ -290,14 +288,14 @@ public class VnfmAdapterControllerTest { .location(new URI("http://vnfm1:8080/vnf_lcm_op_occs/1234567"))); final InlineResponse200 firstOperationQueryResponse = createOperationQueryResponse( - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE, - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING); + org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE, + org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING); mockRestServer.expect(requestTo("http://vnfm1:8080/vnf_lcm_op_occs/1234567")) .andRespond(withSuccess(gson.toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON)); final InlineResponse200 secondOperationQueryReponse = createOperationQueryResponse( - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE, - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED); + org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE, + org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED); mockRestServer.expect(requestTo("http://vnfm1:8080/vnf_lcm_op_occs/1234567")) .andRespond(withSuccess(gson.toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON)); @@ -413,8 +411,8 @@ public class VnfmAdapterControllerTest { } private InlineResponse200 createOperationQueryResponse( - final org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum operation, - final org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum operationState) { + final org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum operation, + final org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum operationState) { final InlineResponse200 response = new InlineResponse200(); response.setId("9876"); response.setOperation(operation); diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/application.yaml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/resources/application.yaml index cdb6662191..cdb6662191 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/application.yaml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/resources/application.yaml diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/pom.xml index 54f05859d9..06251a2593 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/pom.xml @@ -3,30 +3,17 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-adapter</artifactId> + <artifactId>etsi-sol003-lcm</artifactId> <version>1.6.0-SNAPSHOT</version> </parent> - <artifactId>mso-vnfm-adapter-api</artifactId> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <gson-fire-version>1.8.2</gson-fire-version> - <retrofit-version>2.3.0</retrofit-version> - <threetenbp-version>1.3.5</threetenbp-version> - <oltu-version>1.0.1</oltu-version> - <swagger-core-version>1.5.15</swagger-core-version> - <okhttp3-version>3.14.0</okhttp3-version> - <okhttp-version>2.7.5</okhttp-version> - </properties> - <name>mso-vnfm-adapter-api</name> - <description>MSO VNFM adapter API</description> - + <artifactId>etsi-sol003-lcm-api</artifactId> + <name>ETSI SOL003 Life Cycle Management Adapter API</name> <build> <plugins> <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> - <version>2.3.1</version> + <version>${version-swagger-codegen}</version> <executions> <execution> <id>vnfmadapter</id> @@ -38,8 +25,10 @@ <language>java</language> <library>retrofit2</library> <output>${project.build.directory}/generated-sources/vnfmadapter</output> - <apiPackage>org.onap.vnfmadapter.v1.api</apiPackage> - <modelPackage>org.onap.vnfmadapter.v1.model</modelPackage> + <apiPackage>org.onap.etsi.sol003.adapter.lcm.v1.api</apiPackage> + <modelPackage>org.onap.etsi.sol003.adapter.lcm.v1.model</modelPackage> + <generateApiTests>false</generateApiTests> + <generateModelTests>false</generateModelTests> <configOptions> <jackson>true</jackson> <sourceFolder>src/gen/java/main</sourceFolder> @@ -50,17 +39,19 @@ </configuration> </execution> <execution> - <id>sol003-packagemanagement-notification-api</id> + <id>sol003-vnf-lcn-api</id> <goals> <goal>generate</goal> </goals> <configuration> - <inputSpec>${basedir}/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json</inputSpec> + <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json</inputSpec> <language>java</language> <library>okhttp-gson</library> - <output>${project.build.directory}/generated-sources/sol003-vnf-packagemanagement/notification</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model</modelPackage> + <output>${project.build.directory}/generated-sources/sol003-vnf-lcn</output> + <apiPackage>org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model</modelPackage> + <generateApiTests>false</generateApiTests> + <generateModelTests>false</generateModelTests> <configOptions> <sourceFolder>src/gen/java/main</sourceFolder> <withXml>true</withXml> @@ -70,18 +61,21 @@ </configuration> </execution> <execution> - <id>etsicatalog-notification-api</id> + <id>sol003-vnf-grant-api</id> <goals> <goal>generate</goal> </goals> <configuration> - <inputSpec>${basedir}/src/main/resources/ETSI-Catalog-Notification-API.json</inputSpec> + <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json</inputSpec> <language>java</language> <library>okhttp-gson</library> - <output>${project.build.directory}/generated-sources/etsicatalog/notification</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model</modelPackage> + <output>${project.build.directory}/generated-sources/sol003-vnf-grant</output> + <apiPackage>org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsi.sol003.adapter.lcm.grant.model</modelPackage> + <generateApiTests>false</generateApiTests> + <generateModelTests>false</generateModelTests> <configOptions> + <generateSupportingFiles>false</generateSupportingFiles> <sourceFolder>src/gen/java/main</sourceFolder> <withXml>true</withXml> <useRxJava2>true</useRxJava2> @@ -103,9 +97,9 @@ </goals> <configuration> <sources> - <source>${project.basedir}/target/generated-sources/etsicatalog/notification/src/gen/java/main</source> - <source>${project.basedir}/target/generated-sources/sol003-vnf-packagemanagement/notification/src/gen/java/main</source> <source>${project.basedir}/target/generated-sources/vnfmadapter/src/gen/java/main</source> + <source>${project.basedir}/target/generated-sources/sol003-vnf-lcn/src/gen/java/main</source> + <source>${project.basedir}/target/generated-sources/sol003-vnf-grant/src/gen/java/main</source> </sources> </configuration> </execution> @@ -195,7 +189,7 @@ <dependency> <groupId>com.squareup.okio</groupId> <artifactId>okio</artifactId> - <version>1.13.0</version> + <version>${okio-version}</version> </dependency> <dependency> <groupId>com.squareup.okhttp3</groupId> @@ -222,9 +216,5 @@ <artifactId>logging-interceptor</artifactId> <version>${okhttp-version}</version> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </dependency> </dependencies> -</project> +</project>
\ No newline at end of file diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json index d3b6ebaa7e..d3b6ebaa7e 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json index aab56ee2af..aab56ee2af 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/vnfmadapter.yaml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/vnfmadapter.yaml index 9d0a5283af..9d0a5283af 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/vnfmadapter.yaml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/vnfmadapter.yaml diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/pom.xml new file mode 100644 index 0000000000..97c261971f --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/pom.xml @@ -0,0 +1,173 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-lcm</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <artifactId>etsi-sol003-lcm-ext-clients</artifactId> + <name>ETSI SOL003 Life Cycle Management Adapter Ext Clients</name> + <build> + <plugins> + <plugin> + <groupId>io.swagger</groupId> + <artifactId>swagger-codegen-maven-plugin</artifactId> + <version>${version-swagger-codegen}</version> + <executions> + <execution> + <id>sol003-vnf-lcm-api</id> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleManagement-API.json</inputSpec> + <language>java</language> + <library>okhttp-gson</library> + <output>${project.build.directory}/generated-sources/sol003-vnf-lcm</output> + <apiPackage>org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model</modelPackage> + <generateApiTests>false</generateApiTests> + <generateModelTests>false</generateModelTests> + <configOptions> + <jackson>true</jackson> + <sourceFolder>src/gen/java/main</sourceFolder> + <withXml>true</withXml> + <useRxJava2>true</useRxJava2> + <serializableModel>true</serializableModel> + </configOptions> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>${project.basedir}/target/generated-sources/sol003-vnf-lcm/src/gen/java/main</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>io.swagger</groupId> + <artifactId>swagger-codegen-maven-plugin</artifactId> + <goals> + <goal>generate</goal> + </goals> + <versionRange>[2.2.0,)</versionRange> + </pluginExecutionFilter> + <action> + <execute> + <runOnIncremental>false</runOnIncremental> + </execute> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + <dependencies> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-annotations</artifactId> + <version>${swagger-core-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>converter-gson</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>retrofit</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>converter-scalars</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>org.apache.oltu.oauth2</groupId> + <artifactId>org.apache.oltu.oauth2.client</artifactId> + <version>${oltu-version}</version> + </dependency> + <dependency> + <groupId>io.gsonfire</groupId> + <artifactId>gson-fire</artifactId> + <version>${gson-fire-version}</version> + </dependency> + <dependency> + <groupId>org.threeten</groupId> + <artifactId>threetenbp</artifactId> + <version>${threetenbp-version}</version> + </dependency> + <dependency> + <groupId>io.reactivex.rxjava2</groupId> + <artifactId>rxjava</artifactId> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>adapter-rxjava2</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + </dependency> + <dependency> + <groupId>com.squareup.okio</groupId> + <artifactId>okio</artifactId> + <version>${okio-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>okhttp</artifactId> + <version>${okhttp3-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp3-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>okhttp</artifactId> + <version>${okhttp-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp-version}</version> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleManagement-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/src/main/resources/SOL003-VNFLifecycleManagement-API.json index 2bc25a2d5b..2bc25a2d5b 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFLifecycleManagement-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/src/main/resources/SOL003-VNFLifecycleManagement-API.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/pom.xml new file mode 100644 index 0000000000..e3f87680d8 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/pom.xml @@ -0,0 +1,17 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-adapter</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <artifactId>etsi-sol003-lcm</artifactId> + <name>ETSI SOL003 Life Cycle Management</name> + <packaging>pom</packaging> + <modules> + <module>etsi-sol003-lcm-api</module> + <module>etsi-sol003-lcm-ext-clients</module> + <module>etsi-sol003-lcm-adapter</module> + </modules> +</project>
\ No newline at end of file diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/pom.xml new file mode 100644 index 0000000000..f24ad64db4 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/pom.xml @@ -0,0 +1,109 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-package-management</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <artifactId>etsi-sol003-package-management-adapter</artifactId> + <name>ETSI SOL003 VNF Package Management Adapter</name> + + <build> + <plugins> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <so.log.level>DEBUG</so.log.level> + </systemPropertyVariables> + <rerunFailingTestsCount>2</rerunFailingTestsCount> + <parallel>suites</parallel> + <useUnlimitedThreads>false</useUnlimitedThreads> + <threadCount>1</threadCount> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + <exclusions> + <exclusion> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-security</artifactId> + <exclusions> + <exclusion> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-tomcat</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>common</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-adapter-common</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-package-management-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-package-management-ext-clients</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.core</groupId> + <artifactId>jersey-client</artifactId> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.core</groupId> + <artifactId>jersey-common</artifactId> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.inject</groupId> + <artifactId>jersey-hk2</artifactId> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.media</groupId> + <artifactId>jersey-media-json-jackson</artifactId> + </dependency> + <dependency> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/ConversionServiceConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/ConversionServiceConfiguration.java new file mode 100644 index 0000000000..ecb8bbbc2e --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/ConversionServiceConfiguration.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2020 Ericsson. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement; + +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.etsicatalog.sol003.PkgChangeNotificationConverter; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.etsicatalog.sol003.PkgOnboardingNotificationConverter; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.etsicatalog.sol003.VnfPkgInfoConverter; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.sol003.etsicatalog.PkgmSubscriptionRequestConverter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.core.convert.ConversionService; +import org.springframework.core.convert.support.DefaultConversionService; + +/** + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class ConversionServiceConfiguration { + + private final VnfmAdapterUrlProvider vnfmAdapterUrlProvider; + + @Autowired + public ConversionServiceConfiguration(final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { + this.vnfmAdapterUrlProvider = vnfmAdapterUrlProvider; + } + + @Bean + public ConversionService conversionService() { + final DefaultConversionService service = new DefaultConversionService(); + service.addConverter(new VnfPkgInfoConverter(vnfmAdapterUrlProvider)); + service.addConverter(new PkgmSubscriptionRequestConverter()); + service.addConverter(new PkgChangeNotificationConverter()); + service.addConverter(new PkgOnboardingNotificationConverter()); + return service; + } + +} diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/PackageManagementConstants.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/PackageManagementConstants.java new file mode 100644 index 0000000000..9f39b092eb --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/PackageManagementConstants.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement; + +/** + * ETSI SOL003 VNF Package Management Adapter constants + * + * @author Ronan Kenny (ronan.kenny@est.tech) + * @author Gareth Roper (gareth.roper@est.tech) + */ +public class PackageManagementConstants { + + public static final String APPLICATION_ZIP = "application/zip"; + + /** + * Name of the subscription cache + */ + public static final String PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE = "PackageManagementSubscriptionCache"; + + private PackageManagementConstants() {} +} diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java index e1c43098f8..5aba579115 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.etsicatalog.sol003; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgmLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgmLinks; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage; /** * A base class that can be extended by classes for converting Etsi Catalog Manager Pkg Notification classes. Provides diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java index 8c4168632b..164f6d05b4 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.etsicatalog.sol003; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgChangeNotification; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model.VnfPackageChangeNotification; import org.slf4j.Logger; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Service; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java index 836acb6d36..aeaef94304 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.etsicatalog.sol003; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model.VnfPackageOnboardingNotification; import org.slf4j.Logger; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Service; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/VnfPkgInfoConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/etsicatalog/sol003/VnfPkgInfoConverter.java index ee941f6951..b6a955bc23 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/VnfPkgInfoConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/etsicatalog/sol003/VnfPkgInfoConverter.java @@ -18,22 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.etsicatalog.sol003; import java.util.ArrayList; import java.util.List; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Checksum; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VNFPKGMLinkSerializer; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageArtifactInfo; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPkgInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.VnfPackagesAdditionalArtifacts; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.VnfPackagesChecksum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.VnfPackagesLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.VnfPackagesLinksSelf; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.VnfPackagesSoftwareImages; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.Checksum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VNFPKGMLinkSerializer; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfPackageArtifactInfo; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfPkgInfo; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse2001; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.VnfPackagesAdditionalArtifacts; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.VnfPackagesChecksum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.VnfPackagesLinks; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.VnfPackagesLinksSelf; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.VnfPackagesSoftwareImages; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.convert.converter.Converter; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java index caefe71993..1fb5d8ad5c 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java @@ -18,22 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.sol003.etsicatalog; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.converters.sol003.etsicatalog; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Version; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfProducts; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfProductsProviders; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilter1; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilter1.NotificationTypesEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilter1.OperationalStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilter1.UsageStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilterVersions; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilterVnfProducts; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilterVnfProductsFromProviders; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.Version; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfProducts; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfProductsProviders; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilter1; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilter1.NotificationTypesEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilter1.OperationalStateEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilter1.UsageStateEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilterVersions; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilterVnfProducts; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilterVnfProductsFromProviders; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Service; @@ -46,13 +46,13 @@ import org.springframework.stereotype.Service; */ @Service public class PkgmSubscriptionRequestConverter implements - Converter<PkgmSubscriptionRequest, org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest> { + Converter<PkgmSubscriptionRequest, org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest> { @Override - public org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest convert( + public org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest convert( final PkgmSubscriptionRequest pkgmSubscriptionRequest) { - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest = - new org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest(); + final org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest = + new org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest(); etsiCatalogManagerSubscriptionRequest .setFilter(getPkgmNotificationsFilter(pkgmSubscriptionRequest.getFilter())); @@ -61,10 +61,10 @@ public class PkgmSubscriptionRequestConverter implements } - private org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter getPkgmNotificationsFilter( + private org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter getPkgmNotificationsFilter( final SubscriptionsFilter1 sol003SubscriptionsFilter) { - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter etsiCatalogManagerFilters = - new org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter(); + final org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter etsiCatalogManagerFilters = + new org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter(); if (sol003SubscriptionsFilter.getNotificationTypes() != null) { etsiCatalogManagerFilters.setNotificationTypes( @@ -87,14 +87,14 @@ public class PkgmSubscriptionRequestConverter implements } - private List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum> getUsageState( + private List<org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum> getUsageState( final List<UsageStateEnum> usageStates) { if (usageStates != null) { - final List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum> etsiCatalogUsageStates = + final List<org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum> etsiCatalogUsageStates = new ArrayList<>(); usageStates.stream().forEach(state -> { etsiCatalogUsageStates.add( - org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum + org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum .fromValue(state.getValue())); }); return etsiCatalogUsageStates; @@ -103,14 +103,14 @@ public class PkgmSubscriptionRequestConverter implements } - private List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum> getOperationalState( + private List<org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum> getOperationalState( final List<OperationalStateEnum> operationalStates) { if (operationalStates != null) { - final List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum> etsiCatalogOperationalStates = + final List<org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum> etsiCatalogOperationalStates = new ArrayList<>(); operationalStates.forEach(state -> { etsiCatalogOperationalStates.add( - org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum + org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum .fromValue(state.getValue())); }); @@ -180,14 +180,14 @@ public class PkgmSubscriptionRequestConverter implements return Collections.emptyList(); } - private List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum> getPkgmNotificationsFilterNotificationTypes( + private List<org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum> getPkgmNotificationsFilterNotificationTypes( final List<NotificationTypesEnum> notificationTypes) { if (notificationTypes != null && !notificationTypes.isEmpty()) { - final List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum> etsiCatalogNotificationTypes = + final List<org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum> etsiCatalogNotificationTypes = new ArrayList<>(); notificationTypes.forEach(type -> etsiCatalogNotificationTypes.add( - org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum + org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum .fromValue(type.getValue()))); return etsiCatalogNotificationTypes; } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/AbstractServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/AbstractServiceProviderConfiguration.java new file mode 100644 index 0000000000..5ac9fe6a0d --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/AbstractServiceProviderConfiguration.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients; + +import java.util.Iterator; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.JSON; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.GsonHttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.client.RestTemplate; +import com.google.gson.Gson; + +/** + * A base class that can be extended by classes for configuring HttpRestServiceProvider classes. Provides common methods + * that will be useful to some such classes. + * + * @author gareth.roper@est.tech + */ +public abstract class AbstractServiceProviderConfiguration { + + public void setGsonMessageConverter(final RestTemplate restTemplate) { + final Iterator<HttpMessageConverter<?>> iterator = restTemplate.getMessageConverters().iterator(); + while (iterator.hasNext()) { + if (iterator.next() instanceof MappingJackson2HttpMessageConverter) { + iterator.remove(); + } + } + final Gson gson = new JSON().getGson(); + restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson)); + } +} diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java index 95252218c8..dfa0ab73bd 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java @@ -17,10 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse2001; /** * @author Waqas Ikram (waqas.ikram@est.tech) diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogServiceProvider.java index 61db82f38c..7a99c344ef 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogServiceProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog; /** * Provides methods for invoking REST calls to the ETSI Catalog Manager. diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java index 860dfbbe9c..f99bdfe3b7 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java @@ -18,13 +18,14 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog; import java.io.IOException; import java.security.KeyManagementException; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; +import java.util.Iterator; import java.util.concurrent.TimeUnit; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; @@ -39,7 +40,7 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.ssl.SSLContextBuilder; import org.onap.logging.filter.spring.SpringClientPayloadFilter; -import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.AbstractServiceProviderConfiguration; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.configuration.rest.HttpClientConnectionConfiguration; import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter; @@ -55,7 +56,12 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; import org.springframework.http.client.BufferingClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.GsonHttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; /** * Configures the HttpRestServiceProvider to make REST calls to the ETSI Catalog Manager @@ -167,4 +173,15 @@ public class EtsiCatalogServiceProviderConfiguration extends AbstractServiceProv } + public void setGsonMessageConverter(final RestTemplate restTemplate) { + final Iterator<HttpMessageConverter<?>> iterator = restTemplate.getMessageConverters().iterator(); + while (iterator.hasNext()) { + if (iterator.next() instanceof MappingJackson2HttpMessageConverter) { + iterator.remove(); + } + } + final Gson gson = new GsonBuilder().create(); + restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson)); + } + } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java index cae413ce10..a27a22d674 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog; -import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_SERVICE_PROVIDER_BEAN; +import static org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_SERVICE_PROVIDER_BEAN; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPkgInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.EtsiCatalogManagerBadRequestException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.EtsiCatalogManagerRequestFailureException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.SubscriptionNotFoundException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgBadRequestException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgConflictException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.NsdmSubscription; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscription; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfPkgInfo; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse2001; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.EtsiCatalogManagerBadRequestException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.EtsiCatalogManagerRequestFailureException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.SubscriptionNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.VnfPkgBadRequestException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.VnfPkgConflictException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.VnfPkgNotFoundException; import org.onap.so.rest.exceptions.HttpResouceNotFoundException; import org.onap.so.rest.exceptions.InvalidRestRequestException; import org.onap.so.rest.exceptions.RestProcessingException; @@ -183,7 +183,7 @@ public class EtsiCatalogServiceProviderImpl implements EtsiCatalogServiceProvide @Override public Optional<PkgmSubscription> postSubscription( - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest) { + final org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest) { try { final ResponseEntity<PkgmSubscription> responseEntity = httpServiceProvider.postHttpRequest(etsiCatalogManagerSubscriptionRequest, diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java index ed04ad7746..74e9915819 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java @@ -17,11 +17,11 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.NsdmSubscription; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscription; /** * @author Waqas Ikram (waqas.ikram@est.tech) @@ -35,7 +35,7 @@ public interface EtsiCatalogSubscriptionServiceProvider { * @return The ETSI Catalog Manager's PkgmSubscription object. */ Optional<PkgmSubscription> postSubscription( - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest); + final org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest); /** * Get the Subscription from ETSI Catalog. diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogUrlProvider.java index 3b4c4c3066..63564600ca 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/etsicatalog/EtsiCatalogUrlProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog; import static org.slf4j.LoggerFactory.getLogger; import org.slf4j.Logger; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java index 9ed17e4379..57ed2c381a 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java @@ -17,10 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm; import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; -import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.AbstractServiceProviderConfiguration; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; import org.onap.so.rest.service.HttpRestServiceProviderImpl; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/EtsiSubscriptionNotificationController.java index a97f04bcc8..0d821fcd69 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/EtsiSubscriptionNotificationController.java @@ -18,18 +18,18 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest; -import static org.onap.so.adapters.vnfmadapter.Constants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; import static org.slf4j.LoggerFactory.getLogger; import java.util.AbstractMap; import java.util.Map.Entry; import javax.ws.rs.core.MediaType; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.NotificationManager; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.InternalServerErrorException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.NotificationTypeNotSupportedException; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgChangeNotification; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.InternalServerErrorException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.NotificationTypeNotSupportedException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement.NotificationManager; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/Sol003PackageManagementController.java index 6d067902c5..275ffa21e5 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/Sol003PackageManagementController.java @@ -18,16 +18,16 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest; -import static org.onap.so.adapters.vnfmadapter.Constants.APPLICATION_ZIP; -import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.PackageManagementConstants.APPLICATION_ZIP; import static org.slf4j.LoggerFactory.getLogger; import java.util.Optional; import javax.ws.rs.core.MediaType; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.EtsiCatalogServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse2001; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionController.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/Sol003PackageManagementSubscriptionController.java index 515e317496..73c62afac5 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/Sol003PackageManagementSubscriptionController.java @@ -18,19 +18,19 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest; -import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; import static org.slf4j.LoggerFactory.getLogger; import java.net.URI; import java.security.GeneralSecurityException; import java.util.List; import java.util.Optional; import javax.ws.rs.core.MediaType; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.SubscriptionManager; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement.SubscriptionManager; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/AuthenticationTypeNotSupportedException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/AuthenticationTypeNotSupportedException.java index 303420f1e8..b886f348fe 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/AuthenticationTypeNotSupportedException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/AuthenticationTypeNotSupportedException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/ConversionFailedException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/ConversionFailedException.java index e19a53d1dc..ebb2aeb2c3 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/ConversionFailedException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/ConversionFailedException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerBadRequestException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/EtsiCatalogManagerBadRequestException.java index dbd098f7cd..fec2045253 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerBadRequestException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/EtsiCatalogManagerBadRequestException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerRequestFailureException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/EtsiCatalogManagerRequestFailureException.java index dbdc354f4e..8c20ec1565 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerRequestFailureException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/EtsiCatalogManagerRequestFailureException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java index e8e1ce35b9..434560aa57 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.rest.EtsiSubscriptionNotificationController; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.EtsiSubscriptionNotificationController; import org.onap.so.rest.exceptions.HttpResouceNotFoundException; import org.onap.so.rest.exceptions.InvalidRestRequestException; import org.onap.so.rest.exceptions.RestProcessingException; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/InternalServerErrorException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/InternalServerErrorException.java index 9b547d3c5a..e3a7207dcb 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/InternalServerErrorException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/InternalServerErrorException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/NotificationTypeNotSupportedException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/NotificationTypeNotSupportedException.java index dcc98864aa..42b75d51b2 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/NotificationTypeNotSupportedException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/NotificationTypeNotSupportedException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java index 8091f35da6..bfcf451f13 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.rest.Sol003PackageManagementController; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.Sol003PackageManagementController; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/SubscriptionNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/SubscriptionNotFoundException.java index 58c2ef050d..65f7245b09 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/SubscriptionNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/SubscriptionNotFoundException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/VnfPkgBadRequestException.java index 211131c2a4..bbf80928cb 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/VnfPkgBadRequestException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgConflictException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/VnfPkgConflictException.java index f9aa2a0e21..a5ec31318e 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgConflictException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/VnfPkgConflictException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/VnfPkgNotFoundException.java index c15e7052ab..0d3cdd27a8 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/exceptions/VnfPkgNotFoundException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java index d6b7ae7201..666067b714 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; -import static org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmHttpServiceProviderConfiguration.VNFM_ADAPTER_HTTP_SERVICE_PROVIDER_BEAN; +import static org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.VnfmHttpServiceProviderConfiguration.VNFM_ADAPTER_HTTP_SERVICE_PROVIDER_BEAN; import java.nio.charset.StandardCharsets; import org.apache.commons.codec.binary.Base64; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java index cf0cdb085a..616493ccf3 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java @@ -17,11 +17,11 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; import org.onap.so.configuration.rest.HttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; import org.slf4j.Logger; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/NotificationManager.java index c1051d1c9d..aaf824630d 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationManager.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/NotificationManager.java @@ -18,22 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; import static org.slf4j.LoggerFactory.getLogger; import java.util.List; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.AuthenticationTypeNotSupportedException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.ConversionFailedException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.NotificationTypeNotSupportedException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.SubscriptionNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgChangeNotification; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model.VnfPackageChangeNotification; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.AuthenticationTypeNotSupportedException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.ConversionFailedException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.NotificationTypeNotSupportedException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.SubscriptionNotFoundException; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.convert.ConversionService; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/NotificationServiceProvider.java index 2be80eec75..bdba77efcb 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/NotificationServiceProvider.java @@ -17,10 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; /** * Interface which lays out requirements for a Notification Service Provider diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProviderFactory.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/NotificationServiceProviderFactory.java index ab67afed82..05795750c3 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProviderFactory.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/NotificationServiceProviderFactory.java @@ -17,14 +17,14 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; import static org.slf4j.LoggerFactory.getLogger; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.AuthenticationTypeNotSupportedException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.AuthenticationTypeNotSupportedException; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java index c065203cd8..e5bc5bdbed 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java @@ -17,12 +17,12 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.InternalServerErrorException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.InternalServerErrorException; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.configuration.rest.HttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthTokenResponse.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/OAuthTokenResponse.java index 146641cc7c..b7e288a4be 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthTokenResponse.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/OAuthTokenResponse.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; import java.io.Serializable; import javax.xml.bind.annotation.XmlElement; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/SubscriptionManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/SubscriptionManager.java index a63e14c899..adf0fda1ab 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/SubscriptionManager.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/SubscriptionManager.java @@ -18,9 +18,9 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; -import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.SubscriptionAuthentication.AuthTypeEnum.BASIC; +import static org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.SubscriptionAuthentication.AuthTypeEnum.BASIC; import static org.slf4j.LoggerFactory.getLogger; import java.net.URI; import java.security.GeneralSecurityException; @@ -30,19 +30,19 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.BasicAuth; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.VnfPackagesLinksSelf; -import org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache.PackageManagementCacheServiceProvider; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.ConversionFailedException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.InternalServerErrorException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.SubscriptionNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.EtsiCatalogServiceProvider; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.BasicAuth; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.NsdmSubscription; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscription; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsLinks; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.VnfPackagesLinksSelf; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.ConversionFailedException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.InternalServerErrorException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.SubscriptionNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement.cache.PackageManagementCacheServiceProvider; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.convert.ConversionService; @@ -76,7 +76,7 @@ public class SubscriptionManager { public Optional<InlineResponse201> createSubscription(final PkgmSubscriptionRequest pkgmSubscriptionRequest) throws GeneralSecurityException { - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest = + final org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest = buildEtsiCatalogManagerPkgmSubscriptionRequest(pkgmSubscriptionRequest); final Optional<PkgmSubscription> optionalEtsiCatalogManagerSubscription = @@ -172,13 +172,13 @@ public class SubscriptionManager { .callbackUri(subscription.getCallbackUri()); } - private org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest buildEtsiCatalogManagerPkgmSubscriptionRequest( + private org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest buildEtsiCatalogManagerPkgmSubscriptionRequest( final PkgmSubscriptionRequest pkgmSubscriptionRequest) throws GeneralSecurityException { - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest; + final org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest; try { etsiCatalogManagerSubscriptionRequest = conversionService.convert(pkgmSubscriptionRequest, - org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest.class); + org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest.class); } catch (final org.springframework.core.convert.ConversionException conversionException) { logger.error(conversionException.getMessage()); throw new ConversionFailedException( @@ -196,7 +196,7 @@ public class SubscriptionManager { final ImmutablePair<String, String> immutablePair = vnfmAdapterUrlProvider.getDecryptAuth(); if (!immutablePair.equals(ImmutablePair.nullPair())) { etsiCatalogManagerSubscriptionRequest.setAuthentication( - new org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.SubscriptionAuthentication() + new org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.SubscriptionAuthentication() .addAuthTypeItem(BASIC).paramsBasic(new BasicAuth().userName(immutablePair.getLeft()) .password(immutablePair.getRight()))); } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/TlsNotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/TlsNotificationServiceProvider.java index c9babbd345..3db2cca75a 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/TlsNotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/TlsNotificationServiceProvider.java @@ -17,16 +17,17 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.AuthenticationTypeNotSupportedException; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest.exceptions.AuthenticationTypeNotSupportedException; import org.slf4j.Logger; import org.springframework.stereotype.Service; /** + * * @author Waqas Ikram (waqas.ikram@est.tech) * @author Andrew Lamb (andrew.a.lamb@est.tech) */ diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/AbstractCacheServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/AbstractCacheServiceProvider.java index e1e9b2307e..6d92a9f688 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/AbstractCacheServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/AbstractCacheServiceProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement.cache; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheManagerConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/CacheManagerConfiguration.java index 830db39888..89b1164c1e 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheManagerConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/CacheManagerConfiguration.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement.cache; import java.util.Arrays; -import org.onap.so.adapters.vnfmadapter.Constants; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.PackageManagementConstants; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.cache.concurrent.ConcurrentMapCache; @@ -39,7 +39,7 @@ public class CacheManagerConfiguration { @Bean public CacheManager cacheManager() { final SimpleCacheManager manager = new SimpleCacheManager(); - manager.setCaches(Arrays.asList(getCache(Constants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE))); + manager.setCaches(Arrays.asList(getCache(PackageManagementConstants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE))); return manager; } diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/CacheNotFoundException.java index edd5982ab1..1c9448b50c 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/CacheNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement.cache; /** * Exception for failure to find the cache. diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProvider.java index 437d20e593..531beec83a 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProvider.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement.cache; import java.util.Map; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.PkgmSubscriptionRequest; /** * Interface which provides methods for communicating with the cache diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProviderImpl.java index ba57eb5e05..8280a4614b 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProviderImpl.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.subscriptionmanagement.cache; import java.util.Collections; import java.util.HashMap; @@ -26,8 +26,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; -import org.onap.so.adapters.vnfmadapter.Constants; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.PackageManagementConstants; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.PkgmSubscriptionRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -49,7 +49,7 @@ public class PackageManagementCacheServiceProviderImpl extends AbstractCacheServ @Autowired public PackageManagementCacheServiceProviderImpl(final CacheManager cacheManager) { - super(Constants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE, cacheManager); + super(PackageManagementConstants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE, cacheManager); } @Override diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/EtsiSubscriptionNotificationControllerTest.java index 29afa8c549..5f2f8f5c39 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/EtsiSubscriptionNotificationControllerTest.java @@ -18,14 +18,17 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.onap.so.adapters.vnfmadapter.Constants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; import static org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_CLASS; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.*; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.header; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.jsonPath; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; import java.net.URI; @@ -36,19 +39,18 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.so.adapters.vnfmadapter.Constants; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.NOTIFICATIONLINKSERIALIZER; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgmLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthenticationParamsBasic; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.NOTIFICATIONLINKSERIALIZER; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgChangeNotification; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model.PkgmLinks; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model.VnfPackageChangeNotification; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.PackageManagementConstants; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthenticationParamsBasic; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -57,7 +59,11 @@ import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; -import org.springframework.http.*; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; @@ -74,7 +80,7 @@ import com.google.gson.GsonBuilder; * */ @RunWith(SpringRunner.class) -@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") @DirtiesContext(classMode = BEFORE_CLASS) public class EtsiSubscriptionNotificationControllerTest { @@ -106,7 +112,7 @@ public class EtsiSubscriptionNotificationControllerTest { @Autowired @Qualifier(CONFIGURABLE_REST_TEMPLATE) private RestTemplate restTemplate; - private MockRestServiceServer mockRestServer; + private MockRestServiceServer mockRestServiceServer; @Autowired private TestRestTemplate testRestTemplate; @@ -117,14 +123,15 @@ public class EtsiSubscriptionNotificationControllerTest { @Before public void setUp() { - mockRestServer = MockRestServiceServer.bindTo(restTemplate).build(); + mockRestServiceServer = MockRestServiceServer.bindTo(restTemplate).build(); basicHttpHeadersProvider = new BasicHttpHeadersProvider(); - cache = cacheServiceProvider.getCache(Constants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE); + cache = cacheServiceProvider.getCache(PackageManagementConstants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE); cache.clear(); } @After public void tearDown() { + mockRestServiceServer.reset(); cache.clear(); } @@ -142,7 +149,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) .andExpect(jsonPath("$.notificationType") .value(VnfPackageOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION @@ -183,7 +190,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.BAD_REQUEST)); final ResponseEntity<?> response = sendHttpPost(notificationString); @@ -206,7 +213,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.MOVED_PERMANENTLY)); final ResponseEntity<?> response = sendHttpPost(notificationString); @@ -228,7 +235,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.NOT_FOUND)); final ResponseEntity<?> response = sendHttpPost(notificationString); @@ -251,7 +258,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); final ResponseEntity<?> response = sendHttpPost(notificationString); @@ -275,7 +282,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgChangeNotification notification = buildPkgChangeNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) .andExpect(jsonPath("$.notificationType").value( VnfPackageChangeNotification.NotificationTypeEnum.VNFPACKAGECHANGENOTIFICATION.getValue())) @@ -319,7 +326,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgChangeNotification notification = buildPkgChangeNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.BAD_REQUEST)); final ResponseEntity<?> response = sendHttpPost(notificationString); @@ -342,7 +349,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgChangeNotification notification = buildPkgChangeNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.NOT_FOUND)); final ResponseEntity<?> response = sendHttpPost(notificationString); @@ -365,7 +372,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgChangeNotification notification = buildPkgChangeNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); final ResponseEntity<?> response = sendHttpPost(notificationString); @@ -389,7 +396,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) .andExpect(jsonPath("$.notificationType") .value(VnfPackageOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION @@ -414,7 +421,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgChangeNotification notification = buildPkgChangeNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)) .andRespond(withStatus(HttpStatus.UNAUTHORIZED)); @@ -438,11 +445,11 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgChangeNotification notification = buildPkgChangeNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(TOKEN_ENDPOINT)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(TOKEN_ENDPOINT)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)) .andRespond(withSuccess(JSON_TOKEN, MediaType.APPLICATION_JSON)); - mockRestServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_OAUTH_AUTHORIZATION)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) .andExpect(jsonPath("$.notificationType").value( @@ -470,7 +477,7 @@ public class EtsiSubscriptionNotificationControllerTest { final PkgChangeNotification notification = buildPkgChangeNotification(); final String notificationString = gson.toJson(notification); - mockRestServer.expect(requestTo(TOKEN_ENDPOINT)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(TOKEN_ENDPOINT)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); final ResponseEntity<?> response = sendHttpPost(notificationString); diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/Sol003PackageManagementControllerTest.java index be8b0c2e0b..b473248da1 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/Sol003PackageManagementControllerTest.java @@ -18,14 +18,14 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL; -import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN; import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; @@ -33,19 +33,19 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat import java.util.ArrayList; import java.util.List; import java.util.Random; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Checksum; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.UriLink; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VNFPKGMLinkSerializer; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageArtifactInfo; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPkgInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.VnfPackagesLinks; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.Checksum; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.UriLink; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VNFPKGMLinkSerializer; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfPackageArtifactInfo; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfPkgInfo; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse2001; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.VnfPackagesLinks; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -67,7 +67,7 @@ import com.google.gson.Gson; * @author gareth.roper@est.tech */ @RunWith(SpringRunner.class) -@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") public class Sol003PackageManagementControllerTest { @@ -101,7 +101,7 @@ public class Sol003PackageManagementControllerTest { private static final String EXPECTED_VNFD_HREF = EXPECTED_BASE_URL + VNF_PACKAGE_ID + "/vnfd"; private static final String EXPECTED_PACKAGE_CONTENT_HREF = EXPECTED_BASE_URL + VNF_PACKAGE_ID + "/package_content"; - private MockRestServiceServer mockRestServer; + private MockRestServiceServer mockRestServiceServer; private BasicHttpHeadersProvider basicHttpHeadersProvider; private final Gson gson = new Gson(); @@ -111,15 +111,20 @@ public class Sol003PackageManagementControllerTest { public void setUp() { final MockRestServiceServer.MockRestServiceServerBuilder builder = MockRestServiceServer.bindTo(restTemplate); builder.ignoreExpectOrder(true); - mockRestServer = builder.build(); + mockRestServiceServer = builder.build(); basicHttpHeadersProvider = new BasicHttpHeadersProvider(); } + @After + public void after() { + mockRestServiceServer.reset(); + } + @Test public void testGetPackageContent_ValidArray_Success() { final byte[] responseArray = buildByteArrayWithRandomData(10); - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) .andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(responseArray, MediaType.APPLICATION_OCTET_STREAM)); @@ -136,7 +141,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageContent_Conflict_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.CONFLICT)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content"); @@ -147,7 +152,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageContent_NotFound_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.NOT_FOUND)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content"); @@ -161,7 +166,7 @@ public class Sol003PackageManagementControllerTest { final String testURL = "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/" + VNF_PACKAGE_ID + "/package_content"; - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED)); final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders()); @@ -176,7 +181,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageContent_InternalServerError_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content"); @@ -187,7 +192,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageContent_BadRequest_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.BAD_REQUEST)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content"); @@ -198,7 +203,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageContent_UnauthorizedServer_InternalError_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content"); @@ -209,7 +214,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testGetPackageContent_SuccessResponseFromServerWithNullPackage_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/package_content")) .andExpect(method(HttpMethod.GET)).andRespond(withSuccess()); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/package_content"); @@ -222,7 +227,7 @@ public class Sol003PackageManagementControllerTest { public void testGetPackageArtifact_ValidArray_Success() { final byte[] responseArray = buildByteArrayWithRandomData(10); - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) .andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(responseArray, MediaType.APPLICATION_OCTET_STREAM)); @@ -239,7 +244,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageArtifact_Conflict_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.CONFLICT)); final ResponseEntity<ProblemDetails> responseEntity = @@ -251,7 +256,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageArtifact_NotFound_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.NOT_FOUND)); final ResponseEntity<ProblemDetails> responseEntity = @@ -266,7 +271,7 @@ public class Sol003PackageManagementControllerTest { final String testURL = "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH; - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED)); final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders()); @@ -279,7 +284,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageArtifact_InternalServerError_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); final ResponseEntity<ProblemDetails> responseEntity = @@ -291,7 +296,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageArtifact_BadRequest_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.BAD_REQUEST)); final ResponseEntity<ProblemDetails> responseEntity = @@ -303,7 +308,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageArtifact_UnauthorizedServer_InternalError_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED)); final ResponseEntity<ProblemDetails> responseEntity = @@ -315,7 +320,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testGetPackageArtifact_SuccessResponseFromServerWithNullPackage_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/artifacts/" + ARTIFACT_PATH)) .andExpect(method(HttpMethod.GET)).andRespond(withSuccess()); final ResponseEntity<ProblemDetails> responseEntity = @@ -329,7 +334,7 @@ public class Sol003PackageManagementControllerTest { public void testVnfPackagesReceivedAsInlineResponse2001ListIfGetVnfPackagesSuccessful() { final VnfPkgInfo[] responses = createVnfPkgArray(); - mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(gson.toJson(responses), MediaType.APPLICATION_JSON)); final String testURL = localhostUrl + port + VNFPKGM_BASE_URL; @@ -360,7 +365,7 @@ public class Sol003PackageManagementControllerTest { @Test public void test400BadRequestInfoReceivedAsProblemDetailsIfGetVnfPackagesIs400BadRequest() { - mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) .andRespond(withStatus(HttpStatus.BAD_REQUEST)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGES_URL); @@ -373,7 +378,7 @@ public class Sol003PackageManagementControllerTest { @Test public void test404NotFoundInfoReceivedAsProblemDetailsIfGetVnfPackagesIs404NotFound() { - mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) .andRespond(withStatus(HttpStatus.NOT_FOUND)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGES_URL); @@ -386,7 +391,7 @@ public class Sol003PackageManagementControllerTest { @Test public void test500InternalServerErrorProblemDetailsReceivedIfGetVnfPackagesReturns500InternalServerError() { - mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGES_URL); @@ -399,7 +404,8 @@ public class Sol003PackageManagementControllerTest { @Test public void test500InternalServerErrorProblemDetailsReceivedIfGetVnfPackagesReturnsANullPackage() { - mockRestServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)).andRespond(withSuccess()); + mockRestServiceServer.expect(requestTo(MSB_BASE_URL)).andExpect(method(HttpMethod.GET)) + .andRespond(withSuccess()); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGES_URL); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode()); @@ -415,7 +421,7 @@ public class Sol003PackageManagementControllerTest { public void testVnfPackageReceivedAsInlineResponse2001IfGetVnfPackageByIdSuccessful() { final VnfPkgInfo response = createVnfPkgInfo(VNF_PACKAGE_ID); - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(gson.toJson(response), MediaType.APPLICATION_JSON)); final String testURL = localhostUrl + port + VNFPKGM_BASE_URL + "/" + VNF_PACKAGE_ID; @@ -445,7 +451,7 @@ public class Sol003PackageManagementControllerTest { @Test public void test400BadRequestInfoReceivedAsProblemDetailsIfGetVnfPackageByIdIs400BadRequest() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) .andRespond(withStatus(HttpStatus.BAD_REQUEST)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGE_BY_ID_URL); @@ -458,7 +464,7 @@ public class Sol003PackageManagementControllerTest { @Test public void test404NotFoundInfoReceivedAsProblemDetailsIfGetVnfPackageByIdIs404NotFound() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) .andRespond(withStatus(HttpStatus.NOT_FOUND)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGE_BY_ID_URL); @@ -471,7 +477,7 @@ public class Sol003PackageManagementControllerTest { @Test public void test500InternalServerErrorProblemDetailsReceivedIfGetVnfPackageByIdReturns500InternalServerError() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGE_BY_ID_URL); @@ -484,7 +490,7 @@ public class Sol003PackageManagementControllerTest { @Test public void test500InternalServerErrorProblemDetailsReceivedIfGetVnfPackageByIdReturnsANullPackage() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID)).andExpect(method(HttpMethod.GET)) .andRespond(withSuccess()); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(GET_VNF_PACKAGE_BY_ID_URL); @@ -503,7 +509,7 @@ public class Sol003PackageManagementControllerTest { public void testGetPackageVnfd_ValidArray_Success() { final byte[] responseArray = buildByteArrayWithRandomData(10); - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) .andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(responseArray, MediaType.APPLICATION_OCTET_STREAM)); @@ -520,7 +526,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageVnfd_Conflict_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.CONFLICT)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd"); @@ -531,7 +537,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageVnfd_NotFound_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.NOT_FOUND)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd"); @@ -542,7 +548,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageVnfd_UnauthorizedClient_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd"); @@ -553,7 +559,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageVnfd_InternalServerError_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd"); @@ -564,7 +570,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageVnfd_BadRequest_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.BAD_REQUEST)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd"); @@ -575,7 +581,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testOnGetPackageVnfd_UnauthorizedServer_InternalError_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED)); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd"); @@ -586,7 +592,7 @@ public class Sol003PackageManagementControllerTest { @Test public void testGetPackageVnfd_SuccessResponseFromServerWithNullPackage_Fail() { - mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) + mockRestServiceServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd")) .andExpect(method(HttpMethod.GET)).andRespond(withSuccess()); final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd"); diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/Sol003PackageManagementSubscriptionControllerTest.java index c269af8e68..a2a7c4510e 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/Sol003PackageManagementSubscriptionControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; @@ -27,8 +27,9 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -import static org.onap.so.adapters.vnfmadapter.Constants.PACKAGE_MANAGEMENT_BASE_URL; -import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN; import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; @@ -47,26 +48,25 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.so.adapters.vnfmadapter.Constants; -import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.BasicAuth; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.LinkSelf; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.SubscriptionAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Version; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfProducts; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfProductsProviders; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse2002; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilter1; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilterVnfProductsFromProviders; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.VnfPackagesLinksSelf; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.PackageManagementConstants; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.BasicAuth; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.LinkSelf; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.NsdmSubscription; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmNotificationsFilter; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscription; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.SubscriptionAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.Version; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfProducts; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.VnfProductsProviders; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse2002; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.InlineResponse201; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilter1; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsFilterVnfProductsFromProviders; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.SubscriptionsLinks; +import org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model.VnfPackagesLinksSelf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; @@ -91,14 +91,14 @@ import com.google.gson.Gson; * @author Gareth Roper (gareth.roper@est.tech) */ @RunWith(SpringRunner.class) -@SpringBootTest(classes = VnfmAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") public class Sol003PackageManagementSubscriptionControllerTest { private final Gson gson = new Gson(); private final URI msbEndpoint = URI.create("http://msb-iag.onap:80/api/vnfpkgm/v1/subscriptions"); private static final String _NOTIFICATION_CALLBACK_URI = - "https://so-vnfm-adapter.onap:30406" + Constants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; + "https://so-vnfm-adapter.onap:30406" + ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; private static final String LOCALHOST_URL = "http://localhost:"; @Autowired @@ -121,7 +121,8 @@ public class Sol003PackageManagementSubscriptionControllerTest { @Before public void setUp() { mockRestServiceServer = MockRestServiceServer.bindTo(restTemplate).build(); - final Cache cache = cacheServiceProvider.getCache(Constants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE); + final Cache cache = + cacheServiceProvider.getCache(PackageManagementConstants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE); cache.clear(); } @@ -280,7 +281,8 @@ public class Sol003PackageManagementSubscriptionControllerTest { (ResponseEntity<InlineResponse2002>) sol003PackageManagementSubscriptionController .postSubscriptionRequest(pkgmSubscriptionRequest); - final Cache cache = cacheServiceProvider.getCache(Constants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE); + final Cache cache = + cacheServiceProvider.getCache(PackageManagementConstants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE); assertNotNull(cache.get(ID)); final ResponseEntity responseDelete = sol003PackageManagementSubscriptionController.deleteSubscription(ID); @@ -310,9 +312,9 @@ public class Sol003PackageManagementSubscriptionControllerTest { .andRespond(withSuccess(gson.toJson(buildPkgmSubscription()), MediaType.APPLICATION_JSON)); - final ResponseEntity<InlineResponse201> responseEntity = testRestTemplate.postForEntity( - LOCALHOST_URL + port + Constants.PACKAGE_MANAGEMENT_BASE_URL + "/subscriptions", request, - InlineResponse201.class); + final ResponseEntity<InlineResponse201> responseEntity = + testRestTemplate.postForEntity(LOCALHOST_URL + port + PACKAGE_MANAGEMENT_BASE_URL + "/subscriptions", + request, InlineResponse201.class); assertEquals(HttpStatus.CREATED, responseEntity.getStatusCode()); assertTrue(responseEntity.hasBody()); @@ -322,8 +324,8 @@ public class Sol003PackageManagementSubscriptionControllerTest { } - private org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest getEtsiCatalogPkgmSubscriptionRequest() { - return new org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest() + private org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest getEtsiCatalogPkgmSubscriptionRequest() { + return new org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model.PkgmSubscriptionRequest() .filter(new PkgmNotificationsFilter() .addNotificationTypesItem( PkgmNotificationsFilter.NotificationTypesEnum.VNFPACKAGEONBOARDINGNOTIFICATION) diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/TestApplication.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/TestApplication.java new file mode 100755 index 0000000000..7e3f925a58 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/etsi/sol003/adapter/packagemanagement/rest/TestApplication.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.rest; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; +import org.springframework.cache.annotation.EnableCaching; + +@EnableCaching +@SpringBootApplication(scanBasePackages = {"org.onap.so"}) +@EnableAutoConfiguration(exclude = {JacksonAutoConfiguration.class}) +public class TestApplication { + + public static void main(final String[] args) { + new SpringApplication(TestApplication.class).run(args); + } + +} diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/application.yaml b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/application.yaml new file mode 100644 index 0000000000..cdb6662191 --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/application.yaml @@ -0,0 +1,61 @@ +# Copyright © 2019 Nordix Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +spring: + security: + usercredentials: + - username: test + password: '$2a$12$Zi3AuYcZoZO/gBQyUtST2.F5N6HqcTtaNci2Et.ufsQhski56srIu' + role: BPEL-Client + - username: vnfm + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + main: + allow-bean-definition-overriding: true + +mso: + key: 07a7159d3bf51a0e53be7a8f89699be7 + +aai: + auth: 2A11B07DB6214A839394AA1EC5844695F5114FC407FF5422625FB00175A3DCB8A1FF745F22867EFA72D5369D599BBD88DA8BED4233CF5586 + endpoint: https://aai.onap:8443 + version: v15 + +sdc: + username: sdcUser + password: sdcPassword + key: adadadadad + endpoint: http://sdc.onap/1234A + + +vnfmadapter: + endpoint: https://so-vnfm-adapter.onap:30406 + + +#Actuator +management: + endpoints: + web: + base-path: /manage + exposure: + include: "*" + metrics: + se-global-registry: false + export: + prometheus: + enabled: true # Whether exporting of metrics to Prometheus is enabled. + step: 1m # Step size (i.e. reporting frequency) to use. + +etsi-catalog-manager: + vnfpkgm: + endpoint: http://msb-iag.onap:80/api/vnfpkgm/v1 diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/requests/SubscriptionRequest.json b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/requests/SubscriptionRequest.json index c38466f8e5..c38466f8e5 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/resources/requests/SubscriptionRequest.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/requests/SubscriptionRequest.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/pom.xml new file mode 100644 index 0000000000..ba7fb65add --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/pom.xml @@ -0,0 +1,195 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-package-management</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <artifactId>etsi-sol003-package-management-api</artifactId> + <name>ETSI SOL003 VNF Package Management Adapter API</name> + <build> + <plugins> + <plugin> + <groupId>io.swagger</groupId> + <artifactId>swagger-codegen-maven-plugin</artifactId> + <version>${version-swagger-codegen}</version> + <executions> + <execution> + <id>etsicatalog-notification-api</id> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${basedir}/src/main/resources/ETSI-Catalog-Notification-API.json</inputSpec> + <language>java</language> + <library>okhttp-gson</library> + <output>${project.build.directory}/generated-sources/etsicatalog/notification</output> + <apiPackage>org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsi.sol003.adapter.etsicatalog.notification.model</modelPackage> + <generateApiTests>false</generateApiTests> + <generateModelTests>false</generateModelTests> + <configOptions> + <sourceFolder>src/gen/java/main</sourceFolder> + <withXml>true</withXml> + <useRxJava2>true</useRxJava2> + <serializableModel>true</serializableModel> + </configOptions> + </configuration> + </execution> + <execution> + <id>sol003-vnf-packagemanagement-api</id> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${basedir}/src/main/resources/SOL003-VNFPackageManagement-API.json</inputSpec> + <language>java</language> + <library>okhttp-gson</library> + <output>${project.build.directory}/generated-sources/sol003-vnf-packagemanagement</output> + <apiPackage>org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.model</modelPackage> + <generateApiTests>false</generateApiTests> + <generateModelTests>false</generateModelTests> + <configOptions> + <sourceFolder>src/gen/java/main</sourceFolder> + <withXml>true</withXml> + <useRxJava2>true</useRxJava2> + <serializableModel>true</serializableModel> + </configOptions> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>${project.basedir}/target/generated-sources/etsicatalog/notification/src/gen/java/main</source> + <source>${project.basedir}/target/generated-sources/sol003-vnf-packagemanagement/src/gen/java/main</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>io.swagger</groupId> + <artifactId>swagger-codegen-maven-plugin</artifactId> + <goals> + <goal>generate</goal> + </goals> + <versionRange>[2.2.0,)</versionRange> + </pluginExecutionFilter> + <action> + <execute> + <runOnIncremental>false</runOnIncremental> + </execute> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + <dependencies> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-annotations</artifactId> + <version>${swagger-core-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>converter-gson</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>retrofit</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>converter-scalars</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>org.apache.oltu.oauth2</groupId> + <artifactId>org.apache.oltu.oauth2.client</artifactId> + <version>${oltu-version}</version> + </dependency> + <dependency> + <groupId>io.gsonfire</groupId> + <artifactId>gson-fire</artifactId> + <version>${gson-fire-version}</version> + </dependency> + <dependency> + <groupId>org.threeten</groupId> + <artifactId>threetenbp</artifactId> + <version>${threetenbp-version}</version> + </dependency> + <dependency> + <groupId>io.reactivex.rxjava2</groupId> + <artifactId>rxjava</artifactId> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>adapter-rxjava2</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + </dependency> + <dependency> + <groupId>com.squareup.okio</groupId> + <artifactId>okio</artifactId> + <version>${okio-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>okhttp</artifactId> + <version>${okhttp3-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp3-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>okhttp</artifactId> + <version>${okhttp-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp-version}</version> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/ETSI-Catalog-Notification-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/ETSI-Catalog-Notification-API.json index 6db54435d2..6db54435d2 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/ETSI-Catalog-Notification-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/ETSI-Catalog-Notification-API.json diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFPackageManagement-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/SOL003-VNFPackageManagement-API.json index 17d81f44c1..17d81f44c1 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/SOL003-VNFPackageManagement-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/SOL003-VNFPackageManagement-API.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/pom.xml new file mode 100644 index 0000000000..5c0963f68d --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/pom.xml @@ -0,0 +1,196 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-package-management</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <artifactId>etsi-sol003-package-management-ext-clients</artifactId> + <name>ETSI SOL003 VNF Package Management Adapter Ext Clients</name> + <build> + <plugins> + <plugin> + <groupId>io.swagger</groupId> + <artifactId>swagger-codegen-maven-plugin</artifactId> + <version>${version-swagger-codegen}</version> + <executions> + <execution> + <id>etsicatalog-api</id> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${basedir}/src/main/resources/ETSI-Catalog-API.json</inputSpec> + <language>java</language> + <library>okhttp-gson</library> + <output>${project.build.directory}/generated-sources/etsicatalog</output> + <apiPackage>org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.etsicatalog.model</modelPackage> + <generateApiTests>false</generateApiTests> + <generateModelTests>false</generateModelTests> + <configOptions> + <sourceFolder>src/gen/java/main</sourceFolder> + <withXml>true</withXml> + <useRxJava2>true</useRxJava2> + <serializableModel>true</serializableModel> + </configOptions> + </configuration> + </execution> + <execution> + <id>sol003-packagemanagement-notification-api</id> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${basedir}/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json</inputSpec> + <language>java</language> + <library>okhttp-gson</library> + <output>${project.build.directory}/generated-sources/sol003-vnf-packagemanagement/notification</output> + <apiPackage>org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsi.sol003.adapter.packagemanagement.extclients.vnfm.notification.model</modelPackage> + <generateApiTests>false</generateApiTests> + <generateModelTests>false</generateModelTests> + <configOptions> + <sourceFolder>src/gen/java/main</sourceFolder> + <withXml>true</withXml> + <useRxJava2>true</useRxJava2> + <serializableModel>true</serializableModel> + </configOptions> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>${project.basedir}/target/generated-sources/sol003-vnf-packagemanagement/notification/src/gen/java/main</source> + <source>${project.basedir}/target/generated-sources/etsicatalog/src/gen/java/main</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>io.swagger</groupId> + <artifactId>swagger-codegen-maven-plugin</artifactId> + <goals> + <goal>generate</goal> + </goals> + <versionRange>[2.2.0,)</versionRange> + </pluginExecutionFilter> + <action> + <execute> + <runOnIncremental>false</runOnIncremental> + </execute> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + <dependencies> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-annotations</artifactId> + <version>${swagger-core-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>converter-gson</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>retrofit</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>converter-scalars</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>org.apache.oltu.oauth2</groupId> + <artifactId>org.apache.oltu.oauth2.client</artifactId> + <version>${oltu-version}</version> + </dependency> + <dependency> + <groupId>io.gsonfire</groupId> + <artifactId>gson-fire</artifactId> + <version>${gson-fire-version}</version> + </dependency> + <dependency> + <groupId>org.threeten</groupId> + <artifactId>threetenbp</artifactId> + <version>${threetenbp-version}</version> + </dependency> + <dependency> + <groupId>io.reactivex.rxjava2</groupId> + <artifactId>rxjava</artifactId> + </dependency> + <dependency> + <groupId>com.squareup.retrofit2</groupId> + <artifactId>adapter-rxjava2</artifactId> + <version>${retrofit-version}</version> + </dependency> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + </dependency> + <dependency> + <groupId>com.squareup.okio</groupId> + <artifactId>okio</artifactId> + <version>${okio-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>okhttp</artifactId> + <version>${okhttp3-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp3-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>okhttp</artifactId> + <version>${okhttp-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp-version}</version> + </dependency> + </dependencies> + +</project>
\ No newline at end of file diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/ETSI-Catalog-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/ETSI-Catalog-API.json index 35a8c2bd3d..35a8c2bd3d 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/src/main/resources/ETSI-Catalog-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/ETSI-Catalog-API.json diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json index 32e002f0e7..32e002f0e7 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-api/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/pom.xml new file mode 100644 index 0000000000..6983f2ffed --- /dev/null +++ b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/pom.xml @@ -0,0 +1,17 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-adapter</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <artifactId>etsi-sol003-package-management</artifactId> + <name>ETSI SOL003 VNF Package Management</name> + <packaging>pom</packaging> + <modules> + <module>etsi-sol003-package-management-api</module> + <module>etsi-sol003-package-management-ext-clients</module> + <module>etsi-sol003-package-management-adapter</module> + </modules> +</project>
\ No newline at end of file diff --git a/adapters/etsi-sol003-adapter/pom.xml b/adapters/etsi-sol003-adapter/pom.xml new file mode 100644 index 0000000000..7179fb7492 --- /dev/null +++ b/adapters/etsi-sol003-adapter/pom.xml @@ -0,0 +1,35 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.so</groupId> + <artifactId>adapters</artifactId> + <version>1.6.0-SNAPSHOT</version> + </parent> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-adapter</artifactId> + <name>ETSI SOL003 Adapter</name> + <packaging>pom</packaging> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <version-swagger-codegen>2.3.1</version-swagger-codegen> + <gson-fire-version>1.8.2</gson-fire-version> + <retrofit-version>2.3.0</retrofit-version> + <threetenbp-version>1.3.5</threetenbp-version> + <oltu-version>1.0.1</oltu-version> + <swagger-core-version>1.5.15</swagger-core-version> + <okhttp3-version>3.14.0</okhttp3-version> + <okhttp-version>2.7.5</okhttp-version> + <okio-version>1.13.0</okio-version> + <spring-security-oauth2-version>2.3.6.RELEASE</spring-security-oauth2-version> + </properties> + + <modules> + <module>etsi-sol003-adapter-common</module> + <module>etsi-sol003-package-management</module> + <module>etsi-sol003-lcm</module> + <module>etsi-sol003-adapter-application</module> + </modules> +</project>
\ No newline at end of file diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java index 698b605be3..b98811c490 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java @@ -26,11 +26,11 @@ import org.onap.so.openstack.exceptions.MsoException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; +import org.springframework.web.util.UriUtils; import com.woorea.openstack.base.client.OpenStackRequest; import com.woorea.openstack.glance.Glance; import com.woorea.openstack.glance.model.Images; - @Component public class GlanceClientImpl extends MsoCommonUtils { @@ -70,10 +70,14 @@ public class GlanceClientImpl extends MsoCommonUtils { public Images queryImages(String cloudSiteId, String tenantId, int limit, String visibility, String marker, String name) throws MsoCloudSiteNotFound, GlanceClientException { try { + String encodedName = null; + if (name != null) { + encodedName = UriUtils.encodeQueryParam(name, "UTF-8"); + } Glance glanceClient = getGlanceClient(cloudSiteId, tenantId); // list is set to false, otherwise an invalid URL is appended OpenStackRequest<Images> request = glanceClient.images().list(false).queryParam("visibility", visibility) - .queryParam("limit", limit).queryParam("marker", marker).queryParam("name", name); + .queryParam("limit", limit).queryParam("marker", marker).queryParam("name", encodedName); return executeAndRecordOpenstackRequest(request, false); } catch (MsoException e) { logger.error("Error building Glance Client", e); diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java index 62d9f068f9..c33160d255 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java @@ -184,6 +184,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin { if (CREATE_COMPLETE.equals(currentStack.getStackStatus())) { new StackInfoMapper(currentStack).map(); } else if (CREATE_IN_PROGRESS.equals(currentStack.getStackStatus())) { + // TODO should check poll for completion right here currentStack = processCreateStack(cloudSiteId, tenantId, timeoutMinutes, backout, currentStack, createStack, true); } else if (CREATE_FAILED.equals(currentStack.getStackStatus()) @@ -322,6 +323,27 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin { } } + public Stack postProcessStackUpdate(Stack updateStack) throws MsoOpenstackException { + if (!"UPDATE_COMPLETE".equals(updateStack.getStackStatus())) { + logger.error("{} Stack status: {} Stack status reason: {} {} Update Stack error", + MessageEnum.RA_UPDATE_STACK_ERR, updateStack.getStackStatus(), updateStack.getStackStatusReason(), + ErrorCode.DataError.getValue()); + + MsoOpenstackException me = null; + if ("UPDATE_IN_PROGRESS".equals(updateStack.getStackStatus())) { + me = new MsoOpenstackException(0, "", "Stack Update Timeout"); + } else { + String error = + "Stack error (" + updateStack.getStackStatus() + "): " + updateStack.getStackStatusReason(); + me = new MsoOpenstackException(0, "", error); + } + me.addContext("UpdateStack"); + throw me; + } else { + return updateStack; + } + } + public Stack pollStackForStatus(int timeoutMinutes, Stack stack, String stackStatus, String cloudSiteId, String tenantId, boolean notFoundIsSuccess) throws MsoException { int pollingFrequency = diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java index 3e28e5c45a..9a9bccfb5d 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java @@ -24,7 +24,6 @@ package org.onap.so.openstack.utils; import java.util.ArrayList; -import java.util.Calendar; import java.util.List; import java.util.Optional; import org.onap.so.cloud.CloudConfig; diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java index 8f9dbd1f5a..27ff86d7f7 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java @@ -26,6 +26,7 @@ import org.onap.so.openstack.exceptions.MsoException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; +import org.springframework.web.util.UriUtils; import com.woorea.openstack.base.client.OpenStackRequest; import com.woorea.openstack.quantum.Quantum; import com.woorea.openstack.quantum.model.Networks; @@ -73,9 +74,13 @@ public class NeutronClientImpl extends MsoCommonUtils { public Networks queryNetworks(String cloudSiteId, String tenantId, int limit, String marker, String name, String id) throws MsoCloudSiteNotFound, NeutronClientException { try { + String encodedName = null; + if (name != null) { + encodedName = UriUtils.encodeQueryParam(name, "UTF-8"); + } Quantum neutronClient = getNeutronClient(cloudSiteId, tenantId); OpenStackRequest<Networks> request = neutronClient.networks().list().queryParam("id", id) - .queryParam("limit", limit).queryParam("marker", marker).queryParam("name", name); + .queryParam("limit", limit).queryParam("marker", marker).queryParam("name", encodedName); return executeAndRecordOpenstackRequest(request, false); } catch (MsoException e) { logger.error("Error building Neutron Client", e); diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java index 4dc139f37d..5d28eaaf71 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NovaClientImpl.java @@ -20,6 +20,7 @@ package org.onap.so.openstack.utils; +import java.io.IOException; import org.onap.so.cloud.authentication.KeystoneAuthHolder; import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound; import org.onap.so.openstack.exceptions.MsoException; @@ -224,20 +225,15 @@ public class NovaClientImpl extends MsoCommonUtils { } public void postActionToServer(String cloudSiteId, String tenantId, String id, String request) - throws NovaClientException { - try { - ObjectMapper mapper = new ObjectMapper(); - JsonNode actualObj = mapper.readTree(request); - Entity<JsonNode> openstackEntity = new Entity<>(actualObj, "application/json"); - CharSequence actionPath = "/servers/" + id + "/action"; - Nova novaClient = getNovaClient(cloudSiteId, tenantId); - OpenStackRequest<Void> OSRequest = - new OpenStackRequest<>(novaClient, HttpMethod.POST, actionPath, openstackEntity, Void.class); - executeAndRecordOpenstackRequest(OSRequest, false); - } catch (Exception e) { - logger.error("Error building Nova Client", e); - throw new NovaClientException("Error building Nova Client", e); - } + throws IOException, MsoException { + ObjectMapper mapper = new ObjectMapper(); + JsonNode actualObj = mapper.readTree(request); + Entity<JsonNode> openstackEntity = new Entity<>(actualObj, "application/json"); + CharSequence actionPath = "/servers/" + id + "/action"; + Nova novaClient = getNovaClient(cloudSiteId, tenantId); + OpenStackRequest<Void> OSRequest = + new OpenStackRequest<>(novaClient, HttpMethod.POST, actionPath, openstackEntity, Void.class); + executeAndRecordOpenstackRequest(OSRequest, false); } public void attachVolume(String cloudSiteId, String tenantId, String serverId, VolumeAttachment volumeAttachment) diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java deleted file mode 100644 index a95df93a27..0000000000 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnfrest; - - -import java.util.Map; -import javax.xml.bind.annotation.XmlRootElement; -import org.onap.so.openstack.beans.VnfStatus; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@XmlRootElement(name = "queryVolumeGroupResponse") -public class QueryVolumeGroupResponse { - private static final Logger logger = LoggerFactory.getLogger(QueryVolumeGroupResponse.class); - private String volumeGroupId; - private String volumeGroupStackId; - private VnfStatus volumeGroupStatus; - private Map<String, String> volumeGroupOutputs; - - public QueryVolumeGroupResponse() {} - - public QueryVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, VnfStatus volumeGroupStatus, - Map<String, String> volumeGroupOutputs) { - super(); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupStatus = volumeGroupStatus; - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public VnfStatus getVolumeGroupStatus() { - return volumeGroupStatus; - } - - public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) { - this.volumeGroupStatus = volumeGroupStatus; - } - - public Map<String, String> getVolumeGroupOutputs() { - return volumeGroupOutputs; - } - - public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) { - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - } catch (Exception e) { - logger.debug("Exception :", e); - } - return jsonString; - } -} diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceInfo.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceInfo.java index 195ada37f7..d08c2e1444 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceInfo.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceInfo.java @@ -26,7 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.CollectionUtils; import javax.xml.bind.annotation.XmlRootElement; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java index d6e7415a77..f945208854 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java @@ -23,7 +23,6 @@ package org.onap.so.adapters.catalogdb.catalogrest; /* should be called QueryVnfResource.java */ -import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -33,7 +32,6 @@ import org.onap.so.db.catalog.beans.VnfResourceCustomization; import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.ObjectMapper; @XmlRootElement(name = "serviceVnfs") public class QueryServiceVnfs extends CatalogQuery { diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java index 98abf15645..f283af1ba6 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java @@ -27,6 +27,7 @@ package org.onap.so.adapters.catalogdb.rest; import java.util.ArrayList; import java.util.List; import javax.ws.rs.GET; +import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; @@ -46,8 +47,34 @@ import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceMacroHolder; import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceNetworks; import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceVnfs; import org.onap.so.adapters.catalogdb.catalogrest.QueryVfModule; -import org.onap.so.db.catalog.beans.*; -import org.onap.so.db.catalog.data.repository.*; +import org.onap.so.db.catalog.beans.AllottedResource; +import org.onap.so.db.catalog.beans.AllottedResourceCustomization; +import org.onap.so.db.catalog.beans.InstanceGroup; +import org.onap.so.db.catalog.beans.NetworkResource; +import org.onap.so.db.catalog.beans.NetworkResourceCustomization; +import org.onap.so.db.catalog.beans.ProcessingFlags; +import org.onap.so.db.catalog.beans.Recipe; +import org.onap.so.db.catalog.beans.Service; +import org.onap.so.db.catalog.beans.ToscaCsar; +import org.onap.so.db.catalog.beans.VfModule; +import org.onap.so.db.catalog.beans.VfModuleCustomization; +import org.onap.so.db.catalog.beans.VnfRecipe; +import org.onap.so.db.catalog.beans.VnfResource; +import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository; +import org.onap.so.db.catalog.data.repository.AllottedResourceRepository; +import org.onap.so.db.catalog.data.repository.ArRecipeRepository; +import org.onap.so.db.catalog.data.repository.InstanceGroupRepository; +import org.onap.so.db.catalog.data.repository.NetworkRecipeRepository; +import org.onap.so.db.catalog.data.repository.NetworkResourceCustomizationRepository; +import org.onap.so.db.catalog.data.repository.NetworkResourceRepository; +import org.onap.so.db.catalog.data.repository.ProcessingFlagsRepository; +import org.onap.so.db.catalog.data.repository.ServiceRepository; +import org.onap.so.db.catalog.data.repository.ToscaCsarRepository; +import org.onap.so.db.catalog.data.repository.VFModuleRepository; +import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository; +import org.onap.so.db.catalog.data.repository.VnfRecipeRepository; +import org.onap.so.db.catalog.data.repository.VnfResourceRepository; import org.onap.so.db.catalog.rest.beans.ServiceMacroHolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -102,6 +129,9 @@ public class CatalogDbAdapterRest { @Autowired private InstanceGroupRepository instanceGroupRepository; + @Autowired + private ProcessingFlagsRepository processingFlagsRepo; + private static final String NO_MATCHING_PARAMETERS = "no matching parameters"; public Response respond(String version, int respStatus, boolean isArray, CatalogQuery qryResp) { @@ -547,4 +577,82 @@ public class CatalogDbAdapterRest { .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build(); } } + + @GET + @Path("processingFlags/{flag}") + @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) + @Transactional(readOnly = true) + public Response getProcessingFlags(@PathParam("flag") String flag) { + return getProcessingFlagsImpl(flag); + } + + public Response getProcessingFlagsImpl(String flag) { + ProcessingFlags processingFlags = null; + logger.debug("Flag is: " + flag); + int respStatus = HttpStatus.SC_OK; + try { + processingFlags = processingFlagsRepo.findByFlag(flag); + if (processingFlags == null) { + logger.debug("ProcessingFlag not found"); + respStatus = HttpStatus.SC_NOT_FOUND; + + } else { + + logger.debug("ProcessingFlags processingFlags = {}", processingFlags.toString()); + } + return Response.status(respStatus).entity(processingFlags) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build(); + } catch (Exception e) { + logger.error("Exception - queryProcesssingFlags", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), + CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build(); + } + } + + @PUT + @Path("processingFlags/{flag}") + @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) + @Transactional + public Response updateProcessingFlagsValue(@PathParam("flag") String flag, ProcessingFlags updatedProcessingFlag) { + return updateProcessingFlagsValueImpl(flag, updatedProcessingFlag); + } + + public Response updateProcessingFlagsValueImpl(String flag, ProcessingFlags updatedProcessingFlag) { + ProcessingFlags processingFlags = null; + logger.debug("Flag is: " + flag); + int respStatus = HttpStatus.SC_OK; + try { + if (updatedProcessingFlag == null) { + logger.debug("No valid updatedProcessingFlag is provided"); + throw new RuntimeException("No valid updatedProcessingFlag is provided"); + } + String value = updatedProcessingFlag.getValue(); + if (value == null || (!value.equalsIgnoreCase("YES") && !value.equalsIgnoreCase("NO"))) { + logger.debug("Value " + value + " is invalid, only yes/no are allowed"); + throw new RuntimeException("Invalid value specified"); + } + processingFlags = processingFlagsRepo.findByFlag(flag); + if (processingFlags == null) { + logger.debug("ProcessingFlag not found"); + respStatus = HttpStatus.SC_NOT_FOUND; + } else { + logger.debug("ProcessingFlags processingFlags = {}", processingFlags.toString()); + processingFlags.setValue(value); + processingFlagsRepo.saveAndFlush(processingFlags); + return Response.status(respStatus).entity(null) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build(); + } + } catch (Exception e) { + logger.error("Exception - queryProcesssingFlags", e); + CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), + CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null); + return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR) + .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build(); + } + + return Response.status(HttpStatus.SC_NOT_FOUND).header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .build(); + } } diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java index 9202fd21d4..87526f7009 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java @@ -34,7 +34,6 @@ import javax.ws.rs.core.Response; import org.onap.so.db.catalog.beans.VnfResourceCustomization; import org.onap.so.db.catalog.data.repository.ServiceRepository; import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository; -import org.onap.so.rest.catalog.beans.Service; import org.onap.so.rest.catalog.beans.Vnf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql index b70d409cd8..33293afa10 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql @@ -632,7 +632,17 @@ VALUES ('VOLUME_GROUP', 'PENDING', 'DELETE', 'SILENT_SUCCESS'), ('VF_MODULE', 'PENDING', 'DELETE', 'FAIL'), -('NETWORK', 'PENDING', 'DELETE', 'FAIL'); +('NETWORK', 'PENDING', 'DELETE', 'FAIL'), + +('VNF', 'CONFIGURED', 'ACTIVATE', 'CONTINUE'), +('VNF', 'CONFIGURED', 'UNASSIGN', 'CONTINUE'), +('VNF', 'CONFIGURED', 'DESACTIVATE', 'SILENT_SUCCESS'), + +('VNF', 'CONFIGURE', 'UNASSIGN', 'CONTINUE'), +('VNF', 'CONFIGURE', 'DESACTIVATE', 'SILENT_SUCCESS'), + +('VNF', 'CONFIGASSIGNED', 'UNASSIGN', 'CONTINUE'), +('VNF', 'CONFIGASSIGNED', 'DESACTIVATE', 'SILENT_SUCCESS'); UPDATE orchestration_flow_reference SET FLOW_NAME = 'HomingBB' WHERE FLOW_NAME = 'SniroHoming'; diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.7__AddProcessingFlags.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.7__AddProcessingFlags.sql new file mode 100644 index 0000000000..2686df13a3 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.7__AddProcessingFlags.sql @@ -0,0 +1,13 @@ +use catalogdb; + +CREATE TABLE IF NOT EXISTS `processing_flags` ( + `ID` INT(11) NOT NULL AUTO_INCREMENT, + `FLAG` varchar(200) NOT NULL, + `VALUE` varchar(200) NOT NULL, + `ENDPOINT` varchar(200) NOT NULL, + `DESCRIPTION` longtext NOT NULL, + `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(), + `UPDATE_TIMESTAMP` timestamp DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`ID`), + UNIQUE KEY `UK_processing_flags` (`FLAG`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java index 69a23a0eba..04161e9df9 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java @@ -27,6 +27,7 @@ import javax.ws.rs.core.Response; import org.json.JSONException; import org.junit.Test; import org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest; +import org.onap.so.db.catalog.beans.ProcessingFlags; import org.onap.so.db.catalog.beans.ServiceRecipe; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; @@ -36,6 +37,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.util.UriComponentsBuilder; +import com.fasterxml.jackson.databind.ObjectMapper; public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { @@ -55,6 +57,8 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { private static final String ECOMP_MSO_CATALOG_V2_SERVICE_RESOURCES = "ecomp/mso/catalog/v2/serviceResources"; + private static final String ECOMP_MSO_CATALOG_PROCESSING_FLAGS = "ecomp/mso/catalog/v2/processingFlags"; + TestRestTemplate restTemplate = new TestRestTemplate("test", "test"); HttpHeaders headers = new HttpHeaders(); @@ -805,6 +809,44 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatusCode().value()); } + @Test + public void testGetProcessingFlagsByFlag() throws Exception { + HttpEntity<String> entity = new HttpEntity<String>(null, headers); + headers.set("Accept", MediaType.APPLICATION_JSON); + + UriComponentsBuilder builder = UriComponentsBuilder + .fromHttpUrl(createURLWithPort(ECOMP_MSO_CATALOG_PROCESSING_FLAGS)).pathSegment("TESTFLAG"); + + ResponseEntity<String> response = + restTemplate.exchange(builder.toUriString(), HttpMethod.GET, entity, String.class); + + assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + ObjectMapper mapper = new ObjectMapper(); + ProcessingFlags processingFlagsResponse = mapper.readValue(response.getBody(), ProcessingFlags.class); + + assertEquals(processingFlagsResponse.getFlag(), "TESTFLAG"); + assertEquals(processingFlagsResponse.getValue(), "NO"); + assertEquals(processingFlagsResponse.getEndpoint(), "TESTENDPOINT"); + assertEquals(processingFlagsResponse.getDescription(), "TEST FLAG"); + } + + @Test + public void testSetProcessingFlagsFlagValue() throws JSONException { + ProcessingFlags updatedProcessingFlag = new ProcessingFlags(); + updatedProcessingFlag.setFlag("TESTFLAG"); + updatedProcessingFlag.setValue("YES"); + HttpEntity<ProcessingFlags> entity = new HttpEntity<ProcessingFlags>(updatedProcessingFlag, headers); + headers.set("Accept", MediaType.APPLICATION_JSON); + + UriComponentsBuilder builder = UriComponentsBuilder + .fromHttpUrl(createURLWithPort(ECOMP_MSO_CATALOG_PROCESSING_FLAGS)).pathSegment("TESTFLAG"); + + ResponseEntity<String> response = + restTemplate.exchange(builder.toUriString(), HttpMethod.PUT, entity, String.class); + + assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + } + private String createURLWithPort(String uri) { return "http://localhost:" + port + uri; } diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceArtifactTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceArtifactTest.java new file mode 100644 index 0000000000..2266eafa12 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceArtifactTest.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (c) 2019, CMCC Technologies Co., Ltd. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.adapters.catalogdb.catalogrest; + +import org.assertj.core.api.Assertions; +import org.junit.Test; +import org.onap.so.db.catalog.beans.Service; +import org.onap.so.db.catalog.beans.ServiceArtifact; +import org.onap.so.jsonpath.JsonPathUtil; +import java.util.ArrayList; +import java.util.List; +import static org.mockito.Mockito.mock; + +public class QueryServiceArtifactTest { + + @Test + public void ServiceArtifactTest() { + QueryServiceArtifact queryServiceArtifact = new QueryServiceArtifact(createList()); + String jsonResult = queryServiceArtifact.JSON2(true, false); + Assertions.assertThat(JsonPathUtil.getInstance().locateResult(jsonResult, "$.serviceArtifact[0].name").get()) + .isEqualTo("eMBB.zip"); + } + + private List<ServiceArtifact> createList() { + List<ServiceArtifact> artifacts = new ArrayList<>(); + Service service = mock(Service.class); + ServiceArtifact artifact = new ServiceArtifact(); + artifact.setService(service); + artifact.setArtifactUUID("b170dbeb-2954-4a4f-ad12-6bc84b3e089e"); + artifact.setChecksum("ZWRkMGM3NzNjMmE3NzliYTFiZGNmZjVlMDE4OWEzMTA="); + artifact.setDescription("embbCn"); + artifact.setType("OTHER"); + artifact.setName("eMBB.zip"); + artifact.setVersion("1"); + artifacts.add(artifact); + return artifacts; + } +} diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index 03ef24ded0..d6f2c6dbcc 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -43,6 +43,7 @@ import org.onap.so.db.catalog.beans.InstanceGroup; import org.onap.so.db.catalog.beans.NetworkResourceCustomization; import org.onap.so.db.catalog.beans.PnfResource; import org.onap.so.db.catalog.beans.PnfResourceCustomization; +import org.onap.so.db.catalog.beans.ProcessingFlags; import org.onap.so.db.catalog.beans.ServerType; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.ServiceRecipe; @@ -771,5 +772,12 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { } + @Test + public void testGetProcessingFlagsFromFlag() { + ProcessingFlags processingFlags = client.findProcessingFlagsByFlag("TESTFLAG"); + assertNotNull(processingFlags); + assertEquals(processingFlags.getEndpoint(), "TESTENDPOINT"); + } + } diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 8fd171bf64..31a4f126e8 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -253,4 +253,8 @@ insert into workflow(artifact_uuid, artifact_name, name, operation_name, version ('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values -('ff2ae348-214a-11e7-93ae-92361f002671', '1');
\ No newline at end of file +('ff2ae348-214a-11e7-93ae-92361f002671', '1'); + +insert into processing_flags (flag,value,endpoint,description) values +('TESTFLAG', 'NO', 'TESTENDPOINT', 'TEST FLAG'); + diff --git a/adapters/mso-nssmf-adapter/src/main/resources/application.yaml b/adapters/mso-nssmf-adapter/src/main/resources/application.yaml index cb2f04d7ec..f8b28efaf8 100644 --- a/adapters/mso-nssmf-adapter/src/main/resources/application.yaml +++ b/adapters/mso-nssmf-adapter/src/main/resources/application.yaml @@ -25,11 +25,10 @@ logging: spring: datasource: + jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb + username: ${DB_USERNAME} + password: ${DB_PASSWORD} driver-class-name: org.mariadb.jdbc.Driver - jdbcUrl: jdbc:mariadb://192.168.235.44:30444/requestdb - username: root - password: secretpassword - jpa: show-sql: false hibernate: @@ -37,6 +36,14 @@ spring: ddl-auto: validate naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy enable-lazy-load-no-trans: true + security: + usercredentials: + - username: bpel + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR server: port: 8080 tomcat: @@ -46,8 +53,6 @@ mso: key: 07a7159d3bf51a0e53be7a8f89699be7 site-name: localSite logPath: ./logs/nssmf - msb-ip: msb-iag.{{ include "common.namespace" . }} - msb-port: 80 adapters: requestDb: endpoint: https://so-request-db-adapter.{{ include "common.namespace" . }}:8083 diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java index 302a6d302b..010d91fec9 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java @@ -191,13 +191,16 @@ public interface MsoNetworkAdapter { @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, @WebParam(name = "networkId") @XmlElement(required = true) String networkId, @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "networkDeleted", mode = Mode.OUT) Holder<Boolean> networkDeleted) throws NetworkException; + @WebParam(name = "networkDeleted", mode = Mode.OUT) Holder<Boolean> networkDeleted, + @WebParam(name = "pollForCompletion") @XmlElement(required = false) Boolean pollForCompletion) + throws NetworkException; /** * This is the "Rollback Network" Web Service endpoint definition. */ @WebMethod - public void rollbackNetwork(@WebParam(name = "rollback") @XmlElement(required = true) NetworkRollback rollback) + public void rollbackNetwork(@WebParam(name = "rollback") @XmlElement(required = true) NetworkRollback rollback, + @WebParam(name = "pollForCompletion") @XmlElement(required = false) Boolean pollForCompletion) throws NetworkException; @WebMethod diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsync.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsync.java deleted file mode 100644 index 5b7340e24f..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsync.java +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -import java.util.List; -import java.util.Map; -import javax.jws.Oneway; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlElement; -import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.NetworkRollback; -import org.onap.so.openstack.beans.Subnet; - -/** - * This webservice defines the Asynchronous versions of NETWORK adapter calls. The notification messages for final - * responses are documented elsewhere (by the client service WSDL). - * - */ -@WebService(name = "NetworkAdapterAsync", targetNamespace = "http://org.onap.so/networkA") -public interface MsoNetworkAdapterAsync { - /** - * This is the "Create NETWORK" Web Service Endpoint definition. - */ - @WebMethod - @Oneway - public void createNetworkA(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkType") @XmlElement(required = true) String networkType, - @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, - @WebParam(name = "networkName") @XmlElement(required = true) String networkName, - @WebParam(name = "physicalNetworkName") String physicalNetworkName, - @WebParam(name = "vlans") List<Integer> vlans, @WebParam(name = "failIfExists") Boolean failIfExists, - @WebParam(name = "backout") Boolean backout, @WebParam(name = "subnets") List<Subnet> subnets, - @WebParam(name = "networkParams") Map<String, String> networkParams, - @WebParam(name = "messageId") @XmlElement(required = true) String messageId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - - @WebMethod - @Oneway - public void updateNetworkA(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkType") @XmlElement(required = true) String networkType, - @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, - @WebParam(name = "networkId") @XmlElement(required = true) String networkId, - @WebParam(name = "networkName") @XmlElement(required = true) String networkName, - @WebParam(name = "physicalNetworkName") @XmlElement(required = true) String physicalNetworkName, - @WebParam(name = "vlans") @XmlElement(required = true) List<Integer> vlans, - @WebParam(name = "subnets") List<Subnet> subnets, - @WebParam(name = "networkParams") Map<String, String> networkParams, - @WebParam(name = "messageId") @XmlElement(required = true) String messageId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - - @WebMethod - @Oneway - public void queryNetworkA(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkNameOrId") @XmlElement(required = true) String networkNameOrId, - @WebParam(name = "messageId") @XmlElement(required = true) String messageId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - - @WebMethod - @Oneway - public void deleteNetworkA(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkType") @XmlElement(required = true) String networkType, - @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, - @WebParam(name = "networkId") @XmlElement(required = true) String networkId, - @WebParam(name = "messageId") @XmlElement(required = true) String messageId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - - @WebMethod - @Oneway - public void rollbackNetworkA(@WebParam(name = "rollback") @XmlElement(required = true) NetworkRollback rollback, - @WebParam(name = "messageId") @XmlElement(required = true) String messageId, - @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - - @WebMethod - public void healthCheckA(); -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java deleted file mode 100644 index 8d75212f4e..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java +++ /dev/null @@ -1,605 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -import java.net.MalformedURLException; -import java.net.URL; -import java.security.GeneralSecurityException; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.jws.WebService; -import javax.xml.bind.DatatypeConverter; -import javax.xml.namespace.QName; -import javax.xml.ws.BindingProvider; -import javax.xml.ws.Holder; -import javax.xml.ws.handler.MessageContext; -import org.onap.so.adapters.network.async.client.CreateNetworkNotification; -import org.onap.so.adapters.network.async.client.MsoExceptionCategory; -import org.onap.so.adapters.network.async.client.NetworkAdapterNotify; -import org.onap.so.adapters.network.async.client.NetworkAdapterNotify_Service; -import org.onap.so.adapters.network.async.client.QueryNetworkNotification; -import org.onap.so.adapters.network.async.client.UpdateNetworkNotification; -import org.onap.so.adapters.network.exceptions.NetworkException; -import org.onap.so.entity.MsoRequest; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.LoggingAnchor; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.NetworkRollback; -import org.onap.so.openstack.beans.NetworkStatus; -import org.onap.so.openstack.beans.Subnet; -import org.onap.so.utils.CryptoUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; - -@Component -@WebService(serviceName = "NetworkAdapterAsync", - endpointInterface = "org.onap.so.adapters.network.MsoNetworkAdapterAsync", - targetNamespace = "http://org.onap.so/networkA") -public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { - - private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterAsyncImpl.class); - - private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.network.bpelauth"; - private static final String ENCRYPTION_KEY_PROP = "mso.msoKey"; - private static final String NETWORK_EXCEPTION_MSG = "Got a NetworkException on createNetwork: "; - private static final String CREATE_NETWORK_ERROR_LOGMSG = "{} {} Error sending createNetwork notification {} "; - private static final String FAULT_INFO_ERROR_LOGMSG = "{} {} Exception - fault info "; - private static final String SHARED = "shared"; - private static final String EXTERNAL = "external"; - - @Autowired - private Environment environment; - - @Autowired - private MsoNetworkAdapter networkAdapter; - - /** - * Health Check web method. Does nothing but return to show the adapter is deployed. - */ - @Override - public void healthCheckA() { - logger.debug("Health check call in Network Adapter"); - } - - /** - * This is the "Create Network" web service implementation. It will create a new Network of the requested type in - * the specified cloud and tenant. The tenant must exist at the time this service is called. - * - * If a network with the same name already exists, this can be considered a success or failure, depending on the - * value of the 'failIfExists' parameter. - * - * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a - * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks, - * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs) - * - * Initially, all provider networks must be "vlan" type, and multiple segments in a multi-provider network must be - * multiple VLANs on the same physical network. - * - * This service supports two modes of Network creation/update: - via Heat Templates - via Neutron API The network - * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must - * support some subset of the same input parameters: network_name, physical_network, vlan(s). - * - * The method returns the network ID and a NetworkRollback object. This latter object can be passed as-is to the - * rollbackNetwork operation to undo everything that was created. This is useful if a network is successfully - * created but the orchestration fails on a subsequent operation. - */ - @Override - public void createNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, - String networkName, String physicalNetworkName, List<Integer> vlans, Boolean failIfExists, Boolean backout, - List<Subnet> subnets, Map<String, String> networkParams, String messageId, MsoRequest msoRequest, - String notificationUrl) { - - logger.debug("Async Create Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId); - - // Use the synchronous method to perform the actual Create - - - // Synchronous Web Service Outputs - Holder<String> networkId = new Holder<>(); - Holder<String> neutronNetworkId = new Holder<>(); - Holder<NetworkRollback> networkRollback = new Holder<>(); - Holder<Map<String, String>> subnetIdMap = new Holder<>(); - - HashMap<String, String> params = (HashMap<String, String>) networkParams; - if (params == null) - params = new HashMap<>(); - String shared = null; - String external = null; - if (params.containsKey(SHARED)) - shared = params.get(SHARED); - if (params.containsKey(EXTERNAL)) - external = params.get(EXTERNAL); - - try { - networkAdapter.createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName, - physicalNetworkName, vlans, shared, external, failIfExists, backout, subnets, params, msoRequest, - networkId, neutronNetworkId, subnetIdMap, networkRollback); - } catch (NetworkException e) { - logger.debug(NETWORK_EXCEPTION_MSG, e); - MsoExceptionCategory exCat = null; - String eMsg = null; - try { - eMsg = e.getFaultInfo().getMessage(); - exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name()); - } catch (Exception e1) { - logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(), - e1); - } - // Build and send Asynchronous error response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.createNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null); - } catch (Exception e1) { - logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, - ErrorCode.DataError.getValue(), e1.getMessage(), e1); - - } - return; - } - logger.debug("Async Create Network:Name {} physicalNetworkName:{}", networkName, physicalNetworkName); - // Build and send Asynchronous response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.createNetworkNotification(messageId, true, null, null, networkId.value, neutronNetworkId.value, - copyCreateSubnetIdMap(subnetIdMap), copyNrb(networkRollback)); - } catch (Exception e) { - logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, - ErrorCode.DataError.getValue(), e.getMessage(), e); - - } - return; - } - - /** - * This is the "Update Network" web service implementation. It will update an existing Network of the requested type - * in the specified cloud and tenant. The typical use will be to replace the VLANs with the supplied list (to add or - * remove a VLAN), but other properties may be updated as well. - * - * There will be a pre-defined set of network types defined in the MSO Catalog. All such networks will have a - * similar configuration, based on the allowable Openstack networking definitions. This includes basic networks, - * provider networks (with a single VLAN), and multi-provider networks (one or more VLANs). - * - * Initially, all provider networks must currently be "vlan" type, and multi-provider networks must be multiple - * VLANs on the same physical network. - * - * This service supports two modes of Network update: - via Heat Templates - via Neutron API The network - * orchestration mode for each network type is declared in its catalog definition. All Heat-based templates must - * support some subset of the same input parameters: network_name, physical_network, vlan, segments. - * - * The method returns a NetworkRollback object. This object can be passed as-is to the rollbackNetwork operation to - * undo everything that was updated. This is useful if a network is successfully updated but orchestration fails on - * a subsequent operation. - */ - @Override - public void updateNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, - String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, List<Subnet> subnets, - Map<String, String> networkParams, String messageId, MsoRequest msoRequest, String notificationUrl) { - - logger.debug("Async Update Network: {} of type {} in {}/{}", networkId, networkType, cloudSiteId, tenantId); - - // Use the synchronous method to perform the actual Create - - - // Synchronous Web Service Outputs - Holder<NetworkRollback> networkRollback = new Holder<>(); - Holder<Map<String, String>> subnetIdMap = new Holder<>(); - - HashMap<String, String> params = (HashMap<String, String>) networkParams; - if (params == null) - params = new HashMap<>(); - String shared = null; - String external = null; - if (params.containsKey(SHARED)) - shared = params.get(SHARED); - if (params.containsKey(EXTERNAL)) - external = params.get(EXTERNAL); - - try { - networkAdapter.updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId, - networkName, physicalNetworkName, vlans, shared, external, subnets, params, msoRequest, subnetIdMap, - networkRollback); - } catch (NetworkException e) { - logger.debug("Got a NetworkException on updateNetwork: ", e); - MsoExceptionCategory exCat = null; - String eMsg = null; - try { - eMsg = e.getFaultInfo().getMessage(); - exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name()); - } catch (Exception e1) { - logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(), - e1); - } - // Build and send Asynchronous error response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.updateNetworkNotification(messageId, false, exCat, eMsg, null, copyNrb(networkRollback)); - } catch (Exception e1) { - logger.error("{} {} Error sending updateNetwork notification {} ", - MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e1.getMessage(), e1); - - } - return; - } - logger.debug("Async Update Network:Name {} NetworkId:{}", networkName, networkId); - // Build and send Asynchronous response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.updateNetworkNotification(messageId, true, null, null, copyUpdateSubnetIdMap(subnetIdMap), - copyNrb(networkRollback)); - } catch (Exception e) { - logger.error("{} {} Error sending updateNotification request {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, - ErrorCode.DataError.getValue(), e.getMessage(), e); - } - return; - } - - /** - * This is the queryNetwork method. It returns the existence and status of the specified network, along with its - * Neutron UUID and list of VLANs. This method attempts to find the network using both Heat and Neutron. Heat stacks - * are first searched based on the provided network name/id. If none is found, the Neutron is directly queried. - */ - @Override - public void queryNetworkA(String cloudSiteId, String tenantId, String networkNameOrId, String messageId, - MsoRequest msoRequest, String notificationUrl) { - - logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId); - String errorCreateNetworkMessage = CREATE_NETWORK_ERROR_LOGMSG; - - // Use the synchronous method to perform the actual Create - - - // Synchronous Web Service Outputs - Holder<Boolean> networkExists = new Holder<>(); - Holder<String> networkId = new Holder<>(); - Holder<String> neutronNetworkId = new Holder<>(); - Holder<NetworkStatus> status = new Holder<>(); - Holder<List<Integer>> vlans = new Holder<>(); - Holder<Map<String, String>> subnetIdMap = new Holder<>(); - - try { - networkAdapter.queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId, - neutronNetworkId, status, vlans, subnetIdMap); - } catch (NetworkException e) { - logger.debug(NETWORK_EXCEPTION_MSG, e); - MsoExceptionCategory exCat = null; - String eMsg = null; - try { - eMsg = e.getFaultInfo().getMessage(); - exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name()); - } catch (Exception e1) { - logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(), - e1); - } - // Build and send Asynchronous error response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.queryNetworkNotification(messageId, false, exCat, eMsg, null, null, null, null, null, null); - } catch (Exception e1) { - logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, - ErrorCode.DataError.getValue(), e1.getMessage(), e1); - } - return; - } - logger.debug("Async Query Network:NameOrId {} tenantId:{}", networkNameOrId, tenantId); - // Build and send Asynchronous response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - org.onap.so.adapters.network.async.client.NetworkStatus networkS = - org.onap.so.adapters.network.async.client.NetworkStatus.fromValue(status.value.name()); - notifyPort.queryNetworkNotification(messageId, true, null, null, networkExists.value, networkId.value, - neutronNetworkId.value, networkS, vlans.value, copyQuerySubnetIdMap(subnetIdMap)); - } catch (Exception e) { - logger.error(errorCreateNetworkMessage, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, - ErrorCode.DataError.getValue(), e.getMessage(), e); - } - return; - } - - /** - * This is the "Delete Network" web service implementation. It will delete a Network in the specified cloud and - * tenant. - * - * If the network is not found, it is treated as a success. - * - * This service supports two modes of Network creation/update/delete: - via Heat Templates - via Neutron API The - * network orchestration mode for each network type is declared in its catalog definition. - * - * For Heat-based orchestration, the networkId should be the stack ID. For Neutron-based orchestration, the - * networkId should be the Neutron network UUID. - * - * The method returns nothing on success. Rollback is not possible for delete commands, so any failure on delete - * will require manual fallout in the client. - */ - @Override - public void deleteNetworkA(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, - String networkId, String messageId, MsoRequest msoRequest, String notificationUrl) { - - String serviceName = "DeleteNetworkA"; - logger.debug("Async Delete Network {} in {}/{}", networkId, cloudSiteId, tenantId); - - // Use the synchronous method to perform the actual Create - - - // Synchronous Web Service Outputs - Holder<Boolean> networkDeleted = new Holder<>(); - - try { - networkAdapter.deleteNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId, - msoRequest, networkDeleted); - } catch (NetworkException e) { - logger.debug(NETWORK_EXCEPTION_MSG, e); - MsoExceptionCategory exCat = null; - String eMsg = null; - try { - eMsg = e.getFaultInfo().getMessage(); - exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name()); - } catch (Exception e1) { - logger.error(FAULT_INFO_ERROR_LOGMSG, MessageEnum.RA_FAULT_INFO_EXC, ErrorCode.DataError.getValue(), - e1); - } - // Build and send Asynchronous error response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.deleteNetworkNotification(messageId, false, exCat, eMsg, null); - } catch (Exception e1) { - logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, - ErrorCode.DataError.getValue(), e1.getMessage(), e1); - - } - return; - } - logger.debug("Async Delete NetworkId: {} tenantId:{}", networkId, tenantId); - // Build and send Asynchronous response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.deleteNetworkNotification(messageId, true, null, null, networkDeleted.value); - } catch (Exception e) { - logger.error("{} {} Error sending deleteNetwork notification {} ", MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, - ErrorCode.DataError.getValue(), e.getMessage(), e); - - } - return; - } - - /** - * This web service endpoint will rollback a previous Create VNF operation. A rollback object is returned to the - * client in a successful creation response. The client can pass that object as-is back to the rollbackNetwork - * operation to undo the creation. - * - * The rollback includes removing the VNF and deleting the tenant if the tenant did not exist prior to the VNF - * creation. - */ - @Override - public void rollbackNetworkA(NetworkRollback rollback, String messageId, String notificationUrl) { - // rollback may be null (e.g. if network already existed when Create was called) - if (rollback == null) { - logger.warn("{} {} Rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.SchemaError.getValue()); - return; - } - - logger.info(LoggingAnchor.TWO, MessageEnum.RA_ASYNC_ROLLBACK, rollback.getNetworkStackId()); - // Use the synchronous method to perform the actual Create - - - try { - networkAdapter.rollbackNetwork(rollback); - } catch (NetworkException e) { - logger.debug("Got a NetworkException on rollbackNetwork: ", e); - // Build and send Asynchronous error response - MsoExceptionCategory exCat = null; - String eMsg = null; - try { - eMsg = e.getFaultInfo().getMessage(); - exCat = MsoExceptionCategory.fromValue(e.getFaultInfo().getCategory().name()); - } catch (Exception e1) { - logger.error("{} {} Exception in get fault info ", MessageEnum.RA_FAULT_INFO_EXC, - ErrorCode.DataError.getValue(), e1); - } - // Build and send Asynchronous error response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), false, exCat, eMsg); - } catch (Exception e1) { - logger.error(CREATE_NETWORK_ERROR_LOGMSG, MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, - ErrorCode.DataError.getValue(), e1.getMessage(), e1); - - } - return; - } - logger.debug("Async Rollback NetworkId: {} tenantId:{}", rollback.getNetworkStackId(), rollback.getTenantId()); - // Build and send Asynchronous response - try { - NetworkAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.rollbackNetworkNotification(rollback.getMsoRequest().getRequestId(), true, null, null); - } catch (Exception e) { - logger.error("{} {} Error sending rollbackNetwork notification {} ", - MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e); - - } - return; - } - - private org.onap.so.adapters.network.async.client.NetworkRollback copyNrb(Holder<NetworkRollback> hNrb) { - org.onap.so.adapters.network.async.client.NetworkRollback cnrb = - new org.onap.so.adapters.network.async.client.NetworkRollback(); - - if (hNrb != null && hNrb.value != null) { - org.onap.so.adapters.network.async.client.MsoRequest cmr = - new org.onap.so.adapters.network.async.client.MsoRequest(); - - cnrb.setCloudId(hNrb.value.getCloudId()); - cmr.setRequestId(hNrb.value.getMsoRequest().getRequestId()); - cmr.setServiceInstanceId(hNrb.value.getMsoRequest().getServiceInstanceId()); - cnrb.setMsoRequest(cmr); - cnrb.setNetworkId(hNrb.value.getNetworkId()); - cnrb.setNetworkStackId(hNrb.value.getNetworkStackId()); - cnrb.setNeutronNetworkId(hNrb.value.getNeutronNetworkId()); - cnrb.setTenantId(hNrb.value.getTenantId()); - cnrb.setNetworkType(hNrb.value.getNetworkType()); - cnrb.setNetworkCreated(hNrb.value.getNetworkCreated()); - cnrb.setNetworkName(hNrb.value.getNetworkName()); - cnrb.setPhysicalNetwork(hNrb.value.getPhysicalNetwork()); - List<Integer> vlansc = cnrb.getVlans(); - List<Integer> vlansh = hNrb.value.getVlans(); - if (vlansh != null) { - vlansc.addAll(vlansh); - } - } - return cnrb; - } - - private NetworkAdapterNotify getNotifyEP(String notificationUrl) { - - URL warWsdlLoc = null; - try { - warWsdlLoc = Thread.currentThread().getContextClassLoader().getResource("NetworkAdapterNotify.wsdl"); - } catch (Exception e) { - logger.error("{} {} Exception - WSDL not found ", MessageEnum.RA_WSDL_NOT_FOUND, - ErrorCode.DataError.getValue(), e); - } - if (warWsdlLoc == null) { - logger.error("{} {} WSDL not found", MessageEnum.RA_WSDL_NOT_FOUND, ErrorCode.DataError.getValue()); - } else { - try { - logger.debug("NetworkAdpaterNotify.wsdl location: {}", warWsdlLoc.toURI().toString()); - } catch (Exception e) { - logger.error("{} {} Exception - WSDL URL convention ", MessageEnum.RA_WSDL_URL_CONVENTION_EXC, - ErrorCode.SchemaError.getValue(), e); - } - } - - NetworkAdapterNotify_Service notifySvc = new NetworkAdapterNotify_Service(warWsdlLoc, - new QName("http://org.onap.so/networkNotify", "networkAdapterNotify")); - - NetworkAdapterNotify notifyPort = notifySvc.getMsoNetworkAdapterAsyncImplPort(); - - BindingProvider bp = (BindingProvider) notifyPort; - - URL epUrl = null; - try { - epUrl = new URL(notificationUrl); - } catch (MalformedURLException e1) { - logger.error("{} {} Exception - init notification ", MessageEnum.RA_INIT_NOTIF_EXC, - ErrorCode.DataError.getValue(), e1); - } - - if (null != epUrl) { - logger.debug("Notification Endpoint URL: {}", epUrl.toExternalForm()); - bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm()); - } else { - logger.debug("Notification Endpoint URL is NULL: "); - } - - // authentication - try { - Map<String, Object> reqCtx = bp.getRequestContext(); - Map<String, List<String>> headers = new HashMap<>(); - - String userCredentials = this.getEncryptedProperty(BPEL_AUTH_PROP, "", ENCRYPTION_KEY_PROP); - - String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes()); - reqCtx.put(MessageContext.HTTP_REQUEST_HEADERS, headers); - headers.put("Authorization", Collections.singletonList(basicAuth)); - } catch (Exception e) { - logger.error("{} {} Unable to set authorization in callback request {} ", - MessageEnum.RA_SET_CALLBACK_AUTH_EXC, ErrorCode.DataError.getValue(), e.getMessage(), e); - } - - return notifyPort; - } - - public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) { - try { - return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey)); - } catch (GeneralSecurityException e) { - logger.debug("Exception while decrypting property: {} ", this.environment.getProperty(key), e); - } - return defaultValue; - - } - - private CreateNetworkNotification.SubnetIdMap copyCreateSubnetIdMap(Holder<Map<String, String>> hMap) { - - CreateNetworkNotification.SubnetIdMap subnetIdMap = new CreateNetworkNotification.SubnetIdMap(); - - if (hMap != null && hMap.value != null) { - Map<String, String> sMap = hMap.value; - CreateNetworkNotification.SubnetIdMap.Entry entry = new CreateNetworkNotification.SubnetIdMap.Entry(); - - for (Map.Entry<String, String> mapEntry : sMap.entrySet()) { - String key = mapEntry.getKey(); - String value = mapEntry.getValue(); - entry.setKey(key); - entry.setValue(value); - subnetIdMap.getEntry().add(entry); - } - } - return subnetIdMap; - } - - private UpdateNetworkNotification.SubnetIdMap copyUpdateSubnetIdMap(Holder<Map<String, String>> hMap) { - - UpdateNetworkNotification.SubnetIdMap subnetIdMap = new UpdateNetworkNotification.SubnetIdMap(); - - if (hMap != null && hMap.value != null) { - Map<String, String> sMap = hMap.value; - UpdateNetworkNotification.SubnetIdMap.Entry entry = new UpdateNetworkNotification.SubnetIdMap.Entry(); - - for (Map.Entry<String, String> mapEntry : sMap.entrySet()) { - String key = mapEntry.getKey(); - String value = mapEntry.getValue(); - entry.setKey(key); - entry.setValue(value); - subnetIdMap.getEntry().add(entry); - } - } - return subnetIdMap; - } - - private QueryNetworkNotification.SubnetIdMap copyQuerySubnetIdMap(Holder<Map<String, String>> hMap) { - - QueryNetworkNotification.SubnetIdMap subnetIdMap = new QueryNetworkNotification.SubnetIdMap(); - - if (hMap != null && hMap.value != null) { - Map<String, String> sMap = hMap.value; - QueryNetworkNotification.SubnetIdMap.Entry entry = new QueryNetworkNotification.SubnetIdMap.Entry(); - - for (Map.Entry<String, String> mapEntry : sMap.entrySet()) { - String key = mapEntry.getKey(); - String value = mapEntry.getValue(); - entry.setKey(key); - entry.setValue(value); - subnetIdMap.getEntry().add(entry); - } - } - return subnetIdMap; - } -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java index 4728effdca..489585c04b 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java @@ -81,8 +81,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; targetNamespace = "http://org.onap.so/network") public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { - private static final String AIC3_NW_PROPERTY = "org.onap.so.adapters.network.aic3nw"; - private static final String AIC3_NW = "OS::ContrailV2::VirtualNetwork"; + private static final String OS3_NW_PROPERTY = "org.onap.so.adapters.network.aic3nw"; + private static final String OS3_NW = "OS::ContrailV2::VirtualNetwork"; private static final String VLANS = "vlans"; private static final String PHYSICAL_NETWORK = "physical_network"; private static final String UPDATE_NETWORK_CONTEXT = "UpdateNetwork"; @@ -140,6 +140,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { * @see MsoNetworkAdapterImpl#MsoNetworkAdapterImpl(MsoPropertiesFactory) */ + @Deprecated @Override public void createNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, String networkName, String physicalNetworkName, List<Integer> vlans, String shared, String external, @@ -149,9 +150,10 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { Holder<String> networkFqdn = new Holder<>(); createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName, physicalNetworkName, vlans, null, shared, external, failIfExists, backout, subnets, null, null, msoRequest, networkId, - neutronNetworkId, networkFqdn, subnetIdMap, rollback); + neutronNetworkId, networkFqdn, subnetIdMap, rollback, true); } + @Deprecated @Override public void createNetworkContrail(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, String networkName, List<RouteTarget> routeTargets, String shared, @@ -162,7 +164,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throws NetworkException { createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName, null, null, routeTargets, shared, external, failIfExists, backout, subnets, policyFqdns, routeTableFqdns, msoRequest, networkId, - neutronNetworkId, networkFqdn, subnetIdMap, rollback); + neutronNetworkId, networkFqdn, subnetIdMap, rollback, true); } /** @@ -188,12 +190,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { * created but the orchestration fails on a subsequent operation. */ - private void createNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, + public void createNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, String networkName, String physicalNetworkName, List<Integer> vlans, List<RouteTarget> routeTargets, String shared, String external, Boolean failIfExists, Boolean backout, List<Subnet> subnets, List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, Holder<String> networkId, Holder<String> neutronNetworkId, Holder<String> networkFqdn, Holder<Map<String, String>> subnetIdMap, - Holder<NetworkRollback> rollback) throws NetworkException { + Holder<NetworkRollback> rollback, Boolean pollForCompletion) throws NetworkException { logger.debug("*** CREATE Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId); // Will capture execution time for metrics @@ -223,275 +225,208 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { NetworkResource networkResource = networkCheck(startTime, networkType, modelCustomizationUuid, networkName, physicalNetworkName, vlans, routeTargets, cloudSiteId, cloudSiteOpt.get()); - String mode = networkResource.getOrchestrationMode(); NetworkType neutronNetworkType = NetworkType.valueOf(networkResource.getNeutronNetworkType()); - if (NEUTRON_MODE.equals(mode)) { - - // Use an MsoNeutronUtils for all neutron commands - - // See if the Network already exists (by name) - NetworkInfo netInfo = null; - try { - netInfo = neutron.queryNetwork(networkName, tenantId, cloudSiteId); - } catch (MsoException me) { - logger.error( - "{} {} Exception while querying network {} for CloudSite {} from Tenant {} from OpenStack ", - MessageEnum.RA_QUERY_NETWORK_EXC, ErrorCode.BusinessProcessError.getValue(), networkName, - cloudSiteId, tenantId, me); - me.addContext(CREATE_NETWORK_CONTEXT); - throw new NetworkException(me); - } - - if (netInfo != null) { - // Exists. If that's OK, return success with the network ID. - // Otherwise, return an exception. - if (failIfExists != null && failIfExists) { - String error = String.format("Create Nework: Network %s already exists in %s/%s with ID %s", - networkName, cloudSiteId, tenantId, netInfo.getId()); - logger.error(LoggingAnchor.THREE, MessageEnum.RA_NETWORK_ALREADY_EXIST, - ErrorCode.DataError.getValue(), error); - throw new NetworkException(error, MsoExceptionCategory.USERDATA); - } else { - // Populate the outputs from the existing network. - networkId.value = netInfo.getId(); - neutronNetworkId.value = netInfo.getId(); - rollback.value = networkRollback; // Default rollback - no updates performed - logger.warn("{} {} Found Existing network, status={} for Neutron mode ", - MessageEnum.RA_NETWORK_ALREADY_EXIST, ErrorCode.DataError.getValue(), netInfo.getStatus()); - } - heat.updateResourceStatus(msoRequest.getRequestId(), NETWORK_EXIST_STATUS_MESSAGE); - return; - } + HeatTemplate heatTemplate = networkResource.getHeatTemplate(); + if (heatTemplate == null) { + String error = String.format("Network error - undefined Heat Template. Network Type = %s", networkType); + logger.error(LoggingAnchor.THREE, MessageEnum.RA_PARAM_NOT_FOUND, ErrorCode.DataError.getValue(), error); + throw new NetworkException(error, MsoExceptionCategory.INTERNAL); + } - try { - netInfo = neutron.createNetwork(cloudSiteId, tenantId, neutronNetworkType, networkName, - physicalNetworkName, vlans); - } catch (MsoException me) { - me.addContext(CREATE_NETWORK_CONTEXT); - logger.error("{} {} Create Network: type {} in {}/{}: ", MessageEnum.RA_CREATE_NETWORK_EXC, - ErrorCode.DataError.getValue(), neutronNetworkType, cloudSiteId, tenantId, me); + logger.debug("Got HEAT Template from DB: {}", heatTemplate); - throw new NetworkException(me); - } + // "Fix" the template if it has CR/LF (getting this from Oracle) + String template = heatTemplate.getHeatTemplate(); + template = template.replaceAll("\r\n", "\n"); - // Note: ignoring MsoNetworkAlreadyExists because we already checked. + boolean os3template = false; + String os3nw = OS3_NW; - // If reach this point, network creation is successful. - // Since directly created via Neutron, networkId tracked by MSO is the same - // as the neutron network ID. - networkId.value = netInfo.getId(); - neutronNetworkId.value = netInfo.getId(); + os3nw = environment.getProperty(OS3_NW_PROPERTY, OS3_NW); - networkRollback.setNetworkCreated(true); - networkRollback.setNetworkId(netInfo.getId()); - networkRollback.setNeutronNetworkId(netInfo.getId()); - networkRollback.setNetworkType(networkType); + if (template.contains(os3nw)) + os3template = true; - logger.debug("Network {} created, id = {}", networkName, netInfo.getId()); - } else if ("HEAT".equals(mode)) { + // First, look up to see if the Network already exists (by name). + // For HEAT orchestration of networks, the stack name will always match the network name + StackInfo heatStack = null; + try { + heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName); + } catch (MsoException me) { + me.addContext(CREATE_NETWORK_CONTEXT); + logger.error("{} {} Create Network (heat): query network {} in {}/{}: ", MessageEnum.RA_QUERY_NETWORK_EXC, + ErrorCode.DataError.getValue(), networkName, cloudSiteId, tenantId, me); + throw new NetworkException(me); + } - HeatTemplate heatTemplate = networkResource.getHeatTemplate(); - if (heatTemplate == null) { - String error = String.format("Network error - undefined Heat Template. Network Type = %s", networkType); - logger.error(LoggingAnchor.THREE, MessageEnum.RA_PARAM_NOT_FOUND, ErrorCode.DataError.getValue(), + if (heatStack != null && (heatStack.getStatus() != HeatStatus.NOTFOUND)) { + // Stack exists. Return success or error depending on input directive + if (failIfExists != null && failIfExists) { + String error = String.format("CreateNetwork: Stack %s already exists in %s/%s as %s", networkName, + cloudSiteId, tenantId, heatStack.getCanonicalName()); + logger.error(LoggingAnchor.THREE, MessageEnum.RA_NETWORK_ALREADY_EXIST, ErrorCode.DataError.getValue(), error); - throw new NetworkException(error, MsoExceptionCategory.INTERNAL); - } - - logger.debug("Got HEAT Template from DB: {}", heatTemplate); - - // "Fix" the template if it has CR/LF (getting this from Oracle) - String template = heatTemplate.getHeatTemplate(); - template = template.replaceAll("\r\n", "\n"); - - boolean aic3template = false; - String aic3nw = AIC3_NW; - - aic3nw = environment.getProperty(AIC3_NW_PROPERTY, AIC3_NW); - - if (template.contains(aic3nw)) - aic3template = true; - - // First, look up to see if the Network already exists (by name). - // For HEAT orchestration of networks, the stack name will always match the network name - StackInfo heatStack = null; - try { - heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName); - } catch (MsoException me) { - me.addContext(CREATE_NETWORK_CONTEXT); - logger.error("{} {} Create Network (heat): query network {} in {}/{}: ", - MessageEnum.RA_QUERY_NETWORK_EXC, ErrorCode.DataError.getValue(), networkName, cloudSiteId, - tenantId, me); - throw new NetworkException(me); - } - - if (heatStack != null && (heatStack.getStatus() != HeatStatus.NOTFOUND)) { - // Stack exists. Return success or error depending on input directive - if (failIfExists != null && failIfExists) { - String error = String.format("CreateNetwork: Stack %s already exists in %s/%s as %s", networkName, - cloudSiteId, tenantId, heatStack.getCanonicalName()); - logger.error(LoggingAnchor.THREE, MessageEnum.RA_NETWORK_ALREADY_EXIST, - ErrorCode.DataError.getValue(), error); - throw new NetworkException(error, MsoExceptionCategory.USERDATA); - } else { - // Populate the outputs from the existing stack. - networkId.value = heatStack.getCanonicalName(); - Map<String, String> sMap = new HashMap<>(); - if (heatStack.getOutputs() != null) { - neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID); - rollback.value = networkRollback; // Default rollback - no updates performed - if (aic3template) { - networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN); - } - Map<String, Object> outputs = heatStack.getOutputs(); - - for (Map.Entry<String, Object> entry : outputs.entrySet()) { - String key = entry.getKey(); - if (key != null && key.startsWith("subnet")) { - if (aic3template) // one subnet_id output - { - Map<String, String> map = getSubnetUUId(key, outputs, subnets); - sMap.putAll(map); - } else // multiples subnet_%aaid% outputs - { - String subnetUUId = (String) outputs.get(key); - sMap.put(key.substring("subnet_id_".length()), subnetUUId); - } + throw new NetworkException(error, MsoExceptionCategory.USERDATA); + } else { + // Populate the outputs from the existing stack. + networkId.value = heatStack.getCanonicalName(); + Map<String, String> sMap = new HashMap<>(); + if (heatStack.getOutputs() != null) { + neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID); + rollback.value = networkRollback; // Default rollback - no updates performed + if (os3template) { + networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN); + } + Map<String, Object> outputs = heatStack.getOutputs(); + + for (Map.Entry<String, Object> entry : outputs.entrySet()) { + String key = entry.getKey(); + if (key != null && key.startsWith("subnet")) { + if (os3template) // one subnet_id output + { + Map<String, String> map = getSubnetUUId(key, outputs, subnets); + sMap.putAll(map); + } else // multiples subnet_%aaid% outputs + { + String subnetUUId = (String) outputs.get(key); + sMap.put(key.substring("subnet_id_".length()), subnetUUId); } } } - subnetIdMap.value = sMap; - logger.warn("{} {} Found Existing network stack, status={} networkName={} for {}/{}", - MessageEnum.RA_NETWORK_ALREADY_EXIST, ErrorCode.DataError.getValue(), heatStack.getStatus(), - networkName, cloudSiteId, tenantId); } - heat.updateResourceStatus(msoRequest.getRequestId(), NETWORK_EXIST_STATUS_MESSAGE); - return; + subnetIdMap.value = sMap; + logger.warn("{} {} Found Existing network stack, status={} networkName={} for {}/{}", + MessageEnum.RA_NETWORK_ALREADY_EXIST, ErrorCode.DataError.getValue(), heatStack.getStatus(), + networkName, cloudSiteId, tenantId); } + heat.updateResourceStatus(msoRequest.getRequestId(), NETWORK_EXIST_STATUS_MESSAGE); + return; + } - // Ready to deploy the new Network - // Build the common set of HEAT template parameters - Map<String, Object> stackParams = populateNetworkParams(neutronNetworkType, networkName, - physicalNetworkName, vlans, routeTargets, shared, external, aic3template); - - // Validate (and update) the input parameters against the DB definition - // Shouldn't happen unless DB config is wrong, since all networks use same inputs - // and inputs were already validated. - try { - stackParams = heat.validateStackParams(stackParams, heatTemplate); - } catch (IllegalArgumentException e) { - String error = "Create Network: Configuration Error: " + e.getMessage(); - logger.error(LoggingAnchor.THREE, MessageEnum.RA_CONFIG_EXC, ErrorCode.DataError.getValue(), error, e); - // Input parameters were not valid - throw new NetworkException(error, MsoExceptionCategory.INTERNAL); - } + // Ready to deploy the new Network + // Build the common set of HEAT template parameters + Map<String, Object> stackParams = populateNetworkParams(neutronNetworkType, networkName, physicalNetworkName, + vlans, routeTargets, shared, external, os3template); - if (subnets != null) { - try { - if (aic3template) { - template = mergeSubnetsAIC3(template, subnets, stackParams); - } else { - template = mergeSubnets(template, subnets); - } - } catch (MsoException me) { - me.addContext(CREATE_NETWORK_CONTEXT); - logger.error("{} {} Exception Create Network, merging subnets for network (heat) type {} in {}/{} ", - MessageEnum.RA_CREATE_NETWORK_EXC, ErrorCode.DataError.getValue(), - neutronNetworkType.toString(), cloudSiteId, tenantId, me); - throw new NetworkException(me); - } - } + // Validate (and update) the input parameters against the DB definition + // Shouldn't happen unless DB config is wrong, since all networks use same inputs + // and inputs were already validated. + try { + stackParams = heat.validateStackParams(stackParams, heatTemplate); + } catch (IllegalArgumentException e) { + String error = "Create Network: Configuration Error: " + e.getMessage(); + logger.error(LoggingAnchor.THREE, MessageEnum.RA_CONFIG_EXC, ErrorCode.DataError.getValue(), error, e); + // Input parameters were not valid + throw new NetworkException(error, MsoExceptionCategory.INTERNAL); + } - if (policyFqdns != null && !policyFqdns.isEmpty() && aic3template) { - try { - mergePolicyRefs(policyFqdns, stackParams); - } catch (MsoException me) { - me.addContext(CREATE_NETWORK_CONTEXT); - logger.error("{} {} Exception Create Network, merging policyRefs type {} in {}/{} ", - MessageEnum.RA_CREATE_NETWORK_EXC, ErrorCode.DataError.getValue(), - neutronNetworkType.toString(), cloudSiteId, tenantId, me); - throw new NetworkException(me); + if (subnets != null) { + try { + if (os3template) { + template = mergeSubnetsAIC3(template, subnets, stackParams); + } else { + template = mergeSubnets(template, subnets); } + } catch (MsoException me) { + me.addContext(CREATE_NETWORK_CONTEXT); + logger.error("{} {} Exception Create Network, merging subnets for network (heat) type {} in {}/{} ", + MessageEnum.RA_CREATE_NETWORK_EXC, ErrorCode.DataError.getValue(), + neutronNetworkType.toString(), cloudSiteId, tenantId, me); + throw new NetworkException(me); } + } - if (routeTableFqdns != null && !routeTableFqdns.isEmpty() && aic3template) { - try { - mergeRouteTableRefs(routeTableFqdns, stackParams); - } catch (MsoException me) { - me.addContext(CREATE_NETWORK_CONTEXT); - logger.error("{} {} Exception Create Network, merging routeTableRefs type {} in {}/{} ", - MessageEnum.RA_CREATE_NETWORK_EXC, ErrorCode.DataError.getValue(), - neutronNetworkType.toString(), cloudSiteId, tenantId, me); - throw new NetworkException(me); - } + if (policyFqdns != null && !policyFqdns.isEmpty() && os3template) { + try { + mergePolicyRefs(policyFqdns, stackParams); + } catch (MsoException me) { + me.addContext(CREATE_NETWORK_CONTEXT); + logger.error("{} {} Exception Create Network, merging policyRefs type {} in {}/{} ", + MessageEnum.RA_CREATE_NETWORK_EXC, ErrorCode.DataError.getValue(), + neutronNetworkType.toString(), cloudSiteId, tenantId, me); + throw new NetworkException(me); } + } - // Deploy the network stack - // Ignore MsoStackAlreadyExists exception because we already checked. + if (routeTableFqdns != null && !routeTableFqdns.isEmpty() && os3template) { try { - if (backout == null) - backout = true; - heatStack = heat.createStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName, null, template, - stackParams, true, heatTemplate.getTimeoutMinutes(), null, null, null, backout.booleanValue(), - failIfExists); + mergeRouteTableRefs(routeTableFqdns, stackParams); } catch (MsoException me) { me.addContext(CREATE_NETWORK_CONTEXT); - logger.error("{} {} Exception creating network type {} in {}/{} ", MessageEnum.RA_CREATE_NETWORK_EXC, - ErrorCode.DataError.getValue(), networkName, cloudSiteId, tenantId, me); + logger.error("{} {} Exception Create Network, merging routeTableRefs type {} in {}/{} ", + MessageEnum.RA_CREATE_NETWORK_EXC, ErrorCode.DataError.getValue(), + neutronNetworkType.toString(), cloudSiteId, tenantId, me); throw new NetworkException(me); } + } - // Reach this point if createStack is successful. + // Deploy the network stack + // Ignore MsoStackAlreadyExists exception because we already checked. + try { + if (backout == null) + backout = true; + heatStack = heat.createStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName, null, template, stackParams, + pollForCompletion, heatTemplate.getTimeoutMinutes(), null, null, null, backout.booleanValue(), + failIfExists); + } catch (MsoException me) { + me.addContext(CREATE_NETWORK_CONTEXT); + logger.error("{} {} Exception creating network type {} in {}/{} ", MessageEnum.RA_CREATE_NETWORK_EXC, + ErrorCode.DataError.getValue(), networkName, cloudSiteId, tenantId, me); + throw new NetworkException(me); + } - // For Heat-based orchestration, the MSO-tracked network ID is the heat stack, - // and the neutronNetworkId is the network UUID returned in stack outputs. - networkId.value = heatStack.getCanonicalName(); - if (heatStack.getOutputs() != null) { - neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID); - if (aic3template) { - networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN); - } + // Reach this point if createStack is successful. + + // For Heat-based orchestration, the MSO-tracked network ID is the heat stack, + // and the neutronNetworkId is the network UUID returned in stack outputs. + networkId.value = heatStack.getCanonicalName(); + if (heatStack.getOutputs() != null) { + neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID); + if (os3template) { + networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN); } - Map<String, Object> outputs = heatStack.getOutputs(); - Map<String, String> sMap = new HashMap<>(); - if (outputs != null) { - for (Map.Entry<String, Object> entry : outputs.entrySet()) { - String key = entry.getKey(); - if (key != null && key.startsWith("subnet")) { - if (aic3template) // one subnet output expected - { - Map<String, String> map = getSubnetUUId(key, outputs, subnets); - sMap.putAll(map); - } else // multiples subnet_%aaid% outputs allowed - { - String subnetUUId = (String) outputs.get(key); - sMap.put(key.substring("subnet_id_".length()), subnetUUId); - } + } + Map<String, Object> outputs = heatStack.getOutputs(); + Map<String, String> sMap = new HashMap<>(); + if (outputs != null) { + for (Map.Entry<String, Object> entry : outputs.entrySet()) { + String key = entry.getKey(); + if (key != null && key.startsWith("subnet")) { + if (os3template) // one subnet output expected + { + Map<String, String> map = getSubnetUUId(key, outputs, subnets); + sMap.putAll(map); + } else // multiples subnet_%aaid% outputs allowed + { + String subnetUUId = (String) outputs.get(key); + sMap.put(key.substring("subnet_id_".length()), subnetUUId); } } - networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID)); } - subnetIdMap.value = sMap; - - rollback.value = networkRollback; - // Populate remaining rollback info and response parameters. - networkRollback.setNetworkStackId(heatStack.getCanonicalName()); - networkRollback.setNetworkCreated(true); - networkRollback.setNetworkType(networkType); + networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID)); + } + subnetIdMap.value = sMap; - try { - heat.updateResourceStatus(msoRequest.getRequestId(), NETWORK_CREATED_STATUS_MESSAGE); - } catch (Exception e) { - logger.warn("Exception while updating infra active request", e); - } + rollback.value = networkRollback; + // Populate remaining rollback info and response parameters. + networkRollback.setNetworkStackId(heatStack.getCanonicalName()); + networkRollback.setNetworkCreated(true); + networkRollback.setNetworkType(networkType); - logger.debug("Network {} successfully created via HEAT", networkName); + try { + heat.updateResourceStatus(msoRequest.getRequestId(), NETWORK_CREATED_STATUS_MESSAGE); + } catch (Exception e) { + logger.warn("Exception while updating infra active request", e); } + logger.debug("Network {} successfully created via HEAT", networkName); + + return; } + @Deprecated @Override public void updateNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, String shared, @@ -503,6 +438,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } + @Deprecated @Override public void updateNetworkContrail(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, String networkId, String networkName, List<RouteTarget> routeTargets, @@ -534,7 +470,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { * undo everything that was updated. This is useful if a network is successfully updated but orchestration fails on * a subsequent operation. */ - private void updateNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, + public void updateNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, List<RouteTarget> routeTargets, String shared, String external, List<Subnet> subnets, List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, @@ -593,7 +529,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Does not exist. Throw an exception (can't update a non-existent network) throw new NetworkException(error, MsoExceptionCategory.USERDATA); } - long updateNetworkStarttime = System.currentTimeMillis(); try { netInfo = neutron.updateNetwork(cloudSiteId, tenantId, networkId, neutronNetworkType, physicalNetworkName, vlans); @@ -674,17 +609,17 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { String template = heatTemplate.getHeatTemplate(); template = template.replaceAll("\r\n", "\n"); - boolean aic3template = false; - String aic3nw = AIC3_NW; + boolean os3template = false; + String os3nw = OS3_NW; - aic3nw = environment.getProperty(AIC3_NW_PROPERTY, AIC3_NW); + os3nw = environment.getProperty(OS3_NW_PROPERTY, OS3_NW); - if (template.contains(aic3nw)) - aic3template = true; + if (template.contains(os3nw)) + os3template = true; // Build the common set of HEAT template parameters Map<String, Object> stackParams = populateNetworkParams(neutronNetworkType, networkName, - physicalNetworkName, vlans, routeTargets, shared, external, aic3template); + physicalNetworkName, vlans, routeTargets, shared, external, os3template); // Validate (and update) the input parameters against the DB definition // Shouldn't happen unless DB config is wrong, since all networks use same inputs @@ -698,7 +633,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { if (subnets != null) { try { - if (aic3template) { + if (os3template) { template = mergeSubnetsAIC3(template, subnets, stackParams); } else { template = mergeSubnets(template, subnets); @@ -712,7 +647,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } } - if (policyFqdns != null && aic3template) { + if (policyFqdns != null && os3template) { try { mergePolicyRefs(policyFqdns, stackParams); } catch (MsoException me) { @@ -724,7 +659,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } } - if (routeTableFqdns != null && !routeTableFqdns.isEmpty() && aic3template) { + if (routeTableFqdns != null && !routeTableFqdns.isEmpty() && os3template) { try { mergeRouteTableRefs(routeTableFqdns, stackParams); } catch (MsoException me) { @@ -740,7 +675,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Ignore MsoStackNotFound exception because we already checked. try { heatStack = heatWithUpdate.updateStack(cloudSiteId, CLOUD_OWNER, tenantId, networkId, template, - stackParams, true, heatTemplate.getTimeoutMinutes()); + stackParams, false, heatTemplate.getTimeoutMinutes()); } catch (MsoException me) { me.addContext(UPDATE_NETWORK_CONTEXT); logger.error("{} {} Exception - update network {} in {}/{} ", MessageEnum.RA_UPDATE_NETWORK_ERR, @@ -754,7 +689,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { for (Map.Entry<String, Object> entry : outputs.entrySet()) { String key = entry.getKey(); if (key != null && key.startsWith("subnet")) { - if (aic3template) // one subnet output expected + if (os3template) // one subnet output expected { Map<String, String> map = getSubnetUUId(key, outputs, subnets); sMap.putAll(map); @@ -837,14 +772,14 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(error, MsoExceptionCategory.INTERNAL); } - MavenLikeVersioning aicV = new MavenLikeVersioning(); - aicV.setVersion(cloudSite.getCloudVersion()); - if ((aicV.isMoreRecentThan(networkResource.getAicVersionMin()) - || aicV.isTheSameVersion(networkResource.getAicVersionMin())) // aic + MavenLikeVersioning osV = new MavenLikeVersioning(); + osV.setVersion(cloudSite.getCloudVersion()); + if ((osV.isMoreRecentThan(networkResource.getAicVersionMin()) + || osV.isTheSameVersion(networkResource.getAicVersionMin())) // os // >= // min - && (aicV.isTheSameVersion(networkResource.getAicVersionMax()) - || !(aicV.isMoreRecentThan(networkResource.getAicVersionMax())))) // aic <= max + && (osV.isTheSameVersion(networkResource.getAicVersionMax()) + || !(osV.isMoreRecentThan(networkResource.getAicVersionMax())))) // os <= max { logger.debug("Network Type:{} VersionMin:{} VersionMax:{} supported on Cloud:{} with AIC_Version:{}", networkType, networkResource.getAicVersionMin(), networkResource.getAicVersionMax(), cloudSiteId, @@ -921,7 +856,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Use MsoNeutronUtils for all NEUTRON commands - String mode; String neutronId = null; // Try Heat first, since networks may be named the same as the Heat stack StackInfo heatStack = null; @@ -939,7 +873,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Found it. Get the neutronNetworkId for further query Map<String, String> sMap = new HashMap<>(); Map<String, Object> outputs = heatStack.getOutputs(); - mode = "HEAT"; if (outputs != null) { neutronId = (String) outputs.get(NETWORK_ID); @@ -957,10 +890,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } } subnetIdMap.value = sMap; - } else { - // Input ID was not a Heat stack ID. Try it directly in Neutron - neutronId = networkNameOrId; - mode = NEUTRON_MODE; } // Query directly against the Neutron Network for the details @@ -971,7 +900,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { if (netInfo != null) { // Found. Populate the output elements networkExists.value = Boolean.TRUE; - if ("HEAT".equals(mode) && heatStack != null) { + if (heatStack != null) { networkId.value = heatStack.getCanonicalName(); } else { networkId.value = netInfo.getId(); @@ -981,8 +910,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { if (vlans != null) vlans.value = netInfo.getVlans(); - logger.debug("Network {} found({}), ID = {}{}", networkNameOrId, mode, networkId.value, - ("HEAT".equals(mode) ? ",NeutronId = " + neutronNetworkId.value : "")); + logger.debug("Network {}, ID = {}{}", networkNameOrId, networkId.value, + (",NeutronId = " + neutronNetworkId.value)); } else { // Not found. Populate the status fields, leave the rest null networkExists.value = Boolean.FALSE; @@ -1019,7 +948,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { */ @Override public void deleteNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, - String networkId, MsoRequest msoRequest, Holder<Boolean> networkDeleted) throws NetworkException { + String networkId, MsoRequest msoRequest, Holder<Boolean> networkDeleted, Boolean pollForCompletion) + throws NetworkException { logger.debug("*** DELETE Network adapter with Network: {} in {}/{}", networkId, cloudSiteId, tenantId); if (commonUtils.isNullOrEmpty(cloudSiteId) || commonUtils.isNullOrEmpty(tenantId) || commonUtils.isNullOrEmpty(networkId)) { @@ -1028,6 +958,10 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(error, MsoExceptionCategory.USERDATA); } + if (pollForCompletion == null) { + pollForCompletion = true; + } + // Retrieve the Network Resource definition NetworkResource networkResource = null; if (commonUtils.isNullOrEmpty(modelCustomizationUuid)) { @@ -1043,10 +977,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } int timeoutMinutes = 118; - String mode = ""; if (networkResource != null) { logger.debug(LOG_DEBUG_MSG, networkResource.toString()); - mode = networkResource.getOrchestrationMode(); networkResource.getHeatTemplate().getTimeoutMinutes(); HeatTemplate heat = networkResource.getHeatTemplate(); if (heat != null && heat.getTimeoutMinutes() != null) { @@ -1056,27 +988,17 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } } - if (NEUTRON_MODE.equals(mode)) { - try { - boolean deleted = neutron.deleteNetwork(networkId, tenantId, cloudSiteId); - networkDeleted.value = deleted; - } catch (MsoException me) { - me.addContext("DeleteNetwork"); - logger.error("{} {} Delete Network (neutron): {} in {}/{} ", MessageEnum.RA_DELETE_NETWORK_EXC, - ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me); - throw new NetworkException(me); - } - } else { - try { - StackInfo stack = heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true, timeoutMinutes); - networkDeleted.value = stack.isOperationPerformed(); - } catch (MsoException me) { - me.addContext("DeleteNetwork"); - logger.error("{} {} Delete Network (heat): {} in {}/{} ", MessageEnum.RA_DELETE_NETWORK_EXC, - ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me); - throw new NetworkException(me); - } + try { + StackInfo stack = + heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, timeoutMinutes); + networkDeleted.value = stack.isOperationPerformed(); + } catch (MsoException me) { + me.addContext("DeleteNetwork"); + logger.error("{} {} Delete Network (heat): {} in {}/{} ", MessageEnum.RA_DELETE_NETWORK_EXC, + ErrorCode.DataError.getValue(), networkId, cloudSiteId, tenantId, me); + throw new NetworkException(me); } + try { heat.updateResourceStatus(msoRequest.getRequestId(), networkDeleted.value ? NETWORK_DELETED_STATUS_MESSAGE : NETWORK_NOT_EXIST_STATUS_MESSAGE); @@ -1094,58 +1016,34 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { * creation. */ @Override - public void rollbackNetwork(NetworkRollback rollback) throws NetworkException { + public void rollbackNetwork(NetworkRollback rollback, Boolean pollForCompletion) throws NetworkException { if (rollback == null) { logger.error("{} {} rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.DataError.getValue()); return; } + if (pollForCompletion == null) { + pollForCompletion = true; + } + // Get the elements of the VnfRollback object for easier access String cloudSiteId = rollback.getCloudId(); String tenantId = rollback.getTenantId(); String networkId = rollback.getNetworkStackId(); - String networkType = rollback.getNetworkType(); - String modelCustomizationUuid = rollback.getModelCustomizationUuid(); logger.debug("*** ROLLBACK Network {} in {}/{}", networkId, cloudSiteId, tenantId); - // Retrieve the Network Resource definition - NetworkResource networkResource = null; - if (commonUtils.isNullOrEmpty(modelCustomizationUuid)) { - networkResource = networkCustomRepo.findOneByNetworkType(networkType).getNetworkResource(); - } else { - networkResource = - networkCustomRepo.findOneByModelCustomizationUUID(modelCustomizationUuid).getNetworkResource(); - } - String mode = ""; - if (networkResource != null) { - - logger.debug(LOG_DEBUG_MSG, networkResource); - - mode = networkResource.getOrchestrationMode(); - } if (rollback.getNetworkCreated()) { - if (NEUTRON_MODE.equals(mode)) { - try { - neutron.deleteNetwork(networkId, tenantId, cloudSiteId); - } catch (MsoException me) { - me.addContext("RollbackNetwork"); - logger.error("{} {} Exception - Rollback Network (neutron): {} in {}/{} ", - MessageEnum.RA_DELETE_NETWORK_EXC, ErrorCode.BusinessProcessError.getValue(), networkId, - cloudSiteId, tenantId, me); - throw new NetworkException(me); - } - } else { - try { - heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, true, 120); - } catch (MsoException me) { - me.addContext("RollbackNetwork"); - logger.error("{} {} Exception - Rollback Network (heat): {} in {}/{} ", - MessageEnum.RA_DELETE_NETWORK_EXC, ErrorCode.BusinessProcessError.getValue(), networkId, - cloudSiteId, tenantId, me); - throw new NetworkException(me); - } + try { + heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, 120); + } catch (MsoException me) { + me.addContext("RollbackNetwork"); + logger.error("{} {} Exception - Rollback Network (heat): {} in {}/{} ", + MessageEnum.RA_DELETE_NETWORK_EXC, ErrorCode.BusinessProcessError.getValue(), networkId, + cloudSiteId, tenantId, me); + throw new NetworkException(me); } + } } @@ -1173,7 +1071,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { private Map<String, Object> populateNetworkParams(NetworkType neutronNetworkType, String networkName, String physicalNetwork, List<Integer> vlans, List<RouteTarget> routeTargets, String shared, String external, - boolean aic3template) { + boolean os3template) { // Build the common set of HEAT template parameters Map<String, Object> stackParams = new HashMap<>(); stackParams.put("network_name", networkName); @@ -1227,14 +1125,14 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { if ("IMPORT".equalsIgnoreCase(role)) { sep = rtImport.isEmpty() ? "" : ","; - rtImport = aic3template ? rtImport + sep + "target:" + rtValue : rtImport + sep + rtValue; + rtImport = os3template ? rtImport + sep + "target:" + rtValue : rtImport + sep + rtValue; } else if ("EXPORT".equalsIgnoreCase(role)) { sep = rtExport.isEmpty() ? "" : ","; - rtExport = aic3template ? rtExport + sep + "target:" + rtValue : rtExport + sep + rtValue; + rtExport = os3template ? rtExport + sep + "target:" + rtValue : rtExport + sep + rtValue; } else // covers BOTH, empty etc { sep = rtGlobal.isEmpty() ? "" : ","; - rtGlobal = aic3template ? rtGlobal + sep + "target:" + rtValue : rtGlobal + sep + rtValue; + rtGlobal = os3template ? rtGlobal + sep + "target:" + rtValue : rtGlobal + sep + rtValue; } } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java deleted file mode 100644 index 09356d02c8..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java +++ /dev/null @@ -1,660 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.inject.Provider; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.ws.Holder; -import org.apache.http.HttpStatus; -import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.onap.so.adapters.network.exceptions.NetworkException; -import org.onap.so.adapters.nwrest.ContrailNetwork; -import org.onap.so.adapters.nwrest.CreateNetworkError; -import org.onap.so.adapters.nwrest.CreateNetworkRequest; -import org.onap.so.adapters.nwrest.CreateNetworkResponse; -import org.onap.so.adapters.nwrest.DeleteNetworkError; -import org.onap.so.adapters.nwrest.DeleteNetworkRequest; -import org.onap.so.adapters.nwrest.DeleteNetworkResponse; -import org.onap.so.adapters.nwrest.ProviderVlanNetwork; -import org.onap.so.adapters.nwrest.QueryNetworkError; -import org.onap.so.adapters.nwrest.QueryNetworkResponse; -import org.onap.so.adapters.nwrest.RollbackNetworkError; -import org.onap.so.adapters.nwrest.RollbackNetworkRequest; -import org.onap.so.adapters.nwrest.RollbackNetworkResponse; -import org.onap.so.adapters.nwrest.UpdateNetworkError; -import org.onap.so.adapters.nwrest.UpdateNetworkRequest; -import org.onap.so.adapters.nwrest.UpdateNetworkResponse; -import org.onap.so.adapters.vnf.BpelRestClient; -import org.onap.so.entity.MsoRequest; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.NetworkRollback; -import org.onap.so.openstack.beans.NetworkStatus; -import org.onap.so.openstack.beans.RouteTarget; -import org.onap.so.openstack.exceptions.MsoExceptionCategory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -@Path("/v1/networks") -@Api(value = "/v1/networks", description = "root of network adapters restful web service") -@Component -@Transactional -public class NetworkAdapterRest { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterRest.class); - private static final String TESTING_KEYWORD = "___TESTING___"; - private String exceptionMsg = "Exception:"; - private static final String SHARED = "shared"; - private static final String EXTERNAL = "external"; - - @Autowired - private MsoNetworkAdapterImpl adapter; - - @Autowired - private Provider<BpelRestClient> bpelRestClientProvider; - - - @POST - @Path("") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "CreateNetwork", response = Response.class, - notes = "Creates a new network, CreateNetworkRquest JSON is required") - @ApiResponses({@ApiResponse(code = 200, message = "network has been successfully created"), - @ApiResponse(code = 202, message = "create network request has been accepted (async only)"), - @ApiResponse(code = 500, message = "create network failed, examine entity object for details")}) - public Response createNetwork( - @ApiParam(value = "details of network being created", required = true) CreateNetworkRequest req) { - logger.debug("createNetwork enter: {}", req.toJsonString()); - CreateNetworkTask task = new CreateNetworkTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception while create network ", MessageEnum.RA_CREATE_NETWORK_EXC, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("createNetwork exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class CreateNetworkTask implements Runnable { - private final CreateNetworkRequest req; - private CreateNetworkResponse response = null; - private CreateNetworkError eresp = null; - private boolean sendxml; - - public CreateNetworkTask(CreateNetworkRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<CreateNetworkResponse>(response) {} - : new GenericEntity<CreateNetworkError>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("CreateNetworkTask start"); - try { - // Synchronous Web Service Outputs - Holder<String> networkId = new Holder<>(); - Holder<String> neutronNetworkId = new Holder<>(); - Holder<String> networkFqdn = new Holder<>(); - Holder<Map<String, String>> subnetIdMap = new Holder<>(); - Holder<NetworkRollback> rollback = new Holder<>(); - - HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams(); - if (params == null) { - params = new HashMap<>(); - } - String shared = null; - String external = null; - - String cloudsite = req.getCloudSiteId(); - if (cloudsite != null && cloudsite.equals(TESTING_KEYWORD)) { - String tenant = req.getTenantId(); - if (tenant != null && tenant.equals(TESTING_KEYWORD)) { - throw new NetworkException("testing."); - } - networkId.value = "479D3D8B-6360-47BC-AB75-21CC91981484"; - neutronNetworkId.value = "55e55884-28fa-11e6-8971-0017f20fe1b8"; - networkFqdn.value = "086f70b6-28fb-11e6-8260-0017f20fe1b8"; - subnetIdMap.value = testMap(); - rollback.value = new NetworkRollback(); - } else if (req.isContrailRequest()) { - ContrailNetwork ctn = req.getContrailNetwork(); - if (ctn == null) { - ctn = new ContrailNetwork(); - req.setContrailNetwork(ctn); - } - if (params.containsKey(SHARED)) { - shared = params.get(SHARED); - } else { - if (ctn.getShared() != null) { - shared = ctn.getShared(); - } - } - if (params.containsKey(EXTERNAL)) { - external = params.get(EXTERNAL); - } else { - if (ctn.getExternal() != null) { - external = ctn.getExternal(); - } - } - adapter.createNetworkContrail(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), - req.getModelCustomizationUuid(), req.getNetworkName(), - req.getContrailNetwork().getRouteTargets(), shared, external, req.getFailIfExists(), - req.getBackout(), req.getSubnets(), params, req.getContrailNetwork().getPolicyFqdns(), - req.getContrailNetwork().getRouteTableFqdns(), req.getMsoRequest(), networkId, - neutronNetworkId, networkFqdn, subnetIdMap, rollback); - } else { - ProviderVlanNetwork pvn = req.getProviderVlanNetwork(); - if (pvn == null) { - pvn = new ProviderVlanNetwork(); - req.setProviderVlanNetwork(pvn); - } - if (params.containsKey(SHARED)) - shared = params.get(SHARED); - if (params.containsKey(EXTERNAL)) - external = params.get(EXTERNAL); - adapter.createNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), - req.getModelCustomizationUuid(), req.getNetworkName(), - req.getProviderVlanNetwork().getPhysicalNetworkName(), - req.getProviderVlanNetwork().getVlans(), shared, external, req.getFailIfExists(), - req.getBackout(), req.getSubnets(), params, req.getMsoRequest(), networkId, - neutronNetworkId, subnetIdMap, rollback); - } - response = new CreateNetworkResponse(req.getNetworkId(), neutronNetworkId.value, - rollback.value.getNetworkStackId(), networkFqdn.value, rollback.value.getNetworkCreated(), - subnetIdMap.value, rollback.value, req.getMessageId()); - } catch (NetworkException e) { - logger.debug(exceptionMsg, e); - eresp = new CreateNetworkError(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("CreateNetworkTask exit: code={}, resp={}", getStatusCode(), getResponse()); - } - } - - @DELETE - @Path("{aaiNetworkId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "DeleteNetwork", response = Response.class, - notes = "Deletes an existing network, aaiNetworkId and DeleteNetworkRequest JSON are required") - @ApiResponses({@ApiResponse(code = 200, message = "network has been successfully deleted"), - @ApiResponse(code = 202, message = "request to delete network has been accepted (async only)"), - @ApiResponse(code = 500, message = "delete network failed, examine entity object for details")}) - public Response deleteNetwork( - @ApiParam(value = "aaiNetworkId to be deleted ", - required = true) @PathParam("aaiNetworkId") String aaiNetworkId, - @ApiParam(value = "details of network being deleted", required = true) DeleteNetworkRequest req) { - logger.debug("deleteNetwork enter: {}", req.toJsonString()); - if (aaiNetworkId == null || !aaiNetworkId.equals(req.getNetworkId())) { - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN).entity( - "A&AI NetworkId in URL (" + aaiNetworkId + ") does not match content (" + req.getNetworkId() + ")") - .build(); - } - DeleteNetworkTask task = new DeleteNetworkTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception while delete network ", MessageEnum.RA_DELETE_NETWORK_EXC, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("deleteNetwork exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class DeleteNetworkTask implements Runnable { - private final DeleteNetworkRequest req; - private DeleteNetworkResponse response = null; - private DeleteNetworkError eresp = null; - private boolean sendxml; - - public DeleteNetworkTask(DeleteNetworkRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<DeleteNetworkResponse>(response) {} - : new GenericEntity<DeleteNetworkError>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("DeleteNetworkTask start"); - try { - Holder<Boolean> networkDeleted = new Holder<>(); - if (req.getCloudSiteId().equals(TESTING_KEYWORD)) { - networkDeleted.value = true; - } else { - adapter.deleteNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), - req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getMsoRequest(), - networkDeleted); - } - response = new DeleteNetworkResponse(req.getNetworkId(), networkDeleted.value, req.getMessageId()); - } catch (NetworkException e) { - logger.debug(exceptionMsg, e); - eresp = new DeleteNetworkError(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("DeleteNetworkTask exit: code={}, resp={}", getStatusCode(), getResponse()); - } - } - - @GET - @Path("{aaiNetworkId}") - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "QueryNetwork", response = Response.class, notes = "Queries an existing network") - @ApiResponses({@ApiResponse(code = 200, message = "Query network successful"), - @ApiResponse(code = 500, message = "Query network failed, examine entity object for details")}) - public Response queryNetwork( - @ApiParam(value = "cloudSiteId", required = false) @QueryParam("cloudSiteId") String cloudSiteId, - @ApiParam(value = "tenantId", required = false) @QueryParam("tenantId") String tenantId, - @ApiParam(value = "networkStackId", required = false) @QueryParam("networkStackId") String networkStackId, - @ApiParam(value = "skipAAI", required = false) @QueryParam("skipAAI") String skipAAI, - @ApiParam(value = "msoRequest.requestId", - required = false) @QueryParam("msoRequest.requestId") String requestId, - @ApiParam(value = "msoRequest.serviceInstanceId", - required = false) @QueryParam("msoRequest.serviceInstanceId") String serviceInstanceId, - @ApiParam(value = "aaiNetworkId", required = false) @PathParam("aaiNetworkId") String aaiNetworkId) { - // This request responds synchronously only - logger.debug("Query network enter:{}" + aaiNetworkId); - MsoRequest msoRequest = new MsoRequest(requestId, serviceInstanceId); - - try { - int respStatus = HttpStatus.SC_OK; - QueryNetworkResponse resp = new QueryNetworkResponse(networkStackId, null, networkStackId, null, null); - Holder<Boolean> networkExists = new Holder<>(); - Holder<String> networkId = new Holder<>(); - Holder<String> neutronNetworkId = new Holder<>(); - Holder<NetworkStatus> status = new Holder<>(); - Holder<List<RouteTarget>> routeTargets = new Holder<>(); - Holder<Map<String, String>> subnetIdMap = new Holder<>(); - - adapter.queryNetworkContrail(cloudSiteId, tenantId, aaiNetworkId, msoRequest, networkExists, networkId, - neutronNetworkId, status, routeTargets, subnetIdMap); - - if (!networkExists.value) { - logger.debug("network not found"); - respStatus = HttpStatus.SC_NOT_FOUND; - } else { - logger.debug("network found {}, status={}", networkId.value, status.value); - resp.setNetworkExists(networkExists.value); - resp.setNetworkId(networkId.value); - resp.setNeutronNetworkId(neutronNetworkId.value); - resp.setNetworkStatus(status.value); - resp.setRouteTargets(routeTargets.value); - resp.setSubnetIdMap(subnetIdMap.value); - } - logger.debug("Query network exit"); - return Response.status(respStatus).entity(new GenericEntity<QueryNetworkResponse>(resp) {}).build(); - } catch (NetworkException e) { - logger.error("{} {} Exception when query VNF ", MessageEnum.RA_QUERY_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - QueryNetworkError err = new QueryNetworkError(); - err.setMessage(e.getMessage()); - err.setCategory(MsoExceptionCategory.INTERNAL); - return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity<QueryNetworkError>(err) {}).build(); - } - } - - @DELETE - @Path("{aaiNetworkId}/rollback") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "RollbackNetwork", response = Response.class, notes = "Rollback an existing network") - @ApiResponses({@ApiResponse(code = 200, message = "Rollback network successful"), - @ApiResponse(code = 202, message = "Rollback network request has been accepted (async only)"), - @ApiResponse(code = 500, message = "Rollback network failed, examine entity object for details")}) - public Response rollbackNetwork( - @ApiParam(value = "RollbackNetworkRequest in JSON format", required = true) RollbackNetworkRequest req) { - logger.debug("rollbackNetwork enter: {}", req.toJsonString()); - RollbackNetworkTask task = new RollbackNetworkTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception in rollbackNetwork ", MessageEnum.RA_ROLLBACK_NULL, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("rollbackNetwork exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class RollbackNetworkTask implements Runnable { - private final RollbackNetworkRequest req; - private RollbackNetworkResponse response = null; - private RollbackNetworkError eresp = null; - private boolean sendxml; - - public RollbackNetworkTask(RollbackNetworkRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<RollbackNetworkResponse>(response) {} - : new GenericEntity<RollbackNetworkError>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getNetworkRollback().getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("RollbackNetworkTask start"); - try { - NetworkRollback nwr = req.getNetworkRollback(); - adapter.rollbackNetwork(nwr); - response = new RollbackNetworkResponse(true, req.getMessageId()); - } catch (NetworkException e) { - logger.debug(exceptionMsg, e); - eresp = new RollbackNetworkError(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("RollbackNetworkTask exit: code={}, resp={}", getStatusCode(), getResponse()); - } - } - - @PUT - @Path("{aaiNetworkId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "UpdateNetwork", response = Response.class, notes = "Update an existing network") - @ApiResponses({@ApiResponse(code = 200, message = "Update network successful"), - @ApiResponse(code = 202, message = "Update network request has been accepted (async only)"), - @ApiResponse(code = 500, message = "Update network failed, examine entity object for details")}) - public Response updateNetwork( - @ApiParam(value = "aaiNetworkId", required = true) @PathParam("aaiNetworkId") String aaiNetworkId, - @ApiParam(value = "UpdateNetworkRequest in JSON format", required = true) UpdateNetworkRequest req) { - logger.debug("updateNetwork enter: {}", req.toJsonString()); - if (aaiNetworkId == null || !aaiNetworkId.equals(req.getNetworkId())) { - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN).entity( - "A&AI NetworkId in URL (" + aaiNetworkId + ") does not match content (" + req.getNetworkId() + ")") - .build(); - } - UpdateNetworkTask task = new UpdateNetworkTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception in updateNetwork ", MessageEnum.RA_UPDATE_NETWORK_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("updateNetwork exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class UpdateNetworkTask implements Runnable { - private final UpdateNetworkRequest req; - private UpdateNetworkResponse response = null; - private UpdateNetworkError eresp = null; - private boolean sendxml; - - public UpdateNetworkTask(UpdateNetworkRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<UpdateNetworkResponse>(response) {} - : new GenericEntity<UpdateNetworkError>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("UpdateNetworkTask start"); - try { - Holder<Map<String, String>> subnetIdMap = new Holder<>(); - Holder<NetworkRollback> rollback = new Holder<>(); - HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams(); - if (params == null) { - params = new HashMap<String, String>(); - } - String shared = null; - String external = null; - - if (req.getCloudSiteId().equals(TESTING_KEYWORD)) { - subnetIdMap.value = testMap(); - NetworkRollback rb = new NetworkRollback(); - rb.setCloudId(req.getCloudSiteId()); - rb.setTenantId(req.getTenantId()); - rb.setMsoRequest(req.getMsoRequest()); - rollback.value = rb; - } else if (req.isContrailRequest()) { - ContrailNetwork ctn = req.getContrailNetwork(); - if (ctn == null) { - ctn = new ContrailNetwork(); - req.setContrailNetwork(ctn); - } - if (params.containsKey(SHARED)) { - shared = params.get(SHARED); - } else { - if (ctn.getShared() != null) { - shared = ctn.getShared(); - } - } - if (params.containsKey(EXTERNAL)) { - external = params.get(EXTERNAL); - } else { - if (ctn.getExternal() != null) { - external = ctn.getExternal(); - } - } - adapter.updateNetworkContrail(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), - req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), - req.getContrailNetwork().getRouteTargets(), shared, external, req.getSubnets(), params, - req.getContrailNetwork().getPolicyFqdns(), req.getContrailNetwork().getRouteTableFqdns(), - req.getMsoRequest(), subnetIdMap, rollback); - } else { - ProviderVlanNetwork pvn = req.getProviderVlanNetwork(); - if (pvn == null) { - pvn = new ProviderVlanNetwork(); - req.setProviderVlanNetwork(pvn); - } - if (params.containsKey(SHARED)) { - shared = params.get(SHARED); - } - if (params.containsKey(EXTERNAL)) { - external = params.get(EXTERNAL); - } - adapter.updateNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), - req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), - req.getProviderVlanNetwork().getPhysicalNetworkName(), - req.getProviderVlanNetwork().getVlans(), shared, external, req.getSubnets(), params, - req.getMsoRequest(), subnetIdMap, rollback); - } - response = new UpdateNetworkResponse(req.getNetworkId(), null, // NeutronNetworkId is not available from - // an update - subnetIdMap.value, req.getMessageId()); - } catch (NetworkException e) { - logger.debug(exceptionMsg, e); - eresp = new UpdateNetworkError(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("UpdateNetworkTask exit: code={}, resp={}", getStatusCode(), getResponse()); - } - } - - public static Map<String, String> testMap() { - Map<String, String> m = new HashMap<>(); - m.put("mickey", "7"); - m.put("clyde", "10"); - m.put("wayne", "99"); - return m; - } -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/CreateNetworkNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/CreateNetworkNotification.java deleted file mode 100644 index f30ccf2214..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/CreateNetworkNotification.java +++ /dev/null @@ -1,394 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for createNetworkNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="createNetworkNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/networkNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="networkId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="neutronNetworkId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="subnetIdMap" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * <element name="rollback" type="{http://org.onap.so/networkNotify}networkRollback" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "createNetworkNotification", propOrder = {"messageId", "completed", "exception", "errorMessage", - "networkId", "neutronNetworkId", "subnetIdMap", "rollback"}) -public class CreateNetworkNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - protected String networkId; - protected String neutronNetworkId; - protected CreateNetworkNotification.SubnetIdMap subnetIdMap; - protected NetworkRollback rollback; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - - /** - * Gets the value of the networkId property. - * - * @return possible object is {@link String } - * - */ - public String getNetworkId() { - return networkId; - } - - /** - * Sets the value of the networkId property. - * - * @param value allowed object is {@link String } - * - */ - public void setNetworkId(String value) { - this.networkId = value; - } - - /** - * Gets the value of the neutronNetworkId property. - * - * @return possible object is {@link String } - * - */ - public String getNeutronNetworkId() { - return neutronNetworkId; - } - - /** - * Sets the value of the neutronNetworkId property. - * - * @param value allowed object is {@link String } - * - */ - public void setNeutronNetworkId(String value) { - this.neutronNetworkId = value; - } - - /** - * Gets the value of the subnetIdMap property. - * - * @return possible object is {@link CreateNetworkNotification.SubnetIdMap } - * - */ - public CreateNetworkNotification.SubnetIdMap getSubnetIdMap() { - return subnetIdMap; - } - - /** - * Sets the value of the subnetIdMap property. - * - * @param value allowed object is {@link CreateNetworkNotification.SubnetIdMap } - * - */ - public void setSubnetIdMap(CreateNetworkNotification.SubnetIdMap value) { - this.subnetIdMap = value; - } - - /** - * Gets the value of the rollback property. - * - * @return possible object is {@link NetworkRollback } - * - */ - public NetworkRollback getRollback() { - return rollback; - } - - /** - * Sets the value of the rollback property. - * - * @param value allowed object is {@link NetworkRollback } - * - */ - public void setRollback(NetworkRollback value) { - this.rollback = value; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"entry"}) - public static class SubnetIdMap { - - protected List<CreateNetworkNotification.SubnetIdMap.Entry> entry; - - /** - * Gets the value of the entry property. - * - * <p> - * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you - * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> - * method for the entry property. - * - * <p> - * For example, to add a new item, do as follows: - * - * <pre> - * getEntry().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list {@link CreateNetworkNotification.SubnetIdMap.Entry } - * - * - */ - public List<CreateNetworkNotification.SubnetIdMap.Entry> getEntry() { - if (entry == null) { - entry = new ArrayList<>(); - } - return this.entry; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"key", "value"}) - public static class Entry { - - protected String key; - protected String value; - - /** - * Gets the value of the key property. - * - * @return possible object is {@link String } - * - */ - public String getKey() { - return key; - } - - /** - * Sets the value of the key property. - * - * @param value allowed object is {@link String } - * - */ - public void setKey(String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - } - - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/CreateNetworkNotificationResponse.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/CreateNetworkNotificationResponse.java deleted file mode 100644 index 4ade875193..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/CreateNetworkNotificationResponse.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for createNetworkNotificationResponse complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="createNetworkNotificationResponse"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "createNetworkNotificationResponse") -public class CreateNetworkNotificationResponse { - - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/DeleteNetworkNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/DeleteNetworkNotification.java deleted file mode 100644 index ff94be9156..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/DeleteNetworkNotification.java +++ /dev/null @@ -1,162 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for deleteNetworkNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="deleteNetworkNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/networkNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="networkDeleted" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteNetworkNotification", - propOrder = {"messageId", "completed", "exception", "errorMessage", "networkDeleted"}) -public class DeleteNetworkNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - protected Boolean networkDeleted; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - - /** - * Gets the value of the networkDeleted property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isNetworkDeleted() { - return networkDeleted; - } - - /** - * Sets the value of the networkDeleted property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setNetworkDeleted(Boolean value) { - this.networkDeleted = value; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/MsoExceptionCategory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/MsoExceptionCategory.java deleted file mode 100644 index ad3c541730..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/MsoExceptionCategory.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for msoExceptionCategory. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * <p> - * - * <pre> - * <simpleType name="msoExceptionCategory"> - * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> - * <enumeration value="OPENSTACK"/> - * <enumeration value="IO"/> - * <enumeration value="INTERNAL"/> - * <enumeration value="USERDATA"/> - * </restriction> - * </simpleType> - * </pre> - * - */ -@XmlType(name = "msoExceptionCategory") -@XmlEnum -public enum MsoExceptionCategory { - - OPENSTACK, IO, INTERNAL, USERDATA; - - public String value() { - return name(); - } - - public static MsoExceptionCategory fromValue(String v) { - return valueOf(v); - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/MsoRequest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/MsoRequest.java deleted file mode 100644 index 90ae448660..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/MsoRequest.java +++ /dev/null @@ -1,97 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for msoRequest complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="msoRequest"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="requestId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="serviceInstanceId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "msoRequest", propOrder = {"requestId", "serviceInstanceId"}) -public class MsoRequest { - - protected String requestId; - protected String serviceInstanceId; - - /** - * Gets the value of the requestId property. - * - * @return possible object is {@link String } - * - */ - public String getRequestId() { - return requestId; - } - - /** - * Sets the value of the requestId property. - * - * @param value allowed object is {@link String } - * - */ - public void setRequestId(String value) { - this.requestId = value; - } - - /** - * Gets the value of the serviceInstanceId property. - * - * @return possible object is {@link String } - * - */ - public String getServiceInstanceId() { - return serviceInstanceId; - } - - /** - * Sets the value of the serviceInstanceId property. - * - * @param value allowed object is {@link String } - * - */ - public void setServiceInstanceId(String value) { - this.serviceInstanceId = value; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkAdapterNotify.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkAdapterNotify.java deleted file mode 100644 index 8fb62cc32e..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkAdapterNotify.java +++ /dev/null @@ -1,170 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import java.util.List; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.ws.Action; -import javax.xml.ws.RequestWrapper; -import javax.xml.ws.ResponseWrapper; - - -/** - * This class was generated by the JAX-WS RI. JAX-WS RI 2.2.9-b14002 Generated source version: 2.2 - * - */ -@WebService(name = "networkAdapterNotify", targetNamespace = "http://org.onap.so/networkNotify") -@XmlSeeAlso({ObjectFactory.class}) -public interface NetworkAdapterNotify { - - - /** - * - * @param exception - * @param errorMessage - * @param messageId - * @param completed - */ - @WebMethod - @RequestWrapper(localName = "rollbackNetworkNotification", targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.RollbackNetworkNotification") - @ResponseWrapper(localName = "rollbackNetworkNotificationResponse", - targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.RollbackNetworkNotificationResponse") - @Action(input = "http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationRequest", - output = "http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationResponse") - public void rollbackNetworkNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage); - - /** - * - * @param exception - * @param vlans - * @param networkExists - * @param errorMessage - * @param messageId - * @param networkId - * @param completed - * @param neutronNetworkId - * @param status - * @param subnetIdMap - */ - @WebMethod - @RequestWrapper(localName = "queryNetworkNotification", targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.QueryNetworkNotification") - @ResponseWrapper(localName = "queryNetworkNotificationResponse", - targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.QueryNetworkNotificationResponse") - @Action(input = "http://org.onap.so/notify/adapterNotify/queryNetworkNotificationRequest", - output = "http://org.onap.so/notify/adapterNotify/queryNetworkNotificationResponse") - public void queryNetworkNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage, - @WebParam(name = "networkExists", targetNamespace = "") Boolean networkExists, - @WebParam(name = "networkId", targetNamespace = "") String networkId, - @WebParam(name = "neutronNetworkId", targetNamespace = "") String neutronNetworkId, - @WebParam(name = "status", targetNamespace = "") NetworkStatus status, - @WebParam(name = "vlans", targetNamespace = "") List<Integer> vlans, @WebParam(name = "subnetIdMap", - targetNamespace = "") org.onap.so.adapters.network.async.client.QueryNetworkNotification.SubnetIdMap subnetIdMap); - - /** - * - * @param exception - * @param rollback - * @param errorMessage - * @param messageId - * @param networkId - * @param completed - * @param neutronNetworkId - * @param subnetIdMap - */ - @WebMethod - @RequestWrapper(localName = "createNetworkNotification", targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.CreateNetworkNotification") - @ResponseWrapper(localName = "createNetworkNotificationResponse", - targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.CreateNetworkNotificationResponse") - @Action(input = "http://org.onap.so/notify/adapterNotify/createNetworkNotificationRequest", - output = "http://org.onap.so/notify/adapterNotify/createNetworkNotificationResponse") - public void createNetworkNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage, - @WebParam(name = "networkId", targetNamespace = "") String networkId, - @WebParam(name = "neutronNetworkId", targetNamespace = "") String neutronNetworkId, - @WebParam(name = "subnetIdMap", - targetNamespace = "") org.onap.so.adapters.network.async.client.CreateNetworkNotification.SubnetIdMap subnetIdMap, - @WebParam(name = "rollback", targetNamespace = "") NetworkRollback rollback); - - /** - * - * @param exception - * @param networkDeleted - * @param errorMessage - * @param messageId - * @param completed - */ - @WebMethod - @RequestWrapper(localName = "deleteNetworkNotification", targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.DeleteNetworkNotification") - @ResponseWrapper(localName = "deleteNetworkNotificationResponse", - targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.DeleteNetworkNotificationResponse") - @Action(input = "http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationRequest", - output = "http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationResponse") - public void deleteNetworkNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage, - @WebParam(name = "networkDeleted", targetNamespace = "") Boolean networkDeleted); - - /** - * - * @param exception - * @param rollback - * @param errorMessage - * @param messageId - * @param completed - * @param subnetIdMap - */ - @WebMethod - @RequestWrapper(localName = "updateNetworkNotification", targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.UpdateNetworkNotification") - @ResponseWrapper(localName = "updateNetworkNotificationResponse", - targetNamespace = "http://org.onap.so/networkNotify", - className = "org.onap.so.adapters.network.async.client.UpdateNetworkNotificationResponse") - @Action(input = "http://org.onap.so/notify/adapterNotify/updateNetworkNotificationRequest", - output = "http://org.onap.so/notify/adapterNotify/updateNetworkNotificationResponse") - public void updateNetworkNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage, - @WebParam(name = "subnetIdMap", - targetNamespace = "") org.onap.so.adapters.network.async.client.UpdateNetworkNotification.SubnetIdMap subnetIdMap, - @WebParam(name = "rollback", targetNamespace = "") NetworkRollback rollback); - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkAdapterNotify_Service.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkAdapterNotify_Service.java deleted file mode 100644 index 68142e6cc9..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkAdapterNotify_Service.java +++ /dev/null @@ -1,110 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import java.net.URL; -import javax.xml.namespace.QName; -import javax.xml.ws.Service; -import javax.xml.ws.WebEndpoint; -import javax.xml.ws.WebServiceClient; -import javax.xml.ws.WebServiceException; -import javax.xml.ws.WebServiceFeature; - - -/** - * This class was generated by the JAX-WS RI. JAX-WS RI 2.2.9-b14002 Generated source version: 2.2 - * - */ -@WebServiceClient(name = "networkAdapterNotify", targetNamespace = "http://org.onap.so/networkNotify", - wsdlLocation = "/NetworkAdapterNotify.wsdl") -public class NetworkAdapterNotify_Service extends Service { - - private static final URL NETWORKADAPTERNOTIFY_WSDL_LOCATION; - private static final WebServiceException NETWORKADAPTERNOTIFY_EXCEPTION; - private static final String URL = "http://org.onap.so/networkNotify"; - private static final QName NETWORKADAPTERNOTIFY_QNAME = new QName(URL, "networkAdapterNotify"); - - static { - NETWORKADAPTERNOTIFY_WSDL_LOCATION = - org.onap.so.adapters.network.async.client.NetworkAdapterNotify_Service.class - .getResource("/NetworkAdapterNotify.wsdl"); - WebServiceException e = null; - if (NETWORKADAPTERNOTIFY_WSDL_LOCATION == null) { - e = new WebServiceException( - "Cannot find '/NetworkAdapterNotify.wsdl' wsdl. Place the resource correctly in the classpath."); - } - NETWORKADAPTERNOTIFY_EXCEPTION = e; - } - - public NetworkAdapterNotify_Service() { - super(getWsdlLocation(), NETWORKADAPTERNOTIFY_QNAME); - } - - public NetworkAdapterNotify_Service(WebServiceFeature... features) { - super(getWsdlLocation(), NETWORKADAPTERNOTIFY_QNAME, features); - } - - public NetworkAdapterNotify_Service(URL wsdlLocation) { - super(wsdlLocation, NETWORKADAPTERNOTIFY_QNAME); - } - - public NetworkAdapterNotify_Service(URL wsdlLocation, WebServiceFeature... features) { - super(wsdlLocation, NETWORKADAPTERNOTIFY_QNAME, features); - } - - public NetworkAdapterNotify_Service(URL wsdlLocation, QName serviceName) { - super(wsdlLocation, serviceName); - } - - public NetworkAdapterNotify_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { - super(wsdlLocation, serviceName, features); - } - - /** - * - * @return returns NetworkAdapterNotify - */ - @WebEndpoint(name = "MsoNetworkAdapterAsyncImplPort") - public NetworkAdapterNotify getMsoNetworkAdapterAsyncImplPort() { - return super.getPort(new QName(URL, "MsoNetworkAdapterAsyncImplPort"), NetworkAdapterNotify.class); - } - - /** - * - * @param features A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features - * not in the <code>features</code> parameter will have their default values. - * @return returns NetworkAdapterNotify - */ - @WebEndpoint(name = "MsoNetworkAdapterAsyncImplPort") - public NetworkAdapterNotify getMsoNetworkAdapterAsyncImplPort(WebServiceFeature... features) { - return super.getPort(new QName(URL, "MsoNetworkAdapterAsyncImplPort"), NetworkAdapterNotify.class, features); - } - - private static URL getWsdlLocation() { - if (NETWORKADAPTERNOTIFY_EXCEPTION != null) { - throw NETWORKADAPTERNOTIFY_EXCEPTION; - } - return NETWORKADAPTERNOTIFY_WSDL_LOCATION; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkRollback.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkRollback.java deleted file mode 100644 index c51a21d5f0..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkRollback.java +++ /dev/null @@ -1,325 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for networkRollback complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="networkRollback"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="cloudId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="msoRequest" type="{http://org.onap.so/networkNotify}msoRequest" minOccurs="0"/> - * <element name="networkCreated" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="networkId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="networkStackId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="networkName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="networkType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="networkUpdated" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="neutronNetworkId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="physicalNetwork" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="tenantId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="vlans" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "networkRollback", - propOrder = {"cloudId", "msoRequest", "networkCreated", "networkId", "networkStackId", "networkName", - "networkType", "networkUpdated", "neutronNetworkId", "physicalNetwork", "tenantId", "vlans"}) -public class NetworkRollback { - - protected String cloudId; - protected MsoRequest msoRequest; - protected boolean networkCreated; - protected String networkId; - protected String networkStackId; - protected String networkName; - protected String networkType; - protected boolean networkUpdated; - protected String neutronNetworkId; - protected String physicalNetwork; - protected String tenantId; - @XmlElement(nillable = true) - protected List<Integer> vlans; - - /** - * Gets the value of the cloudId property. - * - * @return possible object is {@link String } - * - */ - public String getCloudId() { - return cloudId; - } - - /** - * Sets the value of the cloudId property. - * - * @param value allowed object is {@link String } - * - */ - public void setCloudId(String value) { - this.cloudId = value; - } - - /** - * Gets the value of the msoRequest property. - * - * @return possible object is {@link MsoRequest } - * - */ - public MsoRequest getMsoRequest() { - return msoRequest; - } - - /** - * Sets the value of the msoRequest property. - * - * @param value allowed object is {@link MsoRequest } - * - */ - public void setMsoRequest(MsoRequest value) { - this.msoRequest = value; - } - - /** - * Gets the value of the networkCreated property. - * - */ - public boolean isNetworkCreated() { - return networkCreated; - } - - /** - * Sets the value of the networkCreated property. - * - */ - public void setNetworkCreated(boolean value) { - this.networkCreated = value; - } - - /** - * Gets the value of the networkId property. - * - * @return possible object is {@link String } - * - */ - public String getNetworkId() { - return networkId; - } - - /** - * Sets the value of the networkId property. - * - * @param value allowed object is {@link String } - * - */ - public void setNetworkId(String value) { - this.networkId = value; - } - - /** - * Gets the value of the networkStackId property. - * - * @return possible object is {@link String } - * - */ - public String getNetworkStackId() { - return networkStackId; - } - - /** - * Sets the value of the networkStackId property. - * - * @param value allowed object is {@link String } - * - */ - public void setNetworkStackId(String value) { - this.networkStackId = value; - } - - /** - * Gets the value of the networkName property. - * - * @return possible object is {@link String } - * - */ - public String getNetworkName() { - return networkName; - } - - /** - * Sets the value of the networkName property. - * - * @param value allowed object is {@link String } - * - */ - public void setNetworkName(String value) { - this.networkName = value; - } - - /** - * Gets the value of the networkType property. - * - * @return possible object is {@link String } - * - */ - public String getNetworkType() { - return networkType; - } - - /** - * Sets the value of the networkType property. - * - * @param value allowed object is {@link String } - * - */ - public void setNetworkType(String value) { - this.networkType = value; - } - - /** - * Gets the value of the networkUpdated property. - * - */ - public boolean isNetworkUpdated() { - return networkUpdated; - } - - /** - * Sets the value of the networkUpdated property. - * - */ - public void setNetworkUpdated(boolean value) { - this.networkUpdated = value; - } - - /** - * Gets the value of the neutronNetworkId property. - * - * @return possible object is {@link String } - * - */ - public String getNeutronNetworkId() { - return neutronNetworkId; - } - - /** - * Sets the value of the neutronNetworkId property. - * - * @param value allowed object is {@link String } - * - */ - public void setNeutronNetworkId(String value) { - this.neutronNetworkId = value; - } - - /** - * Gets the value of the physicalNetwork property. - * - * @return possible object is {@link String } - * - */ - public String getPhysicalNetwork() { - return physicalNetwork; - } - - /** - * Sets the value of the physicalNetwork property. - * - * @param value allowed object is {@link String } - * - */ - public void setPhysicalNetwork(String value) { - this.physicalNetwork = value; - } - - /** - * Gets the value of the tenantId property. - * - * @return possible object is {@link String } - * - */ - public String getTenantId() { - return tenantId; - } - - /** - * Sets the value of the tenantId property. - * - * @param value allowed object is {@link String } - * - */ - public void setTenantId(String value) { - this.tenantId = value; - } - - /** - * Gets the value of the vlans property. - * - * <p> - * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to - * the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for - * the vlans property. - * - * <p> - * For example, to add a new item, do as follows: - * - * <pre> - * getVlans().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list {@link Integer } - * - * - */ - public List<Integer> getVlans() { - if (vlans == null) { - vlans = new ArrayList<>(); - } - return this.vlans; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkStatus.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkStatus.java deleted file mode 100644 index 36641477c0..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/NetworkStatus.java +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for networkStatus. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * <p> - * - * <pre> - * <simpleType name="networkStatus"> - * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> - * <enumeration value="NOTFOUND"/> - * <enumeration value="ACTIVE"/> - * <enumeration value="DOWN"/> - * <enumeration value="BUILD"/> - * <enumeration value="ERROR"/> - * <enumeration value="UNKNOWN"/> - * </restriction> - * </simpleType> - * </pre> - * - */ -@XmlType(name = "networkStatus") -@XmlEnum -public enum NetworkStatus { - - NOTFOUND, ACTIVE, DOWN, BUILD, ERROR, UNKNOWN; - - public String value() { - return name(); - } - - public static NetworkStatus fromValue(String v) { - return valueOf(v); - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/ObjectFactory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/ObjectFactory.java deleted file mode 100644 index a7a2974660..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/ObjectFactory.java +++ /dev/null @@ -1,311 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each Java content interface and Java element interface generated in the - * org.onap.so.adapters.network.async.client package. - * <p> - * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. - * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding - * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in - * this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private static final String URL = "http://org.onap.so/networkNotify"; - private static final QName _RollbackNetworkNotification_QNAME = new QName(URL, "rollbackNetworkNotification"); - private static final QName _UpdateNetworkNotification_QNAME = new QName(URL, "updateNetworkNotification"); - private static final QName _QueryNetworkNotificationResponse_QNAME = - new QName(URL, "queryNetworkNotificationResponse"); - private static final QName _UpdateNetworkNotificationResponse_QNAME = - new QName(URL, "updateNetworkNotificationResponse"); - private static final QName _CreateNetworkNotificationResponse_QNAME = - new QName(URL, "createNetworkNotificationResponse"); - private static final QName _DeleteNetworkNotification_QNAME = new QName(URL, "deleteNetworkNotification"); - private static final QName _DeleteNetworkNotificationResponse_QNAME = - new QName(URL, "deleteNetworkNotificationResponse"); - private static final QName _CreateNetworkNotification_QNAME = new QName(URL, "createNetworkNotification"); - private static final QName _QueryNetworkNotification_QNAME = new QName(URL, "queryNetworkNotification"); - private static final QName _RollbackNetworkNotificationResponse_QNAME = - new QName(URL, "rollbackNetworkNotificationResponse"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: - * org.onap.so.adapters.network.async.client - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link QueryNetworkNotification } - * - */ - public QueryNetworkNotification createQueryNetworkNotification() { - return new QueryNetworkNotification(); - } - - /** - * Create an instance of {@link QueryNetworkNotification.SubnetIdMap } - * - */ - public QueryNetworkNotification.SubnetIdMap createQueryNetworkNotificationSubnetIdMap() { - return new QueryNetworkNotification.SubnetIdMap(); - } - - /** - * Create an instance of {@link CreateNetworkNotification } - * - */ - public CreateNetworkNotification createCreateNetworkNotification() { - return new CreateNetworkNotification(); - } - - /** - * Create an instance of {@link CreateNetworkNotification.SubnetIdMap } - * - */ - public CreateNetworkNotification.SubnetIdMap createCreateNetworkNotificationSubnetIdMap() { - return new CreateNetworkNotification.SubnetIdMap(); - } - - /** - * Create an instance of {@link UpdateNetworkNotification } - * - */ - public UpdateNetworkNotification createUpdateNetworkNotification() { - return new UpdateNetworkNotification(); - } - - /** - * Create an instance of {@link UpdateNetworkNotification.SubnetIdMap } - * - */ - public UpdateNetworkNotification.SubnetIdMap createUpdateNetworkNotificationSubnetIdMap() { - return new UpdateNetworkNotification.SubnetIdMap(); - } - - /** - * Create an instance of {@link UpdateNetworkNotificationResponse } - * - */ - public UpdateNetworkNotificationResponse createUpdateNetworkNotificationResponse() { - return new UpdateNetworkNotificationResponse(); - } - - /** - * Create an instance of {@link CreateNetworkNotificationResponse } - * - */ - public CreateNetworkNotificationResponse createCreateNetworkNotificationResponse() { - return new CreateNetworkNotificationResponse(); - } - - /** - * Create an instance of {@link RollbackNetworkNotification } - * - */ - public RollbackNetworkNotification createRollbackNetworkNotification() { - return new RollbackNetworkNotification(); - } - - /** - * Create an instance of {@link QueryNetworkNotificationResponse } - * - */ - public QueryNetworkNotificationResponse createQueryNetworkNotificationResponse() { - return new QueryNetworkNotificationResponse(); - } - - /** - * Create an instance of {@link RollbackNetworkNotificationResponse } - * - */ - public RollbackNetworkNotificationResponse createRollbackNetworkNotificationResponse() { - return new RollbackNetworkNotificationResponse(); - } - - /** - * Create an instance of {@link DeleteNetworkNotification } - * - */ - public DeleteNetworkNotification createDeleteNetworkNotification() { - return new DeleteNetworkNotification(); - } - - /** - * Create an instance of {@link DeleteNetworkNotificationResponse } - * - */ - public DeleteNetworkNotificationResponse createDeleteNetworkNotificationResponse() { - return new DeleteNetworkNotificationResponse(); - } - - /** - * Create an instance of {@link NetworkRollback } - * - */ - public NetworkRollback createNetworkRollback() { - return new NetworkRollback(); - } - - /** - * Create an instance of {@link MsoRequest } - * - */ - public MsoRequest createMsoRequest() { - return new MsoRequest(); - } - - /** - * Create an instance of {@link QueryNetworkNotification.SubnetIdMap.Entry } - * - */ - public QueryNetworkNotification.SubnetIdMap.Entry createQueryNetworkNotificationSubnetIdMapEntry() { - return new QueryNetworkNotification.SubnetIdMap.Entry(); - } - - /** - * Create an instance of {@link CreateNetworkNotification.SubnetIdMap.Entry } - * - */ - public CreateNetworkNotification.SubnetIdMap.Entry createCreateNetworkNotificationSubnetIdMapEntry() { - return new CreateNetworkNotification.SubnetIdMap.Entry(); - } - - /** - * Create an instance of {@link UpdateNetworkNotification.SubnetIdMap.Entry } - * - */ - public UpdateNetworkNotification.SubnetIdMap.Entry createUpdateNetworkNotificationSubnetIdMapEntry() { - return new UpdateNetworkNotification.SubnetIdMap.Entry(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link RollbackNetworkNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "rollbackNetworkNotification") - public JAXBElement<RollbackNetworkNotification> createRollbackNetworkNotification( - RollbackNetworkNotification value) { - return new JAXBElement<>(_RollbackNetworkNotification_QNAME, RollbackNetworkNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link UpdateNetworkNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "updateNetworkNotification") - public JAXBElement<UpdateNetworkNotification> createUpdateNetworkNotification(UpdateNetworkNotification value) { - return new JAXBElement<>(_UpdateNetworkNotification_QNAME, UpdateNetworkNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link QueryNetworkNotificationResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "queryNetworkNotificationResponse") - public JAXBElement<QueryNetworkNotificationResponse> createQueryNetworkNotificationResponse( - QueryNetworkNotificationResponse value) { - return new JAXBElement<>(_QueryNetworkNotificationResponse_QNAME, QueryNetworkNotificationResponse.class, null, - value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link UpdateNetworkNotificationResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "updateNetworkNotificationResponse") - public JAXBElement<UpdateNetworkNotificationResponse> createUpdateNetworkNotificationResponse( - UpdateNetworkNotificationResponse value) { - return new JAXBElement<>(_UpdateNetworkNotificationResponse_QNAME, UpdateNetworkNotificationResponse.class, - null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CreateNetworkNotificationResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "createNetworkNotificationResponse") - public JAXBElement<CreateNetworkNotificationResponse> createCreateNetworkNotificationResponse( - CreateNetworkNotificationResponse value) { - return new JAXBElement<>(_CreateNetworkNotificationResponse_QNAME, CreateNetworkNotificationResponse.class, - null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link DeleteNetworkNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "deleteNetworkNotification") - public JAXBElement<DeleteNetworkNotification> createDeleteNetworkNotification(DeleteNetworkNotification value) { - return new JAXBElement<>(_DeleteNetworkNotification_QNAME, DeleteNetworkNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link DeleteNetworkNotificationResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "deleteNetworkNotificationResponse") - public JAXBElement<DeleteNetworkNotificationResponse> createDeleteNetworkNotificationResponse( - DeleteNetworkNotificationResponse value) { - return new JAXBElement<>(_DeleteNetworkNotificationResponse_QNAME, DeleteNetworkNotificationResponse.class, - null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CreateNetworkNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "createNetworkNotification") - public JAXBElement<CreateNetworkNotification> createCreateNetworkNotification(CreateNetworkNotification value) { - return new JAXBElement<>(_CreateNetworkNotification_QNAME, CreateNetworkNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link QueryNetworkNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "queryNetworkNotification") - public JAXBElement<QueryNetworkNotification> createQueryNetworkNotification(QueryNetworkNotification value) { - return new JAXBElement<>(_QueryNetworkNotification_QNAME, QueryNetworkNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link RollbackNetworkNotificationResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "rollbackNetworkNotificationResponse") - public JAXBElement<RollbackNetworkNotificationResponse> createRollbackNetworkNotificationResponse( - RollbackNetworkNotificationResponse value) { - return new JAXBElement<>(_RollbackNetworkNotificationResponse_QNAME, RollbackNetworkNotificationResponse.class, - null, value); - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/QueryNetworkNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/QueryNetworkNotification.java deleted file mode 100644 index d9adbf2ad2..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/QueryNetworkNotification.java +++ /dev/null @@ -1,447 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for queryNetworkNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="queryNetworkNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/networkNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="networkExists" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> - * <element name="networkId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="neutronNetworkId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="status" type="{http://org.onap.so/networkNotify}networkStatus" minOccurs="0"/> - * <element name="vlans" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/> - * <element name="subnetIdMap" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "queryNetworkNotification", propOrder = {"messageId", "completed", "exception", "errorMessage", - "networkExists", "networkId", "neutronNetworkId", "status", "vlans", "subnetIdMap"}) -public class QueryNetworkNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - protected Boolean networkExists; - protected String networkId; - protected String neutronNetworkId; - protected NetworkStatus status; - @XmlElement(type = Integer.class) - protected List<Integer> vlans; - protected QueryNetworkNotification.SubnetIdMap subnetIdMap; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - - /** - * Gets the value of the networkExists property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isNetworkExists() { - return networkExists; - } - - /** - * Sets the value of the networkExists property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setNetworkExists(Boolean value) { - this.networkExists = value; - } - - /** - * Gets the value of the networkId property. - * - * @return possible object is {@link String } - * - */ - public String getNetworkId() { - return networkId; - } - - /** - * Sets the value of the networkId property. - * - * @param value allowed object is {@link String } - * - */ - public void setNetworkId(String value) { - this.networkId = value; - } - - /** - * Gets the value of the neutronNetworkId property. - * - * @return possible object is {@link String } - * - */ - public String getNeutronNetworkId() { - return neutronNetworkId; - } - - /** - * Sets the value of the neutronNetworkId property. - * - * @param value allowed object is {@link String } - * - */ - public void setNeutronNetworkId(String value) { - this.neutronNetworkId = value; - } - - /** - * Gets the value of the status property. - * - * @return possible object is {@link NetworkStatus } - * - */ - public NetworkStatus getStatus() { - return status; - } - - /** - * Sets the value of the status property. - * - * @param value allowed object is {@link NetworkStatus } - * - */ - public void setStatus(NetworkStatus value) { - this.status = value; - } - - /** - * Gets the value of the vlans property. - * - * <p> - * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to - * the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for - * the vlans property. - * - * <p> - * For example, to add a new item, do as follows: - * - * <pre> - * getVlans().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list {@link Integer } - * - * - */ - public List<Integer> getVlans() { - if (vlans == null) { - vlans = new ArrayList<>(); - } - return this.vlans; - } - - /** - * Gets the value of the subnetIdMap property. - * - * @return possible object is {@link QueryNetworkNotification.SubnetIdMap } - * - */ - public QueryNetworkNotification.SubnetIdMap getSubnetIdMap() { - return subnetIdMap; - } - - /** - * Sets the value of the subnetIdMap property. - * - * @param value allowed object is {@link QueryNetworkNotification.SubnetIdMap } - * - */ - public void setSubnetIdMap(QueryNetworkNotification.SubnetIdMap value) { - this.subnetIdMap = value; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"entry"}) - public static class SubnetIdMap { - - protected List<QueryNetworkNotification.SubnetIdMap.Entry> entry; - - /** - * Gets the value of the entry property. - * - * <p> - * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you - * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> - * method for the entry property. - * - * <p> - * For example, to add a new item, do as follows: - * - * <pre> - * getEntry().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list {@link QueryNetworkNotification.SubnetIdMap.Entry } - * - * - */ - public List<QueryNetworkNotification.SubnetIdMap.Entry> getEntry() { - if (entry == null) { - entry = new ArrayList<>(); - } - return this.entry; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"key", "value"}) - public static class Entry { - - protected String key; - protected String value; - - /** - * Gets the value of the key property. - * - * @return possible object is {@link String } - * - */ - public String getKey() { - return key; - } - - /** - * Sets the value of the key property. - * - * @param value allowed object is {@link String } - * - */ - public void setKey(String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - } - - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/RollbackNetworkNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/RollbackNetworkNotification.java deleted file mode 100644 index 7b5d0f0f2a..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/RollbackNetworkNotification.java +++ /dev/null @@ -1,139 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for rollbackNetworkNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="rollbackNetworkNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/networkNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "rollbackNetworkNotification", propOrder = {"messageId", "completed", "exception", "errorMessage"}) -public class RollbackNetworkNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/RollbackNetworkNotificationResponse.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/RollbackNetworkNotificationResponse.java deleted file mode 100644 index 7ddc8d75de..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/RollbackNetworkNotificationResponse.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for rollbackNetworkNotificationResponse complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="rollbackNetworkNotificationResponse"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "rollbackNetworkNotificationResponse") -public class RollbackNetworkNotificationResponse { - - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/UpdateNetworkNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/UpdateNetworkNotification.java deleted file mode 100644 index 1a464d3250..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/UpdateNetworkNotification.java +++ /dev/null @@ -1,350 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for updateNetworkNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="updateNetworkNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/networkNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="subnetIdMap" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * <element name="rollback" type="{http://org.onap.so/networkNotify}networkRollback" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "updateNetworkNotification", - propOrder = {"messageId", "completed", "exception", "errorMessage", "subnetIdMap", "rollback"}) -public class UpdateNetworkNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - protected UpdateNetworkNotification.SubnetIdMap subnetIdMap; - protected NetworkRollback rollback; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - - /** - * Gets the value of the subnetIdMap property. - * - * @return possible object is {@link UpdateNetworkNotification.SubnetIdMap } - * - */ - public UpdateNetworkNotification.SubnetIdMap getSubnetIdMap() { - return subnetIdMap; - } - - /** - * Sets the value of the subnetIdMap property. - * - * @param value allowed object is {@link UpdateNetworkNotification.SubnetIdMap } - * - */ - public void setSubnetIdMap(UpdateNetworkNotification.SubnetIdMap value) { - this.subnetIdMap = value; - } - - /** - * Gets the value of the rollback property. - * - * @return possible object is {@link NetworkRollback } - * - */ - public NetworkRollback getRollback() { - return rollback; - } - - /** - * Sets the value of the rollback property. - * - * @param value allowed object is {@link NetworkRollback } - * - */ - public void setRollback(NetworkRollback value) { - this.rollback = value; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"entry"}) - public static class SubnetIdMap { - - protected List<UpdateNetworkNotification.SubnetIdMap.Entry> entry; - - /** - * Gets the value of the entry property. - * - * <p> - * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you - * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> - * method for the entry property. - * - * <p> - * For example, to add a new item, do as follows: - * - * <pre> - * getEntry().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list {@link UpdateNetworkNotification.SubnetIdMap.Entry } - * - * - */ - public List<UpdateNetworkNotification.SubnetIdMap.Entry> getEntry() { - if (entry == null) { - entry = new ArrayList<>(); - } - return this.entry; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"key", "value"}) - public static class Entry { - - protected String key; - protected String value; - - /** - * Gets the value of the key property. - * - * @return possible object is {@link String } - * - */ - public String getKey() { - return key; - } - - /** - * Sets the value of the key property. - * - * @param value allowed object is {@link String } - * - */ - public void setKey(String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - } - - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/UpdateNetworkNotificationResponse.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/UpdateNetworkNotificationResponse.java deleted file mode 100644 index 0ffcb5e9e6..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/UpdateNetworkNotificationResponse.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for updateNetworkNotificationResponse complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="updateNetworkNotificationResponse"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "updateNetworkNotificationResponse") -public class UpdateNetworkNotificationResponse { - - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java index 9badd795eb..a7bca73fdd 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java @@ -33,18 +33,11 @@ import org.apache.cxf.jaxrs.swagger.Swagger2Feature; import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.transport.servlet.CXFServlet; import org.onap.so.adapters.cloudregion.CloudRegionRestV1; -import org.onap.so.adapters.network.MsoNetworkAdapterAsyncImpl; import org.onap.so.adapters.network.MsoNetworkAdapterImpl; -import org.onap.so.adapters.network.NetworkAdapterRest; import org.onap.so.adapters.tenant.MsoTenantAdapterImpl; import org.onap.so.adapters.tenant.TenantAdapterRest; import org.onap.so.adapters.vnf.MsoVnfAdapterAsyncImpl; import org.onap.so.adapters.vnf.MsoVnfAdapterImpl; -import org.onap.so.adapters.vnf.MsoVnfCloudifyAdapterImpl; -import org.onap.so.adapters.vnf.VnfAdapterRest; -import org.onap.so.adapters.vnf.VnfAdapterRestV2; -import org.onap.so.adapters.vnf.VolumeAdapterRest; -import org.onap.so.adapters.vnf.VolumeAdapterRestV2; import org.onap.so.client.policy.JettisonStyleMapperProvider; import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor; import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor; @@ -60,30 +53,16 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; @Configuration public class CXFConfiguration { @Autowired - private NetworkAdapterRest networkAdapterRest; - @Autowired private TenantAdapterRest tenantAdapterRest; @Autowired - private VnfAdapterRest vnfAdapterRest; - @Autowired - private VnfAdapterRestV2 vnfAdapterRestV2; - @Autowired - private VolumeAdapterRest volumeAdapterRest; - @Autowired - private VolumeAdapterRestV2 volumeAdapterRestV2; - @Autowired private MsoNetworkAdapterImpl networkAdapterImpl; @Autowired - private MsoNetworkAdapterAsyncImpl networkAdapterAsyncImpl; - @Autowired private MsoTenantAdapterImpl tenantAdapterImpl; @Autowired private MsoVnfAdapterImpl vnfAdapterImpl; @Autowired private MsoVnfAdapterAsyncImpl vnfAdapterAsyncImpl; @Autowired - private MsoVnfCloudifyAdapterImpl vnfCloudifyAdapterImpl; - @Autowired private CloudRegionRestV1 cloudRegionRestV1; @Autowired private JettisonStyleMapperProvider jettisonStyleObjectMapper; @@ -119,17 +98,6 @@ public class CXFConfiguration { return endpoint; } - @Bean - public Endpoint networkAdapterAsyncEndpoint() { - EndpointImpl endpoint = new EndpointImpl(springBus(), networkAdapterAsyncImpl); - endpoint.publish("/NetworkAdapterAsync"); - endpoint.setWsdlLocation("NetworkAdapterAsync.wsdl"); - endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor()); - endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor()); - endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor()); - return endpoint; - } - /* * tenant adapter endpoint */ @@ -169,24 +137,12 @@ public class CXFConfiguration { return endpoint; } - @Bean - public Endpoint vnfCloudAdapterEndpoint() { - EndpointImpl endpoint = new EndpointImpl(springBus(), vnfCloudifyAdapterImpl); - endpoint.publish("/VnfCloudifyAdapterImpl"); - endpoint.setWsdlLocation("VnfCloudifyAdapterImpl.wsdl"); - endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor()); - endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor()); - endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor()); - return endpoint; - } - // Uses Jettson Style marshalling semantics @Bean public Server rsServer() { JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean(); endpoint.setBus(springBus()); - endpoint.setServiceBeans(Arrays.<Object>asList(networkAdapterRest, tenantAdapterRest, vnfAdapterRest, - vnfAdapterRestV2, volumeAdapterRest, volumeAdapterRestV2)); + endpoint.setServiceBeans(Arrays.<Object>asList(tenantAdapterRest)); endpoint.setAddress("/rest"); endpoint.setFeatures(Arrays.asList(createSwaggerFeature(), new LoggingFeature())); endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(jettisonStyleObjectMapper.getMapper()), diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java index 874823a7cd..182ae11166 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java @@ -32,7 +32,6 @@ import org.onap.so.audit.beans.AuditInventory; import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider; import org.onap.so.logging.tasks.AuditMDCSetup; import org.onap.so.objects.audit.AAIObjectAuditList; -import org.onap.so.utils.RetrySequenceLevel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java index 6e181c4696..9ff50e8644 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java @@ -33,10 +33,13 @@ import javax.xml.parsers.DocumentBuilderFactory; import org.apache.commons.lang3.mutable.MutableBoolean; import org.camunda.bpm.client.task.ExternalTask; import org.camunda.bpm.client.task.ExternalTaskService; +import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest; import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; +import org.onap.so.adapters.nwrest.DeleteNetworkRequest; +import org.onap.so.adapters.nwrest.UpdateNetworkRequest; import org.onap.so.logging.tasks.AuditMDCSetup; import org.onap.so.openstack.exceptions.MsoException; import org.onap.so.openstack.utils.MsoHeatUtils; @@ -70,7 +73,7 @@ public class PollService extends ExternalTaskUtils { MutableBoolean success = new MutableBoolean(); String errorMessage = null; try { - String xmlRequest = externalTask.getVariable("vnfAdapterTaskRequest"); + String xmlRequest = externalTask.getVariable("openstackAdapterTaskRequest"); if (xmlRequest != null) { Optional<String> requestType = findRequestType(xmlRequest); if ("createVolumeGroupRequest".equals(requestType.get())) { @@ -87,6 +90,15 @@ public class PollService extends ExternalTaskUtils { DeleteVolumeGroupRequest req = JAXB.unmarshal(new StringReader(xmlRequest), DeleteVolumeGroupRequest.class); pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success); + } else if ("createNetworkRequest".equals(requestType.get())) { + determineCreateNetworkStatus(xmlRequest, externalTask, success); + } else if ("deleteNetworkRequest".equals(requestType.get())) { + logger.debug("Executing External Task Poll Service for Delete Network"); + DeleteNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), DeleteNetworkRequest.class); + pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success); + } else if ("updateNetworkRequest".equals(requestType.get())) { + UpdateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), UpdateNetworkRequest.class); + pollUpdateResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success); } } } catch (Exception e) { @@ -143,6 +155,19 @@ public class PollService extends ExternalTaskUtils { } } + private void determineCreateNetworkStatus(String xmlRequest, ExternalTask externalTask, MutableBoolean success) + throws MsoException { + CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class); + boolean pollRollbackStatus = externalTask.getVariable("PollRollbackStatus"); + if (pollRollbackStatus) { + logger.debug("Executing External Task Poll Service for Rollback Create Network"); + pollDeleteResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success); + } else { + logger.debug("Executing External Task Poll Service for Create Network"); + pollCreateResource(req.getCloudSiteId(), req.getTenantId(), externalTask, success); + } + } + private void pollCreateResource(String cloudSiteId, String tenantId, ExternalTask externalTask, MutableBoolean success) throws MsoException { Stack currentStack = createCurrentStack(externalTask.getVariable("stackId")); @@ -163,6 +188,15 @@ public class PollService extends ExternalTaskUtils { success.setTrue(); } + private void pollUpdateResource(String cloudSiteId, String tenantId, ExternalTask externalTask, + MutableBoolean success) throws MsoException { + Stack currentStack = createCurrentStack(externalTask.getVariable("stackId")); + Stack stack = + msoHeatUtils.pollStackForStatus(1, currentStack, "UPDATE_IN_PROGRESS", cloudSiteId, tenantId, false); + msoHeatUtils.postProcessStackUpdate(stack); + success.setTrue(); + } + protected Optional<String> findRequestType(String xmlString) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java index c302293169..15e6ff581d 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java @@ -11,6 +11,8 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.ws.Holder; import org.camunda.bpm.client.task.ExternalTask; import org.camunda.bpm.client.task.ExternalTaskService; +import org.onap.so.adapters.network.MsoNetworkAdapterImpl; +import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.vnf.MsoVnfAdapterImpl; import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; @@ -30,6 +32,9 @@ public class RollbackService extends ExternalTaskUtils { private MsoVnfAdapterImpl vnfAdapterImpl; @Autowired + private MsoNetworkAdapterImpl networkAdapterImpl; + + @Autowired private AuditMDCSetup mdcSetup; public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) { @@ -39,7 +44,7 @@ public class RollbackService extends ExternalTaskUtils { boolean success = false; boolean pollRollbackStatus = false; try { - String xmlRequest = externalTask.getVariable("vnfAdapterTaskRequest"); + String xmlRequest = externalTask.getVariable("openstackAdapterTaskRequest"); if (xmlRequest != null) { Optional<String> requestType = findRequestType(xmlRequest); if ("createVolumeGroupRequest".equals(requestType.get())) { @@ -59,6 +64,15 @@ public class RollbackService extends ExternalTaskUtils { req.getMsoRequest(), new Holder<>()); pollRollbackStatus = true; success = true; + } else if ("createNetworkRequest".equals(requestType.get())) { + logger.debug("Executing External Task Rollback Service for Create Network"); + Holder<Boolean> networkDeleted = new Holder<>(); + CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class); + networkAdapterImpl.deleteNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), + req.getModelCustomizationUuid(), req.getNetworkName(), req.getMsoRequest(), networkDeleted, + false); + pollRollbackStatus = true; + success = true; } } } catch (Exception e) { diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java index 34952a056b..6b7ceedbb8 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java @@ -25,6 +25,7 @@ package org.onap.so.adapters.tasks.orchestration; import java.io.ByteArrayInputStream; import java.io.StringReader; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Optional; import javax.xml.bind.JAXB; @@ -34,6 +35,18 @@ import javax.xml.ws.Holder; import org.apache.commons.lang3.mutable.MutableBoolean; import org.camunda.bpm.client.task.ExternalTask; import org.camunda.bpm.client.task.ExternalTaskService; +import org.onap.so.adapters.network.MsoNetworkAdapterImpl; +import org.onap.so.adapters.network.exceptions.NetworkException; +import org.onap.so.adapters.nwrest.ContrailNetwork; +import org.onap.so.adapters.nwrest.CreateNetworkRequest; +import org.onap.so.adapters.nwrest.CreateNetworkResponse; +import org.onap.so.adapters.nwrest.DeleteNetworkRequest; +import org.onap.so.adapters.nwrest.DeleteNetworkResponse; +import org.onap.so.adapters.nwrest.ProviderVlanNetwork; +import org.onap.so.adapters.nwrest.RollbackNetworkRequest; +import org.onap.so.adapters.nwrest.RollbackNetworkResponse; +import org.onap.so.adapters.nwrest.UpdateNetworkRequest; +import org.onap.so.adapters.nwrest.UpdateNetworkResponse; import org.onap.so.adapters.vnf.MsoVnfAdapterImpl; import org.onap.so.adapters.vnf.exceptions.VnfException; import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; @@ -47,6 +60,8 @@ import org.onap.so.adapters.vnfrest.DeleteVolumeGroupResponse; import org.onap.so.adapters.vnfrest.VfModuleRollback; import org.onap.so.adapters.vnfrest.VolumeGroupRollback; import org.onap.so.logging.tasks.AuditMDCSetup; +import org.onap.so.openstack.beans.NetworkRollback; +import org.onap.so.openstack.beans.RouteTarget; import org.onap.so.openstack.beans.VnfRollback; import org.onap.so.utils.ExternalTaskUtils; import org.slf4j.Logger; @@ -63,12 +78,19 @@ public class StackService extends ExternalTaskUtils { private MsoVnfAdapterImpl vnfAdapterImpl; @Autowired + private MsoNetworkAdapterImpl networkAdapterImpl; + + @Autowired private AuditMDCSetup mdcSetup; + private static final String SHARED = "shared"; + private static final String EXTERNAL = "external"; + + // TODO set backout earlier in case of exception?? public void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) { Map<String, Object> variables = new HashMap<>(); mdcSetup.setupMDC(externalTask); - String xmlRequest = externalTask.getVariable("vnfAdapterTaskRequest"); + String xmlRequest = externalTask.getVariable("openstackAdapterTaskRequest"); logger.debug("Executing External Task Stack Service. {}", xmlRequest); MutableBoolean success = new MutableBoolean(); MutableBoolean backout = new MutableBoolean(); @@ -80,6 +102,11 @@ public class StackService extends ExternalTaskUtils { Holder<Map<String, String>> outputs = new Holder<>(); Holder<VnfRollback> vnfRollback = new Holder<>(); Optional<String> requestType = findRequestType(xmlRequest); + Holder<String> networkId = new Holder<>(); + Holder<String> neutronNetworkId = new Holder<>(); + Holder<String> networkFqdn = new Holder<>(); + Holder<Map<String, String>> subnetIdMap = new Holder<>(); + Holder<NetworkRollback> networkRollback = new Holder<>(); if ("createVolumeGroupRequest".equals(requestType.get())) { logger.debug("Executing External Task Stack Service For Create Volume Group"); response = createVolumeGroup(xmlRequest, outputs, vnfRollback, canonicalStackId, backout, success); @@ -92,6 +119,16 @@ public class StackService extends ExternalTaskUtils { } else if ("deleteVolumeGroupRequest".equals(requestType.get())) { logger.debug("Executing External Task Stack Service For Delete Volume Group"); response = deleteVolumeGroup(xmlRequest, outputs, vnfRollback, canonicalStackId, backout, success); + } else if ("createNetworkRequest".equals(requestType.get())) { + response = createNetwork(xmlRequest, networkId, neutronNetworkId, networkFqdn, subnetIdMap, + networkRollback, canonicalStackId, backout, success); + } else if ("deleteNetworkRequest".equals(requestType.get())) { + response = deleteNetwork(xmlRequest, canonicalStackId, backout, success); + } else if ("updateNetworkRequest".equals(requestType.get())) { + response = + updateNetwork(xmlRequest, subnetIdMap, networkRollback, canonicalStackId, backout, success); + } else if ("rollbackNetworkRequest".equals(requestType.get())) { + response = rollbackNetwork(xmlRequest, canonicalStackId, backout, success); } } } catch (Exception e) { @@ -192,6 +229,156 @@ public class StackService extends ExternalTaskUtils { return deleteResponse.toXmlString(); } + private String createNetwork(String xmlRequest, Holder<String> networkId, Holder<String> neutronNetworkId, + Holder<String> networkFqdn, Holder<Map<String, String>> subnetIdMap, + Holder<NetworkRollback> networkRollback, Holder<String> canonicalStackId, MutableBoolean backout, + MutableBoolean success) throws NetworkException { + CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class); + HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams(); + if (params == null) { + params = new HashMap<>(); + } + String shared = null; + String external = null; + String physicalNetworkName = null; + List<Integer> vlans = null; + List<RouteTarget> routeTargets = null; + List<String> fqdns = null; + List<String> routeTable = null; + if (params.containsKey(SHARED)) + shared = params.get(SHARED); + if (params.containsKey(EXTERNAL)) + external = params.get(EXTERNAL); + if (req.isContrailRequest()) { + ContrailNetwork ctn = req.getContrailNetwork(); + if (ctn == null) { + ctn = new ContrailNetwork(); + req.setContrailNetwork(ctn); + } + if (shared == null && ctn.getShared() != null) { + shared = ctn.getShared(); + } + if (shared == null && ctn.getExternal() != null) { + external = ctn.getExternal(); + } + routeTargets = req.getContrailNetwork().getRouteTargets(); + fqdns = req.getContrailNetwork().getPolicyFqdns(); + routeTable = req.getContrailNetwork().getRouteTableFqdns(); + } else { + ProviderVlanNetwork pvn = req.getProviderVlanNetwork(); + if (pvn == null) { + pvn = new ProviderVlanNetwork(); + req.setProviderVlanNetwork(pvn); + } + physicalNetworkName = req.getProviderVlanNetwork().getPhysicalNetworkName(); + vlans = req.getProviderVlanNetwork().getVlans(); + } + networkAdapterImpl.createNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), + req.getModelCustomizationUuid(), req.getNetworkName(), physicalNetworkName, vlans, routeTargets, shared, + external, req.getFailIfExists(), false, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(), + networkId, neutronNetworkId, networkFqdn, subnetIdMap, networkRollback, false); + success.setTrue(); + backout.setValue(req.getBackout()); + canonicalStackId.value = networkRollback.value.getNetworkStackId(); + + CreateNetworkResponse response = new CreateNetworkResponse(req.getNetworkId(), neutronNetworkId.value, + networkRollback.value.getNetworkStackId(), networkFqdn.value, networkRollback.value.getNetworkCreated(), + subnetIdMap.value, networkRollback.value, req.getMessageId()); + return response.toXmlString(); + } + + private String deleteNetwork(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout, + MutableBoolean success) throws NetworkException { + backout.setFalse(); + DeleteNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), DeleteNetworkRequest.class); + Holder<Boolean> networkDeleted = new Holder<>(); + + networkAdapterImpl.deleteNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), + req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getMsoRequest(), networkDeleted, false); + + canonicalStackId.value = req.getNetworkStackId(); + success.setTrue(); + + DeleteNetworkResponse response = + new DeleteNetworkResponse(req.getNetworkId(), networkDeleted.value, req.getMessageId()); + return response.toXmlString(); + } + + private String rollbackNetwork(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout, + MutableBoolean success) throws NetworkException { + backout.setFalse(); + RollbackNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), RollbackNetworkRequest.class); + + NetworkRollback rollback = req.getNetworkRollback(); + networkAdapterImpl.rollbackNetwork(rollback, false); + + canonicalStackId.value = rollback.getNetworkStackId(); + success.setTrue(); + + RollbackNetworkResponse response = new RollbackNetworkResponse(true, req.getMessageId()); + return response.toXmlString(); + } + + private String updateNetwork(String xmlRequest, Holder<Map<String, String>> subnetIdMap, + Holder<NetworkRollback> networkRollback, Holder<String> canonicalStackId, MutableBoolean backout, + MutableBoolean success) throws NetworkException { + backout.setFalse(); + UpdateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), UpdateNetworkRequest.class); + HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams(); + if (params == null) { + params = new HashMap<>(); + } + String shared = null; + String external = null; + String physicalNetworkName = null; + List<Integer> vlans = null; + List<RouteTarget> routeTargets = null; + List<String> fqdns = null; + List<String> routeTable = null; + if (params.containsKey(SHARED)) + shared = params.get(SHARED); + if (params.containsKey(EXTERNAL)) + external = params.get(EXTERNAL); + if (req.isContrailRequest()) { + ContrailNetwork ctn = req.getContrailNetwork(); + if (ctn == null) { + ctn = new ContrailNetwork(); + req.setContrailNetwork(ctn); + } + if (shared == null && ctn.getShared() != null) { + shared = ctn.getShared(); + } + if (shared == null && ctn.getExternal() != null) { + external = ctn.getExternal(); + } + routeTargets = req.getContrailNetwork().getRouteTargets(); + fqdns = req.getContrailNetwork().getPolicyFqdns(); + routeTable = req.getContrailNetwork().getRouteTableFqdns(); + } else { + ProviderVlanNetwork pvn = req.getProviderVlanNetwork(); + if (pvn == null) { + pvn = new ProviderVlanNetwork(); + req.setProviderVlanNetwork(pvn); + } + physicalNetworkName = req.getProviderVlanNetwork().getPhysicalNetworkName(); + vlans = req.getProviderVlanNetwork().getVlans(); + } + + networkAdapterImpl.updateNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), + req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), physicalNetworkName, + vlans, routeTargets, shared, external, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(), + subnetIdMap, networkRollback); + + success.setTrue(); + canonicalStackId.value = req.getNetworkStackId(); + + UpdateNetworkResponse response = + new UpdateNetworkResponse(req.getNetworkId(), null, subnetIdMap.value, req.getMessageId()); + return response.toXmlString(); + } + + + protected Optional<String> findRequestType(String xmlString) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java deleted file mode 100644 index 0074dca03c..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java +++ /dev/null @@ -1,150 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - - -import java.util.Map; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebParam.Mode; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.ws.Holder; -import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; -import org.onap.so.openstack.mappers.MapAdapter; - -@WebService(name = "VnfAdapter", targetNamespace = "http://org.onap.so/vnf") -public interface MsoVnfAdapter { - /** - * This is the "Create VNF" Web Service Endpoint definition. - */ - @WebMethod - public void createVnf(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vnfType") @XmlElement(required = true) String vnfType, - @WebParam(name = "vnfVersion") @XmlElement(required = false) String vnfVersion, - @WebParam(name = "vnfName") @XmlElement(required = true) String vnfName, - @WebParam(name = "requestType") @XmlElement(required = false) String requestType, - @WebParam(name = "volumeGroupHeatStackId") @XmlElement(required = false) String volumeGroupHeatStackId, - @WebParam(name = "inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String, Object> inputs, - @WebParam(name = "failIfExists") Boolean failIfExists, @WebParam(name = "backout") Boolean backout, - @WebParam(name = "enableBridge") Boolean enableBridge, @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "vnfId", mode = Mode.OUT) Holder<String> vnfId, - @WebParam(name = "outputs", mode = Mode.OUT) Holder<Map<String, String>> outputs, - @WebParam(name = "rollback", mode = Mode.OUT) Holder<VnfRollback> rollback) - throws VnfException, VnfAlreadyExists; - - @WebMethod - public void updateVnf(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vnfType") @XmlElement(required = true) String vnfType, - @WebParam(name = "vnfVersion") @XmlElement(required = false) String vnfVersion, - @WebParam(name = "vnfName") @XmlElement(required = true) String vnfName, - @WebParam(name = "requestType") @XmlElement(required = false) String requestType, - @WebParam(name = "volumeGroupHeatStackId") @XmlElement(required = false) String volumeGroupHeatStackId, - @WebParam(name = "inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String, Object> inputs, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "outputs", mode = Mode.OUT) Holder<Map<String, String>> outputs, - @WebParam(name = "rollback", mode = Mode.OUT) Holder<VnfRollback> rollback) throws VnfException; - - @WebMethod - public void queryVnf(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vnfName") @XmlElement(required = true) String vnfName, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "vnfExists", mode = Mode.OUT) Holder<Boolean> vnfExists, - @WebParam(name = "vnfId", mode = Mode.OUT) Holder<String> vnfId, - @WebParam(name = "status", mode = Mode.OUT) Holder<VnfStatus> status, - @WebParam(name = "outputs", mode = Mode.OUT) Holder<Map<String, String>> outputs) throws VnfException; - - @WebMethod - public void deleteVnf(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vnfName") @XmlElement(required = true) String vnfName, - @WebParam(name = "request") MsoRequest msoRequest) throws VnfException; - - - @WebMethod - public void rollbackVnf(@WebParam(name = "rollback") @XmlElement(required = true) VnfRollback rollback) - throws VnfException; - - @WebMethod - public void createVfModule(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vnfType") @XmlElement(required = true) String vnfType, - @WebParam(name = "vnfVersion") @XmlElement(required = false) String vnfVersion, - @WebParam(name = "genericVnfId") @XmlElement(required = true) String genericVnfId, - @WebParam(name = "vnfName") @XmlElement(required = true) String vnfName, - @WebParam(name = "vfModuleId") @XmlElement(required = true) String vfModuleId, - @WebParam(name = "requestType") @XmlElement(required = false) String requestType, - @WebParam(name = "volumeGroupHeatStackId") @XmlElement(required = false) String volumeGroupHeatStackId, - @WebParam(name = "baseVfHeatStackId") @XmlElement(required = false) String baseVfHeatStackId, - @WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid, - @WebParam(name = "inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String, Object> inputs, - @WebParam(name = "failIfExists") Boolean failIfExists, @WebParam(name = "backout") Boolean backout, - @WebParam(name = "enableBridge") Boolean enableBridge, @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "vnfId", mode = Mode.OUT) Holder<String> vnfId, - @WebParam(name = "outputs", mode = Mode.OUT) Holder<Map<String, String>> outputs, - @WebParam(name = "rollback", mode = Mode.OUT) Holder<VnfRollback> rollback) - throws VnfException, VnfAlreadyExists; - - @WebMethod - public void deleteVfModule(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vfName") @XmlElement(required = true) String vfName, - @WebParam(name = "vnfId") @XmlElement(required = true) String vnfId, - @WebParam(name = "vfModuleId") @XmlElement(required = true) String vfModuleId, - @WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "vfModuleOutputs", mode = Mode.OUT) Holder<Map<String, String>> vfModuleOutputs) - throws VnfException; - - @WebMethod - public void updateVfModule(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vnfType") @XmlElement(required = true) String vnfType, - @WebParam(name = "vnfVersion") @XmlElement(required = false) String vnfVersion, - @WebParam(name = "vnfName") @XmlElement(required = true) String vnfName, - @WebParam(name = "requestType") @XmlElement(required = false) String requestType, - @WebParam(name = "volumeGroupHeatStackId") @XmlElement(required = false) String volumeGroupHeatStackId, - @WebParam(name = "baseVfHeatStackId") @XmlElement(required = false) String baseVfHeatStackId, - @WebParam(name = "vfModuleStackId") @XmlElement(required = false) String vfModuleStackId, - @WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid, - @WebParam(name = "inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String, Object> inputs, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "outputs", mode = Mode.OUT) Holder<Map<String, String>> outputs, - @WebParam(name = "rollback", mode = Mode.OUT) Holder<VnfRollback> rollback) throws VnfException; - - @WebMethod - public void healthCheck(); -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java index 13ca78a1f5..4b9c36b7b7 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java @@ -29,7 +29,6 @@ import javax.jws.WebService; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.VnfRollback; import org.onap.so.openstack.mappers.MapAdapter; /** @@ -37,6 +36,7 @@ import org.onap.so.openstack.mappers.MapAdapter; * are documented elsewhere (by the client service WSDL). * */ +@Deprecated @WebService(name = "VnfAdapterAsync", targetNamespace = "http://org.onap.so/vnfA") public interface MsoVnfAdapterAsync { /** @@ -61,31 +61,6 @@ public interface MsoVnfAdapterAsync { @WebMethod @Oneway - public void updateVnfA(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vnfType") @XmlElement(required = true) String vnfType, - @WebParam(name = "vnfVersion") @XmlElement(required = false) String vnfVersion, - @WebParam(name = "vnfName") @XmlElement(required = true) String vnfName, - @WebParam(name = "requestType") @XmlElement(required = false) String requestType, - @WebParam(name = "volumeGroupHeatStackId") @XmlElement(required = false) String volumeGroupHeatStackId, - @WebParam(name = "inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String, Object> inputs, - @WebParam(name = "messageId") @XmlElement(required = true) String messageId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - - @WebMethod - @Oneway - public void queryVnfA(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "vnfName") @XmlElement(required = true) String vnfName, - @WebParam(name = "messageId") @XmlElement(required = true) String messageId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - - @WebMethod - @Oneway public void deleteVnfA(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, @WebParam(name = "cloudOwner") @XmlElement(required = false) String cloudOwner, @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, @@ -94,12 +69,6 @@ public interface MsoVnfAdapterAsync { @WebParam(name = "request") MsoRequest msoRequest, @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - @WebMethod - @Oneway - public void rollbackVnfA(@WebParam(name = "rollback") @XmlElement(required = true) VnfRollback rollback, - @WebParam(name = "messageId") @XmlElement(required = true) String messageId, - @WebParam(name = "notificationUrl") @XmlElement(required = true) String notificationUrl); - @WebMethod public void healthCheckA(); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java index 68d1bebc51..3bea44b884 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java @@ -38,8 +38,6 @@ import javax.xml.ws.BindingProvider; import javax.xml.ws.Holder; import javax.xml.ws.handler.MessageContext; import org.onap.so.adapters.vnf.async.client.CreateVnfNotification; -import org.onap.so.adapters.vnf.async.client.QueryVnfNotification; -import org.onap.so.adapters.vnf.async.client.UpdateVnfNotification; import org.onap.so.adapters.vnf.async.client.VnfAdapterNotify; import org.onap.so.adapters.vnf.async.client.VnfAdapterNotify_Service; import org.onap.so.adapters.vnf.exceptions.VnfException; @@ -48,7 +46,6 @@ import org.onap.logging.filter.base.ErrorCode; import org.onap.so.logger.LoggingAnchor; import org.onap.so.logger.MessageEnum; import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; import org.onap.so.utils.CryptoUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -64,9 +61,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { private static final Logger logger = LoggerFactory.getLogger(MsoVnfAdapterAsyncImpl.class); private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.vnf.bpelauth"; - private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey"; - private static final String UPDATE_VNFA = "{} UpdateVnfA"; - private static final String EXCEPTION_UPDATEVNF_NOTIFICATION = "{} {} Exception sending updateVnf notification "; + private static final String ENCRYPTION_KEY_PROP = "mso.msoKey"; @Autowired private Environment environment; @@ -122,15 +117,13 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { String notificationUrl) { logger.info("{} createVnfA", MessageEnum.RA_ASYNC_CREATE_VNF); - // Use the synchronous method to perform the actual Create - MsoVnfAdapter vnfAdapter = vnfImpl; // Synchronous Web Service Outputs Holder<String> vnfId = new Holder<>(); Holder<Map<String, String>> outputs = new Holder<>(); Holder<VnfRollback> vnfRollback = new Holder<>(); try { - vnfAdapter.createVnf(cloudSiteId, cloudOwner, tenantId, vnfType, vnfVersion, vnfName, requestType, + vnfImpl.createVnf(cloudSiteId, cloudOwner, tenantId, vnfType, vnfVersion, vnfName, requestType, volumeGroupHeatStackId, inputs, failIfExists, backout, enableBridge, msoRequest, vnfId, outputs, vnfRollback); } catch (VnfException e) { @@ -171,140 +164,6 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { return; } - @Override - public void updateVnfA(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, - String vnfName, String requestType, String volumeGroupHeatStackId, Map<String, Object> inputs, - String messageId, MsoRequest msoRequest, String notificationUrl) { - - logger.info(UPDATE_VNFA, MessageEnum.RA_ASYNC_UPDATE_VNF); - - // Use the synchronous method to perform the actual Create - MsoVnfAdapter vnfAdapter = vnfImpl; - - // Synchronous Web Service Outputs - Holder<String> vnfId = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - - try { - vnfAdapter.updateVnf(cloudSiteId, cloudOwner, tenantId, vnfType, vnfVersion, vnfName, requestType, - volumeGroupHeatStackId, inputs, msoRequest, outputs, vnfRollback); - } catch (VnfException e) { - logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_UPDATE_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null; - String eMsg = null; - try { - eMsg = e.getFaultInfo().getMessage(); - exCat = org.onap.so.adapters.vnf.async.client.MsoExceptionCategory - .fromValue(e.getFaultInfo().getCategory().name()); - } catch (Exception e1) { - logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC, - ErrorCode.BusinessProcessError.getValue(), e1); - } - // Build and send Asynchronous error response - try { - VnfAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.updateVnfNotification(messageId, false, exCat, eMsg, null, null); - } catch (Exception e1) { - logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_SEND_VNF_NOTIF_ERR, - ErrorCode.BusinessProcessError.getValue(), e1); - } - logger.info(UPDATE_VNFA, MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE); - return; - } - logger.debug("Async Update VNF: {} VnfId:{}", vnfName, vnfId.value); - // Build and send Asynchronous response - try { - VnfAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.updateVnfNotification(messageId, true, null, null, copyUpdateOutputs(outputs), - copyVrb(vnfRollback)); - } catch (Exception e) { - logger.error(EXCEPTION_UPDATEVNF_NOTIFICATION, MessageEnum.RA_SEND_VNF_NOTIF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - } - logger.info(UPDATE_VNFA, MessageEnum.RA_ASYNC_UPDATE_VNF_COMPLETE); - return; - } - - /** - * This is the "Query VNF" web service implementation. It will look up a VNF by name or ID in the specified cloud - * and tenant. - * - * The method returns an indicator that the VNF exists, its Openstack internal ID, its status, and the set of - * outputs (from when the stack was created). - * - * @param cloudSiteId CLLI code of the cloud site in which to query - * @param cloudOwner cloud owner of cloud site in which to query - * @param tenantId Openstack tenant identifier - * @param vnfName VNF Name or Openstack ID - * @param msoRequest Request tracking information for logs - * @param notificationURL the target URL for asynchronous response - */ - @Override - public void queryVnfA(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, String messageId, - MsoRequest msoRequest, String notificationUrl) { - - logger.info(LoggingAnchor.ONE, MessageEnum.RA_ASYNC_QUERY_VNF); - - // Use the synchronous method to perform the actual query - MsoVnfAdapter vnfAdapter = vnfImpl; - - // Synchronous Web Service Outputs - Holder<Boolean> vnfExists = new Holder<>(); - Holder<String> vnfId = new Holder<>(); - Holder<VnfStatus> status = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - - try { - vnfAdapter.queryVnf(cloudSiteId, cloudOwner, tenantId, vnfName, msoRequest, vnfExists, vnfId, status, - outputs); - } catch (VnfException e) { - logger.error("{} {} Exception sending queryVnfA notification ", MessageEnum.RA_QUERY_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null; - String eMsg = null; - try { - eMsg = e.getFaultInfo().getMessage(); - exCat = org.onap.so.adapters.vnf.async.client.MsoExceptionCategory - .fromValue(e.getFaultInfo().getCategory().name()); - } catch (Exception e1) { - logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC, - ErrorCode.BusinessProcessError.getValue(), e1); - } - // Build and send Asynchronous error response - try { - VnfAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.queryVnfNotification(messageId, false, exCat, eMsg, null, null, null, null); - } catch (Exception e1) { - logger.error("{} {} Exception sending queryVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR, - ErrorCode.BusinessProcessError.getValue(), e1); - } - logger.info("{} queryVnfA", MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE); - return; - } - - if (!vnfExists.value) { - logger.debug("Async Query, VNF not found"); - } else { - logger.debug("Async Query, VNF={}, status={}", vnfId.value, status.value); - } - // Build and send Asynchronous response - try { - VnfAdapterNotify notifyPort = getNotifyEP(notificationUrl); - org.onap.so.adapters.vnf.async.client.VnfStatus vnfS = - org.onap.so.adapters.vnf.async.client.VnfStatus.fromValue(status.value.name()); - notifyPort.queryVnfNotification(messageId, true, null, null, vnfExists.value, vnfId.value, vnfS, - copyQueryOutputs(outputs)); - } catch (Exception e) { - logger.error("{} {} Exception sending queryVnf notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - } - - logger.info("{} queryVnfA", MessageEnum.RA_ASYNC_QUERY_VNF_COMPLETE); - return; - } - /** * This is the Asynchronous "Delete VNF" web service implementation. It will delete a VNF by name or ID in the * specified cloud and tenant. @@ -324,11 +183,8 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { logger.info(LoggingAnchor.ONE, MessageEnum.RA_ASYNC_DELETE_VNF); - // Use the synchronous method to perform the actual delete - MsoVnfAdapter vnfAdapter = vnfImpl; - try { - vnfAdapter.deleteVnf(cloudSiteId, cloudOwner, tenantId, vnfName, msoRequest); + vnfImpl.deleteVnf(cloudSiteId, cloudOwner, tenantId, vnfName, msoRequest); } catch (VnfException e) { logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_DELETE_VNF_ERR, ErrorCode.BusinessProcessError.getValue(), e); @@ -369,65 +225,6 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { return; } - /** - * This web service endpoint will rollback a previous Create VNF operation. A rollback object is returned to the - * client in a successful creation response. The client can pass that object as-is back to the rollbackVnf operation - * to undo the creation. - */ - @Override - public void rollbackVnfA(VnfRollback rollback, String messageId, String notificationUrl) { - // rollback may be null (e.g. if stack already existed when Create was called) - if (rollback == null) { - logger.info("{} rollbackVnfA: Empty Rollback: No action to perform", MessageEnum.RA_ROLLBACK_NULL); - return; - } - - logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF); - - // Use the synchronous method to perform the actual rollback - MsoVnfAdapter vnfAdapter = vnfImpl; - - try { - vnfAdapter.rollbackVnf(rollback); - } catch (VnfException e) { - logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_ROLLBACK_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null; - String eMsg = null; - try { - eMsg = e.getFaultInfo().getMessage(); - exCat = org.onap.so.adapters.vnf.async.client.MsoExceptionCategory - .fromValue(e.getFaultInfo().getCategory().name()); - } catch (Exception e1) { - logger.error("{} {} Exception - fault info ", MessageEnum.RA_FAULT_INFO_EXC, - ErrorCode.BusinessProcessError.getValue(), e1); - } - // Build and send Asynchronous error response - try { - VnfAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.rollbackVnfNotification(messageId, false, exCat, eMsg); - } catch (Exception e1) { - logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR, - ErrorCode.BusinessProcessError.getValue(), e1); - } - logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE); - return; - } - - logger.debug("Async Rollback VNF:" + rollback.getVnfId()); - // Build and send Asynchronous response - try { - VnfAdapterNotify notifyPort = getNotifyEP(notificationUrl); - notifyPort.rollbackVnfNotification(messageId, true, null, null); - } catch (Exception e) { - logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_SEND_VNF_NOTIF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - } - - logger.info("{} rollbackVnfA", MessageEnum.RA_ASYNC_ROLLBACK_VNF_COMPLETE); - return; - } - private org.onap.so.adapters.vnf.async.client.VnfRollback copyVrb(Holder<VnfRollback> hVrb) { org.onap.so.adapters.vnf.async.client.VnfRollback cvrb = new org.onap.so.adapters.vnf.async.client.VnfRollback(); @@ -471,47 +268,6 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync { return outputs; } - private UpdateVnfNotification.Outputs copyUpdateOutputs(Holder<Map<String, String>> hMap) { - - UpdateVnfNotification.Outputs outputs = new UpdateVnfNotification.Outputs(); - - if (hMap != null && hMap.value != null) { - Map<String, String> sMap; - sMap = hMap.value; - UpdateVnfNotification.Outputs.Entry entry = new UpdateVnfNotification.Outputs.Entry(); - - for (Map.Entry<String, String> mapEntry : sMap.entrySet()) { - String key = mapEntry.getKey(); - String value = mapEntry.getValue(); - entry.setKey(key); - entry.setValue(value); - outputs.getEntry().add(entry); - } - } - return outputs; - } - - private QueryVnfNotification.Outputs copyQueryOutputs(Holder<Map<String, String>> hMap) { - - QueryVnfNotification.Outputs outputs = new QueryVnfNotification.Outputs(); - - if (hMap != null && hMap.value != null) { - Map<String, String> sMap; - sMap = hMap.value; - - QueryVnfNotification.Outputs.Entry entry = new QueryVnfNotification.Outputs.Entry(); - - for (Map.Entry<String, String> mapEntry : sMap.entrySet()) { - String key = mapEntry.getKey(); - String value = mapEntry.getValue(); - entry.setKey(key); - entry.setValue(value); - outputs.getEntry().add(entry); - } - } - return outputs; - } - private VnfAdapterNotify getNotifyEP(String notificationUrl) { URL warWsdlLoc = null; diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java index 5951fda16e..a58c0c10c5 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java @@ -30,7 +30,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import javax.jws.WebService; import javax.xml.ws.Holder; import org.apache.commons.collections.CollectionUtils; import org.onap.logging.filter.base.ErrorCode; @@ -59,7 +58,6 @@ import org.onap.so.logger.MessageEnum; import org.onap.so.openstack.beans.HeatStatus; import org.onap.so.openstack.beans.StackInfo; import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound; import org.onap.so.openstack.exceptions.MsoException; import org.onap.so.openstack.exceptions.MsoExceptionCategory; @@ -81,11 +79,9 @@ import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -@WebService(serviceName = "VnfAdapter", endpointInterface = "org.onap.so.adapters.vnf.MsoVnfAdapter", - targetNamespace = "http://org.onap.so/vnf") @Component @Transactional -public class MsoVnfAdapterImpl implements MsoVnfAdapter { +public class MsoVnfAdapterImpl { @Autowired private CloudConfig cloudConfig; @@ -96,7 +92,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { private static final Logger logger = LoggerFactory.getLogger(MsoVnfAdapterImpl.class); - private static final String VNF_ADAPTER_SERVICE_NAME = "MSO-BPMN:MSO-VnfAdapter."; private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters"; private static final String ADD_GET_FILES_ON_VOLUME_REQ = "org.onap.so.adapters.vnf.addGetFilesOnVolumeReq"; private static final ObjectMapper JSON_MAPPER = new ObjectMapper(); @@ -107,12 +102,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { private static final String USER_ERROR = "USER ERROR"; private static final String VERSION_MIN = "VersionMin"; private static final String VERSION_MAX = "VersionMax"; - private static final String VF_EXIST_STATUS_MESSAGE = - "The vf module was found to already exist, thus no new vf module was created in the cloud via this request"; - private static final String VF_CREATED_STATUS_MESSAGE = "The new vf module was successfully created in the cloud"; - private static final String VF_NOT_EXIST_STATUS_MESSAGE = - "The vf module was not found, thus no vf module was deleted in the cloud via this request"; - private static final String VF_DELETED_STATUS_MESSAGE = "The vf module was successfully deleted in the cloud"; + private static final String RESOURCE_EXIST_STATUS_MESSAGE = + "The %s was found to already exist, thus no new %s was created in the cloud via this request"; + private static final String RESOURCE_CREATED_STATUS_MESSAGE = "The new %s was successfully created in the cloud"; + private static final String RESOURCE_NOT_EXIST_STATUS_MESSAGE = + "The %s was not found, thus no %s was deleted in the cloud via this request"; + private static final String RESOURCE_DELETED_STATUS_MESSAGE = "The %s was successfully deleted in the cloud"; + private static final String VF_MODULE = "vf module"; + private static final String VOLUME_GROUP = "volume group"; + @Autowired private VFModuleCustomizationRepository vfModuleCustomRepo; @@ -136,7 +134,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { /** * Health Check web method. Does nothing but return to show the adapter is deployed. */ - @Override public void healthCheck() { logger.debug("Health check call in VNF Adapter"); } @@ -172,7 +169,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { * @param outputs Holder for Map of VNF outputs from heat (assigned IPs, etc) * @param rollback Holder for returning VnfRollback object */ - @Override public void createVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, String vnfName, String requestType, String volumeGroupHeatStackId, Map<String, Object> inputs, Boolean failIfExists, Boolean backout, Boolean enableBridge, MsoRequest msoRequest, Holder<String> vnfId, @@ -215,75 +211,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { // End createVf shortcut } - @Override - public void updateVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, - String vnfName, String requestType, String volumeGroupHeatStackId, Map<String, Object> inputs, - MsoRequest msoRequest, Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) - throws VnfException { - // As of 1707 - this method should no longer be called - logger.debug("UpdateVnf called?? This should not be called any longer - update vfModule"); - } - - /** - * This is the "Query VNF" web service implementation. It will look up a VNF by name or ID in the specified cloud - * and tenant. - * - * The method returns an indicator that the VNF exists, its Openstack internal ID, its status, and the set of - * outputs (from when the stack was created). - * - * @param cloudSiteId CLLI code of the cloud site in which to query - * @param tenantId Openstack tenant identifier - * @param vnfName VNF Name or Openstack ID - * @param msoRequest Request tracking information for logs - * @param vnfExists Flag reporting the result of the query - * @param vnfId Holder for output VNF Openstack ID - * @param outputs Holder for Map of VNF outputs from heat (assigned IPs, etc) - */ - @Override - public void queryVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, MsoRequest msoRequest, - Holder<Boolean> vnfExists, Holder<String> vnfId, Holder<VnfStatus> status, - Holder<Map<String, String>> outputs) throws VnfException { - - logger.debug("Querying VNF {} in {}/{}", vnfName, cloudSiteId, tenantId); - - // Will capture execution time for metrics - - StackInfo heatStack; - try { - heatStack = msoHeatUtils.queryStack(cloudSiteId, cloudOwner, tenantId, vnfName); - } catch (MsoException me) { - me.addContext("QueryVNF"); - // Failed to query the Stack due to an openstack exception. - // Convert to a generic VnfException - String error = - "Query VNF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; - logger.error(LoggingAnchor.EIGHT, MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId, tenantId, - OPENSTACK, "QueryVNF", ErrorCode.DataError.getValue(), "Exception - " + QUERY_STACK, me); - logger.debug(error); - throw new VnfException(me); - } - - // Populate the outputs based on the returned Stack information - // - if (heatStack == null || heatStack.getStatus() == HeatStatus.NOTFOUND) { - // Not Found - vnfExists.value = Boolean.FALSE; - status.value = VnfStatus.NOTFOUND; - vnfId.value = null; - outputs.value = new HashMap<>(); // Return as an empty map - - logger.debug("VNF {} not found", vnfName); - } else { - vnfExists.value = Boolean.TRUE; - status.value = stackStatusToVnfStatus(heatStack.getStatus()); - vnfId.value = heatStack.getCanonicalName(); - outputs.value = copyStringOutputs(heatStack.getOutputs()); - - logger.debug("VNF {} found, ID = {}", vnfName, vnfId.value); - } - return; - } - /** * This is the "Delete VNF" web service implementation. It will delete a VNF by name or ID in the specified cloud * and tenant. @@ -296,14 +223,17 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { * @param vnfName VNF Name or Openstack ID * @param msoRequest Request tracking information for logs */ - @Override public void deleteVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, MsoRequest msoRequest) throws VnfException { logger.debug("Deleting VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId); try { - msoHeatUtils.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfName, true, 118); + StackInfo stackInfo = msoHeatUtils.deleteStack(tenantId, cloudOwner, cloudSiteId, vnfName, true, 118); + + msoHeatUtils.updateResourceStatus(msoRequest.getRequestId(), + stackInfo.isOperationPerformed() ? String.format(RESOURCE_DELETED_STATUS_MESSAGE, VOLUME_GROUP) + : String.format(RESOURCE_NOT_EXIST_STATUS_MESSAGE, VOLUME_GROUP, VOLUME_GROUP)); } catch (MsoException me) { me.addContext(DELETE_VNF); // Failed to query the Stack due to an openstack exception. @@ -361,7 +291,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { * client in a successful creation response. The client can pass that object as-is back to the rollbackVnf operation * to undo the creation. */ - @Override public void rollbackVnf(VnfRollback rollback) throws VnfException { // rollback may be null (e.g. if stack already existed when Create was called) if (rollback == null) { @@ -397,19 +326,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { return; } - private VnfStatus stackStatusToVnfStatus(HeatStatus stackStatus) { - switch (stackStatus) { - case CREATED: - return VnfStatus.ACTIVE; - case UPDATED: - return VnfStatus.ACTIVE; - case FAILED: - return VnfStatus.FAILED; - default: - return VnfStatus.UNKNOWN; - } - } - private Map<String, String> copyStringOutputs(Map<String, Object> stackOutputs) { Map<String, String> stringOutputs = new HashMap<>(); for (Map.Entry<String, Object> entry : stackOutputs.entrySet()) { @@ -563,7 +479,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { return stringMap; } - @Override public void createVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, String genericVnfName, String vnfName, String vfModuleId, String requestType, String volumeGroupHeatStackId, String baseVfHeatStackId, String modelCustomizationUuid, @@ -1088,9 +1003,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { template, goldenInputs, pollForCompletion, heatTemplate.getTimeoutMinutes(), newEnvironmentString, nestedTemplatesChecked, heatFilesObjects, backout.booleanValue(), failIfExists); + String resource = VF_MODULE; + if (isVolumeRequest) { + resource = VOLUME_GROUP; + } if (msoRequest.getRequestId() != null) { msoHeatUtils.updateResourceStatus(msoRequest.getRequestId(), - heatStack.isOperationPerformed() ? VF_CREATED_STATUS_MESSAGE : VF_EXIST_STATUS_MESSAGE); + heatStack.isOperationPerformed() + ? String.format(RESOURCE_CREATED_STATUS_MESSAGE, resource) + : String.format(RESOURCE_EXIST_STATUS_MESSAGE, resource, resource)); } } else { throw new MsoHeatNotFoundException(); @@ -1125,7 +1046,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { } } - @Override public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, String vnfId, String vfModuleId, String modelCustomizationUuid, MsoRequest msoRequest, Holder<Map<String, String>> outputs) throws VnfException { @@ -1178,8 +1098,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { outputs.value.put("canonicalStackId", currentStack.getCanonicalName()); } msoHeatUtils.updateResourceStatus(msoRequest.getRequestId(), - currentStack.isOperationPerformed() ? VF_DELETED_STATUS_MESSAGE : VF_NOT_EXIST_STATUS_MESSAGE); - + currentStack.isOperationPerformed() ? String.format(RESOURCE_DELETED_STATUS_MESSAGE, VF_MODULE) + : String.format(RESOURCE_NOT_EXIST_STATUS_MESSAGE, VF_MODULE, VF_MODULE)); } catch (MsoException me) { me.addContext(DELETE_VNF); // Failed to query the Stack due to an openstack exception. @@ -1199,7 +1119,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { } } - @Override public void updateVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, String vnfName, String requestType, String volumeGroupHeatStackId, String baseVfHeatStackId, String vfModuleStackId, String modelCustomizationUuid, Map<String, Object> inputs, @@ -1207,8 +1126,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { throws VnfException { String vfModuleName = vnfName; String vfModuleType = vnfType; - String methodName = "updateVfModule"; - String serviceName = VNF_ADAPTER_SERVICE_NAME + methodName; StringBuilder sbInit = new StringBuilder(); sbInit.append("updateVfModule: \n"); @@ -1321,7 +1238,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { // 1604 Cinder Volume support - handle a nestedStackId if sent (volumeGroupHeatStackId): StackInfo nestedHeatStack = null; - Map<String, Object> nestedVolumeOutputs = null; if (nestedStackId != null) { try { logger.debug("Querying for nestedStackId = {}", nestedStackId); @@ -1347,13 +1263,11 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { throw new VnfException(error, MsoExceptionCategory.USERDATA); } else { logger.debug("Found nested heat stack - copying values to inputs *later*"); - nestedVolumeOutputs = nestedHeatStack.getOutputs(); msoHeatUtils.copyStringOutputsToInputs(inputs, nestedHeatStack.getOutputs(), false); } } // handle a nestedBaseStackId if sent - this is the stack ID of the base. StackInfo nestedBaseHeatStack = null; - Map<String, Object> baseStackOutputs = null; if (nestedBaseStackId != null) { try { logger.debug("Querying for nestedBaseStackId = {}", nestedBaseStackId); @@ -1379,7 +1293,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { throw new VnfException(error, MsoExceptionCategory.USERDATA); } else { logger.debug("Found nested base heat stack - copying values to inputs *later*"); - baseStackOutputs = nestedBaseHeatStack.getOutputs(); msoHeatUtils.copyStringOutputsToInputs(inputs, nestedBaseHeatStack.getOutputs(), false); } } @@ -1819,56 +1732,4 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { return vfModuleName; } - /* - * Helper method to check a boolean property value - on error return provided default - */ - private boolean checkBooleanProperty(String propertyName, boolean defaultValue) { - boolean property = defaultValue; - try { - String propertyString = this.environment.getProperty(propertyName); - if ("true".equalsIgnoreCase(propertyString) || "y".equalsIgnoreCase(propertyString)) { - property = true; - } else if ("false".equalsIgnoreCase(propertyString) || "n".equalsIgnoreCase(propertyString)) { - property = false; - } - } catch (Exception e) { - logger.debug("An exception occured trying to get property {} - defaulting to ", propertyName, defaultValue, - e); - property = defaultValue; - } - return property; - } - - /* - * Helper method to combine getFiles and nestedTemplates in to a single Map - */ - private Map<String, Object> combineGetFilesAndNestedTemplates(Map<String, Object> getFiles, - Map<String, Object> nestedTemplates) { - boolean haveGetFiles = true; - boolean haveNestedTemplates = true; - Map<String, Object> files = new HashMap<>(); - if (getFiles == null || getFiles.isEmpty()) { - haveGetFiles = false; - } - if (nestedTemplates == null || nestedTemplates.isEmpty()) { - haveNestedTemplates = false; - } - if (haveGetFiles && haveNestedTemplates) { - for (String keyString : getFiles.keySet()) { - files.put(keyString, getFiles.get(keyString)); - } - for (String keyString : nestedTemplates.keySet()) { - files.put(keyString, nestedTemplates.get(keyString)); - } - } else { - // Handle if we only have one or neither: - if (haveGetFiles) { - files = getFiles; - } - if (haveNestedTemplates) { - files = nestedTemplates; - } - } - return files; - } } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java deleted file mode 100644 index ba837a9718..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java +++ /dev/null @@ -1,1142 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * OPENECOMP - MSO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import javax.jws.WebService; -import javax.xml.ws.Holder; -import org.onap.so.logger.LoggingAnchor; -import com.woorea.openstack.heat.Heat; -import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.cloud.CloudConfig; -import org.onap.so.db.catalog.beans.CloudSite; -import org.onap.so.cloudify.beans.DeploymentInfo; -import org.onap.so.cloudify.beans.DeploymentStatus; -import org.onap.so.cloudify.exceptions.MsoCloudifyManagerNotFound; -import org.onap.so.cloudify.utils.MsoCloudifyUtils; -import org.onap.so.db.catalog.beans.HeatEnvironment; -import org.onap.so.db.catalog.beans.HeatFiles; -import org.onap.so.db.catalog.beans.HeatTemplate; -import org.onap.so.db.catalog.beans.HeatTemplateParam; -import org.onap.so.db.catalog.beans.VfModule; -import org.onap.so.db.catalog.beans.VfModuleCustomization; -import org.onap.so.db.catalog.beans.VnfResource; -import org.onap.so.db.catalog.data.repository.VFModuleCustomizationRepository; -import org.onap.so.db.catalog.utils.MavenLikeVersioning; -import org.onap.so.entity.MsoRequest; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.MsoTenant; -import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; -import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound; -import org.onap.so.openstack.exceptions.MsoException; -import org.onap.so.openstack.exceptions.MsoExceptionCategory; -import org.onap.so.openstack.utils.MsoHeatEnvironmentEntry; -import org.onap.so.openstack.utils.MsoHeatEnvironmentParameter; -import org.onap.so.openstack.utils.MsoKeystoneUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.springframework.transaction.annotation.Transactional; - -@Component -@Transactional -@WebService(serviceName = "VnfAdapter", endpointInterface = "org.onap.so.adapters.vnf.MsoVnfAdapter", - targetNamespace = "http://org.onap.so/vnf") -public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { - - private static Logger logger = LoggerFactory.getLogger(MsoVnfCloudifyAdapterImpl.class); - - private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters"; - private static final String CLOUDIFY = "Cloudify"; - - private static final ObjectMapper JSON_MAPPER = new ObjectMapper(); - private static final String BRACKETS = LoggingAnchor.NINE; - private static final String OPENSTACK = "OpenStack"; - - @Autowired - protected CloudConfig cloudConfig; - - @Autowired - private VFModuleCustomizationRepository vfModuleCustomRepo; - - @Autowired - private Environment environment; - - @Autowired - protected MsoKeystoneUtils keystoneUtils; - - @Autowired - protected MsoCloudifyUtils cloudifyUtils; - - /** - * DO NOT use that constructor to instantiate this class, the msoPropertiesfactory will be NULL. - * - * @see MsoVnfCloudifyAdapterImpl#MsoVnfAdapterImpl(MsoPropertiesFactory, CloudConfigFactory) - */ - public MsoVnfCloudifyAdapterImpl() { - - } - - /** - * Health Check web method. Does nothing but return to show the adapter is deployed. - */ - @Override - public void healthCheck() { - logger.debug("Health check call in VNF Cloudify Adapter"); - } - - /** - * This is the "Create VNF" web service implementation. This function is now unsupported and will return an error. - * - */ - @Override - public void createVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, - String vnfName, String requestType, String volumeGroupHeatStackId, Map<String, Object> inputs, - Boolean failIfExists, Boolean backout, Boolean enableBridge, MsoRequest msoRequest, Holder<String> vnfId, - Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) throws VnfException { - // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules. - logger.debug("CreateVNF command attempted but not supported"); - throw new VnfException("CreateVNF: Unsupported command", MsoExceptionCategory.USERDATA); - } - - /** - * This is the "Update VNF" web service implementation. This function is now unsupported and will return an error. - * - */ - @Override - public void updateVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, - String vnfName, String requestType, String volumeGroupHeatStackId, Map<String, Object> inputs, - MsoRequest msoRequest, Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) - throws VnfException { - // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules. - logger.debug("UpdateVNF command attempted but not supported"); - throw new VnfException("UpdateVNF: Unsupported command", MsoExceptionCategory.USERDATA); - } - - /** - * This is the "Query VNF" web service implementation. - * - * This really should be QueryVfModule, but nobody ever changed it. - * - * For Cloudify, this will look up a deployment by its deployment ID, which is really the same as deployment name, - * since it assigned by the client when a deployment is created. Also, the input cloudSiteId is used only to - * identify which Cloudify instance to query, and the tenantId is ignored (since that really only applies for - * Openstack/Heat). - * - * The method returns an indicator that the VNF exists, along with its status and outputs. The input "vnfName" will - * also be reflected back as its ID. - * - * @param cloudSiteId CLLI code of the cloud site in which to query - * @param cloudOwner cloud owner of the cloud site in which to query - * @param tenantId Openstack tenant identifier - ignored for Cloudify - * @param vnfName VNF Name (should match a deployment ID) - * @param msoRequest Request tracking information for logs - * @param vnfExists Flag reporting the result of the query - * @param vnfId Holder for output VNF ID - * @param outputs Holder for Map of VNF outputs from Cloudify deployment (assigned IPs, etc) - */ - @Override - public void queryVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, MsoRequest msoRequest, - Holder<Boolean> vnfExists, Holder<String> vnfId, Holder<VnfStatus> status, - Holder<Map<String, String>> outputs) throws VnfException { - logger.debug("Querying VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId); - - DeploymentInfo deployment = null; - - try { - deployment = cloudifyUtils.queryDeployment(cloudSiteId, tenantId, vnfName); - } catch (MsoCloudifyManagerNotFound e) { - // This site does not have a Cloudify Manager. - // This isn't an error, just means we won't find the VNF here. - deployment = null; - } catch (MsoException me) { - // Failed to query the Deployment due to a cloudify exception. - logger.debug("Failed to query the Deployment due to a cloudify exception"); - // Convert to a generic VnfException - me.addContext("QueryVNF"); - String error = "Query VNF (Cloudify): " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + ": " + me; - logger.error(BRACKETS, MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId, tenantId, - CLOUDIFY, "QueryVNF", ErrorCode.DataError.getValue(), "Exception - queryDeployment", me); - logger.debug(error); - throw new VnfException(me); - } - - if (deployment != null && deployment.getStatus() != DeploymentStatus.NOTFOUND) { - vnfExists.value = Boolean.TRUE; - status.value = deploymentStatusToVnfStatus(deployment); - vnfId.value = deployment.getId(); - outputs.value = copyStringOutputs(deployment.getOutputs()); - - logger.debug("VNF {} found in Cloudify, ID = {}", vnfName, vnfId.value); - } else { - vnfExists.value = Boolean.FALSE; - status.value = VnfStatus.NOTFOUND; - vnfId.value = null; - outputs.value = new HashMap<String, String>(); // Return as an empty map - - logger.debug("VNF {} not found", vnfName); - } - } - - - /** - * This is the "Delete VNF" web service implementation. This function is now unsupported and will return an error. - * - */ - @Override - public void deleteVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, MsoRequest msoRequest) - throws VnfException { - - // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules. - logger.debug("DeleteVNF command attempted but not supported"); - throw new VnfException("DeleteVNF: Unsupported command", MsoExceptionCategory.USERDATA); - } - - /** - * This web service endpoint will rollback a previous Create VNF operation. A rollback object is returned to the - * client in a successful creation response. The client can pass that object as-is back to the rollbackVnf operation - * to undo the creation. - * - * TODO: This should be rollbackVfModule and/or rollbackVolumeGroup, but APIs were apparently never updated. - */ - @Override - public void rollbackVnf(VnfRollback rollback) throws VnfException { - // rollback may be null (e.g. if stack already existed when Create was called) - if (rollback == null) { - logger.info(LoggingAnchor.THREE, MessageEnum.RA_ROLLBACK_NULL.toString(), OPENSTACK, "rollbackVnf"); - return; - } - - // Don't rollback if nothing was done originally - if (!rollback.getVnfCreated()) { - return; - } - - // Get the elements of the VnfRollback object for easier access - String cloudSiteId = rollback.getCloudSiteId(); - String cloudOwner = rollback.getCloudOwner(); - String tenantId = rollback.getTenantId(); - String vfModuleId = rollback.getVfModuleStackId(); - - logger.debug("Rolling Back VF Module {} in {}", vfModuleId, cloudOwner + "/" + cloudSiteId + "/" + tenantId); - - DeploymentInfo deployment = null; - - // Use the MsoCloudifyUtils to delete the deployment. Set the polling flag to true. - // The possible outcomes of deleteStack are a StackInfo object with status - // of NOTFOUND (on success) or FAILED (on error). Also, MsoOpenstackException - // could be thrown. - try { - // KLUDGE - Cloudify requires Tenant Name for Openstack. We have the ID. - // Go directly to Keystone until APIs could be updated to supply the name. - MsoTenant msoTenant = keystoneUtils.queryTenant(tenantId, cloudSiteId); - String tenantName = (msoTenant != null ? msoTenant.getTenantName() : tenantId); - - // TODO: Get a reasonable timeout. Use a global property, or store the creation timeout in rollback object - // and use that. - deployment = cloudifyUtils.uninstallAndDeleteDeployment(cloudSiteId, tenantName, vfModuleId, 5); - logger.debug("Rolled back deployment: {}", deployment.getId()); - } catch (MsoException me) { - // Failed to rollback the VNF due to a cloudify exception. - // Convert to a generic VnfException - me.addContext("RollbackVNF"); - String error = "Rollback VF Module: " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" - + tenantId + ": " + me; - logger.error(BRACKETS, MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudOwner, cloudSiteId, - tenantId, CLOUDIFY, "DeleteDeployment", ErrorCode.DataError.getValue(), - "Exception - DeleteDeployment", me); - logger.debug(error); - throw new VnfException(me); - } - } - - - private VnfStatus deploymentStatusToVnfStatus(DeploymentInfo deployment) { - // Determine the status based on last action & status - // DeploymentInfo object should be enhanced to report a better status internally. - DeploymentStatus status = deployment.getStatus(); - String lastAction = deployment.getLastAction(); - - if (status == null || lastAction == null) { - return VnfStatus.UNKNOWN; - } else if (status == DeploymentStatus.NOTFOUND) { - return VnfStatus.NOTFOUND; - } else if (status == DeploymentStatus.INSTALLED) { - return VnfStatus.ACTIVE; - } else if (status == DeploymentStatus.CREATED) { - // Should have an INACTIVE status for this case. Shouldn't really happen, but - // Install was never run, or Uninstall was done but deployment didn't get deleted. - return VnfStatus.UNKNOWN; - } else if (status == DeploymentStatus.FAILED) { - return VnfStatus.FAILED; - } - - return VnfStatus.UNKNOWN; - } - - private Map<String, String> copyStringOutputs(Map<String, Object> stackOutputs) { - Map<String, String> stringOutputs = new HashMap<>(); - for (Map.Entry<String, Object> entry : stackOutputs.entrySet()) { - if (entry.getValue() instanceof String) { - stringOutputs.put(entry.getKey(), (String) entry.getValue()); - } else if (entry.getValue() instanceof Integer) { - try { - String str = "" + entry.getValue(); - stringOutputs.put(entry.getKey(), str); - } catch (Exception e) { - logger.error("Unable to add " + entry.getKey() + " to outputs", e); - } - } else if (entry.getValue() instanceof JsonNode) { - try { - String str = this.convertNode((JsonNode) entry.getValue()); - stringOutputs.put(entry.getKey(), str); - } catch (Exception e) { - logger.error("Unable to add " + entry.getKey() + " to outputs - exception converting JsonNode", e); - } - } else if (entry.getValue() instanceof java.util.LinkedHashMap) { - try { - String str = JSON_MAPPER.writeValueAsString(entry.getValue()); - stringOutputs.put(entry.getKey(), str); - } catch (Exception e) { - logger.error("Unable to add " + entry.getKey() + " to outputs - exception converting LinkedHashMap", - e); - } - } else { - try { - String str = entry.getValue().toString(); - stringOutputs.put(entry.getKey(), str); - } catch (Exception e) { - logger.error("Unable to add " + entry.getKey() + " to outputs - unable to call .toString() ", e); - } - } - } - return stringOutputs; - } - - - private void sendMapToDebug(Map<String, Object> inputs, String optionalName) { - int i = 0; - StringBuilder sb = new StringBuilder(optionalName == null ? "\ninputs" : "\n" + optionalName); - if (inputs == null) { - sb.append("\tNULL"); - } else if (inputs.size() < 1) { - sb.append("\tEMPTY"); - } else { - for (Map.Entry<String, Object> entry : inputs.entrySet()) { - String outputString; - try { - outputString = entry.getValue().toString(); - } catch (Exception e) { - outputString = "Unable to call toString() on the value for " + entry.getKey(); - } - sb.append("\t\nitem " + i++ + ": '" + entry.getKey() + "'='" + outputString + "'"); - } - } - logger.debug(sb.toString()); - } - - private void sendMapToDebug(Map<String, Object> inputs) { - int i = 0; - StringBuilder sb = new StringBuilder("inputs:"); - if (inputs == null) { - sb.append("\tNULL"); - } else if (inputs.size() < 1) { - sb.append("\tEMPTY"); - } else { - for (Map.Entry<String, Object> entry : inputs.entrySet()) { - sb.append("\titem " + i++ + ": " + entry.getKey() + "=" + entry.getValue()); - } - } - logger.debug(sb.toString()); - } - - private String convertNode(final JsonNode node) { - try { - final Object obj = JSON_MAPPER.treeToValue(node, Object.class); - final String json = JSON_MAPPER.writeValueAsString(obj); - return json; - } catch (JsonParseException jpe) { - logger.error("Error converting json to string ", jpe); - } catch (Exception e) { - logger.error("Error converting json to string ", e); - } - return "[Error converting json to string]"; - } - - private Map<String, String> convertMapStringObjectToStringString(Map<String, Object> objectMap) { - if (objectMap == null) { - return null; - } - Map<String, String> stringMap = new HashMap<>(); - for (Map.Entry<String, Object> entry : objectMap.entrySet()) { - if (!stringMap.containsKey(entry.getKey())) { - Object obj = entry.getValue(); - if (obj instanceof String) { - stringMap.put(entry.getKey(), (String) entry.getValue()); - } else if (obj instanceof JsonNode) { - // This is a bit of mess - but I think it's the least impacting - // let's convert it BACK to a string - then it will get converted back later - try { - String str = this.convertNode((JsonNode) obj); - stringMap.put(entry.getKey(), str); - } catch (Exception e) { - logger.error("DANGER WILL ROBINSON: unable to convert value for JsonNode " + entry.getKey(), e); - // okay in this instance - only string values (fqdn) are expected to be needed - } - } else if (obj instanceof java.util.LinkedHashMap) { - logger.debug("LinkedHashMap - this is showing up as a LinkedHashMap instead of JsonNode"); - try { - String str = JSON_MAPPER.writeValueAsString(obj); - stringMap.put(entry.getKey(), str); - } catch (Exception e) { - logger.error( - "DANGER WILL ROBINSON: unable to convert value for LinkedHashMap " + entry.getKey(), e); - } - } else if (obj instanceof Integer) { - try { - String str = "" + obj; - stringMap.put(entry.getKey(), str); - } catch (Exception e) { - logger.error("DANGER WILL ROBINSON: unable to convert value for Integer " + entry.getKey(), e); - } - } else { - try { - String str = obj.toString(); - stringMap.put(entry.getKey(), str); - } catch (Exception e) { - logger.error("DANGER WILL ROBINSON: unable to convert value " + entry.getKey(), e); - } - } - } - } - - return stringMap; - } - - /** - * This is the "Create VF Module" web service implementation. It will instantiate a new VF Module of the requested - * type in the specified cloud and tenant. The tenant must exist before this service is called. - * - * If a VF Module with the same name already exists, this can be considered a success or failure, depending on the - * value of the 'failIfExists' parameter. - * - * All VF Modules are defined in the MSO catalog. The caller must request one of the pre-defined module types or an - * error will be returned. Within the catalog, each VF Module references (among other things) a cloud template which - * is used to deploy the required artifacts (VMs, networks, etc.) to the cloud. In this adapter implementation, that - * artifact is expected to be a Cloudify blueprint. - * - * Depending on the blueprint, a variable set of input parameters will be defined, some of which are required. The - * caller is responsible to pass the necessary input data for the module or an error will be thrown. - * - * The method returns the vfModuleId, a Map of output attributes, and a VnfRollback object. This last object can be - * passed as-is to the rollbackVnf operation to undo everything that was created for the Module. This is useful if a - * VF module is successfully created but the orchestration fails on a subsequent step. - * - * @param cloudSiteId CLLI code of the cloud site in which to create the VNF - * @param cloudOwner cloud owner of the cloud site in which to create the VNF - * @param tenantId Openstack tenant identifier - * @param vfModuleType VF Module type key, should match a VNF definition in catalog DB. Deprecated - should use - * modelCustomizationUuid - * @param vnfVersion VNF version key, should match a VNF definition in catalog DB Deprecated - VF Module versions - * also captured by modelCustomizationUuid - * @param genericVnfId Generic VNF ID - * @param vfModuleName Name to be assigned to the new VF Module - * @param vfModuleId Id of the new VF Module - * @param requestType Indicates if this is a Volume Group or Module request - * @param volumeGroupId Identifier (i.e. deployment ID) for a Volume Group to attach to a VF Module - * @param baseVfModuleId Identifier (i.e. deployment ID) of the Base Module if this is an Add-on module - * @param modelCustomizationUuid Unique ID for the VF Module's model. Replaces the use of vfModuleType. - * @param inputs Map of key=value inputs for VNF stack creation - * @param failIfExists Flag whether already existing VNF should be considered - * @param backout Flag whether to suppress automatic backout (for testing) - * @param msoRequest Request tracking information for logs - * @param vnfId Holder for output VNF Cloudify Deployment ID - * @param outputs Holder for Map of VNF outputs from Deployment (assigned IPs, etc) - * @param rollback Holder for returning VnfRollback object - */ - @Override - public void createVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vfModuleType, - String vnfVersion, String genericVnfId, String vfModuleName, String vfModuleId, String requestType, - String volumeGroupId, String baseVfModuleId, String modelCustomizationUuid, Map<String, Object> inputs, - Boolean failIfExists, Boolean backout, Boolean enableBridge, MsoRequest msoRequest, Holder<String> vnfId, - Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) throws VnfException { - - // Require a model customization ID. Every VF Module definition must have one. - if (modelCustomizationUuid == null || modelCustomizationUuid.isEmpty()) { - logger.debug("Missing required input: modelCustomizationUuid"); - String error = "Create vfModule error: Missing required input: modelCustomizationUuid"; - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), - "VF Module ModelCustomizationUuid", CLOUDIFY, ErrorCode.DataError.getValue(), - "Create VF Module: Missing required input: modelCustomizationUuid"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } - - // Clean up some inputs to make comparisons easier - if (requestType == null) - requestType = ""; - - if ("".equals(volumeGroupId) || "null".equals(volumeGroupId)) - volumeGroupId = null; - - if ("".equals(baseVfModuleId) || "null".equals(baseVfModuleId)) - baseVfModuleId = null; - - if (inputs == null) { - // Create an empty set of inputs - inputs = new HashMap<>(); - logger.debug("inputs == null - setting to empty"); - } else { - this.sendMapToDebug(inputs); - } - - // Check if this is for a "Volume" module - boolean isVolumeRequest = false; - if (requestType.startsWith("VOLUME")) { - isVolumeRequest = true; - } - - logger.debug("requestType = " + requestType + ", volumeGroupStackId = " + volumeGroupId + ", baseStackId = " - + baseVfModuleId); - - // Build a default rollback object (no actions performed) - VnfRollback vfRollback = new VnfRollback(); - vfRollback.setCloudSiteId(cloudSiteId); - vfRollback.setCloudOwner(cloudOwner); - vfRollback.setTenantId(tenantId); - vfRollback.setMsoRequest(msoRequest); - vfRollback.setRequestType(requestType); - vfRollback.setIsBase(false); // Until we know better - vfRollback.setVolumeGroupHeatStackId(volumeGroupId); - vfRollback.setBaseGroupHeatStackId(baseVfModuleId); - vfRollback.setModelCustomizationUuid(modelCustomizationUuid); - vfRollback.setMode("CFY"); - - rollback.value = vfRollback; // Default rollback - no updates performed - - // Get the VNF/VF Module definition from the Catalog DB first. - // There are three relevant records: VfModule, VfModuleCustomization, VnfResource - - VfModule vf = null; - VnfResource vnfResource = null; - VfModuleCustomization vfmc = null; - - try { - vfmc = vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(modelCustomizationUuid); - - if (vfmc == null) { - String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" - + modelCustomizationUuid; - logger.debug(error); - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), - "VF Module " + "ModelCustomizationUuid", modelCustomizationUuid, "CatalogDb", - ErrorCode.DataError.getValue(), error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } else { - logger.debug("Found vfModuleCust entry " + vfmc.toString()); - } - - // Get the vfModule and vnfResource records - vf = vfmc.getVfModule(); - vnfResource = vfmc.getVfModule().getVnfResources(); - } catch (Exception e) { - - logger.error("unhandled exception in create VF - [Query]", e); - throw new VnfException("Exception during create VF " + e.getMessage()); - } - - // Perform a version check against cloudSite - // Obtain the cloud site information where we will create the VF Module - Optional<CloudSite> cloudSiteOp = cloudConfig.getCloudSite(cloudSiteId); - if (!cloudSiteOp.isPresent()) { - throw new VnfException(new MsoCloudSiteNotFound(cloudSiteId)); - } - CloudSite cloudSite = cloudSiteOp.get(); - MavenLikeVersioning aicV = new MavenLikeVersioning(); - aicV.setVersion(cloudSite.getCloudVersion()); - - String vnfMin = vnfResource.getAicVersionMin(); - String vnfMax = vnfResource.getAicVersionMax(); - - if ((vnfMin != null && !(aicV.isMoreRecentThan(vnfMin) || aicV.isTheSameVersion(vnfMin))) - || (vnfMax != null && aicV.isMoreRecentThan(vnfMax))) { - // ERROR - String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" - + vnfResource.getModelUUID() + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax - + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSite.getCloudVersion(); - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_CONFIG_EXC.toString(), error, OPENSTACK, - ErrorCode.BusinessProcessError.getValue(), "Exception - setVersion"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } - // End Version check - - - DeploymentInfo cloudifyDeployment = null; - - // First, look up to see if the VF already exists. - - try { - cloudifyDeployment = cloudifyUtils.queryDeployment(cloudSiteId, tenantId, vfModuleName); - } catch (MsoException me) { - // Failed to query the Deployment due to a cloudify exception. - String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" - + tenantId + ": " + me; - logger.error(LoggingAnchor.EIGHT, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId, - tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(), - "Exception - queryDeployment", me); - logger.debug(error); - - // Convert to a generic VnfException - me.addContext("CreateVFModule"); - throw new VnfException(me); - } - - // More precise handling/messaging if the Module already exists - if (cloudifyDeployment != null && !(cloudifyDeployment.getStatus() == DeploymentStatus.NOTFOUND)) { - // CREATED, INSTALLED, INSTALLING, FAILED, UNINSTALLING, UNKNOWN - DeploymentStatus status = cloudifyDeployment.getStatus(); - logger.debug("Found Existing Deployment, status=" + status); - - if (status == DeploymentStatus.INSTALLED) { - // fail - it exists - if (failIfExists != null && failIfExists) { - String error = "Create VF: Deployment " + vfModuleName + " already exists in " + cloudOwner + "/" - + cloudSiteId + "/" + tenantId; - logger.error(BRACKETS, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(), - "Deployment " + vfModuleName + " already exists"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, - cloudifyDeployment.getId()); - } else { - // Found existing deployment and client has not requested "failIfExists". - // Populate the outputs from the existing deployment. - - vnfId.value = cloudifyDeployment.getId(); - outputs.value = copyStringOutputs(cloudifyDeployment.getOutputs()); - return; - } - } - // Check through various detailed error cases - if (status == DeploymentStatus.INSTALLING || status == DeploymentStatus.UNINSTALLING) { - // fail - it's in progress - return meaningful error - String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " - + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + "; please wait for it to complete, or fix manually."; - logger.error(BRACKETS, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(), - "Deployment " + vfModuleName + " already exists"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId()); - } else if (status == DeploymentStatus.FAILED) { - // fail - it exists and is in a FAILED state - String error = "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " - + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention."; - logger.error(BRACKETS, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(), - "Deployment " + vfModuleName + " already " + "exists and is in FAILED state"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId()); - } else if (status == DeploymentStatus.UNKNOWN || status == DeploymentStatus.CREATED) { - // fail - it exists and is in a UNKNOWN state - String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " - + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + "; requires manual intervention."; - logger.error(BRACKETS, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(), - "Deployment " + vfModuleName + " already " + "exists and is in " + status.toString() - + " state"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId()); - } else { - // Unexpected, since all known status values have been tested for - String error = "Create VF: Deployment " + vfModuleName + " already exists with unexpected status " - + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + "; requires manual intervention."; - logger.error(BRACKETS, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(), - "Deployment " + vfModuleName + " already " + "exists and is in an unknown state"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId()); - } - } - - - // Collect outputs from Base Modules and Volume Modules - Map<String, Object> baseModuleOutputs = null; - Map<String, Object> volumeGroupOutputs = null; - - // If a Volume Group was provided, query its outputs for inclusion in Module input parameters - if (volumeGroupId != null) { - DeploymentInfo volumeDeployment = null; - try { - volumeDeployment = cloudifyUtils.queryDeployment(cloudSiteId, tenantId, volumeGroupId); - } catch (MsoException me) { - // Failed to query the Volume GroupDeployment due to a cloudify exception. - String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudOwner + "/" - + cloudSiteId + "/" + tenantId + ": " + me; - logger.error(BRACKETS, MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId, cloudOwner, cloudSiteId, - tenantId, CLOUDIFY, "queryDeployment(volume)", ErrorCode.DataError.getValue(), - "Exception - queryDeployment(volume)", me); - logger.debug(error); - // Convert to a generic VnfException - me.addContext("CreateVFModule(QueryVolume)"); - throw new VnfException(me); - } - - if (volumeDeployment == null || volumeDeployment.getStatus() == DeploymentStatus.NOTFOUND) { - String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " - + cloudSiteId + "/" + tenantId + " USER ERROR"; - logger.error(BRACKETS, MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId, cloudSiteId, tenantId, - error, CLOUDIFY, "queryDeployment(volume)", ErrorCode.BusinessProcessError.getValue(), - "Create VFModule: Attached Volume Group DOES NOT EXIST"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } else { - logger.debug("Found nested volume group"); - volumeGroupOutputs = volumeDeployment.getOutputs(); - this.sendMapToDebug(volumeGroupOutputs, "volumeGroupOutputs"); - } - } - - // If this is an Add-On Module, query the Base Module outputs - // Note: This will be performed whether or not the current request is for an - // Add-On Volume Group or Add-On VF Module - - if (vf.getIsBase()) { - logger.debug("This is a BASE Module request"); - vfRollback.setIsBase(true); - } else { - logger.debug("This is an Add-On Module request"); - - // Add-On Modules should always have a Base, but just treat as a warning if not provided. - // Add-on Volume requests may or may not specify a base. - if (!isVolumeRequest && baseVfModuleId == null) { - logger.debug("WARNING: Add-on Module request - no Base Module ID provided"); - } - - if (baseVfModuleId != null) { - DeploymentInfo baseDeployment = null; - try { - baseDeployment = cloudifyUtils.queryDeployment(cloudSiteId, tenantId, baseVfModuleId); - } catch (MsoException me) { - // Failed to query the Volume GroupDeployment due to a cloudify exception. - String error = "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudOwner + "/" - + cloudSiteId + "/" + tenantId + ": " + me; - logger.error(BRACKETS, MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId, cloudOwner, - cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(Base)", ErrorCode.DataError.getValue(), - "Exception - queryDeployment(Base)", me); - logger.debug(error); - // Convert to a generic VnfException - me.addContext("CreateVFModule(QueryBase)"); - throw new VnfException(me); - } - - if (baseDeployment == null || baseDeployment.getStatus() == DeploymentStatus.NOTFOUND) { - String error = "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " - + cloudSiteId + "/" + tenantId + " USER ERROR"; - logger.error(BRACKETS, MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId, cloudSiteId, - tenantId, error, CLOUDIFY, "queryDeployment(Base)", - ErrorCode.BusinessProcessError.getValue(), - "Create VFModule: Base " + "Module DOES NOT EXIST"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } else { - logger.debug("Found base module"); - baseModuleOutputs = baseDeployment.getOutputs(); - this.sendMapToDebug(baseModuleOutputs, "baseModuleOutputs"); - } - } - } - - - // Ready to deploy the new VNF - - // NOTE: For this section, heatTemplate is used for both HEAT templates and Cloudify blueprints. - // In final implementation (post-POC), the template object would either be generic or there would - // be a separate DB Table/Object for Blueprints. - - - // NOTE: The template is fixed for the VF Module. The environment is part of the customization. - HeatTemplate heatTemplate = null; - HeatEnvironment heatEnvironment = null; - if (isVolumeRequest) { - heatTemplate = vf.getVolumeHeatTemplate(); - heatEnvironment = vfmc.getVolumeHeatEnv(); - } else { - heatTemplate = vf.getModuleHeatTemplate(); - heatEnvironment = vfmc.getHeatEnvironment(); - } - - if (heatTemplate == null) { - String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType - + ", modelCustomizationUuid=" + modelCustomizationUuid + ", vfModuleUuid=" + vf.getModelUUID() - + ", reqType=" + requestType; - logger.error(LoggingAnchor.SIX, MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", - vfModuleType, OPENSTACK, ErrorCode.DataError.getValue(), error); - throw new VnfException(error, MsoExceptionCategory.INTERNAL); - } else { - logger.debug("Got HEAT Template from DB: {}", heatTemplate.getHeatTemplate()); - } - - if (heatEnvironment == null) { - String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType + ", modelCustomizationUuid=" - + modelCustomizationUuid + ", vfModuleUuid=" + vf.getModelUUID() + ", reqType=" + requestType; - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID", - OPENSTACK, ErrorCode.DataError.getValue(), error); - // Alarm on this error, configuration must be fixed - throw new VnfException(error, MsoExceptionCategory.INTERNAL); - } else { - logger.debug("Got Heat Environment from DB: {}", heatEnvironment.getEnvironment()); - } - - - try { - // All variables converted to their native object types - HashMap<String, Object> goldenInputs = new HashMap<>(); - List<String> extraInputs = new ArrayList<>(); - - // NOTE: SKIP THIS FOR CLOUDIFY for now. Just use what was passed in. - // This whole section needs to be rewritten. - Boolean skipInputChecks = false; - - if (skipInputChecks) { - goldenInputs = new HashMap<>(); - for (Map.Entry<String, Object> entry : inputs.entrySet()) { - goldenInputs.put(entry.getKey(), entry.getValue()); - } - } else { - // Build maps for the parameters (including aliases) to simplify checks - HashMap<String, HeatTemplateParam> params = new HashMap<>(); - - Set<HeatTemplateParam> paramSet = heatTemplate.getParameters(); - logger.debug("paramSet has {} entries", paramSet.size()); - - for (HeatTemplateParam htp : paramSet) { - params.put(htp.getParamName(), htp); - - // Include aliases. - String alias = htp.getParamAlias(); - if (alias != null && !"".equals(alias) && !params.containsKey(alias)) { - params.put(alias, htp); - } - } - - // First, convert all inputs to their "template" type - for (String key : inputs.keySet()) { - if (params.containsKey(key)) { - Object value = cloudifyUtils.convertInputValue(inputs.get(key), params.get(key)); - if (value != null) { - goldenInputs.put(key, value); - } else { - logger.debug("Failed to convert input " + key + "='" + inputs.get(key) + "' to " - + params.get(key).getParamType()); - } - } else { - extraInputs.add(key); - } - } - - if (!extraInputs.isEmpty()) { - logger.debug("Ignoring extra inputs: " + extraInputs); - } - - // Next add in Volume Group Outputs if there are any. Copy directly without conversions. - if (volumeGroupOutputs != null && !volumeGroupOutputs.isEmpty()) { - for (Map.Entry<String, Object> entry : volumeGroupOutputs.entrySet()) { - if (params.containsKey(entry.getKey()) && !goldenInputs.containsKey(entry.getKey())) { - goldenInputs.put(entry.getKey(), entry.getValue()); - } - } - } - - // Next add in Base Module Outputs if there are any. Copy directly without conversions. - if (baseModuleOutputs != null && !baseModuleOutputs.isEmpty()) { - for (Map.Entry<String, Object> entry : baseModuleOutputs.entrySet()) { - if (params.containsKey(entry.getKey()) && !goldenInputs.containsKey(entry.getKey())) { - goldenInputs.put(entry.getKey(), entry.getValue()); - } - } - } - - // Last, add in values from the "environment" file. - // These are added to the inputs, since Cloudify doesn't pass an environment file like Heat. - - // TODO: This may take a different form for Cloudify, but for now process it - // with Heat environment file syntax - StringBuilder sb = new StringBuilder(heatEnvironment.getEnvironment()); - MsoHeatEnvironmentEntry mhee = new MsoHeatEnvironmentEntry(sb); - - if (mhee.getParameters() != null) { - for (MsoHeatEnvironmentParameter envParam : mhee.getParameters()) { - // If this is a template input, copy to golden inputs - String envKey = envParam.getName(); - if (params.containsKey(envKey) && !goldenInputs.containsKey(envKey)) { - Object value = cloudifyUtils.convertInputValue(envParam.getValue(), params.get(envKey)); - if (value != null) { - goldenInputs.put(envKey, value); - } else { - logger.debug("Failed to convert environment parameter " + envKey + "='" - + envParam.getValue() + "' to " + params.get(envKey).getParamType()); - } - } - } - } - - this.sendMapToDebug(goldenInputs, "Final inputs sent to Cloudify"); - - - // Check that required parameters have been supplied from any of the sources - String missingParams = null; - boolean checkRequiredParameters = true; - try { - String propertyString = this.environment.getProperty(MsoVnfCloudifyAdapterImpl.CHECK_REQD_PARAMS); - if ("false".equalsIgnoreCase(propertyString) || "n".equalsIgnoreCase(propertyString)) { - checkRequiredParameters = false; - logger.debug("CheckRequiredParameters is FALSE. Will still check but then skip blocking... {}", - MsoVnfCloudifyAdapterImpl.CHECK_REQD_PARAMS); - } - } catch (Exception e) { - // No problem - default is true - logger.error("An exception occured trying to get property {}", - MsoVnfCloudifyAdapterImpl.CHECK_REQD_PARAMS, e); - } - - - for (HeatTemplateParam parm : heatTemplate.getParameters()) { - if (parm.isRequired() && (!goldenInputs.containsKey(parm.getParamName()))) { - logger.debug("adding to missing parameters list: {}", parm.getParamName()); - if (missingParams == null) { - missingParams = parm.getParamName(); - } else { - missingParams += "," + parm.getParamName(); - } - } - } - - if (missingParams != null) { - if (checkRequiredParameters) { - // Problem - missing one or more required parameters - String error = "Create VFModule: Missing Required inputs: " + missingParams; - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_MISSING_PARAM.toString(), missingParams, - CLOUDIFY, ErrorCode.DataError.getValue(), "Create VFModule: Missing Required inputs"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } else { - logger.debug("found missing parameters [" + missingParams - + "] - but checkRequiredParameters is false -" + " will not block"); - } - } else { - logger.debug("No missing parameters found - ok to proceed"); - } - - } // NOTE: END PARAMETER CHECKING - - // Ready to deploy the VF Module. - // *First step - make sure the blueprint is loaded into Cloudify. - String blueprintName = heatTemplate.getTemplateName(); - String blueprint = heatTemplate.getTemplateBody(); - String blueprintId = blueprintName; - - // Use the main blueprint name as the blueprint ID (strip yaml extensions). - if (blueprintId.endsWith(".yaml")) - blueprintId = blueprintId.substring(0, blueprintId.lastIndexOf(".yaml")); - - try { - if (!cloudifyUtils.isBlueprintLoaded(cloudSiteId, blueprintId)) { - logger.debug("Blueprint " + blueprintId + " is not loaded. Will upload it now."); - - Map<String, byte[]> blueprintFiles = new HashMap<>(); - - blueprintFiles.put(blueprintName, blueprint.getBytes()); - - // TODO: Implement nested blueprint logic based on Cloudify structures. - // For now, just use the Heat structures. - // The query returns a map of String->Object, where the map keys provide one layer of - // indirection from the Heat template names. For this case, assume the map key matches - // the nested blueprint name. - List<HeatTemplate> nestedBlueprints = heatTemplate.getChildTemplates(); - if (nestedBlueprints != null) { - for (HeatTemplate nestedBlueprint : nestedBlueprints) { - blueprintFiles.put(nestedBlueprint.getTemplateName(), - nestedBlueprint.getTemplateBody().getBytes()); - } - } - - // TODO: Implement file artifact logic based on Cloudify structures. - // For now, just use the Heat structures. - List<HeatFiles> heatFiles = vf.getHeatFiles(); - if (heatFiles != null) { - for (HeatFiles heatFile : heatFiles) { - blueprintFiles.put(heatFile.getFileName(), heatFile.getFileBody().getBytes()); - } - } - - // Upload the blueprint package - cloudifyUtils.uploadBlueprint(cloudSiteId, blueprintId, blueprintName, blueprintFiles, false); - - } - } - - catch (MsoException me) { - me.addContext("CreateVFModule"); - String error = "Create VF Module: Upload blueprint failed. Blueprint=" + blueprintName + ": " + me; - logger.error(LoggingAnchor.SEVEN, MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId, - tenantId, CLOUDIFY, ErrorCode.DataError.getValue(), "MsoException - uploadBlueprint", me); - logger.debug(error); - throw new VnfException(me); - } - - // Ignore MsoTenantNotFound and MsoStackAlreadyExists exceptions - // because we already checked for those. - try { - // KLUDGE - Cloudify requires Tenant Name for Openstack. We have the ID. - // Go directly to Keystone until APIs could be updated to supply the name. - MsoTenant msoTenant = keystoneUtils.queryTenant(tenantId, cloudSiteId); - String tenantName = (msoTenant != null ? msoTenant.getTenantName() : tenantId); - - if (backout == null) { - backout = true; - } - - cloudifyDeployment = cloudifyUtils.createAndInstallDeployment(cloudSiteId, tenantName, vfModuleName, - blueprintId, goldenInputs, true, heatTemplate.getTimeoutMinutes(), backout.booleanValue()); - - } catch (MsoException me) { - me.addContext("CreateVFModule"); - String error = "Create VF Module " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" - + tenantId + ": " + me; - logger.error(LoggingAnchor.EIGHT, MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, - cloudSiteId, tenantId, CLOUDIFY, ErrorCode.DataError.getValue(), - "MsoException - createDeployment", me); - logger.debug(error); - throw new VnfException(me); - } catch (NullPointerException npe) { - String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" - + tenantId + ": " + npe; - logger.error(LoggingAnchor.EIGHT, MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, - cloudSiteId, tenantId, CLOUDIFY, ErrorCode.DataError.getValue(), - "NullPointerException - createDeployment", npe); - logger.debug(error); - logger.debug("NULL POINTER EXCEPTION at cloudify.createAndInstallDeployment"); - // npe.addContext ("CreateVNF"); - throw new VnfException("NullPointerException during cloudify.createAndInstallDeployment"); - } catch (Exception e) { - logger.error("unhandled exception at cloudify.createAndInstallDeployment", e); - throw new VnfException("Exception during cloudify.createAndInstallDeployment! " + e.getMessage()); - } - } catch (Exception e) { - logger.error("unhandled exception in create VF", e); - throw new VnfException("Exception during create VF " + e.getMessage()); - - } - - // Reach this point if create is successful. - // Populate remaining rollback info and response parameters. - vfRollback.setVnfCreated(true); - vfRollback.setVnfId(cloudifyDeployment.getId()); - vnfId.value = cloudifyDeployment.getId(); - outputs.value = copyStringOutputs(cloudifyDeployment.getOutputs()); - - rollback.value = vfRollback; - - logger.debug("VF Module successfully created {}", vfModuleName); - - } - - public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, String vnfId, - String vfModuleId, String modelCustomizationUuid, MsoRequest msoRequest, - Holder<Map<String, String>> outputs) throws VnfException { - logger.debug("Deleting VF " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId); - - // 1702 capture the output parameters on a delete - // so we'll need to query first - DeploymentInfo deployment = null; - try { - deployment = cloudifyUtils.queryDeployment(cloudSiteId, tenantId, vnfName); - } catch (MsoException me) { - // Failed to query the deployment. Convert to a generic VnfException - me.addContext("DeleteVFModule"); - String error = "Delete VFModule: Query to get outputs: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId - + "/" + tenantId + ": " + me; - logger.error(BRACKETS, MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId, tenantId, - CLOUDIFY, "QueryDeployment", ErrorCode.DataError.getValue(), "Exception - QueryDeployment", me); - logger.debug(error); - throw new VnfException(me); - } - // call method which handles the conversion from Map<String,Object> to Map<String,String> for our expected - // Object types - outputs.value = convertMapStringObjectToStringString(deployment.getOutputs()); - - // Use the MsoHeatUtils to delete the stack. Set the polling flag to true. - // The possible outcomes of deleteStack are a StackInfo object with status - // of NOTFOUND (on success) or FAILED (on error). Also, MsoOpenstackException - // could be thrown. - try { - cloudifyUtils.uninstallAndDeleteDeployment(cloudSiteId, tenantId, vnfName, 5); - } catch (MsoException me) { - me.addContext("DeleteVfModule"); - // Convert to a generic VnfException - String error = - "Delete VF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; - logger.error(BRACKETS, MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId, tenantId, - "DeleteDeployment", "DeleteDeployment", ErrorCode.DataError.getValue(), - "Exception - DeleteDeployment: " + me.getMessage()); - logger.debug(error); - throw new VnfException(me); - } - - // On success, nothing is returned. - return; - } - - // TODO: Should Update be supported for Cloudify? What would this look like? - @Override - public void updateVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, - String vnfVersion, String vnfName, String requestType, String volumeGroupHeatStackId, - String baseVfHeatStackId, String vfModuleStackId, String modelCustomizationUuid, Map<String, Object> inputs, - MsoRequest msoRequest, Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) - throws VnfException { - // This operation is not currently supported for Cloudify-orchestrated VF Modules. - logger.debug("Update VF Module command attempted but not supported"); - throw new VnfException("UpdateVfModule: Unsupported command", MsoExceptionCategory.USERDATA); - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java deleted file mode 100644 index 0ecfd15dde..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ /dev/null @@ -1,1169 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -/** - * This VNF Adapter implementation is based on the VDU Plugin model. It assumes that each VF Module definition in the - * MSO catalog is expressed via a set of template and/or file artifacts that are appropriate for some specific - * sub-orchestrator that provides an implementation of the VduPlugin interface. This adapter handles all of the common - * VF Module logic, including: - catalog lookups for artifact retrieval - parameter filtering and validation - base and - * volume module queries - rollback logic - logging and error handling - * - * Then based on the orchestration mode of the VNF, it will invoke different VDU plug-ins to perform the low level - * instantiations, deletions, and queries. At this time, the set of available plug-ins is hard-coded, though in the - * future a dynamic selection is expected (e.g. via a service-provider interface). - */ -package org.onap.so.adapters.vnf; - - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import javax.jws.WebService; -import javax.xml.ws.Holder; -import org.onap.so.logger.LoggingAnchor; -import org.onap.so.adapters.vdu.CloudInfo; -import org.onap.so.adapters.vdu.VduException; -import org.onap.so.adapters.vdu.VduInstance; -import org.onap.so.adapters.vdu.VduModelInfo; -import org.onap.so.adapters.vdu.VduPlugin; -import org.onap.so.adapters.vdu.VduStateType; -import org.onap.so.adapters.vdu.VduStatus; -import org.onap.so.adapters.vdu.mapper.VfModuleCustomizationToVduMapper; -import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.cloud.CloudConfig; -import org.onap.so.db.catalog.beans.CloudSite; -import org.onap.so.cloudify.utils.MsoCloudifyUtils; -import org.onap.so.db.catalog.beans.HeatEnvironment; -import org.onap.so.db.catalog.beans.HeatTemplate; -import org.onap.so.db.catalog.beans.HeatTemplateParam; -import org.onap.so.db.catalog.beans.VfModule; -import org.onap.so.db.catalog.beans.VfModuleCustomization; -import org.onap.so.db.catalog.beans.VnfResource; -import org.onap.so.db.catalog.data.repository.VFModuleCustomizationRepository; -import org.onap.so.db.catalog.utils.MavenLikeVersioning; -import org.onap.so.entity.MsoRequest; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; -import org.onap.so.openstack.exceptions.MsoException; -import org.onap.so.openstack.exceptions.MsoExceptionCategory; -import org.onap.so.openstack.utils.MsoHeatEnvironmentEntry; -import org.onap.so.openstack.utils.MsoHeatUtils; -import org.onap.so.openstack.utils.MsoKeystoneUtils; -import org.onap.so.openstack.utils.MsoMulticloudUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -@WebService(serviceName = "VnfAdapter", endpointInterface = "org.onap.so.adapters.vnf.MsoVnfAdapter", - targetNamespace = "http://org.onap.so/vnf") -@Component -@Transactional -public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { - - private static Logger logger = LoggerFactory.getLogger(MsoVnfPluginAdapterImpl.class); - - private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters"; - private static final ObjectMapper JSON_MAPPER = new ObjectMapper(); - - @Autowired - protected CloudConfig cloudConfig; - - @Autowired - private VFModuleCustomizationRepository vfModuleCustomRepo; - - @Autowired - private Environment environment; - - @Autowired - protected MsoKeystoneUtils keystoneUtils; - - @Autowired - protected MsoCloudifyUtils cloudifyUtils; - - @Autowired - protected MsoHeatUtils heatUtils; - - @Autowired - protected MsoMulticloudUtils multicloudUtils; - - @Autowired - protected VfModuleCustomizationToVduMapper vduMapper; - - /** - * DO NOT use that constructor to instantiate this class, the msoPropertiesfactory will be NULL. - * - * @see MsoVnfPluginAdapterImpl#MsoVnfAdapterImpl(MsoPropertiesFactory, CloudConfigFactory) - */ - public MsoVnfPluginAdapterImpl() { - - } - - /** - * Health Check web method. Does nothing but return to show the adapter is deployed. - */ - @Override - public void healthCheck() { - logger.debug("Health check call in VNF Plugin Adapter"); - } - - /** - * This is the "Create VNF" web service implementation. This function is now unsupported and will return an error. - * - */ - @Override - public void createVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, - String vnfName, String requestType, String volumeGroupHeatStackId, Map<String, Object> inputs, - Boolean failIfExists, Boolean backout, Boolean enableBridge, MsoRequest msoRequest, Holder<String> vnfId, - Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) throws VnfException { - // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules. - logger.debug("CreateVNF command attempted but not supported"); - throw new VnfException("CreateVNF: Unsupported command", MsoExceptionCategory.USERDATA); - } - - /** - * This is the "Update VNF" web service implementation. This function is now unsupported and will return an error. - * - */ - @Override - public void updateVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, String vnfVersion, - String vnfName, String requestType, String volumeGroupHeatStackId, Map<String, Object> inputs, - MsoRequest msoRequest, Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) - throws VnfException { - // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules. - logger.debug("UpdateVNF command attempted but not supported"); - throw new VnfException("UpdateVNF: Unsupported command", MsoExceptionCategory.USERDATA); - } - - /** - * This is the "Query VNF" web service implementation. - * - * This really should be QueryVfModule, but nobody ever changed it. - * - * The method returns an indicator that the VNF exists, along with its status and outputs. The input "vnfName" will - * also be reflected back as its ID. - * - * @param cloudSiteId CLLI code of the cloud site in which to query - * @param tenantId Openstack tenant identifier - * @param vnfNameOrId VNF Name or ID to query - * @param msoRequest Request tracking information for logs - * @param vnfExists Flag reporting the result of the query - * @param vnfId Holder for output VNF ID - * @param outputs Holder for Map of outputs from the deployed VF Module (assigned IPs, etc) - */ - @Override - public void queryVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfNameOrId, - MsoRequest msoRequest, Holder<Boolean> vnfExists, Holder<String> vnfId, Holder<VnfStatus> status, - Holder<Map<String, String>> outputs) throws VnfException { - logger.debug("Querying VNF " + vnfNameOrId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId); - - VduInstance vduInstance; - CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null); - - VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner); - - try { - vduInstance = vduPlugin.queryVdu(cloudInfo, vnfNameOrId); - } catch (VduException e) { - // Failed to query the VDU due to a plugin exception. - // Convert to a generic VnfException - e.addContext("QueryVNF"); - String error = "Query VNF (VDU): " + vnfNameOrId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + ": " + e; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfNameOrId, cloudOwner, - cloudSiteId, tenantId, "VDU", "QueryVNF", ErrorCode.DataError.getValue(), "Exception - queryVDU", - e); - logger.debug(error); - throw new VnfException(e); - } - - if (vduInstance != null && vduInstance.getStatus().getState() != VduStateType.NOTFOUND) { - vnfExists.value = Boolean.TRUE; - status.value = vduStatusToVnfStatus(vduInstance); - vnfId.value = vduInstance.getVduInstanceId(); - outputs.value = copyStringOutputs(vduInstance.getOutputs()); - - logger.debug("VNF {} found, ID = {}", vnfNameOrId, vnfId.value); - } else { - vnfExists.value = Boolean.FALSE; - status.value = VnfStatus.NOTFOUND; - vnfId.value = null; - outputs.value = new HashMap<String, String>(); // Return as an empty map - - logger.debug("VNF {} not found", vnfNameOrId); - } - return; - } - - - /** - * This is the "Delete VNF" web service implementation. This function is now unsupported and will return an error. - * - */ - @Override - public void deleteVnf(String cloudSiteId, String cloudOwner, String tenantId, String vnfName, MsoRequest msoRequest) - throws VnfException { - - // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules. - logger.debug("DeleteVNF command attempted but not supported"); - throw new VnfException("DeleteVNF: Unsupported command", MsoExceptionCategory.USERDATA); - } - - /** - * This web service endpoint will rollback a previous Create VNF operation. A rollback object is returned to the - * client in a successful creation response. The client can pass that object as-is back to the rollbackVnf operation - * to undo the creation. - * - * TODO: This should be rollbackVfModule and/or rollbackVolumeGroup, but APIs were apparently never updated. - */ - @Override - public void rollbackVnf(VnfRollback rollback) throws VnfException { - // rollback may be null (e.g. if stack already existed when Create was called) - if (rollback == null) { - logger.info(LoggingAnchor.THREE, MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf"); - return; - } - - // Don't rollback if nothing was done originally - if (!rollback.getVnfCreated()) { - return; - } - - // Get the elements of the VnfRollback object for easier access - String cloudSiteId = rollback.getCloudSiteId(); - String cloudOwner = rollback.getCloudOwner(); - String tenantId = rollback.getTenantId(); - CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null); - - String vfModuleId = rollback.getVfModuleStackId(); - - logger.debug("Rolling Back VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId); - - VduInstance vduInstance = null; - - // Use the VduPlugin to delete the VF Module. - VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner); - - try { - // TODO: Get a reasonable timeout. Use a global property, or store the creation timeout in rollback object - // and use that. - vduInstance = vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5); - - logger.debug("Rolled back VDU instantiation: {}", vduInstance.getVduInstanceId()); - } catch (VduException ve) { - // Failed to rollback the VF Module due to a plugin exception. - // Convert to a generic VnfException - ve.addContext("RollbackVFModule"); - String error = "Rollback VF Module: " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" - + tenantId + ": " + ve; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudOwner, - cloudSiteId, tenantId, "VDU", "DeleteVdu", ErrorCode.DataError.getValue(), "Exception - DeleteVdu", - ve); - logger.debug(error); - throw new VnfException(ve); - } - return; - } - - - private VnfStatus vduStatusToVnfStatus(VduInstance vdu) { - // Determine the status based on last action & status - // DeploymentInfo object should be enhanced to report a better status internally. - VduStatus vduStatus = vdu.getStatus(); - VduStateType status = vduStatus.getState(); - - if (status == null) { - return VnfStatus.UNKNOWN; - } else if (status == VduStateType.NOTFOUND) { - return VnfStatus.NOTFOUND; - } else if (status == VduStateType.INSTANTIATED) { - return VnfStatus.ACTIVE; - } else if (status == VduStateType.FAILED) { - return VnfStatus.FAILED; - } - - return VnfStatus.UNKNOWN; - } - - /* - * Normalize an input value to an Object, based on the target parameter type. If the type is not recognized, it will - * just be returned unchanged (as a string). - */ - private Object convertInputValue(Object inputValue, HeatTemplateParam templateParam) { - String type = templateParam.getParamType(); - logger.debug("Parameter: {} is of type ", templateParam.getParamName(), type); - - if ("number".equalsIgnoreCase(type)) { - try { - return Integer.valueOf(inputValue.toString()); - } catch (Exception e) { - logger.debug("Unable to convert " + inputValue + " to an integer!", e); - return null; - } - } else if ("json".equalsIgnoreCase(type)) { - try { - JsonNode jsonNode = JSON_MAPPER.readTree(JSON_MAPPER.writeValueAsString(inputValue)); - return jsonNode; - } catch (Exception e) { - logger.debug("Unable to convert " + inputValue + " to a JsonNode!", e); - return null; - } - } else if ("boolean".equalsIgnoreCase(type)) { - return Boolean.valueOf(inputValue.toString()); - } - - // Nothing else matched. Return the original string - return inputValue; - } - - private Map<String, String> copyStringOutputs(Map<String, Object> stackOutputs) { - Map<String, String> stringOutputs = new HashMap<>(); - for (String key : stackOutputs.keySet()) { - if (stackOutputs.get(key) instanceof String) { - stringOutputs.put(key, (String) stackOutputs.get(key)); - } else if (stackOutputs.get(key) instanceof Integer) { - try { - String str = "" + stackOutputs.get(key); - stringOutputs.put(key, str); - } catch (Exception e) { - logger.debug("Unable to add {} to outputs", key, e); - } - } else if (stackOutputs.get(key) instanceof JsonNode) { - try { - String str = this.convertNode((JsonNode) stackOutputs.get(key)); - stringOutputs.put(key, str); - } catch (Exception e) { - logger.debug("Unable to add {} to outputs - exception converting JsonNode", key, e); - } - } else if (stackOutputs.get(key) instanceof java.util.LinkedHashMap) { - try { - String str = JSON_MAPPER.writeValueAsString(stackOutputs.get(key)); - stringOutputs.put(key, str); - } catch (Exception e) { - logger.debug("Unable to add {} to outputs - exception converting LinkedHashMap", key, e); - } - } else { - try { - String str = stackOutputs.get(key).toString(); - stringOutputs.put(key, str); - } catch (Exception e) { - logger.debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage(), - e); - } - } - } - return stringOutputs; - } - - - private void sendMapToDebug(Map<String, Object> inputs, String optionalName) { - int i = 0; - StringBuilder sb = new StringBuilder(optionalName == null ? "\ninputs" : "\n" + optionalName); - if (inputs == null) { - sb.append("\tNULL"); - } else if (inputs.size() < 1) { - sb.append("\tEMPTY"); - } else { - for (String str : inputs.keySet()) { - String outputString; - try { - outputString = inputs.get(str).toString(); - } catch (Exception e) { - outputString = "Unable to call toString() on the value for " + str; - } - sb.append("\t\nitem " + i++ + ": '" + str + "'='" + outputString + "'"); - } - } - logger.debug(sb.toString()); - return; - } - - private void sendMapToDebug(Map<String, Object> inputs) { - int i = 0; - StringBuilder sb = new StringBuilder("inputs:"); - if (inputs == null) { - sb.append("\tNULL"); - } else if (inputs.size() < 1) { - sb.append("\tEMPTY"); - } else { - for (String str : inputs.keySet()) { - sb.append("\titem " + i++ + ": " + str + "=" + inputs.get(str)); - } - } - logger.debug(sb.toString()); - return; - } - - private String convertNode(final JsonNode node) { - try { - final Object obj = JSON_MAPPER.treeToValue(node, Object.class); - final String json = JSON_MAPPER.writeValueAsString(obj); - return json; - } catch (JsonParseException jpe) { - logger.debug("Error converting json to string " + jpe.getMessage()); - } catch (Exception e) { - logger.debug("Error converting json to string " + e.getMessage()); - } - return "[Error converting json to string]"; - } - - private Map<String, String> convertMapStringObjectToStringString(Map<String, Object> objectMap) { - if (objectMap == null) { - return null; - } - Map<String, String> stringMap = new HashMap<>(); - for (String key : objectMap.keySet()) { - if (!stringMap.containsKey(key)) { - Object obj = objectMap.get(key); - if (obj instanceof String) { - stringMap.put(key, (String) objectMap.get(key)); - } else if (obj instanceof JsonNode) { - // This is a bit of mess - but I think it's the least impacting - // let's convert it BACK to a string - then it will get converted back later - try { - String str = this.convertNode((JsonNode) obj); - stringMap.put(key, str); - } catch (Exception e) { - logger.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode " + key, e); - // okay in this instance - only string values (fqdn) are expected to be needed - } - } else if (obj instanceof java.util.LinkedHashMap) { - logger.debug("LinkedHashMap - this is showing up as a LinkedHashMap instead of JsonNode"); - try { - String str = JSON_MAPPER.writeValueAsString(obj); - stringMap.put(key, str); - } catch (Exception e) { - logger.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap " + key, e); - } - } else if (obj instanceof Integer) { - try { - String str = "" + obj; - stringMap.put(key, str); - } catch (Exception e) { - logger.debug("DANGER WILL ROBINSON: unable to convert value for Integer " + key, e); - } - } else { - try { - String str = obj.toString(); - stringMap.put(key, str); - } catch (Exception e) { - logger.debug( - "DANGER WILL ROBINSON: unable to convert value " + key + " (" + e.getMessage() + ")", - e); - } - } - } - } - - return stringMap; - } - - /** - * This is the "Create VF Module" web service implementation. It will instantiate a new VF Module of the requested - * type in the specified cloud and tenant. The tenant must exist before this service is called. - * - * If a VF Module with the same name already exists, this can be considered a success or failure, depending on the - * value of the 'failIfExists' parameter. - * - * All VF Modules are defined in the MSO catalog. The caller must request one of the pre-defined module types or an - * error will be returned. Within the catalog, each VF Module references (among other things) a collection of - * artifacts that are used to deploy the required cloud resources (VMs, networks, etc.). - * - * Depending on the module templates, a variable set of input parameters will be defined, some of which are - * required. The caller is responsible to pass the necessary input data for the module or an error will be thrown. - * - * The method returns the vfModuleId, a Map of output attributes, and a VnfRollback object. This last object can be - * passed as-is to the rollbackVnf operation to undo everything that was created for the Module. This is useful if a - * VF module is successfully created but the orchestration fails on a subsequent step. - * - * @param cloudSiteId CLLI code of the cloud site in which to create the VNF - * @param cloudOwner cloud owner of the cloud site in which to create the VNF - * @param tenantId Openstack tenant identifier - * @param vfModuleType VF Module type key, should match a VNF definition in catalog DB. Deprecated - should use - * modelCustomizationUuid - * @param vnfVersion VNF version key, should match a VNF definition in catalog DB Deprecated - VF Module versions - * also captured by modelCustomizationUuid - * @param vnfId - VNF ID - * @param vfModuleName Name to be assigned to the new VF Module - * @param vfModuleId Id fo the new VF Module - * @param requestType Indicates if this is a Volume Group or Module request - * @param volumeGroupId Identifier (i.e. deployment ID) for a Volume Group to attach to a VF Module - * @param baseVfModuleId Identifier (i.e. deployment ID) of the Base Module if this is an Add-on module - * @param modelCustomizationUuid Unique ID for the VF Module's model. Replaces the use of vfModuleType. - * @param inputs Map of key=value inputs for VNF stack creation - * @param failIfExists Flag whether already existing VNF should be considered - * @param backout Flag whether to suppress automatic backout (for testing) - * @param msoRequest Request tracking information for logs - * @param vnfId Holder for output VF Module instance ID in the cloud - * @param outputs Holder for Map of VNF outputs from Deployment (assigned IPs, etc) - * @param rollback Holder for returning VnfRollback object - */ - @Override - public void createVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vfModuleType, - String vnfVersion, String genericVnfId, String vfModuleName, String vfModuleId, String requestType, - String volumeGroupId, String baseVfModuleId, String modelCustomizationUuid, Map<String, Object> inputs, - Boolean failIfExists, Boolean backout, Boolean enableBridge, MsoRequest msoRequest, Holder<String> vnfId, - Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) throws VnfException { - - // Require a model customization ID. Every VF Module definition must have one. - if (modelCustomizationUuid == null || modelCustomizationUuid.isEmpty()) { - logger.debug("Missing required input: modelCustomizationUuid"); - String error = "Create vfModule error: Missing required input: modelCustomizationUuid"; - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), - "VF Module ModelCustomizationUuid", "VDU", ErrorCode.DataError, - "Create VF Module: " + "Missing required input: modelCustomizationUuid"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } - - // Clean up some inputs to make comparisons easier - if (requestType == null) - requestType = ""; - - if ("".equals(volumeGroupId) || "null".equals(volumeGroupId)) - volumeGroupId = null; - - if ("".equals(baseVfModuleId) || "null".equals(baseVfModuleId)) - baseVfModuleId = null; - - if (inputs == null) { - // Create an empty set of inputs - inputs = new HashMap<>(); - logger.debug("inputs == null - setting to empty"); - } else { - this.sendMapToDebug(inputs); - } - - // Check if this is for a "Volume" module - boolean isVolumeRequest = false; - if (requestType.startsWith("VOLUME")) { - isVolumeRequest = true; - } - - logger.debug("requestType = " + requestType + ", volumeGroupStackId = " + volumeGroupId + ", baseStackId = " - + baseVfModuleId); - - // Build a default rollback object (no actions performed) - VnfRollback vfRollback = new VnfRollback(); - vfRollback.setCloudSiteId(cloudSiteId); - vfRollback.setCloudOwner(cloudOwner); - vfRollback.setTenantId(tenantId); - vfRollback.setMsoRequest(msoRequest); - vfRollback.setRequestType(requestType); - vfRollback.setIsBase(false); // Until we know better - vfRollback.setVolumeGroupHeatStackId(volumeGroupId); - vfRollback.setBaseGroupHeatStackId(baseVfModuleId); - vfRollback.setModelCustomizationUuid(modelCustomizationUuid); - vfRollback.setMode("CFY"); - - rollback.value = vfRollback; // Default rollback - no updates performed - - // Get the VNF/VF Module definition from the Catalog DB first. - // There are three relevant records: VfModule, VfModuleCustomization, VnfResource - - VfModule vfModule = null; - VnfResource vnfResource = null; - VfModuleCustomization vfModuleCust = null; - - try { - vfModuleCust = - vfModuleCustomRepo.findFirstByModelCustomizationUUIDOrderByCreatedDesc(modelCustomizationUuid); - - if (vfModuleCust == null) { - String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" - + modelCustomizationUuid; - logger.debug(error); - logger.error(LoggingAnchor.SIX, MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), - "VF Module ModelCustomizationUuid", modelCustomizationUuid, "CatalogDb", ErrorCode.DataError, - error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } else { - logger.debug("Found vfModuleCust entry {}", vfModuleCust.toString()); - } - - // Get the vfModule and vnfResource records - vfModule = vfModuleCust.getVfModule(); - vnfResource = vfModuleCust.getVfModule().getVnfResources(); - } catch (Exception e) { - - logger.debug("unhandled exception in create VF - [Query] {}", e.getMessage()); - throw new VnfException("Exception during create VF " + e.getMessage()); - } - - // Perform a version check against cloudSite - // Obtain the cloud site information where we will create the VF Module - Optional<CloudSite> cloudSiteOp = cloudConfig.getCloudSite(cloudSiteId); - if (!cloudSiteOp.isPresent()) { - // If cloudSiteId is not present in the catalog DB, then default to multicloud - logger.debug("{} is not present in cloud_site catalog DB, defaulting to Multicloud plugin adapter", - cloudSiteId); - } else { - CloudSite cloudSite = cloudSiteOp.get(); - MavenLikeVersioning aicV = new MavenLikeVersioning(); - aicV.setVersion(cloudSite.getCloudVersion()); - - String vnfMin = vnfResource.getAicVersionMin(); - String vnfMax = vnfResource.getAicVersionMax(); - - if ((vnfMin != null && !(aicV.isMoreRecentThan(vnfMin) || aicV.isTheSameVersion(vnfMin))) - || (vnfMax != null && aicV.isMoreRecentThan(vnfMax))) { - // ERROR - String error = - "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() - + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " - + cloudSiteId + " with AIC_Version:" + cloudSite.getCloudVersion(); - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack", - ErrorCode.BusinessProcessError.getValue(), "Exception - setVersion"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } - } - // End Version check - - - VduInstance vduInstance = null; - CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null); - - // Use the VduPlugin. - VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner); - - try { - vduInstance = vduPlugin.queryVdu(cloudInfo, vfModuleName); - } catch (VduException me) { - // Failed to query the VDU due to a plugin exception. - String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" - + tenantId + ": " + me; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(), "Exception - queryVdu", - me); - logger.debug(error); - // Convert to a generic VnfException - me.addContext("CreateVFModule"); - throw new VnfException(me); - } - - // More precise handling/messaging if the Module already exists - if (vduInstance != null && !(vduInstance.getStatus().getState() == VduStateType.NOTFOUND)) { - VduStateType status = vduInstance.getStatus().getState(); - logger.debug("Found Existing VDU, status=" + status); - - if (status == VduStateType.INSTANTIATED) { - if (failIfExists != null && failIfExists) { - // fail - it exists - String error = "Create VF: Deployment " + vfModuleName + " already exists in " + cloudOwner + "/" - + cloudSiteId + "/" + tenantId; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, - cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(), - "VF Module " + vfModuleName + " already exists"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, - vduInstance.getVduInstanceId()); - } else { - // Found existing deployment and client has not requested "failIfExists". - // Populate the outputs from the existing deployment. - - vnfId.value = vduInstance.getVduInstanceId(); - outputs.value = copyStringOutputs(vduInstance.getOutputs()); - return; - } - } - // Check through various detailed error cases - else if (status == VduStateType.INSTANTIATING || status == VduStateType.DELETING - || status == VduStateType.UPDATING) { - // fail - it's in progress - return meaningful error - String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " - + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + "; please wait for it to complete, or fix manually."; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(), - "VF Module " + vfModuleName + " already exists"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, - vduInstance.getVduInstanceId()); - } else if (status == VduStateType.FAILED) { - // fail - it exists and is in a FAILED state - String error = "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " - + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention."; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(), - "VF Module " + vfModuleName + " already exists and is in FAILED state"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, - vduInstance.getVduInstanceId()); - } else if (status == VduStateType.UNKNOWN) { - // fail - it exists and is in a UNKNOWN state - String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " - + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + "; requires manual intervention."; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(), - "VF Module " + vfModuleName + " already exists and is in " + status.toString() + " state"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, - vduInstance.getVduInstanceId()); - } else { - // Unexpected, since all known status values have been tested for - String error = "Create VF: Deployment " + vfModuleName + " already exists with unexpected status " - + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + "; requires manual intervention."; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName, cloudOwner, - cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(), - "VF Module " + vfModuleName + " already exists and is in an unknown state"); - logger.debug(error); - throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, - vduInstance.getVduInstanceId()); - } - } - - - // Collect outputs from Base Modules and Volume Modules - Map<String, Object> baseModuleOutputs = null; - Map<String, Object> volumeGroupOutputs = null; - - // If a Volume Group was provided, query its outputs for inclusion in Module input parameters - if (volumeGroupId != null) { - VduInstance volumeVdu; - try { - volumeVdu = vduPlugin.queryVdu(cloudInfo, volumeGroupId); - } catch (VduException me) { - // Failed to query the Volume Group VDU due to a plugin exception. - String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudOwner + "/" - + cloudSiteId + "/" + tenantId + ": " + me; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId, cloudOwner, - cloudSiteId, tenantId, "VDU", "queryVdu(volume)", ErrorCode.DataError.getValue(), - "Exception - queryVdu(volume)", me); - logger.debug(error); - // Convert to a generic VnfException - me.addContext("CreateVFModule(QueryVolume)"); - throw new VnfException(me); - } - - if (volumeVdu == null || volumeVdu.getStatus().getState() == VduStateType.NOTFOUND) { - String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " - + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR"; - logger.error(LoggingAnchor.TEN, MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId, cloudOwner, - cloudSiteId, tenantId, error, "VDU", "queryVdu(volume)", - ErrorCode.BusinessProcessError.getValue(), - "Create VFModule: Attached Volume Group " + "DOES NOT EXIST"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } else { - logger.debug("Found nested volume group"); - volumeGroupOutputs = volumeVdu.getOutputs(); - this.sendMapToDebug(volumeGroupOutputs, "volumeGroupOutputs"); - } - } - - // If this is an Add-On Module, query the Base Module outputs - // Note: This will be performed whether or not the current request is for an - // Add-On Volume Group or Add-On VF Module - - if (vfModule.getIsBase()) { - logger.debug("This is a BASE Module request"); - vfRollback.setIsBase(true); - } else { - logger.debug("This is an Add-On Module request"); - - // Add-On Modules should always have a Base, but just treat as a warning if not provided. - // Add-on Volume requests may or may not specify a base. - if (!isVolumeRequest && baseVfModuleId == null) { - logger.debug("WARNING: Add-on Module request - no Base Module ID provided"); - } - - if (baseVfModuleId != null) { - VduInstance baseVdu; - try { - baseVdu = vduPlugin.queryVdu(cloudInfo, baseVfModuleId); - } catch (MsoException me) { - // Failed to query the Base VF Module due to a Vdu Plugin exception. - String error = "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudOwner + "/" - + cloudSiteId + "/" + tenantId + ": " + me; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId, - cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu(Base)", ErrorCode.DataError.getValue(), - "Exception - queryVdu(Base)", me); - logger.debug(error); - // Convert to a generic VnfException - me.addContext("CreateVFModule(QueryBase)"); - throw new VnfException(me); - } - - if (baseVdu == null || baseVdu.getStatus().getState() == VduStateType.NOTFOUND) { - String error = "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudOwner - + "/" + cloudSiteId + "/" + tenantId + " USER ERROR"; - logger.error(LoggingAnchor.TEN, MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId, cloudOwner, - cloudSiteId, tenantId, error, "VDU", "queryVdu(Base)", - ErrorCode.BusinessProcessError.getValue(), "Create VFModule: Base Module DOES NOT EXIST"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } else { - logger.debug("Found base module"); - baseModuleOutputs = baseVdu.getOutputs(); - this.sendMapToDebug(baseModuleOutputs, "baseModuleOutputs"); - } - } - } - - - // NOTE: For this section, heatTemplate is used for all template artifacts. - // In final implementation (post-POC), the template object would either be generic or there would - // be a separate DB Table/Object for different sub-orchestrators. - - // NOTE: The template is fixed for the VF Module. The environment is part of the customization. - - HeatTemplate heatTemplate = null; - HeatEnvironment heatEnvironment = null; - if (isVolumeRequest) { - heatTemplate = vfModule.getVolumeHeatTemplate(); - heatEnvironment = vfModuleCust.getVolumeHeatEnv(); - } else { - heatTemplate = vfModule.getModuleHeatTemplate(); - heatEnvironment = vfModuleCust.getHeatEnvironment(); - } - - if (heatTemplate == null) { - String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType - + ", modelCustomizationUuid=" + modelCustomizationUuid + ", vfModuleUuid=" + vfModule.getModelUUID() - + ", reqType=" + requestType; - logger.error(LoggingAnchor.SIX, MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", - vfModuleType, "VNF", ErrorCode.DataError.getValue(), error); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.INTERNAL); - } else { - logger.debug("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate()); - } - - if (heatEnvironment == null) { - String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType + ", modelCustomizationUuid=" - + modelCustomizationUuid + ", vfModuleUuid=" + vfModule.getModelUUID() + ", reqType=" + requestType; - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID", - "OpenStack", ErrorCode.DataError.getValue(), error); - throw new VnfException(error, MsoExceptionCategory.INTERNAL); - } else { - logger.debug("Got Heat Environment from DB: " + heatEnvironment.getEnvironment()); - } - - - // Create the combined set of parameters from the incoming request, base-module outputs, - // volume-module outputs. Also, convert all variables to their native object types. - - HashMap<String, Object> goldenInputs = new HashMap<>(); - List<String> extraInputs = new ArrayList<>(); - - Boolean skipInputChecks = false; - - if (skipInputChecks) { - goldenInputs = new HashMap<>(); - for (String key : inputs.keySet()) { - goldenInputs.put(key, inputs.get(key)); - } - } else { - // Build maps for the parameters (including aliases) to simplify checks - HashMap<String, HeatTemplateParam> params = new HashMap<>(); - - Set<HeatTemplateParam> paramSet = heatTemplate.getParameters(); - logger.debug("paramSet has " + paramSet.size() + " entries"); - - for (HeatTemplateParam htp : paramSet) { - params.put(htp.getParamName(), htp); - - // Include aliases. - String alias = htp.getParamAlias(); - if (alias != null && !"".equals(alias) && !params.containsKey(alias)) { - params.put(alias, htp); - } - } - - // First, convert all inputs to their "template" type - for (String key : inputs.keySet()) { - if (params.containsKey(key)) { - Object value = convertInputValue(inputs.get(key), params.get(key)); - if (value != null) { - goldenInputs.put(key, value); - } else { - logger.debug("Failed to convert input " + key + "='" + inputs.get(key) + "' to " - + params.get(key).getParamType()); - } - } else { - extraInputs.add(key); - } - } - - if (!extraInputs.isEmpty()) { - // Add multicloud inputs - for (String key : MsoMulticloudUtils.MULTICLOUD_INPUTS) { - if (extraInputs.contains(key)) { - goldenInputs.put(key, inputs.get(key)); - extraInputs.remove(key); - if (extraInputs.isEmpty()) { - break; - } - } - } - logger.debug("Ignoring extra inputs: " + extraInputs); - } - - // Next add in Volume Group Outputs if there are any. Copy directly without conversions. - if (volumeGroupOutputs != null && !volumeGroupOutputs.isEmpty()) { - for (String key : volumeGroupOutputs.keySet()) { - if (params.containsKey(key) && !goldenInputs.containsKey(key)) { - goldenInputs.put(key, volumeGroupOutputs.get(key)); - } - } - } - - // Next add in Base Module Outputs if there are any. Copy directly without conversions. - if (baseModuleOutputs != null && !baseModuleOutputs.isEmpty()) { - for (String key : baseModuleOutputs.keySet()) { - if (params.containsKey(key) && !goldenInputs.containsKey(key)) { - goldenInputs.put(key, baseModuleOutputs.get(key)); - } - } - } - - // TODO: The model should support a mechanism to pre-assign default parameter values - // per "customization" (i.e. usage) of a given module. In HEAT, this is specified by - // an Environment file. There is not a general mechanism in the model to handle this. - // For the general case, any such parameter/values can be added dynamically to the - // inputs (only if not already specified). - - // Check that required parameters have been supplied from any of the sources - String missingParams = null; - boolean checkRequiredParameters = true; - try { - String propertyString = this.environment.getProperty(MsoVnfPluginAdapterImpl.CHECK_REQD_PARAMS); - if ("false".equalsIgnoreCase(propertyString) || "n".equalsIgnoreCase(propertyString)) { - checkRequiredParameters = false; - logger.debug("CheckRequiredParameters is FALSE. Will still check but then skip blocking..." - + MsoVnfPluginAdapterImpl.CHECK_REQD_PARAMS); - } - } catch (Exception e) { - // No problem - default is true - logger.debug("An exception occured trying to get property " + MsoVnfPluginAdapterImpl.CHECK_REQD_PARAMS, - e); - } - - // Do the actual parameter checking. - // Include looking at the ENV file as a valid definition of a parameter value. - // TODO: This handling of ENV applies only to Heat. A general mechanism to - // support pre-set parameter/values does not yet exist in the model. - // - StringBuilder sb = new StringBuilder(heatEnvironment.getEnvironment()); - MsoHeatEnvironmentEntry mhee = new MsoHeatEnvironmentEntry(sb); - for (HeatTemplateParam parm : heatTemplate.getParameters()) { - if (parm.isRequired() && (!goldenInputs.containsKey(parm.getParamName()))) { - if (mhee != null && mhee.containsParameter(parm.getParamName())) { - logger.debug("Required parameter " + parm.getParamName() - + " appears to be in environment - do not count as missing"); - } else { - logger.debug("adding to missing parameters list: " + parm.getParamName()); - if (missingParams == null) { - missingParams = parm.getParamName(); - } else { - missingParams += "," + parm.getParamName(); - } - } - } - } - - if (missingParams != null) { - if (checkRequiredParameters) { - // Problem - missing one or more required parameters - String error = "Create VFModule: Missing Required inputs: " + missingParams; - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_MISSING_PARAM.toString(), missingParams, "VDU", - ErrorCode.DataError.getValue(), "Create VFModule: Missing Required inputs"); - logger.debug(error); - throw new VnfException(error, MsoExceptionCategory.USERDATA); - } else { - logger.debug("found missing parameters [" + missingParams - + "] - but checkRequiredParameters is false - " + "will not block"); - } - } else { - logger.debug("No missing parameters found - ok to proceed"); - } - - } // NOTE: END PARAMETER CHECKING - - - // Here we go... ready to deploy the VF Module. - if (backout == null) - backout = true; - - try { - // Construct the VDU Model structure to pass to the targeted VduPlugin - VduModelInfo vduModel = null; - if (!isVolumeRequest) { - vduModel = vduMapper.mapVfModuleCustomizationToVdu(vfModuleCust); - } else { - vduModel = vduMapper.mapVfModuleCustVolumeToVdu(vfModuleCust); - } - - // Invoke the VduPlugin to instantiate the VF Module - vduInstance = vduPlugin.instantiateVdu(cloudInfo, vfModuleName, goldenInputs, vduModel, backout); - - } catch (VduException me) { - // Failed to instantiate the VDU. - me.addContext("CreateVFModule"); - String error = "Create VF Module " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + ": " + me; - logger.error(LoggingAnchor.EIGHT, MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, - cloudSiteId, tenantId, "VDU", ErrorCode.DataError.getValue(), "MsoException - instantiateVdu", me); - logger.debug(error); - // Convert to a generic VnfException - throw new VnfException(me); - } catch (NullPointerException npe) { - String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + ": " + npe; - logger.error(LoggingAnchor.EIGHT, MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, - cloudSiteId, tenantId, "VDU", ErrorCode.DataError.getValue(), - "NullPointerException - instantiateVdu", npe); - logger.debug(error); - logger.debug("NULL POINTER EXCEPTION at vduPlugin.instantiateVdu", npe); - throw new VnfException("NullPointerException during instantiateVdu"); - } catch (Exception e) { - String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId - + ": " + e; - logger.debug("Unhandled exception at vduPlugin.instantiateVdu", e); - logger.debug(error); - throw new VnfException("Exception during instantiateVdu: " + e.getMessage()); - } - - - // Reach this point if create is successful. - // Populate remaining rollback info and response parameters. - vfRollback.setVnfCreated(true); - vfRollback.setVnfId(vduInstance.getVduInstanceId()); - vnfId.value = vduInstance.getVduInstanceId(); - outputs.value = copyStringOutputs(vduInstance.getOutputs()); - - rollback.value = vfRollback; - - logger.debug("VF Module " + vfModuleName + " successfully created"); - return; - } - - - public void deleteVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vfModuleId, String vnfId, - String aaiVfModuleId, String modelCustomizationUuid, MsoRequest msoRequest, - Holder<Map<String, String>> outputs) throws VnfException { - - logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId); - - // Capture the output parameters on a delete, so need to query first - VduInstance vduInstance; - CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null); - - // Use the VduPlugin. - VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner); - - try { - vduInstance = vduPlugin.queryVdu(cloudInfo, vfModuleId); - } catch (VduException e) { - // Failed to query the VDU due to a plugin exception. - // Convert to a generic VnfException - e.addContext("QueryVFModule"); - String error = "Query VfModule (VDU): " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" - + tenantId + ": " + e; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleId, cloudOwner, - cloudSiteId, tenantId, "VDU", "QueryVFModule", ErrorCode.DataError.getValue(), - "Exception - queryVDU", e); - logger.debug(error); - throw new VnfException(e); - } - - // call method which handles the conversion from Map<String,Object> to Map<String,String> for our expected - // Object types - outputs.value = convertMapStringObjectToStringString(vduInstance.getOutputs()); - - // Use the VduPlugin to delete the VDU. - // The possible outcomes of deleteVdu are - // - a vnfInstance object with status of DELETED (success) - // - a vnfInstance object with status of NOTFOUND (VDU did not exist, treat as success) - // - a vnfInstance object with status of FAILED (error) - // Also, VduException could be thrown. - try { - // TODO: Get an appropriate timeout value - require access to the model - vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5); - } catch (VduException me) { - me.addContext("DeleteVfModule"); - // Convert to a generic VnfException - String error = - "Delete VF: " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me; - logger.error(LoggingAnchor.NINE, MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudOwner, - cloudSiteId, tenantId, "VDU", "DeleteVdu", ErrorCode.DataError.getValue(), - "Exception - DeleteVdu: " + me.getMessage()); - logger.debug(error); - throw new VnfException(me); - } - - // On success, nothing is returned. - return; - } - - // Update VF Module not yet implemented for generic VDU plug-in model. - @Override - public void updateVfModule(String cloudSiteId, String cloudOwner, String tenantId, String vnfType, - String vnfVersion, String vnfName, String requestType, String volumeGroupHeatStackId, - String baseVfHeatStackId, String vfModuleStackId, String modelCustomizationUuid, Map<String, Object> inputs, - MsoRequest msoRequest, Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) - throws VnfException { - // This operation is not currently supported for VduPlugin-orchestrated VF Modules. - logger.debug("Update VF Module command attempted but not supported"); - throw new VnfException("UpdateVfModule: Unsupported command", MsoExceptionCategory.USERDATA); - } - - /* - * Dynamic selection of a VduPlugin version. For initial tests, base on the "orchestrator" defined for the target - * cloud. Should really be looking at the VNF Model (ochestration_mode) but we don't currently have access to that - * in Query and Delete cases. - */ - private VduPlugin getVduPlugin(String cloudSiteId, String cloudOwner) { - Optional<CloudSite> cloudSiteOp = cloudConfig.getCloudSite(cloudSiteId); - if (cloudSiteOp.isPresent()) { - CloudSite cloudSite = cloudSiteOp.get(); - String orchestrator = cloudSite.getOrchestrator(); - - if ("CLOUDIFY".equalsIgnoreCase(orchestrator)) { - return cloudifyUtils; - } else if ("HEAT".equalsIgnoreCase(orchestrator)) { - return heatUtils; - } else if ("MULTICLOUD".equalsIgnoreCase(orchestrator)) { - return multicloudUtils; - } else { - // Default if cloudSite record exists - return HEAT plugin - will fail later - return heatUtils; - } - } - // Default if no cloudSite record exists - return multicloud plugin - return multicloudUtils; - } -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java deleted file mode 100644 index 5b78d2f066..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java +++ /dev/null @@ -1,578 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - - -import java.util.Map; -import javax.inject.Provider; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.ws.Holder; -import org.onap.so.logger.LoggingAnchor; -import org.apache.http.HttpStatus; -import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; -import org.onap.so.adapters.vnfrest.CreateVfModuleResponse; -import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest; -import org.onap.so.adapters.vnfrest.DeleteVfModuleResponse; -import org.onap.so.adapters.vnfrest.QueryVfModuleResponse; -import org.onap.so.adapters.vnfrest.RollbackVfModuleRequest; -import org.onap.so.adapters.vnfrest.RollbackVfModuleResponse; -import org.onap.so.adapters.vnfrest.UpdateVfModuleRequest; -import org.onap.so.adapters.vnfrest.UpdateVfModuleResponse; -import org.onap.so.adapters.vnfrest.VfModuleExceptionResponse; -import org.onap.so.adapters.vnfrest.VfModuleRollback; -import org.onap.so.entity.MsoRequest; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; -import org.onap.so.openstack.exceptions.MsoExceptionCategory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -/** - * This class services calls to the REST interface for VF Modules (http://host:port/vnfs/rest/v1/vnfs) Both XML and JSON - * can be produced/consumed. Set Accept: and Content-Type: headers appropriately. XML is the default. For testing, call - * with cloudSiteId = ___TESTING___ To test exceptions, also set tenantId = ___TESTING___ - */ -@Deprecated -@Path("/v1/vnfs") -@Api(value = "/v1/vnfs", description = "root of vnf adapters restful web service") -@Transactional -@Component -public class VnfAdapterRest { - private static Logger logger = LoggerFactory.getLogger(VnfAdapterRest.class); - private static final String TESTING_KEYWORD = "___TESTING___"; - private static final String RESP = ", resp="; - - @Autowired - private MsoVnfAdapterImpl vnfAdapter; - - @Autowired - private Provider<BpelRestClient> bpelRestClientProvider; - - @DELETE - @Path("{aaiVnfId}/vf-modules/{aaiVfModuleId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "DeleteVfModule", response = Response.class, - notes = "Delete an existing vnfModule, DeleteVfModuleRequest JSON is required") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully deleted"), - @ApiResponse(code = 202, message = "delete vnfModule request has been accepted (async only)"), - @ApiResponse(code = 500, message = "delete vnfModule failed, examine entity object for details")}) - public Response deleteVfModule( - @ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "aaiVfModuleId", required = true) @PathParam("aaiVfModuleId") String aaiVfModuleId, - @ApiParam(value = "DeleteVfModuleRequest", required = true) final DeleteVfModuleRequest req) { - logger.debug("Delete VfModule enter: " + req.toJsonString()); - if (aaiVnfId == null || !aaiVnfId.equals(req.getVnfId())) { - logger.debug("Req rejected - aaiVnfId not provided or doesn't match URL"); - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity("vnfid in URL does not match content").build(); - } - if (aaiVfModuleId == null || !aaiVfModuleId.equals(req.getVfModuleId())) { - logger.debug("Req rejected - aaiVfModuleId not provided or doesn't match URL"); - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity("vfModuleId in URL does not match content").build(); - } - DeleteVfModuleTask task = new DeleteVfModuleTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling delete, send generic failure as sync resp to caller - logger.error("", MessageEnum.RA_DELETE_VNF_ERR.toString(), "deleteVfModule", - ErrorCode.BusinessProcessError.getValue(), "Exception in deleteVfModule", e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("deleteVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class DeleteVfModuleTask implements Runnable { - private final DeleteVfModuleRequest req; - private DeleteVfModuleResponse response = null; - private VfModuleExceptionResponse eresp = null; - private boolean sendxml; - - public DeleteVfModuleTask(DeleteVfModuleRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<DeleteVfModuleResponse>(response) {} - : new GenericEntity<VfModuleExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - String cloudsite = req.getCloudSiteId(); - Holder<Map<String, String>> outputs = new Holder<>(); - if (cloudsite != null && !cloudsite.equals(TESTING_KEYWORD)) { - vnfAdapter.deleteVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - req.getVfModuleStackId(), req.getVnfId(), req.getVfModuleId(), - req.getModelCustomizationUuid(), req.getMsoRequest(), outputs); - } - response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE, - req.getMessageId(), outputs.value); - } catch (VnfException e) { - logger.error(LoggingAnchor.THREE, MessageEnum.RA_DELETE_VNF_ERR.toString(), - ErrorCode.BusinessProcessError.getValue(), "VnfException - Delete VNF Module", e); - eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, - req.getMessageId()); - } - if (!req.isSynchronous()) { - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("Delete vfModule exit: code=" + getStatusCode() + RESP + getResponse()); - } - } - - - @GET - @Path("{aaiVnfId}/vf-modules/{aaiVfModuleId}") - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "QueryVfModule", response = Response.class, notes = "Query an existing vnfModule") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully queried"), - @ApiResponse(code = 500, message = "query vnfModule failed, examine entity object for details")}) - public Response queryVfModule(@ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "aaiVfModuleId", required = true) @PathParam("aaiVfModuleId") String aaiVfModuleId, - @ApiParam(value = "cloudSiteId", required = true) @QueryParam("cloudSiteId") String cloudSiteId, - @ApiParam(value = "cloudOwner", required = true) @QueryParam("cloudOwner") String cloudOwner, - @ApiParam(value = "tenantId", required = true) @QueryParam("tenantId") String tenantId, - @ApiParam(value = "vfModuleName", required = true) @QueryParam("vfModuleName") String vfModuleName, // RAA? - // Id in - // doc - @ApiParam(value = "skipAAI", required = true) @QueryParam("skipAAI") Boolean skipAAI, - @ApiParam(value = "msoRequest.requestId", - required = true) @QueryParam("msoRequest.requestId") String requestId, - @ApiParam(value = "msoRequest.serviceInstanceId", - required = true) @QueryParam("msoRequest.serviceInstanceId") String serviceInstanceId) { - // This request responds synchronously only - logger.debug("Query vfModule enter:" + vfModuleName); - MsoRequest msoRequest = new MsoRequest(requestId, serviceInstanceId); - - try { - int respStatus = HttpStatus.SC_OK; - QueryVfModuleResponse qryResp = new QueryVfModuleResponse(aaiVnfId, aaiVfModuleId, null, null, null); - Holder<Boolean> vnfExists = new Holder<>(); - Holder<String> vfModuleId = new Holder<>(); - Holder<VnfStatus> status = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - vnfAdapter.queryVnf(cloudSiteId, cloudOwner, tenantId, vfModuleName, msoRequest, vnfExists, vfModuleId, - status, outputs); - if (!vnfExists.value) { - logger.debug("vfModule not found"); - respStatus = HttpStatus.SC_NOT_FOUND; - } else { - logger.debug("vfModule found" + vfModuleId.value + ", status=" + status.value); - qryResp.setVfModuleId(vfModuleId.value); - qryResp.setVnfStatus(status.value); - qryResp.setVfModuleOutputs(outputs.value); - } - logger.debug("Query vfModule exit"); - return Response.status(respStatus).entity(new GenericEntity<QueryVfModuleResponse>(qryResp) {}).build(); - } catch (VnfException e) { - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, "queryVfModule", - ErrorCode.BusinessProcessError.getValue(), "VnfException - queryVfModule", e); - VfModuleExceptionResponse excResp = - new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity<VfModuleExceptionResponse>(excResp) {}).build(); - } - } - - /* - * URL: http://localhost:8080/vnfs/rest/v1/vnfs/<aaivnfid>/vf-modules REQUEST: {"createVfModuleRequest": - * {"cloudSiteId": "DAN", "tenantId": "214b428a1f554c02935e66330f6a5409", "vnfId": "somevnfid", "vfModuleId": - * "somemodid", "vfModuleName": "RaaVnf1", "vnfType": "ApacheVnf", "vfModuleParams": {"entry": [ {"key": - * "network_id", "value": "59ed7b41-2983-413f-ba93-e7d437433916"}, {"key": "subnet_id", "value": - * "086c9298-5c57-49b7-bb2b-6fd5730c5d92"}, {"key": "server_name_0", "value": "RaaVnf1"} ]}, "failIfExists": true, - * "messageId": "ra.1", "notificationUrl": "http://localhost:8089/vnfmock", "skipAAI": true, "msoRequest": { - * "requestId": "ra1", "serviceInstanceId": "sa1" }} } - */ - @POST - @Path("{aaiVnfId}/vf-modules") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "CreateVfModule", response = Response.class, notes = "Create a vnfModule") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully created"), - @ApiResponse(code = 202, message = "create vnfModule request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "create vnfModule failed, examine entity object for details")}) - public Response createVfModule( - @ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "CreateVfModuleRequest", required = true) final CreateVfModuleRequest req) { - logger.debug("Create VfModule enter inside VnfAdapterRest: " + req.toJsonString()); - if (aaiVnfId == null || !aaiVnfId.equals(req.getVnfId())) { - logger.debug("Req rejected - aaiVnfId not provided or doesn't match URL"); - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity("vnfid in URL does not match content").build(); - } - CreateVfModuleTask task = new CreateVfModuleTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error(LoggingAnchor.FOUR, MessageEnum.RA_CREATE_VNF_ERR, "createVfModule", - ErrorCode.BusinessProcessError, "Exception - createVfModule", e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("createVfModule exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class CreateVfModuleTask implements Runnable { - private final CreateVfModuleRequest req; - private CreateVfModuleResponse response = null; - private VfModuleExceptionResponse eresp = null; - private boolean sendxml; - - public CreateVfModuleTask(CreateVfModuleRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<CreateVfModuleResponse>(response) {} - : new GenericEntity<VfModuleExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - logger.debug("CreateVfModuleTask start"); - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - // Synchronous Web Service Outputs - Holder<String> vfModuleStackId = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType(); - logger.debug("completeVnfVfModuleType=" + completeVnfVfModuleType); - String cloudsite = req.getCloudSiteId(); - String cloudOwner = req.getCloudOwner(); - if (cloudsite != null && cloudsite.equals(TESTING_KEYWORD)) { - String tenant = req.getTenantId(); - if (tenant != null && tenant.equals(TESTING_KEYWORD)) { - throw new VnfException("testing."); - } - vnfRollback.value = new VnfRollback(req.getVnfId(), tenant, cloudOwner, cloudsite, true, false, - new MsoRequest("reqid", "svcid"), req.getVolumeGroupId(), req.getVolumeGroupId(), - req.getRequestType(), req.getModelCustomizationUuid()); - vfModuleStackId.value = "479D3D8B-6360-47BC-AB75-21CC91981484"; - outputs.value = VolumeAdapterRest.testMap(); - } else { - vnfAdapter.createVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - completeVnfVfModuleType, req.getVnfVersion(), req.getVnfId(), req.getVfModuleName(), - req.getVfModuleId(), req.getRequestType(), req.getVolumeGroupStackId(), - req.getBaseVfModuleStackId(), req.getModelCustomizationUuid(), req.getVfModuleParams(), - req.getFailIfExists(), req.getBackout(), req.getEnableBridge(), req.getMsoRequest(), - vfModuleStackId, outputs, vnfRollback); - } - VfModuleRollback modRollback = new VfModuleRollback(vnfRollback.value, req.getVfModuleId(), - vfModuleStackId.value, req.getMessageId()); - response = new CreateVfModuleResponse(req.getVnfId(), req.getVfModuleId(), vfModuleStackId.value, - Boolean.TRUE, outputs.value, modRollback, req.getMessageId()); - } catch (VnfException e) { - logger.debug("Exception :", e); - eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, - req.getMessageId()); - } - if (!req.isSynchronous()) { - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("CreateVfModuleTask exit: code=" + getStatusCode()); - } - } - - @PUT - @Path("{aaiVnfId}/vf-modules/{aaiVfModuleId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "UpdateVfModule", response = Response.class, notes = "Update an existing vnfModule") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully updated"), - @ApiResponse(code = 202, message = "update vnfModule request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "update vnfModule failed, examine entity object for details")}) - public Response updateVfModule( - @ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "aaiVfModuleId", required = true) @PathParam("aaiVfModuleId") String aaiVfModuleId, - @ApiParam(value = "UpdateVfModuleRequest", required = true) final UpdateVfModuleRequest req) { - logger.debug("Update VfModule enter: " + req.toJsonString()); - UpdateVfModulesTask task = new UpdateVfModulesTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error(LoggingAnchor.FOUR, MessageEnum.RA_UPDATE_VNF_ERR.toString(), "updateVfModule", - ErrorCode.BusinessProcessError.getValue(), "Exception - updateVfModule", e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("updateVfModules exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class UpdateVfModulesTask implements Runnable { - private final UpdateVfModuleRequest req; - private UpdateVfModuleResponse response = null; - private VfModuleExceptionResponse eresp = null; - private boolean sendxml; - - public UpdateVfModulesTask(UpdateVfModuleRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<UpdateVfModuleResponse>(response) {} - : new GenericEntity<VfModuleExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - Holder<String> vfModuleStackId = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType(); - logger.debug("in updateVf - completeVnfVfModuleType=" + completeVnfVfModuleType); - - vnfAdapter.updateVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - // req.getVnfType(), - completeVnfVfModuleType, req.getVnfVersion(), req.getVfModuleName(), req.getRequestType(), - req.getVolumeGroupStackId(), req.getBaseVfModuleStackId(), req.getVfModuleStackId(), - req.getModelCustomizationUuid(), req.getVfModuleParams(), req.getMsoRequest(), outputs, - vnfRollback); - - response = new UpdateVfModuleResponse(req.getVnfId(), req.getVfModuleId(), vfModuleStackId.value, - outputs.value, req.getMessageId()); - } catch (VnfException e) { - logger.debug("Exception :", e); - eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("Update VfModule exit: code=" + getStatusCode() + RESP + getResponse()); - } - } - - - @DELETE - @Path("{aaiVnfId}/vf-modules/{aaiVfModuleId}/rollback") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "RollbackVfModule", response = Response.class, notes = "Rollback an existing vnfModule") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully rolled back"), - @ApiResponse(code = 202, - message = "rollback vnfModule request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "rollback vnfModule failed, examine entity object for details")}) - public Response rollbackVfModule( - @ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "aaiVfModuleId", required = true) @PathParam("aaiVfModuleId") String aaiVfModuleId, - @ApiParam(value = "RollbackVfModuleRequest", required = true) - // @QueryParam("rollback") String rollback, - final RollbackVfModuleRequest req) { - logger.debug("Rollback VfModule enter: " + req.toJsonString()); - RollbackVfModulesTask task = new RollbackVfModulesTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error(LoggingAnchor.FOUR, MessageEnum.RA_ROLLBACK_VNF_ERR.toString(), "rollbackVfModule", - ErrorCode.BusinessProcessError.getValue(), "Exception - rollbackVfModule", e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("rollbackVfModule exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class RollbackVfModulesTask implements Runnable { - private final RollbackVfModuleRequest req; - private RollbackVfModuleResponse response = null; - private VfModuleExceptionResponse eresp = null; - private boolean sendxml; - - public RollbackVfModulesTask(RollbackVfModuleRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<RollbackVfModuleResponse>(response) {} - : new GenericEntity<VfModuleExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getVfModuleRollback().getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - VfModuleRollback vmr = req.getVfModuleRollback(); - VnfRollback vrb = new VnfRollback(vmr.getVfModuleStackId(), vmr.getTenantId(), vmr.getCloudOwner(), - vmr.getCloudSiteId(), true, true, vmr.getMsoRequest(), null, null, null, null); - vnfAdapter.rollbackVnf(vrb); - response = new RollbackVfModuleResponse(Boolean.TRUE, req.getMessageId()); - } catch (VnfException e) { - logger.error(LoggingAnchor.THREE, MessageEnum.RA_ROLLBACK_VNF_ERR, ErrorCode.BusinessProcessError, - "Exception" + " - " + "rollbackVfModule", e); - eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, false, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("RollbackVfModulesTask exit: code=" + getStatusCode() + RESP + getResponse()); - } - } -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestUtils.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestUtils.java deleted file mode 100644 index b53ac0f899..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestUtils.java +++ /dev/null @@ -1,104 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * OPENECOMP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import java.util.Optional; -import org.onap.so.cloud.CloudConfig; -import org.onap.so.db.catalog.beans.CloudSite; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class VnfAdapterRestUtils { - private static Logger logger = LoggerFactory.getLogger(VnfAdapterRestUtils.class); - - private static final String HEAT_MODE = "HEAT"; - private static final String CLOUDIFY_MODE = "CLOUDIFY"; - private static final String MULTICLOUD_MODE = "MULTICLOUD"; - - @Autowired - private CloudConfig cloudConfig; - - @Autowired - private MsoVnfCloudifyAdapterImpl cloudifyImpl; - - @Autowired - private MsoVnfAdapterImpl vnfImpl; - - @Autowired - private MsoVnfPluginAdapterImpl vnfPluginImpl; - - /* - * Choose which implementation of VNF Adapter to use, based on the orchestration mode. Currently, the two supported - * orchestrators are HEAT and CLOUDIFY. - */ - public MsoVnfAdapter getVnfAdapterImpl(String mode, String cloudSiteId) { - // First, determine the orchestration mode to use. - // If was explicitly provided as a parameter, use that. Else if specified for the - // cloudsite, use that. Otherwise, the default is the (original) HEAT-based impl. - - logger.debug("Entered GetVnfAdapterImpl: mode=" + mode + ", cloudSite=" + cloudSiteId); - - if (mode == null) { - // Didn't get an explicit mode type requested. - // Use the CloudSite to determine which Impl to use, based on whether the target cloutSite - // has a CloudifyManager assigned to it - Optional<CloudSite> cloudSite = cloudConfig.getCloudSite(cloudSiteId); - if (cloudSite.isPresent()) { - logger.debug("Got CloudSite: " + cloudSite.toString()); - if (cloudConfig.getCloudifyManager(cloudSite.get().getCloudifyId()) != null) { - mode = CLOUDIFY_MODE; - } else if (MULTICLOUD_MODE.equalsIgnoreCase(cloudSite.get().getOrchestrator())) { - mode = MULTICLOUD_MODE; - } else { - mode = HEAT_MODE; - } - } - } - - logger.debug("GetVnfAdapterImpl: mode=" + mode); - - MsoVnfAdapter vnfAdapter = null; - - // TODO: Make this more dynamic (e.g. Service Loader) - if (CLOUDIFY_MODE.equalsIgnoreCase(mode)) { - logger.debug("GetVnfAdapterImpl: Return Cloudify Adapter"); - vnfAdapter = cloudifyImpl; - } else if (HEAT_MODE.equalsIgnoreCase(mode)) { - logger.debug("GetVnfAdapterImpl: Return Heat Adapter"); - vnfAdapter = vnfImpl; - } else if (MULTICLOUD_MODE.equalsIgnoreCase(mode)) { - logger.debug("GetVnfAdapterImpl: Return Plugin (multicloud) Adapter"); - vnfAdapter = vnfPluginImpl; - } else { - // Don't expect this, but default is the HEAT adapter - logger.debug("GetVnfAdapterImpl: Return Default (Heat) Adapter"); - vnfAdapter = vnfImpl; - } - - return vnfAdapter; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java deleted file mode 100644 index 63b4c5d0f3..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java +++ /dev/null @@ -1,626 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * OPENECOMP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - - -import java.util.Map; -import javax.inject.Provider; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.ws.Holder; -import org.apache.http.HttpStatus; -import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; -import org.onap.so.adapters.vnfrest.CreateVfModuleResponse; -import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest; -import org.onap.so.adapters.vnfrest.DeleteVfModuleResponse; -import org.onap.so.adapters.vnfrest.QueryVfModuleResponse; -import org.onap.so.adapters.vnfrest.RollbackVfModuleRequest; -import org.onap.so.adapters.vnfrest.RollbackVfModuleResponse; -import org.onap.so.adapters.vnfrest.UpdateVfModuleRequest; -import org.onap.so.adapters.vnfrest.UpdateVfModuleResponse; -import org.onap.so.adapters.vnfrest.VfModuleExceptionResponse; -import org.onap.so.adapters.vnfrest.VfModuleRollback; -import org.onap.so.entity.MsoRequest; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.LoggingAnchor; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; -import org.onap.so.openstack.exceptions.MsoExceptionCategory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -/** - * This class services calls to the REST interface for VF Modules (http://host:port/vnfs/rest/v2/vnfs) Both XML and JSON - * can be produced/consumed. Set Accept: and Content-Type: headers appropriately. XML is the default. For testing, call - * with cloudSiteId = ___TESTING___ To test exceptions, also set tenantId = ___TESTING___ - * - * V2 incorporates run-time selection of sub-orchestrator implementation (Heat or Cloudify) based on the target cloud. - */ -@Deprecated -@Path("/v2/vnfs") -@Api(value = "/v2/vnfs", description = "root of vnf adapters restful web service v2") -@Component -public class VnfAdapterRestV2 { - private static Logger logger = LoggerFactory.getLogger(VnfAdapterRestV2.class); - private static final String TESTING_KEYWORD = "___TESTING___"; - private static final String RESP = ", resp="; - private static final String BRACKETS = LoggingAnchor.FOUR; - - @Autowired - private VnfAdapterRestUtils vnfAdapterRestUtils; - - @Autowired - private Provider<BpelRestClient> bpelRestClientProvider; - - /* - * URL:http://localhost:8080/vnfs/rest/v2/vnfs/<aaivnfid>/vf-modules/<aaimodid> REQUEST: {"deleteVfModuleRequest": - * {"cloudSiteId": "DAN", "tenantId": "214b428a1f554c02935e66330f6a5409", "vnfId": "somevnfid", "vfModuleId": - * "somemodid", "vfModuleStackId": "4e567676-e266-4594-a3a6-131c8a2baf73", "messageId": "ra.1", "notificationUrl": - * "http://localhost:8089/vnfmock", "skipAAI": true, "msoRequest": { "requestId": "ra1", "serviceInstanceId": "sa1" - * }} } - */ - @DELETE - @Path("{aaiVnfId}/vf-modules/{aaiVfModuleId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "DeleteVfModule", response = Response.class, - notes = "Delete an existing vnfModule, DeleteVfModuleRequest JSON is required") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully deleted"), - @ApiResponse(code = 202, message = "delete vnfModule request has been accepted (async only)"), - @ApiResponse(code = 500, message = "delete vnfModule failed, examine entity object for details")}) - public Response deleteVfModule( - @ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "aaiVfModuleId", required = true) @PathParam("aaiVfModuleId") String aaiVfModuleId, - @ApiParam(value = "mode", required = true) @QueryParam("mode") String mode, - @ApiParam(value = "DeleteVfModuleRequest", required = true) final DeleteVfModuleRequest req) { - logger.debug("Delete VfModule enter: " + req.toJsonString()); - if (aaiVnfId == null || !aaiVnfId.equals(req.getVnfId())) { - logger.debug("Req rejected - aaiVnfId not provided or doesn't match URL"); - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity("vnfid in URL does not match content").build(); - } - if (aaiVfModuleId == null || !aaiVfModuleId.equals(req.getVfModuleId())) { - logger.debug("Req rejected - aaiVfModuleId not provided or doesn't match URL"); - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity("vfModuleId in URL does not match content").build(); - } - - DeleteVfModuleTask task = new DeleteVfModuleTask(req, mode); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - MDC.getCopyOfContextMap(); - t1.start(); - } catch (Exception e) { - // problem handling delete, send generic failure as sync resp to caller - logger.error(BRACKETS, MessageEnum.RA_DELETE_VNF_ERR.toString(), "deleteVfModule", - ErrorCode.BusinessProcessError.getValue(), "Exception in deleteVfModule", e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("deleteVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class DeleteVfModuleTask implements Runnable { - private final DeleteVfModuleRequest req; - private DeleteVfModuleResponse response = null; - private VfModuleExceptionResponse eresp = null; - private boolean sendxml; - private String mode; - - public DeleteVfModuleTask(DeleteVfModuleRequest req, String mode) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - this.mode = mode; - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<DeleteVfModuleResponse>(response) {} - : new GenericEntity<VfModuleExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - String cloudsite = req.getCloudSiteId(); - Holder<Map<String, String>> outputs = new Holder<>(); - if (cloudsite != null) { - MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsite); - adapter.deleteVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - req.getVfModuleStackId(), req.getVnfId(), req.getVfModuleId(), - req.getModelCustomizationUuid(), req.getMsoRequest(), outputs); - } - response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE, - req.getMessageId(), outputs.value); - } catch (VnfException e) { - logger.error(LoggingAnchor.THREE, MessageEnum.RA_DELETE_VNF_ERR.toString(), - ErrorCode.BusinessProcessError.getValue(), "VnfException - " + "Delete VNF Module", e); - eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, - req.getMessageId()); - } - if (!req.isSynchronous()) { - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("Delete vfModule exit: code=" + getStatusCode() + RESP + getResponse()); - MDC.clear(); - } - } - - /* - * URL:http://localhost:8080/vnfs/rest/v2/vnfs/<aaiVnfId>/vf-modules/<aaiVfModuleId>?cloudSiteId=DAN&tenantId= - * vfModule?&skipAAI=TRUE&msoRequest.requestId=ra1&msoRequest.serviceInstanceId=si1&vfModuleName=T2N2S1 RESP: - * {"queryVfModuleResponse": { "vfModuleId": "AvfmodId", "vfModuleOutputs": {"entry": { "key": - * "server_private_ip_1", "value": "10.100.1.25" }}, "vfModuleStackId": - * "RaaVnf1/abfa8a6d-feb1-40af-aea3-109403b1cf6b", "vnfId": "AvnfID", "vnfStatus": "ACTIVE" }} - */ - @GET - @Path("{aaiVnfId}/vf-modules/{aaiVfModuleId}") - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "QueryVfModule", response = Response.class, notes = "Query an existing vnfModule") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully queried"), - @ApiResponse(code = 500, message = "query vnfModule failed, examine entity object for details")}) - public Response queryVfModule(@ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "aaiVfModuleId", required = true) @PathParam("aaiVfModuleId") String aaiVfModuleId, - @ApiParam(value = "cloudSiteId", required = true) @QueryParam("cloudSiteId") String cloudSiteId, - @ApiParam(value = "cloudOwner", required = true) @QueryParam("cloudOwner") String cloudOwner, - @ApiParam(value = "tenantId", required = true) @QueryParam("tenantId") String tenantId, - @ApiParam(value = "vfModuleName", required = true) @QueryParam("vfModuleName") String vfModuleName, // RAA? - // Id in - // doc - @ApiParam(value = "skipAAI", required = true) @QueryParam("skipAAI") Boolean skipAAI, - @ApiParam(value = "msoRequest.requestId", - required = true) @QueryParam("msoRequest.requestId") String requestId, - @ApiParam(value = "msoRequest.serviceInstanceId", - required = true) @QueryParam("msoRequest.serviceInstanceId") String serviceInstanceId, - @ApiParam(value = "mode", required = true) @QueryParam("mode") String mode) { - // This request responds synchronously only - logger.debug("Query vfModule enter:" + vfModuleName); - MsoRequest msoRequest = new MsoRequest(requestId, serviceInstanceId); - - try { - int respStatus = HttpStatus.SC_OK; - QueryVfModuleResponse qryResp = new QueryVfModuleResponse(aaiVnfId, aaiVfModuleId, null, null, null); - Holder<Boolean> vnfExists = new Holder<>(); - Holder<String> vfModuleId = new Holder<>(); - Holder<VnfStatus> status = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - - // Support different Adapter Implementations - MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudSiteId); - adapter.queryVnf(cloudSiteId, cloudOwner, tenantId, vfModuleName, msoRequest, vnfExists, vfModuleId, status, - outputs); - - if (!vnfExists.value) { - logger.debug("vfModule not found"); - respStatus = HttpStatus.SC_NOT_FOUND; - } else { - logger.debug("vfModule found" + vfModuleId.value + ", status=" + status.value); - qryResp.setVfModuleId(vfModuleId.value); - qryResp.setVnfStatus(status.value); - qryResp.setVfModuleOutputs(outputs.value); - } - logger.debug("Query vfModule exit"); - return Response.status(respStatus).entity(new GenericEntity<QueryVfModuleResponse>(qryResp) {}).build(); - } catch (VnfException e) { - logger.error(LoggingAnchor.FIVE, MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, "queryVfModule", - ErrorCode.BusinessProcessError.getValue(), "VnfException - queryVfModule", e); - VfModuleExceptionResponse excResp = - new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.FALSE, null); - return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity<VfModuleExceptionResponse>(excResp) {}).build(); - } - } - - /* - * URL: http://localhost:8080/vnfs/rest/v2/vnfs/<aaivnfid>/vf-modules REQUEST: {"createVfModuleRequest": - * {"cloudSiteId": "DAN", "tenantId": "214b428a1f554c02935e66330f6a5409", "vnfId": "somevnfid", "vfModuleId": - * "somemodid", "vfModuleName": "RaaVnf1", "vnfType": "ApacheVnf", "vfModuleParams": {"entry": [ {"key": - * "network_id", "value": "59ed7b41-2983-413f-ba93-e7d437433916"}, {"key": "subnet_id", "value": - * "086c9298-5c57-49b7-bb2b-6fd5730c5d92"}, {"key": "server_name_0", "value": "RaaVnf1"} ]}, "failIfExists": true, - * "messageId": "ra.1", "notificationUrl": "http://localhost:8089/vnfmock", "skipAAI": true, "msoRequest": { - * "requestId": "ra1", "serviceInstanceId": "sa1" }} } - */ - @POST - @Path("{aaiVnfId}/vf-modules") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "CreateVfModule", response = Response.class, notes = "Create a vnfModule") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully created"), - @ApiResponse(code = 202, message = "create vnfModule request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "create vnfModule failed, examine entity object for details")}) - public Response createVfModule( - @ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "mode", required = true) @QueryParam("mode") String mode, - @ApiParam(value = "CreateVfModuleRequest", required = true) final CreateVfModuleRequest req) { - logger.debug("Create VfModule enter inside VnfAdapterRest: " + req.toJsonString()); - if (aaiVnfId == null || !aaiVnfId.equals(req.getVnfId())) { - logger.debug("Req rejected - aaiVnfId not provided or doesn't match URL"); - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity("vnfid in URL does not match content").build(); - } - - CreateVfModuleTask task = new CreateVfModuleTask(req, mode); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error(BRACKETS, MessageEnum.RA_CREATE_VNF_ERR.toString(), "createVfModule", - ErrorCode.BusinessProcessError.getValue(), "Exception - createVfModule", e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("createVfModule exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class CreateVfModuleTask implements Runnable { - private final CreateVfModuleRequest req; - private CreateVfModuleResponse response = null; - private VfModuleExceptionResponse eresp = null; - private boolean sendxml; - private String mode; - - public CreateVfModuleTask(CreateVfModuleRequest req, String mode) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - this.mode = mode; - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<CreateVfModuleResponse>(response) {} - : new GenericEntity<VfModuleExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - logger.debug("CreateVfModuleTask start"); - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - // Synchronous Web Service Outputs - Holder<String> vfModuleStackId = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType(); - logger.debug("completeVnfVfModuleType=" + completeVnfVfModuleType); - - String cloudsiteId = req.getCloudSiteId(); - String cloudOwner = req.getCloudOwner(); - if (cloudsiteId != null && cloudsiteId.equals(TESTING_KEYWORD)) { - String tenant = req.getTenantId(); - if (tenant != null && tenant.equals(TESTING_KEYWORD)) { - throw new VnfException("testing."); - } - vnfRollback.value = new VnfRollback(req.getVnfId(), tenant, cloudOwner, cloudsiteId, true, false, - new MsoRequest("reqid", "svcid"), req.getVolumeGroupId(), req.getVolumeGroupId(), - req.getRequestType(), req.getModelCustomizationUuid()); - vfModuleStackId.value = "479D3D8B-6360-47BC-AB75-21CC91981484"; - outputs.value = VolumeAdapterRest.testMap(); - } else { - // Support different Adapter Implementations - MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsiteId); - adapter.createVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - completeVnfVfModuleType, req.getVnfVersion(), req.getVnfId(), req.getVfModuleName(), - req.getVfModuleId(), req.getRequestType(), req.getVolumeGroupStackId(), - req.getBaseVfModuleStackId(), req.getModelCustomizationUuid(), req.getVfModuleParams(), - req.getFailIfExists(), req.getBackout(), req.getEnableBridge(), req.getMsoRequest(), - vfModuleStackId, outputs, vnfRollback); - } - VfModuleRollback modRollback = new VfModuleRollback(vnfRollback.value, req.getVfModuleId(), - vfModuleStackId.value, req.getMessageId()); - response = new CreateVfModuleResponse(req.getVnfId(), req.getVfModuleId(), vfModuleStackId.value, - Boolean.TRUE, outputs.value, modRollback, req.getMessageId()); - } catch (VnfException e) { - eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, - req.getMessageId()); - } - if (!req.isSynchronous()) { - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("CreateVfModuleTask exit: code=" + getStatusCode() + RESP + getResponse()); - } - } - - @PUT - @Path("{aaiVnfId}/vf-modules/{aaiVfModuleId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "UpdateVfModule", response = Response.class, notes = "Update an existing vnfModule") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully updated"), - @ApiResponse(code = 202, message = "update vnfModule request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "update vnfModule failed, examine entity object for details")}) - public Response updateVfModule( - @ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "aaiVfModuleId", required = true) @PathParam("aaiVfModuleId") String aaiVfModuleId, - @ApiParam(value = "mode", required = true) @QueryParam("mode") String mode, - @ApiParam(value = "UpdateVfModuleRequest", required = true) final UpdateVfModuleRequest req) { - logger.debug("Update VfModule enter: " + req.toJsonString()); - UpdateVfModulesTask task = new UpdateVfModulesTask(req, mode); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error(BRACKETS, MessageEnum.RA_UPDATE_VNF_ERR.toString(), "updateVfModule", - ErrorCode.BusinessProcessError.getValue(), "Exception - updateVfModule", e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("updateVfModules exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class UpdateVfModulesTask implements Runnable { - private final UpdateVfModuleRequest req; - private UpdateVfModuleResponse response = null; - private VfModuleExceptionResponse eresp = null; - private boolean sendxml; - private String mode; - - public UpdateVfModulesTask(UpdateVfModuleRequest req, String mode) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - this.mode = mode; - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<UpdateVfModuleResponse>(response) {} - : new GenericEntity<VfModuleExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - // Synchronous Web Service Outputs - Holder<String> vfModuleStackId = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType(); - logger.debug("in updateVf - completeVnfVfModuleType=" + completeVnfVfModuleType); - - String cloudsiteId = req.getCloudSiteId(); - - // Support different Adapter Implementations - MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsiteId); - adapter.updateVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - completeVnfVfModuleType, req.getVnfVersion(), req.getVfModuleName(), req.getRequestType(), - req.getVolumeGroupStackId(), req.getBaseVfModuleId(), req.getVfModuleStackId(), - req.getModelCustomizationUuid(), req.getVfModuleParams(), req.getMsoRequest(), outputs, - vnfRollback); - - response = new UpdateVfModuleResponse(req.getVnfId(), req.getVfModuleId(), vfModuleStackId.value, - outputs.value, req.getMessageId()); - } catch (VnfException e) { - eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("Update VfModule exit: code=" + getStatusCode() + RESP + getResponse()); - } - } - - /* - * URL:http://localhost:8080/vnfs/rest/v2/vnfs/<aaivnfid>/vf-modules/<aaimodid>/rollback REQUEST: - * {"deleteVfModuleRequest": {"cloudSiteId": "DAN", "tenantId": "214b428a1f554c02935e66330f6a5409", "vnfId": - * "somevnfid", "vfModuleId": "somemodid", "vfModuleStackId": "4e567676-e266-4594-a3a6-131c8a2baf73", "messageId": - * "ra.1", "notificationUrl": "http://localhost:8089/vnfmock", "skipAAI": true, "msoRequest": { "requestId": "ra1", - * "serviceInstanceId": "sa1" }} } - */ - @DELETE - @Path("{aaiVnfId}/vf-modules/{aaiVfModuleId}/rollback") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "RollbackVfModule", response = Response.class, notes = "Rollback an existing vnfModule") - @ApiResponses({@ApiResponse(code = 200, message = "vnfModule has been successfully rolled back"), - @ApiResponse(code = 202, - message = "rollback vnfModule request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "rollback vnfModule failed, examine entity object for details")}) - public Response rollbackVfModule( - @ApiParam(value = "aaiVnfId", required = true) @PathParam("aaiVnfId") String aaiVnfId, - @ApiParam(value = "aaiVfModuleId", required = true) @PathParam("aaiVfModuleId") String aaiVfModuleId, - @ApiParam(value = "RollbackVfModuleRequest", required = true) - // @QueryParam("rollback") String rollback, - final RollbackVfModuleRequest req) { - logger.debug("Rollback VfModule enter: " + req.toJsonString()); - RollbackVfModulesTask task = new RollbackVfModulesTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error(BRACKETS, MessageEnum.RA_ROLLBACK_VNF_ERR.toString(), "rollbackVfModule", - ErrorCode.BusinessProcessError.getValue(), "Exception - rollbackVfModule", e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("rollbackVfModule exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class RollbackVfModulesTask implements Runnable { - private final RollbackVfModuleRequest req; - private RollbackVfModuleResponse response = null; - private VfModuleExceptionResponse eresp = null; - private boolean sendxml; - - public RollbackVfModulesTask(RollbackVfModuleRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<RollbackVfModuleResponse>(response) {} - : new GenericEntity<VfModuleExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getVfModuleRollback().getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - VfModuleRollback vmr = req.getVfModuleRollback(); - VnfRollback vrb = new VnfRollback(vmr.getVfModuleStackId(), vmr.getTenantId(), vmr.getCloudOwner(), - vmr.getCloudSiteId(), true, vmr.isVfModuleCreated(), vmr.getMsoRequest(), null, null, null, - null); - - // Support multiple adapter implementations - MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(vmr.getMode(), vmr.getCloudSiteId()); - adapter.rollbackVnf(vrb); - - response = new RollbackVfModuleResponse(Boolean.TRUE, req.getMessageId()); - } catch (VnfException e) { - logger.error(LoggingAnchor.THREE, MessageEnum.RA_ROLLBACK_VNF_ERR.toString(), - ErrorCode.BusinessProcessError.getValue(), "Exception - rollbackVfModule", e); - eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, false, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("RollbackVfModulesTask exit: code=" + getStatusCode() + RESP + getResponse()); - } - } -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRest.java deleted file mode 100644 index 7e12735e05..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRest.java +++ /dev/null @@ -1,626 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - - -import java.util.HashMap; -import java.util.Map; -import javax.inject.Provider; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.ws.Holder; -import org.apache.http.HttpStatus; -import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.QueryVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.VolumeGroupExceptionResponse; -import org.onap.so.adapters.vnfrest.VolumeGroupRollback; -import org.onap.so.entity.MsoRequest; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; -import org.onap.so.openstack.exceptions.MsoExceptionCategory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -/** - * This class services calls to the REST interface for VNF Volumes (http://host:port/vnfs/rest/v1/volume-groups) Both - * XML and JSON can be produced/consumed. Set Accept: and Content-Type: headers appropriately. XML is the default. For - * testing, call with cloudSiteId = ___TESTING___ To test exceptions, also set tenantId = ___TESTING___ - */ -@Path("/v1/volume-groups") -@Api(value = "/v1/volume-groups", description = "root of volume-groups adapters restful web service") -@Component -public class VolumeAdapterRest { - - private static final Logger logger = LoggerFactory.getLogger(VolumeAdapterRest.class); - private static final String TESTING_KEYWORD = "___TESTING___"; - private static final String EXCEPTION = "Exception :"; - private static final String RESP = ", resp="; - private static final String VOLUME_GROUPID_IN_URL_DOESNT_MATCH_CONTENT = - "VolumeGroupId in URL does not match content"; - @Autowired - private MsoVnfAdapterImpl vnfAdapter; - - @Autowired - private Provider<BpelRestClient> bpelRestClientProvider; - - @POST - @Path("") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "CreateVNFVolumes", response = Response.class, notes = "Create a new vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully created"), - @ApiResponse(code = 202, message = "create vnfVolume request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "create vnfVolume failed, examine entity object for details")}) - public Response createVNFVolumes( - @ApiParam(value = "CreateVolumeGroupRequest", required = true) final CreateVolumeGroupRequest req) { - logger.debug("createVNFVolumes enter: {}", req.toJsonString()); - CreateVNFVolumesTask task = new CreateVNFVolumesTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception - createVNFVolumes: ", MessageEnum.RA_CREATE_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("createVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class CreateVNFVolumesTask implements Runnable { - private final CreateVolumeGroupRequest req; - private CreateVolumeGroupResponse response = null; - private VolumeGroupExceptionResponse eresp = null; - private boolean sendxml; - - public CreateVNFVolumesTask(CreateVolumeGroupRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<CreateVolumeGroupResponse>(response) {} - : new GenericEntity<VolumeGroupExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("CreateVFModule VolumesTask start"); - try { - // Synchronous Web Service Outputs - Holder<String> stackId = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType(); - logger.debug("in createVfModuleVolumes - completeVnfVfModuleType={}", completeVnfVfModuleType); - - String cloudsite = req.getCloudSiteId(); - if (cloudsite != null && cloudsite.equals(TESTING_KEYWORD)) { - String tenant = req.getTenantId(); - if (tenant != null && tenant.equals(TESTING_KEYWORD)) { - throw new VnfException("testing."); - } - stackId.value = "479D3D8B-6360-47BC-AB75-21CC91981484"; - outputs.value = testMap(); - } else { - // vnfAdapter.createVnf( - // req.getCloudSiteId(), - // req.getTenantId(), - // req.getVnfType(), - // req.getVnfVersion(), - // req.getVolumeGroupName(), - // "VOLUME", // request type is VOLUME - // null, // not sure about this - // req.getVolumeGroupParams(), - // req.getFailIfExists(), - // req.getSuppressBackout(), - // req.getMsoRequest(), - // stackId, - // outputs, - // vnfRollback); - vnfAdapter.createVfModule(req.getCloudSiteId(), // cloudSiteId, - req.getCloudOwner(), // cloudOwner, - req.getTenantId(), // tenantId, - // req.getVnfType(), //vnfType, - completeVnfVfModuleType, req.getVnfVersion(), // vnfVersion, - "", // genericVnfId - req.getVolumeGroupName(), // vnfName, - "", // vfModuleid - "VOLUME", // requestType, - null, // volumeGroupHeatStackId, - null, // baseVfHeatStackId, - req.getModelCustomizationUuid(), req.getVolumeGroupParams(), // inputs, - req.getFailIfExists(), // failIfExists, - req.getSuppressBackout(), // backout, - req.getEnableBridge(), req.getMsoRequest(), // msoRequest, - stackId, outputs, vnfRollback); - } - VolumeGroupRollback rb = new VolumeGroupRollback(req.getVolumeGroupId(), stackId.value, true, // TODO - // boolean - // volumeGroupCreated, - // when - // would - // it be - // false? - req.getTenantId(), req.getCloudOwner(), req.getCloudSiteId(), req.getMsoRequest(), - req.getMessageId()); - response = new CreateVolumeGroupResponse(req.getVolumeGroupId(), stackId.value, true, // TODO boolean - // volumeGroupCreated, - // when would it - // be false? - outputs.value, rb, req.getMessageId()); - } catch (VnfException e) { - logger.debug(EXCEPTION, e); - eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("CreateVFModule VolumesTask exit: code={} {} {}", getStatusCode(), RESP, getResponse()); - } - } - - @DELETE - @Path("{aaiVolumeGroupId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "DeleteVNFVolumes", response = Response.class, notes = "Delete an existing vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully deleted"), - @ApiResponse(code = 202, message = "delete vnfVolume request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "delete vnfVolume failed, examine entity object for details")}) - public Response deleteVNFVolumes( - @ApiParam(value = "aaiVolumeGroupId", - required = true) @PathParam("aaiVolumeGroupId") String aaiVolumeGroupId, - @ApiParam(value = "DeleteVolumeGroupRequest", required = true) final DeleteVolumeGroupRequest req) { - logger.debug("deleteVNFVolumes enter: {}", req.toJsonString()); - if (aaiVolumeGroupId == null || !aaiVolumeGroupId.equals(req.getVolumeGroupId())) { - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity(VOLUME_GROUPID_IN_URL_DOESNT_MATCH_CONTENT).build(); - } - DeleteVNFVolumesTask task = new DeleteVNFVolumesTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception - deleteVNFVolumes: ", MessageEnum.RA_DELETE_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("deleteVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class DeleteVNFVolumesTask implements Runnable { - private final DeleteVolumeGroupRequest req; - private DeleteVolumeGroupResponse response = null; - private VolumeGroupExceptionResponse eresp = null; - private boolean sendxml; - - public DeleteVNFVolumesTask(DeleteVolumeGroupRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<DeleteVolumeGroupResponse>(response) {} - : new GenericEntity<VolumeGroupExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("DeleteVNFVolumesTask start"); - try { - if (!req.getCloudSiteId().equals(TESTING_KEYWORD)) { - vnfAdapter.deleteVnf(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - req.getVolumeGroupStackId(), req.getMsoRequest()); - } - response = new DeleteVolumeGroupResponse(true, req.getMessageId()); - } catch (VnfException e) { - logger.debug(EXCEPTION, e); - eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("DeleteVNFVolumesTask exit: code={} {} {}", getStatusCode(), RESP, getResponse()); - } - } - - @DELETE - @Path("{aaiVolumeGroupId}/rollback") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "RollbackVNFVolumes", response = Response.class, notes = "Delete an existing vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully rolled back"), - @ApiResponse(code = 202, - message = "rollback vnfVolume request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "rollback vnfVolume failed, examine entity object for details")}) - public Response rollbackVNFVolumes( - @ApiParam(value = "aaiVolumeGroupId", - required = true) @PathParam("aaiVolumeGroupId") String aaiVolumeGroupId, - @ApiParam(value = "RollbackVolumeGroupRequest", required = true) final RollbackVolumeGroupRequest req) { - logger.debug("rollbackVNFVolumes enter: {}", req.toJsonString()); - if (aaiVolumeGroupId == null || req.getVolumeGroupRollback() == null - || !aaiVolumeGroupId.equals(req.getVolumeGroupRollback().getVolumeGroupId())) { - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity(VOLUME_GROUPID_IN_URL_DOESNT_MATCH_CONTENT).build(); - } - RollbackVNFVolumesTask task = new RollbackVNFVolumesTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception - rollbackVNFVolumes: ", MessageEnum.RA_ROLLBACK_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("rollbackVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class RollbackVNFVolumesTask implements Runnable { - private final RollbackVolumeGroupRequest req; - private RollbackVolumeGroupResponse response = null; - private VolumeGroupExceptionResponse eresp = null; - private boolean sendxml; - - public RollbackVNFVolumesTask(RollbackVolumeGroupRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<RollbackVolumeGroupResponse>(response) {} - : new GenericEntity<VolumeGroupExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getVolumeGroupRollback().getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("DeleteVNFVolumesTask start"); - try { - VolumeGroupRollback vgr = req.getVolumeGroupRollback(); - VnfRollback vrb = new VnfRollback(vgr.getVolumeGroupStackId(), vgr.getTenantId(), vgr.getCloudOwnerId(), - vgr.getCloudSiteId(), true, true, vgr.getMsoRequest(), null, null, null, null); - vnfAdapter.rollbackVnf(vrb); - response = new RollbackVolumeGroupResponse(true, req.getMessageId()); - } catch (VnfException e) { - logger.debug(EXCEPTION, e); - eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("DeleteVNFVolumesTask exit: code={} {} {}", getStatusCode(), RESP, getResponse()); - } - - } - - @PUT - @Path("{aaiVolumeGroupId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "UpdateVNFVolumes", response = Response.class, notes = "Update an existing vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully updated"), - @ApiResponse(code = 202, message = "update vnfVolume request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "update vnfVolume failed, examine entity object for details")}) - public Response updateVNFVolumes( - @ApiParam(value = "aaiVolumeGroupId", - required = true) @PathParam("aaiVolumeGroupId") String aaiVolumeGroupId, - @ApiParam(value = "UpdateVolumeGroupRequest", required = true) final UpdateVolumeGroupRequest req) { - logger.debug("updateVNFVolumes enter: {}", req.toJsonString()); - if (aaiVolumeGroupId == null || !aaiVolumeGroupId.equals(req.getVolumeGroupId())) { - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN) - .entity(VOLUME_GROUPID_IN_URL_DOESNT_MATCH_CONTENT).build(); - } - UpdateVNFVolumesTask task = new UpdateVNFVolumesTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception - updateVNFVolumes: ", MessageEnum.RA_UPDATE_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("updateVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class UpdateVNFVolumesTask implements Runnable { - private final UpdateVolumeGroupRequest req; - private UpdateVolumeGroupResponse response = null; - private VolumeGroupExceptionResponse eresp = null; - private boolean sendxml; - - public UpdateVNFVolumesTask(UpdateVolumeGroupRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<UpdateVolumeGroupResponse>(response) {} - : new GenericEntity<VolumeGroupExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - logger.debug("UpdateVNFVolumesTask start"); - try { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType(); - logger.debug("in updateVfModuleVolume - completeVnfVfModuleType={}", completeVnfVfModuleType); - - if (req.getCloudSiteId().equals(TESTING_KEYWORD)) { - outputs.value = testMap(); - } else { - // vnfAdapter.updateVnf( - // req.getCloudSiteId(), - // req.getTenantId(), - // req.getVnfType(), - // req.getVnfVersion(), - // req.getVfModuleType(), - // "VOLUME", // request type is VOLUME - // req.getVolumeGroupStackId(), - // req.getVolumeGroupParams(), - // req.getMsoRequest(), - // outputs, - // vnfRollback); - vnfAdapter.updateVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - // req.getVnfType(), - completeVnfVfModuleType, req.getVnfVersion(), req.getVolumeGroupStackId(), "VOLUME", null, - null, req.getVolumeGroupStackId(), req.getModelCustomizationUuid(), - req.getVolumeGroupParams(), req.getMsoRequest(), outputs, vnfRollback); - } - response = new UpdateVolumeGroupResponse(req.getVolumeGroupId(), req.getVolumeGroupStackId(), - outputs.value, req.getMessageId()); - } catch (VnfException e) { - logger.debug(EXCEPTION, e); - eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("UpdateVNFVolumesTask exit: code={} {} {}", getStatusCode(), RESP, getResponse()); - } - } - - @GET - @Path("{aaiVolumeGroupId}") - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "QueryVNFVolumes", response = Response.class, notes = "Query an existing vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully queried"), - @ApiResponse(code = 500, message = "query vnfVolume failed, examine entity object for details")}) - public Response queryVNFVolumes( - @ApiParam(value = "aaiVolumeGroupId", - required = true) @PathParam("aaiVolumeGroupId") String aaiVolumeGroupId, - @ApiParam(value = "cloudSiteId", required = true) @QueryParam("cloudSiteId") String cloudSiteId, - @ApiParam(value = "cloudOwner", required = true) @QueryParam("cloudOwner") String cloudOwner, - @ApiParam(value = "tenantId", required = true) @QueryParam("tenantId") String tenantId, - @ApiParam(value = "volumeGroupStackId", - required = true) @QueryParam("volumeGroupStackId") String volumeGroupStackId, - @ApiParam(value = "skipAAI", required = true) @QueryParam("skipAAI") Boolean skipAAI, - @ApiParam(value = "msoRequest.requestId", - required = true) @QueryParam("msoRequest.requestId") String requestId, - @ApiParam(value = "msoRequest.serviceInstanceId", - required = true) @QueryParam("msoRequest.serviceInstanceId") String serviceInstanceId) { - // This request responds synchronously only - logger.debug("queryVNFVolumes enter: {} {}", aaiVolumeGroupId, volumeGroupStackId); - MsoRequest msoRequest = new MsoRequest(requestId, serviceInstanceId); - - try { - int respStatus = HttpStatus.SC_OK; - QueryVolumeGroupResponse qryResp = - new QueryVolumeGroupResponse(aaiVolumeGroupId, volumeGroupStackId, null, null); - Holder<Boolean> vnfExists = new Holder<>(); - Holder<String> vfModuleId = new Holder<>(); - Holder<VnfStatus> status = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - if (cloudSiteId != null && cloudSiteId.equals(TESTING_KEYWORD)) { - if (tenantId != null && tenantId.equals(TESTING_KEYWORD)) { - throw new VnfException("testing."); - } - vnfExists.value = true; - vfModuleId.value = TESTING_KEYWORD; - status.value = VnfStatus.ACTIVE; - outputs.value = testMap(); - } else { - vnfAdapter.queryVnf(cloudSiteId, cloudOwner, tenantId, volumeGroupStackId, msoRequest, vnfExists, - vfModuleId, status, outputs); - } - if (!vnfExists.value) { - logger.debug("VNFVolumes not found"); - qryResp.setVolumeGroupStatus(status.value); - respStatus = HttpStatus.SC_NOT_FOUND; - } else { - logger.debug("VNFVolumes found {}, status={}", vfModuleId.value, status.value); - qryResp.setVolumeGroupStatus(status.value); - qryResp.setVolumeGroupOutputs(outputs.value); - } - logger.debug("Query queryVNFVolumes exit"); - return Response.status(respStatus).entity(new GenericEntity<QueryVolumeGroupResponse>(qryResp) {}).build(); - } catch (VnfException e) { - logger.error("{} {} AaiVolumeGroupId: {} VnfException - queryVNFVolumes", MessageEnum.RA_QUERY_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), aaiVolumeGroupId, e); - VolumeGroupExceptionResponse excResp = new VolumeGroupExceptionResponse(e.getMessage(), - MsoExceptionCategory.INTERNAL, Boolean.FALSE, null); - logger.debug("Query queryVNFVolumes exit"); - return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity<VolumeGroupExceptionResponse>(excResp) {}).build(); - } - } - - public static Map<String, String> testMap() { - Map<String, String> m = new HashMap<>(); - m.put("mickey", "7"); - m.put("clyde", "10"); - m.put("wayne", "99"); - return m; - } -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java deleted file mode 100644 index a424fa92fd..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2.java +++ /dev/null @@ -1,606 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * OPENECOMP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - - -import java.util.HashMap; -import java.util.Map; -import javax.inject.Provider; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.ws.Holder; -import org.apache.http.HttpStatus; -import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.QueryVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.VolumeGroupExceptionResponse; -import org.onap.so.adapters.vnfrest.VolumeGroupRollback; -import org.onap.so.entity.MsoRequest; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.VnfRollback; -import org.onap.so.openstack.beans.VnfStatus; -import org.onap.so.openstack.exceptions.MsoExceptionCategory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.MDC; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -/** - * This class services calls to the REST interface for VNF Volumes (http://host:port/vnfs/rest/v1/volume-groups) Both - * XML and JSON can be produced/consumed. Set Accept: and Content-Type: headers appropriately. XML is the default. For - * testing, call with cloudSiteId = ___TESTING___ To test exceptions, also set tenantId = ___TESTING___ - * - * V2 incorporates run-time selection of sub-orchestrator implementation (Heat or Cloudify) based on the target cloud. - */ -@Path("/v2/volume-groups") -@Api(value = "/v2/volume-groups", description = "root of volume-groups adapters restful web service v2") -@Component -public class VolumeAdapterRestV2 { - - private static final Logger logger = LoggerFactory.getLogger(VolumeAdapterRestV2.class); - private static final String TESTING_KEYWORD = "___TESTING___"; - private static final String RESP = ", resp="; - private static final String EXCEPTION = "Exception :"; - private static final String VOLUME_GROUPID_MISSING = "VolumeGroupId in URL does not match content"; - - @Autowired - private VnfAdapterRestUtils vnfAdapterRestUtils; - - @Autowired - private Provider<BpelRestClient> bpelRestClientProvider; - - @POST - @Path("") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "CreateVNFVolumes", response = Response.class, notes = "Create a new vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully created"), - @ApiResponse(code = 202, message = "create vnfVolume request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "create vnfVolume failed, examine entity object for details")}) - public Response createVNFVolumes(@ApiParam(value = "mode", required = true) @QueryParam("mode") String mode, - @ApiParam(value = "CreateVolumeGroupRequest", required = true) final CreateVolumeGroupRequest req) { - CreateVNFVolumesTask task = new CreateVNFVolumesTask(req, mode); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception - createVNFVolumes: ", MessageEnum.RA_CREATE_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("createVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class CreateVNFVolumesTask implements Runnable { - private final CreateVolumeGroupRequest req; - private CreateVolumeGroupResponse response = null; - private VolumeGroupExceptionResponse eresp = null; - private boolean sendxml; - private String mode; - - public CreateVNFVolumesTask(CreateVolumeGroupRequest req, String mode) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - this.mode = mode; - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<CreateVolumeGroupResponse>(response) {} - : new GenericEntity<VolumeGroupExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("CreateVFModule VolumesTask start"); - try { - // Synchronous Web Service Outputs - Holder<String> stackId = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType(); - logger.debug("in createVfModuleVolumes - completeVnfVfModuleType={}", completeVnfVfModuleType); - - String cloudsiteId = req.getCloudSiteId(); - - // Support different Adapter Implementations - MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsiteId); - vnfAdapter.createVfModule(req.getCloudSiteId(), // cloudSiteId, - req.getCloudOwner(), // cloudOwner, - req.getTenantId(), // tenantId, - completeVnfVfModuleType, // vnfType, - req.getVnfVersion(), // vnfVersion, - "", // genericVnfId - req.getVolumeGroupName(), // vnfName, - "", // vfModuleId - "VOLUME", // requestType, - null, // volumeGroupHeatStackId, - null, // baseVfHeatStackId, - req.getModelCustomizationUuid(), req.getVolumeGroupParams(), // inputs, - req.getFailIfExists(), // failIfExists, - req.getSuppressBackout(), // backout, - req.getEnableBridge(), req.getMsoRequest(), // msoRequest, - stackId, outputs, vnfRollback); - - - VolumeGroupRollback rb = new VolumeGroupRollback(req.getVolumeGroupId(), stackId.value, - vnfRollback.value.getVnfCreated(), req.getTenantId(), req.getCloudOwner(), req.getCloudSiteId(), - req.getMsoRequest(), req.getMessageId()); - - response = new CreateVolumeGroupResponse(req.getVolumeGroupId(), stackId.value, - vnfRollback.value.getVnfCreated(), outputs.value, rb, req.getMessageId()); - } catch (VnfException e) { - logger.debug(EXCEPTION, e); - eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("CreateVFModule VolumesTask exit: code= {} {} {}", getStatusCode(), RESP, getResponse()); - } - } - - @DELETE - @Path("{aaiVolumeGroupId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "DeleteVNFVolumes", response = Response.class, notes = "Delete an existing vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully deleted"), - @ApiResponse(code = 202, message = "delete vnfVolume request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "delete vnfVolume failed, examine entity object for details")}) - public Response deleteVNFVolumes( - @ApiParam(value = "aaiVolumeGroupId", - required = true) @PathParam("aaiVolumeGroupId") String aaiVolumeGroupId, - @ApiParam(value = "mode", required = true) @QueryParam("mode") String mode, - @ApiParam(value = "DeleteVolumeGroupRequest", required = true) final DeleteVolumeGroupRequest req) { - logger.debug("deleteVNFVolumes enter: {}", req.toJsonString()); - if (aaiVolumeGroupId == null || !aaiVolumeGroupId.equals(req.getVolumeGroupId())) { - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN).entity(VOLUME_GROUPID_MISSING) - .build(); - } - DeleteVNFVolumesTask task = new DeleteVNFVolumesTask(req, mode); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception - deleteVNFVolumes: ", MessageEnum.RA_DELETE_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("deleteVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class DeleteVNFVolumesTask implements Runnable { - private final DeleteVolumeGroupRequest req; - private DeleteVolumeGroupResponse response = null; - private VolumeGroupExceptionResponse eresp = null; - private boolean sendxml; - private String mode; - - public DeleteVNFVolumesTask(DeleteVolumeGroupRequest req, String mode) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - this.mode = mode; - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<DeleteVolumeGroupResponse>(response) {} - : new GenericEntity<VolumeGroupExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("DeleteVNFVolumesTask start"); - String cloudSiteId = req.getCloudSiteId(); - try { - if (!cloudSiteId.equals(TESTING_KEYWORD)) { - // Support different Adapter Implementations - MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudSiteId); - vnfAdapter.deleteVnf(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - req.getVolumeGroupStackId(), req.getMsoRequest()); - } - response = new DeleteVolumeGroupResponse(true, req.getMessageId()); - } catch (VnfException e) { - logger.debug(EXCEPTION, e); - eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("DeleteVNFVolumesTask exit: code= {} {} {}", getStatusCode(), RESP, getResponse()); - } - } - - @DELETE - @Path("{aaiVolumeGroupId}/rollback") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "RollbackVNFVolumes", response = Response.class, notes = "Delete an existing vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully rolled back"), - @ApiResponse(code = 202, - message = "rollback vnfVolume request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "rollback vnfVolume failed, examine entity object for details")}) - public Response rollbackVNFVolumes( - @ApiParam(value = "aaiVolumeGroupId", - required = true) @PathParam("aaiVolumeGroupId") String aaiVolumeGroupId, - @ApiParam(value = "RollbackVolumeGroupRequest", required = true) final RollbackVolumeGroupRequest req) { - logger.debug("rollbackVNFVolumes enter: {}", req.toJsonString()); - if (aaiVolumeGroupId == null || req.getVolumeGroupRollback() == null - || !aaiVolumeGroupId.equals(req.getVolumeGroupRollback().getVolumeGroupId())) { - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN).entity(VOLUME_GROUPID_MISSING) - .build(); - } - RollbackVNFVolumesTask task = new RollbackVNFVolumesTask(req); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception - rollbackVNFVolumes: ", MessageEnum.RA_ROLLBACK_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("rollbackVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class RollbackVNFVolumesTask implements Runnable { - private final RollbackVolumeGroupRequest req; - private RollbackVolumeGroupResponse response = null; - private VolumeGroupExceptionResponse eresp = null; - private boolean sendxml; - - public RollbackVNFVolumesTask(RollbackVolumeGroupRequest req) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<RollbackVolumeGroupResponse>(response) {} - : new GenericEntity<VolumeGroupExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getVolumeGroupRollback().getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("RollbackVNFVolumesTask start"); - try { - VolumeGroupRollback vgr = req.getVolumeGroupRollback(); - VnfRollback vrb = new VnfRollback(vgr.getVolumeGroupStackId(), vgr.getTenantId(), vgr.getCloudOwnerId(), - vgr.getCloudSiteId(), true, true, vgr.getMsoRequest(), null, null, null, null); - - // Support different Adapter Implementations - MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(vrb.getMode(), vrb.getCloudSiteId()); - vnfAdapter.rollbackVnf(vrb); - response = new RollbackVolumeGroupResponse(true, req.getMessageId()); - } catch (VnfException e) { - logger.debug(EXCEPTION, e); - eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("RollbackVNFVolumesTask exit: code= {} {} {}", getStatusCode(), RESP, getResponse()); - } - - } - - @PUT - @Path("{aaiVolumeGroupId}") - @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "UpdateVNFVolumes", response = Response.class, notes = "Update an existing vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully updated"), - @ApiResponse(code = 202, message = "update vnfVolume request has been successfully accepted (async only)"), - @ApiResponse(code = 500, message = "update vnfVolume failed, examine entity object for details")}) - public Response updateVNFVolumes( - @ApiParam(value = "aaiVolumeGroupId", - required = true) @PathParam("aaiVolumeGroupId") String aaiVolumeGroupId, - @ApiParam(value = "mode", required = true) @QueryParam("mode") String mode, - @ApiParam(value = "UpdateVolumeGroupRequest", required = true) final UpdateVolumeGroupRequest req) { - logger.debug("updateVNFVolumes enter: {}", req.toJsonString()); - if (aaiVolumeGroupId == null || !aaiVolumeGroupId.equals(req.getVolumeGroupId())) { - return Response.status(HttpStatus.SC_BAD_REQUEST).type(MediaType.TEXT_PLAIN).entity(VOLUME_GROUPID_MISSING) - .build(); - } - UpdateVNFVolumesTask task = new UpdateVNFVolumesTask(req, mode); - if (req.isSynchronous()) { - // This is a synchronous request - task.run(); - return Response.status(task.getStatusCode()).entity(task.getGenericEntityResponse()).build(); - } else { - // This is an asynchronous request - try { - Thread t1 = new Thread(task); - t1.start(); - } catch (Exception e) { - // problem handling create, send generic failure as sync resp to caller - logger.error("{} {} Exception - updateVNFVolumes: ", MessageEnum.RA_UPDATE_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), e); - return Response.serverError().build(); - } - // send sync response (ACK) to caller - logger.debug("updateVNFVolumes exit"); - return Response.status(HttpStatus.SC_ACCEPTED).build(); - } - } - - public class UpdateVNFVolumesTask implements Runnable { - private final UpdateVolumeGroupRequest req; - private UpdateVolumeGroupResponse response = null; - private VolumeGroupExceptionResponse eresp = null; - private boolean sendxml; - private String mode; - - public UpdateVNFVolumesTask(UpdateVolumeGroupRequest req, String mode) { - this.req = req; - this.sendxml = true; // can be set with a field or header later - this.mode = mode; - } - - public int getStatusCode() { - return (response != null) ? HttpStatus.SC_OK : HttpStatus.SC_BAD_REQUEST; - } - - public Object getGenericEntityResponse() { - return (response != null) ? new GenericEntity<UpdateVolumeGroupResponse>(response) {} - : new GenericEntity<VolumeGroupExceptionResponse>(eresp) {}; - } - - private String getResponse() { - if (response != null) { - return sendxml ? response.toXmlString() : response.toJsonString(); - } else { - return sendxml ? eresp.toXmlString() : eresp.toJsonString(); - } - } - - @Override - public void run() { - try { - MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, req.getMsoRequest().getRequestId()); - } catch (Exception e) { - logger.error("Error adding RequestId to MDC", e); - } - logger.debug("UpdateVNFVolumesTask start"); - try { - Holder<Map<String, String>> outputs = new Holder<>(); - Holder<VnfRollback> vnfRollback = new Holder<>(); - String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType(); - logger.debug("in updateVfModuleVolume - completeVnfVfModuleType={}", completeVnfVfModuleType); - - if (req.getCloudSiteId().equals(TESTING_KEYWORD)) { - outputs.value = testMap(); - } else { - // Support different Adapter Implementations - MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, req.getCloudSiteId()); - vnfAdapter.updateVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), - // req.getVnfType(), - completeVnfVfModuleType, req.getVnfVersion(), req.getVolumeGroupStackId(), "VOLUME", null, - null, req.getVolumeGroupStackId(), req.getModelCustomizationUuid(), - req.getVolumeGroupParams(), req.getMsoRequest(), outputs, vnfRollback); - } - response = new UpdateVolumeGroupResponse(req.getVolumeGroupId(), req.getVolumeGroupStackId(), - outputs.value, req.getMessageId()); - } catch (VnfException e) { - logger.debug(EXCEPTION, e); - eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, - req.getMessageId()); - } - if (!req.isSynchronous()) { - // This is asynch, so POST response back to caller - BpelRestClient bpelClient = bpelRestClientProvider.get(); - bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml); - } - logger.debug("UpdateVNFVolumesTask exit: code= {} {} {}", getStatusCode(), RESP, getResponse()); - } - } - - @GET - @Path("{aaiVolumeGroupId}") - @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - @ApiOperation(value = "QueryVNFVolumes", response = Response.class, notes = "Query an existing vnfVolume") - @ApiResponses({@ApiResponse(code = 200, message = "vnfVolume has been successfully queried"), - @ApiResponse(code = 500, message = "query vnfVolume failed, examine entity object for details")}) - public Response queryVNFVolumes( - @ApiParam(value = "aaiVolumeGroupId", - required = true) @PathParam("aaiVolumeGroupId") String aaiVolumeGroupId, - @ApiParam(value = "cloudSiteId", required = true) @QueryParam("cloudSiteId") String cloudSiteId, - @ApiParam(value = "cloudOwner", required = true) @QueryParam("cloudOwner") String cloudOwner, - @ApiParam(value = "tenantId", required = true) @QueryParam("tenantId") String tenantId, - @ApiParam(value = "volumeGroupStackId", - required = true) @QueryParam("volumeGroupStackId") String volumeGroupStackId, - @ApiParam(value = "skipAAI", required = true) @QueryParam("skipAAI") Boolean skipAAI, - @ApiParam(value = "msoRequest.requestId", - required = true) @QueryParam("msoRequest.requestId") String requestId, - @ApiParam(value = "msoRequest.serviceInstanceId", - required = true) @QueryParam("msoRequest.serviceInstanceId") String serviceInstanceId, - @ApiParam(value = "mode", required = true) @QueryParam("mode") String mode) { - // This request responds synchronously only - logger.debug("queryVNFVolumes enter: {} {}", aaiVolumeGroupId, volumeGroupStackId); - MsoRequest msoRequest = new MsoRequest(requestId, serviceInstanceId); - - try { - int respStatus = HttpStatus.SC_OK; - QueryVolumeGroupResponse qryResp = - new QueryVolumeGroupResponse(aaiVolumeGroupId, volumeGroupStackId, null, null); - Holder<Boolean> vnfExists = new Holder<>(); - Holder<String> vfModuleId = new Holder<>(); - Holder<VnfStatus> status = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - if (cloudSiteId != null && cloudSiteId.equals(TESTING_KEYWORD)) { - if (tenantId != null && tenantId.equals(TESTING_KEYWORD)) { - throw new VnfException("testing."); - } - vnfExists.value = true; - vfModuleId.value = TESTING_KEYWORD; - status.value = VnfStatus.ACTIVE; - outputs.value = testMap(); - } else { - // Support different Adapter Implementations - MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudSiteId); - vnfAdapter.queryVnf(cloudSiteId, cloudOwner, tenantId, volumeGroupStackId, msoRequest, vnfExists, - vfModuleId, status, outputs); - } - if (!vnfExists.value) { - logger.debug("VNFVolumes not found"); - qryResp.setVolumeGroupStatus(status.value); - respStatus = HttpStatus.SC_NOT_FOUND; - } else { - logger.debug("VNFVolumes found {}, status={}", vfModuleId.value, status.value); - qryResp.setVolumeGroupStatus(status.value); - qryResp.setVolumeGroupOutputs(outputs.value); - } - logger.debug("Query queryVNFVolumes exit"); - return Response.status(respStatus).entity(new GenericEntity<QueryVolumeGroupResponse>(qryResp) {}).build(); - } catch (VnfException e) { - logger.error("{} {} AaiVolumeGroupId: {} VnfException - queryVNFVolumes: ", MessageEnum.RA_QUERY_VNF_ERR, - ErrorCode.BusinessProcessError.getValue(), aaiVolumeGroupId, e); - VolumeGroupExceptionResponse excResp = new VolumeGroupExceptionResponse(e.getMessage(), - MsoExceptionCategory.INTERNAL, Boolean.FALSE, null); - logger.debug("Query queryVNFVolumes exit"); - return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR) - .entity(new GenericEntity<VolumeGroupExceptionResponse>(excResp) {}).build(); - } - } - - public static Map<String, String> testMap() { - Map<String, String> m = new HashMap<>(); - m.put("mickey", "7"); - m.put("clyde", "10"); - m.put("wayne", "99"); - return m; - } -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java index 6d3b0ab680..390ed38764 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java @@ -68,7 +68,6 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; import org.onap.so.client.graphinventory.entities.uri.Depth; import org.onap.so.client.graphinventory.exceptions.BulkProcessFailed; -import org.onap.so.client.PreconditionFailedException; import org.onap.so.db.catalog.beans.CloudIdentity; import org.onap.so.heatbridge.constants.HeatBridgeConstants; import org.onap.so.heatbridge.factory.MsoCloudClientFactoryImpl; @@ -278,6 +277,9 @@ public class HeatBridgeImpl implements HeatBridgeApi { @Override public void createPserversAndPinterfacesIfNotPresentInAai(final List<Resource> stackResources) throws HeatBridgeException { + if (stackResources == null) { + return; + } Map<String, Pserver> serverHostnames = getPserverMapping(stackResources); createPServerIfNotExists(serverHostnames); List<String> portIds = @@ -294,8 +296,13 @@ public class HeatBridgeImpl implements HeatBridgeApi { private Map<String, Pserver> getPserverMapping(final List<Resource> stackResources) { List<Server> osServers = getAllOpenstackServers(stackResources); Map<String, Pserver> pserverMap = new HashMap<>(); - for (Server server : osServers) { - pserverMap.put(server.getHost(), aaiHelper.buildPserver(server)); + if (osServers != null) { + for (Server server : osServers) { + Pserver pserver = aaiHelper.buildPserver(server); + if (pserver != null) { + pserverMap.put(server.getHost(), pserver); + } + } } return pserverMap; } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java index c578b29664..727cdccff5 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java @@ -146,12 +146,21 @@ public class AaiHelper { * @return AAI Pserver object */ public Pserver buildPserver(final Server server) { + if (server == null || server.getHypervisorHostname() == null) { + return null; + } Pserver pserver = new Pserver(); pserver.setInMaint(false); - pserver.setPserverId(server.getId()); pserver.setHostname(server.getHypervisorHostname()); - pserver.setPserverName2(server.getHost()); - pserver.setProvStatus(server.getStatus().value()); + if (server.getId() != null) { + pserver.setPserverId(server.getId()); + } + if (server.getHost() != null) { + pserver.setPserverName2(server.getHost()); + } + if (server.getStatus() != null && server.getStatus().value() != null) { + pserver.setProvStatus(server.getStatus().value()); + } return pserver; } diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/BeansTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/BeansTest.java index 5bafe2b1d6..d8e1e2a9a9 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/BeansTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/BeansTest.java @@ -49,7 +49,6 @@ public class BeansTest { @Test public void pojoStructure() { - test("org.onap.so.adapters.network.async.client"); test("org.onap.so.adapters.vnf.async.client"); test("org.onap.so.adapters.network"); test("org.onap.so.adapters.vnf"); diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java index 284067a766..88c6992a0a 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java @@ -63,86 +63,6 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { public static final String NETWORK_NAME = "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0"; - - @Test - public void createNetworkByModelNameNeutronModeGetNetworkException() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenstackGet(wireMockServer, "/mockPublicUrl/v2.0/networks", HttpStatus.SC_INTERNAL_SERVER_ERROR); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameNeutronModeCreateNetworkException() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork_404(wireMockServer, "dvspg-VCE_VPE-mtjnj40avbc"); - - mockOpenStackGetAllNeutronNetworks_404(wireMockServer); - - mockOpenstackPost(wireMockServer, "/mockPublicUrl/v2.0/networks", HttpStatus.SC_INTERNAL_SERVER_ERROR); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameNeutronMode() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork_404(wireMockServer, "dvspg-VCE_VPE-mtjnj40avbc"); - - mockOpenStackGetAllNeutronNetworks_404(wireMockServer); - - mockOpenStackPostNeutronNetwork_200(wireMockServer, "OpenstackCreateNeutronNetworkResponse.json"); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameAlreadyExistNeutronMode() throws IOException { - - mockUpdateRequestDb(wireMockServer, "9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetAllNeutronNetworks_200(wireMockServer, "OpenstackGetNeutronNetworks.json"); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameAlreadyExistNeutronModeFailIfExistTrue() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetAllNeutronNetworks_200(wireMockServer, "OpenstackGetNeutronNetworks.json"); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_NEUTRON_Mode_Fail_If_Exist_True.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - @Test public void createNetworkByModelNameHeatMode() throws IOException { @@ -300,61 +220,6 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); } - - @Test - public void deleteNetworkNeureonMode() throws IOException { - - mockUpdateRequestDb(wireMockServer, "5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK); - - mockOpenStackDeleteNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_OK); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/DeleteNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void deleteNetworkNeutronModeDeleteStackException() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK); - - mockOpenStackDeleteNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR); - - // mockOpenStackGetStackCreated_200("OpenstackResponse_Stack_Created.json", NETWORK_ID); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/DeleteNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void updateNetworkNeutronModeSuccess() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK); - mockOpenStackPutNeutronNetwork_200(wireMockServer, "OpenstackCreateNeutronNetworkResponse.json", NETWORK_ID); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/UpdateNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - @Test public void updateNetworkNeutronUpdateException() throws IOException { @@ -487,21 +352,6 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); } - @Test - public void queryNetworkNeutronModeException() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/QueryNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), uri, - HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - public ResponseEntity<String> sendXMLRequest(String requestJson, String uriPath, HttpMethod reqMethod) { headers.set("Accept", MediaType.APPLICATION_XML); headers.set("Content-Type", MediaType.APPLICATION_XML); diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImplTest.java deleted file mode 100644 index 00961a16b9..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImplTest.java +++ /dev/null @@ -1,269 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.containing; -import static com.github.tomakehurst.wiremock.client.WireMock.patch; -import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.onap.so.bpmn.mock.StubOpenStack.getBodyFromFile; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackCreatedVUSP_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackCreated_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackDeleteOrUpdateComplete_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostStacks_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutPublicUrlStackByNameAndID_NETWORK2_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccessQueryNetwork; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import org.apache.http.HttpStatus; -import org.junit.Test; -import org.onap.so.adapters.vnf.BaseRestTestUtils; -import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.NetworkRollback; -import org.onap.so.openstack.beans.Subnet; -import org.springframework.beans.factory.annotation.Autowired; -import com.github.tomakehurst.wiremock.WireMockServer; - -public class MsoNetworkAdapterAsyncImplTest extends BaseRestTestUtils { - @Autowired - MsoNetworkAdapterAsyncImpl impl; - - @Test - public void healthCheckATest() { - MsoNetworkAdapterAsyncImpl mNAAimpl = new MsoNetworkAdapterAsyncImpl(); - mNAAimpl.healthCheckA(); - } - - @Test - public void rollbackNetworkATest() throws IOException { - wireMockServer.stubFor(post(urlPathEqualTo("/v2.0/tokens")).withRequestBody(containing("tenantId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(getBodyFromFile("OpenstackResponse_Access.json", wireMockPort, "/mockPublicUrl")) - .withStatus(HttpStatus.SC_OK))); - wireMockServer.stubFor(post(urlPathEqualTo("/notificationUrl")) - .withRequestBody(containing("<completed>true</completed>")) - .willReturn(aResponse().withBody( - "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:net=\"http://org.onap.so/networkNotify\">\n" - + " <soapenv:Header/>\n" + " <soapenv:Body>\n" - + " <net:rollbackNetworkNotificationResponse>\n" - + " </net:rollbackNetworkNotificationResponse>\n" + " </soapenv:Body>\n" - + "</soapenv:Envelope>") - .withStatus(HttpStatus.SC_OK))); - NetworkRollback nrb = getNetworkRollback("mtn13"); - impl.rollbackNetworkA(nrb, "messageId", "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void rollbackNetworkATest_NotifyException() throws IOException { - wireMockServer.stubFor(post(urlPathEqualTo("/v2.0/tokens")).withRequestBody(containing("tenantId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(getBodyFromFile("OpenstackResponse_Access.json", wireMockPort, "/mockPublicUrl")) - .withStatus(HttpStatus.SC_OK))); - wireMockServer.stubFor( - post(urlPathEqualTo("/notificationUrl")).withRequestBody(containing("<completed>true</completed>")) - .willReturn(aResponse().withStatus(HttpStatus.SC_NOT_FOUND))); - NetworkRollback nrb = getNetworkRollback("mtn13"); - impl.rollbackNetworkA(nrb, "messageId", "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - private NetworkRollback getNetworkRollback(String cloudId) { - NetworkRollback nrb = new NetworkRollback(); - nrb.setCloudId(cloudId); - nrb.setMsoRequest(new MsoRequest()); - nrb.setModelCustomizationUuid("3bdbb104-476c-483e-9f8b-c095b3d3068c"); - nrb.setNetworkCreated(true); - nrb.setNetworkId("networkId"); - nrb.setNetworkName("networkName"); - nrb.setNetworkStackId("networkStackId"); - nrb.setNetworkType("networkType"); - nrb.setNeutronNetworkId("neutronNetworkId"); - nrb.setPhysicalNetwork("physicalNetwork"); - nrb.setTenantId("tenantId"); - nrb.setVlans(new ArrayList<>()); - return nrb; - } - - @Test - public void rollbackNetworkATestNetworkException() { - NetworkRollback nrb = getNetworkRollback("cloudId"); - - impl.rollbackNetworkA(nrb, "messageId", "http://localhost"); - } - - @Test - public void noRollbackNetworkATest() { - impl.rollbackNetworkA(null, "messageId", "http://localhost"); - } - - - @Test - public void deleteNetworkATest() throws IOException { - wireMockServer.stubFor(post(urlPathEqualTo("/v2.0/tokens")).withRequestBody(containing("tenantId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(getBodyFromFile("OpenstackResponse_Access.json", wireMockPort, "/mockPublicUrl")) - .withStatus(HttpStatus.SC_OK))); - wireMockServer.stubFor(post(urlPathEqualTo("/notificationUrl")) - .withRequestBody(containing("<completed>true</completed>")) - .willReturn(aResponse().withBody( - "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:net=\"http://org.onap.so/networkNotify\">\n" - + " <soapenv:Header/>\n" + " <soapenv:Body>\n" - + " <net:deleteNetworkNotificationResponse>\n" - + " </net:deleteNetworkNotificationResponse>\n" + " </soapenv:Body>\n" - + "</soapenv:Envelope>") - .withStatus(HttpStatus.SC_OK))); - impl.deleteNetworkA("mtn13", "tenantId", "networkType", "modelCustomizationUuid", "networkId", "messageId", - new MsoRequest(), "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void deleteNetworkATest_NotifyException() throws IOException { - wireMockServer.stubFor(post(urlPathEqualTo("/v2.0/tokens")).withRequestBody(containing("tenantId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(getBodyFromFile("OpenstackResponse_Access.json", wireMockPort, "/mockPublicUrl")) - .withStatus(HttpStatus.SC_OK))); - wireMockServer.stubFor( - post(urlPathEqualTo("/notificationUrl")).withRequestBody(containing("<completed>true</completed>")) - .willReturn(aResponse().withStatus(HttpStatus.SC_NOT_FOUND))); - impl.deleteNetworkA("mtn13", "tenantId", "networkType", "modelCustomizationUuid", "networkId", "messageId", - new MsoRequest(), "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void deleteNetworkATest_NetworkException() { - impl.deleteNetworkA("cloudSiteId", "tenantId", "networkType", "modelCustomizationUuid", "networkId", - "messageId", new MsoRequest(), "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void updateNetworkATest() throws IOException { - wireMockServer.stubFor(post(urlPathEqualTo("/v2.0/tokens")).withRequestBody(containing("tenantId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(getBodyFromFile("OpenstackResponse_Access.json", wireMockPort, "/mockPublicUrl")) - .withStatus(HttpStatus.SC_OK))); - mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", - "dvspg-VCE_VPE-mtjnj40avbc"); - mockOpenStackGetStackDeleteOrUpdateComplete_200(wireMockServer, "OpenstackResponse_Stack_UpdateComplete.json"); - mockOpenStackPutPublicUrlStackByNameAndID_NETWORK2_200(wireMockServer); - wireMockServer.stubFor(post(urlPathEqualTo("/notificationUrl")) - .withRequestBody(containing("updateNetworkNotification")) - .willReturn(aResponse().withBody( - "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:net=\"http://org.onap.so/networkNotify\">\n" - + " <soapenv:Header/>\n" + " <soapenv:Body>\n" - + " <net:updateNetworkNotificationResponse>\n" - + " </net:updateNetworkNotificationResponse>\n" + " </soapenv:Body>\n" - + "</soapenv:Envelope>") - .withStatus(HttpStatus.SC_OK))); - HashMap<String, String> networkParams = new HashMap<String, String>(); - networkParams.put("shared", "true"); - networkParams.put("external", "false"); - impl.updateNetworkA("mtn13", "tenantId", "networkType", "3bdbb104-476c-483e-9f8b-c095b3d3068c", - "dvspg-VCE_VPE-mtjnj40avbc", "dvspg-VCE_VPE-mtjnj40avbc", "physicalNetworkName", new ArrayList<>(), - new ArrayList<Subnet>(), networkParams, "messageId", new MsoRequest(), - "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void updateNetworkATest_NotifyExcpetion() throws IOException { - wireMockServer.stubFor(post(urlPathEqualTo("/v2.0/tokens")).withRequestBody(containing("tenantId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(getBodyFromFile("OpenstackResponse_Access.json", wireMockPort, "/mockPublicUrl")) - .withStatus(HttpStatus.SC_OK))); - mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", - "dvspg-VCE_VPE-mtjnj40avbc"); - mockOpenStackGetStackDeleteOrUpdateComplete_200(wireMockServer, "OpenstackResponse_Stack_UpdateComplete.json"); - mockOpenStackPutPublicUrlStackByNameAndID_NETWORK2_200(wireMockServer); - HashMap<String, String> networkParams = new HashMap<String, String>(); - networkParams.put("shared", "true"); - networkParams.put("external", "false"); - impl.updateNetworkA("mtn13", "tenantId", "networkType", "3bdbb104-476c-483e-9f8b-c095b3d3068c", - "dvspg-VCE_VPE-mtjnj40avbc", "dvspg-VCE_VPE-mtjnj40avbc", "physicalNetworkName", new ArrayList<>(), - new ArrayList<>(), networkParams, "messageId", new MsoRequest(), - "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void updateNetworkATest_NetworkException() { - impl.updateNetworkA("cloudSiteId", "tenantId", "networkType", "3bdbb104-476c-483e-9f8b-c095b3d3068c", - "networkId", "dvspg-VCE_VPE-mtjnj40avbc", "physicalNetworkName", new ArrayList<>(), new ArrayList<>(), - new HashMap<String, String>(), "messageId", new MsoRequest(), - "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void queryNetworkATest() throws IOException { - mockOpenStackResponseAccessQueryNetwork(wireMockServer, wireMockPort); - impl.queryNetworkA("mtn13", "tenantId", "networkId", "messageId", new MsoRequest(), - "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void createNetworkATest() throws IOException { - wireMockServer.stubFor(post(urlPathEqualTo("/v2.0/tokens")).withRequestBody(containing("tenantId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(getBodyFromFile("OpenstackResponse_Access.json", wireMockPort, "/mockPublicUrl")) - .withStatus(HttpStatus.SC_OK))); - wireMockServer.stubFor(post(urlPathEqualTo("/notificationUrl")) - .withRequestBody(containing("createNetworkNotification")) - .willReturn(aResponse().withBody( - "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:net=\"http://org.onap.so/networkNotify\">\n" - + " <soapenv:Header/>\n" + " <soapenv:Body>\n" - + " <net:createNetworkNotificationResponse>\n" - + " </net:createNetworkNotificationResponse>\n" + " </soapenv:Body>\n" - + "</soapenv:Envelope>") - .withStatus(HttpStatus.SC_OK))); - mockOpenStackGetStackCreatedVUSP_200(wireMockServer); - mockOpenStackPostStacks_200(wireMockServer); - mockOpenStackPostStacks_200(wireMockServer); - HashMap<String, String> networkParams = new HashMap<String, String>(); - impl.createNetworkA("mtn13", "tenantId", "networkType", "3bdbb104-476c-483e-9f8b-c095b3d3068c", - "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", "physicalNetworkName", new ArrayList<>(), false, - false, new ArrayList<>(), networkParams, "messageId", new MsoRequest(), - "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void createNetworkATest_NotifyException() throws IOException { - wireMockServer.stubFor(post(urlPathEqualTo("/v2.0/tokens")).withRequestBody(containing("tenantId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(getBodyFromFile("OpenstackResponse_Access.json", wireMockPort, "/mockPublicUrl")) - .withStatus(HttpStatus.SC_OK))); - mockOpenStackGetStackCreatedVUSP_200(wireMockServer); - mockOpenStackPostStacks_200(wireMockServer); - HashMap<String, String> networkParams = new HashMap<String, String>(); - networkParams.put("shared", "true"); - networkParams.put("external", "false"); - impl.createNetworkA("mtn13", "tenantId", "networkType", "3bdbb104-476c-483e-9f8b-c095b3d3068c", - "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", "physicalNetworkName", new ArrayList<>(), false, - false, new ArrayList<>(), networkParams, "messageId", new MsoRequest(), - "http://localhost:" + wireMockPort + "/notificationUrl"); - } - - @Test - public void createNetworkATest_NetworkException() { - impl.createNetworkA("mtn13", "tenantId", "networkType", "3bdbb104-476c-483e-9f8b-c095b3d3068c", - "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", "physicalNetworkName", new ArrayList<>(), false, - false, new ArrayList<>(), new HashMap<String, String>(), "messageId", new MsoRequest(), - "http://localhost:" + wireMockPort + "/notificationUrl"); - } - -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java deleted file mode 100644 index 412abeab3b..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/NetworkAdapterRestTest.java +++ /dev/null @@ -1,364 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - -import static com.shazam.shazamcrest.MatcherAssert.assertThat; -import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; -import static org.junit.Assert.assertEquals; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeletePublicUrlStackByNameAndID_204; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetPublicUrlStackByNameAndID_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetPublicUrlStackByNameAndID_204; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackAppC_404; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackCreatedAppC_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackCreatedVUSP_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVUSP_404; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostPublicUrlWithBodyFile_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPublicUrlStackByID_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPublicUrlStackByName_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutPublicUrlStackByNameAndID_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import org.json.JSONException; -import org.junit.Test; -import org.onap.so.adapters.nwrest.CreateNetworkRequest; -import org.onap.so.adapters.nwrest.CreateNetworkResponse; -import org.onap.so.adapters.nwrest.DeleteNetworkRequest; -import org.onap.so.adapters.nwrest.DeleteNetworkResponse; -import org.onap.so.adapters.nwrest.QueryNetworkError; -import org.onap.so.adapters.nwrest.QueryNetworkResponse; -import org.onap.so.adapters.nwrest.RollbackNetworkRequest; -import org.onap.so.adapters.nwrest.RollbackNetworkResponse; -import org.onap.so.adapters.nwrest.UpdateNetworkRequest; -import org.onap.so.adapters.nwrest.UpdateNetworkResponse; -import org.onap.so.adapters.vnf.BaseRestTestUtils; -import org.onap.so.client.policy.JettisonStyleMapperProvider; -import org.onap.so.entity.MsoRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; - -public class NetworkAdapterRestTest extends BaseRestTestUtils { - - @Autowired - private JettisonStyleMapperProvider jettisonTypeObjectMapper; - private static final String CLOUDSITE_ID = "mtn13"; - private static final String TENANT_ID = "ba38bc24a2ef4fb2ad2810c894f1938f"; - private static final String NETWORK_ID = "da886914-efb2-4917-b335-c8381528d90b"; - private static final String NETWORK_TYPE = "CONTRAIL30_BASIC"; - private static final String MODEL_CUSTOMIZATION_UUID = "3bdbb104-476c-483e-9f8b-c095b3d308ac"; - private static final String MSO_SERVICE_INSTANCE_ID = "05869d5f-47df-4b45-bbfc-4f03ce0a50bf"; - private static final String MSO_REQUEST_ID = "requestId"; - private static final String NETWORK_NAME = "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0"; - - @Test - public void testCreateNetwork() throws JSONException, JsonParseException, JsonMappingException, IOException { - - CreateNetworkRequest request = new CreateNetworkRequest(); - request.setBackout(true); - request.setSkipAAI(true); - request.setFailIfExists(false); - MsoRequest msoReq = new MsoRequest(); - String networkTechnology = "CONTRAIL"; - - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - request.setMsoRequest(msoReq); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setNetworkId(NETWORK_ID); - request.setNetworkName(NETWORK_NAME); - request.setNetworkType(NETWORK_TYPE); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setNetworkTechnology(networkTechnology); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackPostPublicUrlWithBodyFile_200(wireMockServer); - - mockOpenStackGetStackCreatedVUSP_200(wireMockServer); - - mockOpenStackGetStackVUSP_404(wireMockServer); - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<CreateNetworkRequest> entity = new HttpEntity<CreateNetworkRequest>(request, headers); - ResponseEntity<CreateNetworkResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks"), HttpMethod.POST, entity, CreateNetworkResponse.class); - - CreateNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/CreateNetworkResponse.json"), CreateNetworkResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - } - - @Test - public void testCreateNetwork_JSON() throws JSONException, JsonParseException, JsonMappingException, IOException { - - - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackPostPublicUrlWithBodyFile_200(wireMockServer); - - mockOpenStackGetStackCreatedAppC_200(wireMockServer); - - mockOpenStackGetStackAppC_404(wireMockServer); - - headers.add("Content-Type", MediaType.APPLICATION_JSON); - headers.add("Accept", MediaType.APPLICATION_JSON); - - String request = readJsonFileAsString("src/test/resources/CreateNetwork.json"); - HttpEntity<String> entity = new HttpEntity<String>(request, headers); - - ResponseEntity<CreateNetworkResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks"), HttpMethod.POST, entity, CreateNetworkResponse.class); - - CreateNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/CreateNetworkResponse2.json"), CreateNetworkResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - } - - - - @Test - public void testDeleteNetwork() throws IOException { - - DeleteNetworkRequest request = new DeleteNetworkRequest(); - - MsoRequest msoReq = new MsoRequest(); - - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - request.setMsoRequest(msoReq); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setNetworkId(NETWORK_ID); - request.setNetworkType(NETWORK_TYPE); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setNetworkStackId(NETWORK_ID); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackPublicUrlStackByID_200(wireMockServer, wireMockPort); - - mockOpenStackGetPublicUrlStackByNameAndID_204(wireMockServer, wireMockPort); - - mockOpenStackDeletePublicUrlStackByNameAndID_204(wireMockServer); - - headers.add("Accept", MediaType.APPLICATION_JSON); - - HttpEntity<DeleteNetworkRequest> entity = new HttpEntity<DeleteNetworkRequest>(request, headers); - - ResponseEntity<DeleteNetworkResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks/da886914-efb2-4917-b335-c8381528d90b"), HttpMethod.DELETE, - entity, DeleteNetworkResponse.class); - - DeleteNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/DeleteNetworkResponse.json"), DeleteNetworkResponse.class); - - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - - } - - @Test - public void testRollbackNetwork() throws IOException { - - RollbackNetworkRequest request = new RollbackNetworkRequest(); - MsoRequest msoReq = new MsoRequest(); - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackPublicUrlStackByID_200(wireMockServer, wireMockPort); - - mockOpenStackGetPublicUrlStackByNameAndID_204(wireMockServer, wireMockPort); - - mockOpenStackDeletePublicUrlStackByNameAndID_204(wireMockServer); - - headers.add("Accept", MediaType.APPLICATION_JSON); - - HttpEntity<RollbackNetworkRequest> entity = new HttpEntity<>(request, headers); - - ResponseEntity<RollbackNetworkResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks/da886914-efb2-4917-b335-c8381528d90b/rollback"), - HttpMethod.DELETE, entity, RollbackNetworkResponse.class); - - RollbackNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/RollbackNetworkResponse.json"), RollbackNetworkResponse.class); - - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - - } - - @Test - public void testQueryNetwork_Exception() throws IOException { - MsoRequest msoReq = new MsoRequest(); - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - headers.add("Accept", MediaType.APPLICATION_JSON); - - HttpEntity<DeleteNetworkRequest> entity = new HttpEntity<DeleteNetworkRequest>(headers); - - ResponseEntity<QueryNetworkError> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks/da886914-efb2-4917-b335-c8381528d90b"), HttpMethod.GET, - entity, QueryNetworkError.class); - - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - - } - - @Test - public void testQueryNetwork() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStackVfModule_200(wireMockServer); - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<DeleteNetworkRequest> entity = new HttpEntity<DeleteNetworkRequest>(headers); - - ResponseEntity<QueryNetworkResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks/da886914-efb2-4917-b335-c8381528d90b" + "?cloudSiteId=" - + CLOUDSITE_ID + "&tenantId=" + TENANT_ID + "&aaiNetworkId=aaiNetworkId"), - HttpMethod.GET, entity, QueryNetworkResponse.class); - - assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatusCode().value()); - - } - - @Test - public void testUpdateNetwork() throws IOException { - - UpdateNetworkRequest request = new UpdateNetworkRequest(); - - MsoRequest msoReq = new MsoRequest(); - - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - request.setMsoRequest(msoReq); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setNetworkId(NETWORK_ID); - request.setNetworkName(NETWORK_NAME); - request.setNetworkType(NETWORK_TYPE); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setNetworkStackId(NETWORK_ID); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackPublicUrlStackByName_200(wireMockServer, wireMockPort); - - mockOpenStackPublicUrlStackByID_200(wireMockServer, wireMockPort); - - mockOpenStackGetPublicUrlStackByNameAndID_200(wireMockServer, wireMockPort); - - mockOpenStackPutPublicUrlStackByNameAndID_200(wireMockServer); - - headers.add("Accept", MediaType.APPLICATION_JSON); - - HttpEntity<UpdateNetworkRequest> entity = new HttpEntity<UpdateNetworkRequest>(request, headers); - - ResponseEntity<UpdateNetworkResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks/da886914-efb2-4917-b335-c8381528d90b"), HttpMethod.PUT, - entity, UpdateNetworkResponse.class); - - UpdateNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/UpdateNetworkResponse.json"), UpdateNetworkResponse.class); - - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testCreateNetworkCNRC_JSON() - throws JSONException, JsonParseException, JsonMappingException, IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackPostPublicUrlWithBodyFile_200(wireMockServer); - - mockOpenStackGetStackCreatedAppC_200(wireMockServer); - - mockOpenStackGetStackAppC_404(wireMockServer); - - headers.add("Content-Type", MediaType.APPLICATION_JSON); - headers.add("Accept", MediaType.APPLICATION_JSON); - - String request = readJsonFileAsString("src/test/resources/CreateNetwork3.json"); - HttpEntity<String> entity = new HttpEntity<String>(request, headers); - - ResponseEntity<CreateNetworkResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks"), HttpMethod.POST, entity, CreateNetworkResponse.class); - - CreateNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/CreateNetworkResponse3.json"), CreateNetworkResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - } - - @Test - public void testCreateNetworkNC_Shared_JSON() - throws JSONException, JsonParseException, JsonMappingException, IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackPostPublicUrlWithBodyFile_200(wireMockServer); - - mockOpenStackGetStackCreatedAppC_200(wireMockServer); - - mockOpenStackGetStackAppC_404(wireMockServer); - - headers.add("Content-Type", MediaType.APPLICATION_JSON); - headers.add("Accept", MediaType.APPLICATION_JSON); - - String request = readJsonFileAsString("src/test/resources/CreateNetwork4.json"); - HttpEntity<String> entity = new HttpEntity<String>(request, headers); - - ResponseEntity<CreateNetworkResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/networks"), HttpMethod.POST, entity, CreateNetworkResponse.class); - - CreateNetworkResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/CreateNetworkResponse4.json"), CreateNetworkResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - } - - @Override - protected String readJsonFileAsString(String fileLocation) - throws JsonParseException, JsonMappingException, IOException { - return new String(Files.readAllBytes(Paths.get(fileLocation))); - } -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java index b5b0f5a8ef..8d5ab8234e 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/PollServiceTest.java @@ -44,7 +44,7 @@ public class PollServiceTest { String xmlString = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "/vnfAdapterTaskRequestCreate.xml"))); - Mockito.when(mockExternalTask.getVariable("vnfAdapterTaskRequest")).thenReturn(xmlString); + Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(xmlString); Mockito.when(mockExternalTask.getVariable("PollRollbackStatus")).thenReturn(false); Mockito.when(mockExternalTask.getVariable("stackId")).thenReturn("stackId/stack123"); Mockito.when(msoHeatUtils.pollStackForStatus(eq(1), any(Stack.class), eq("CREATE_IN_PROGRESS"), eq("regionOne"), @@ -64,7 +64,7 @@ public class PollServiceTest { String xmlString = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "/vnfAdapterTaskRequestCreate.xml"))); - Mockito.when(mockExternalTask.getVariable("vnfAdapterTaskRequest")).thenReturn(xmlString); + Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(xmlString); Mockito.when(mockExternalTask.getVariable("PollRollbackStatus")).thenReturn(true); Mockito.when(mockExternalTask.getVariable("stackId")).thenReturn("stackId/stack123"); Mockito.when(msoHeatUtils.pollStackForStatus(eq(1), any(), eq("DELETE_IN_PROGRESS"), eq("regionOne"), diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java index f7613909ec..1f68106f78 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/RollbackServiceTest.java @@ -65,7 +65,7 @@ public class RollbackServiceTest { Stack stack = new Stack(); stack.setId("heatId"); - Mockito.when(mockExternalTask.getVariable("vnfAdapterTaskRequest")).thenReturn(payload); + Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(payload); Mockito.doNothing().when(vnfAdapterImpl).deleteVfModule(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); Mockito.doNothing().when(mockExternalTaskService).complete(Mockito.any(), Mockito.any()); diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java index 2f583b30a2..cc2dfa213e 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tasks/orchestration/StackServiceTest.java @@ -64,7 +64,7 @@ public class StackServiceTest { Stack stack = new Stack(); stack.setId("heatId"); - Mockito.when(mockExternalTask.getVariable("vnfAdapterTaskRequest")).thenReturn(payload); + Mockito.when(mockExternalTask.getVariable("openstackAdapterTaskRequest")).thenReturn(payload); Mockito.doNothing().when(vnfAdapterImpl).createVfModule(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java index 46d9f89303..1a308b7c4c 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -30,13 +30,11 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_200; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess; import java.util.HashMap; -import java.util.Map; import org.apache.http.HttpStatus; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.VnfRollback; import org.springframework.beans.factory.annotation.Autowired; public class MsoVnfAdapterAsyncImplTest extends BaseRestTestUtils { @@ -86,48 +84,6 @@ public class MsoVnfAdapterAsyncImplTest extends BaseRestTestUtils { } @Test - public void updateVnfTest() throws Exception { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - wireMockServer.stubFor(post(urlPathEqualTo("/notify/adapterNotify/updateVnfNotificationRequest")) - .withRequestBody(containing("messageId")).willReturn(aResponse().withStatus(HttpStatus.SC_OK))); - String notificationUrl = - "http://localhost:" + wireMockPort + "/notify/adapterNotify/updateVnfNotificationRequest"; - instance.updateVnfA("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD", - "volumeGroupHeatStackId|1", map, "messageId", msoRequest, notificationUrl); - } - - @Test - public void updateVnfTest_Exception() throws Exception { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - wireMockServer.stubFor(post(urlPathEqualTo("/notify/adapterNotify/updateVnfNotificationRequest")) - .withRequestBody(containing("messageId")).willReturn(aResponse().withStatus(HttpStatus.SC_OK))); - String notificationUrl = - "http://localhost:" + wireMockPort + "/notify/adapterNotify/updateVnfNotificationRequest"; - instance.updateVnfA("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD", - "volumeGroupHeatStackId|1", map, "messageId", msoRequest, notificationUrl); - wireMockServer.verify(1, postRequestedFor(urlEqualTo("/notify/adapterNotify/updateVnfNotificationRequest"))); - } - - @Test - public void queryVnfTest() { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - instance.queryVnfA("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", "messageId", msoRequest, - "http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest"); - } - - @Test public void deleteVnfTest() { MsoRequest msoRequest = new MsoRequest(); msoRequest.setRequestId("12345"); @@ -136,14 +92,4 @@ public class MsoVnfAdapterAsyncImplTest extends BaseRestTestUtils { msoRequest, "http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest"); } - @Test - public void rollbackVnfTest() { - VnfRollback vnfRollBack = new VnfRollback(); - vnfRollBack.setCloudSiteId("mdt1"); - vnfRollBack.setCloudOwner("CloudOwner"); - vnfRollBack.setTenantId("88a6ca3ee0394ade9403f075db23167e"); - vnfRollBack.setVnfId("ff5256d1-5a33-55df-13ab-12abad84e7ff"); - instance.rollbackVnfA(vnfRollBack, "messageId", - "http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest"); - } } diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java deleted file mode 100644 index 45504fcab5..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java +++ /dev/null @@ -1,308 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. - * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.junit.Assert.assertTrue; -import java.util.HashMap; -import java.util.Map; -import javax.xml.ws.Holder; -import org.apache.http.HttpStatus; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.cloud.CloudConfig; -import org.onap.so.db.catalog.beans.CloudifyManager; -import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.VnfRollback; -import org.springframework.beans.factory.annotation.Autowired; - -public class MsoVnfCloudifyAdapterImplTest extends BaseRestTestUtils { - - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - @Autowired - private MsoVnfCloudifyAdapterImpl instance; - - @Autowired - private CloudConfig cloudConfig; - - @Before - public void before() throws Exception { - super.setUp(); - CloudifyManager cloudifyManager = new CloudifyManager(); - cloudifyManager.setId("mtn13"); - cloudifyManager.setCloudifyUrl("http://localhost:" + wireMockPort + "/v2.0"); - cloudifyManager.setUsername("m93945"); - cloudifyManager.setPassword("93937EA01B94A10A49279D4572B48369"); - } - - /* - * @Test public void queryVnfExceptionTest() throws Exception { MsoRequest msoRequest = new MsoRequest(); - * msoRequest.setRequestId("12345"); msoRequest.setServiceInstanceId("12345"); Holder<Map<String, String>> outputs = - * new Holder<>(); instance.queryVnf("siteid", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new - * Holder<>(), new Holder<>(), outputs); - * - * assertTrue(outputs.value.isEmpty()); } - */ - - /* - * @Test public void queryVnfTest() throws Exception { - * - * - * MsoRequest msoRequest = new MsoRequest(); msoRequest.setRequestId("12345"); - * msoRequest.setServiceInstanceId("12345"); - * wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname")) - * .willReturn(aResponse().withBody("{ \"id\": \"123\" }").withStatus(HttpStatus.SC_OK))); - * - * wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname/outputs")) - * .willReturn(aResponse().withBody("{ \"deployment_id\": \"123\",\"outputs\":{\"abc\":\"abc\"} }") - * .withStatus(HttpStatus.SC_OK))); - * - * wireMockServer.stubFor(get(urlMatching("/v2.0/api/v3/executions?.*")).willReturn(aResponse() - * .withBody("{ \"items\": {\"id\": \"123\",\"workflow_id\":\"install\",\"status\":\"terminated\" } } ") - * .withStatus(HttpStatus.SC_OK))); - * - * instance.queryVnf("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new Holder<>(), new - * Holder<>(), new Holder<>()); - * - * } - */ - - @Test - public void deleteVfModuleTest_ExceptionWhileQueryDeployment() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - instance.deleteVfModule("mtn13", "CloudOwner", "1234", "vfname", "5aae1e49-805c-4f9f-bd78-055bf7451157", - "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId", msoRequest, new Holder<>()); - } - - @Test - public void deleteVfModuleTest_ExceptionWhileDeleteDeployment() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname")) - .willReturn(aResponse().withBody("{ \"id\": \"123\" }").withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname/outputs")) - .willReturn(aResponse().withBody("{ \"deployment_id\": \"123\",\"outputs\":{\"abc\":\"abc\"} }") - .withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(get(urlMatching("/v2.0/api/v3/executions?.*")).willReturn(aResponse() - .withBody("{ \"items\": {\"id\": \"123\",\"workflow_id\":\"install\",\"status\":\"terminated\" } } ") - .withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/tokens")) - .willReturn(aResponse().withBodyFile("OpenstackResponse_Access.json").withStatus(HttpStatus.SC_OK))); - - instance.deleteVfModule("mtn13", "CloudOwner", "1234", "vfname", "5aae1e49-805c-4f9f-bd78-055bf7451157", - "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId", msoRequest, new Holder<>()); - } - - @Test - public void deleteVnfVnfExceptionTest() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - instance.deleteVnf("12344", "CloudOwner", "234", "vnfname", msoRequest); - - } - - @Test - public void rollbackVnf() throws Exception { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - VnfRollback vnfRollback = new VnfRollback(); - vnfRollback.setModelCustomizationUuid("1234"); - vnfRollback.setVfModuleStackId("2134"); - vnfRollback.setVnfId("123"); - vnfRollback.setModelCustomizationUuid("1234"); - - instance.rollbackVnf(vnfRollback); - } - - @Test - public void rollbackVnf_Created() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - VnfRollback vnfRollback = new VnfRollback(); - vnfRollback.setModelCustomizationUuid("1234"); - vnfRollback.setVfModuleStackId("2134"); - vnfRollback.setVnfId("123"); - vnfRollback.setModelCustomizationUuid("1234"); - vnfRollback.setVnfCreated(true); - - instance.rollbackVnf(vnfRollback); - } - - @Test - public void createVfModuleVnfException() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - instance.createVfModule("123", "CloudOwner", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", - "123", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>()); - } - - @Test - public void createVfModule_ModelCustUuidIsNull() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - instance.createVfModule("123", "CloudOwner", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", - null, new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>()); - } - - @Test - public void createVfModule_CloudSiteIdNotFound() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - instance.createVfModule("123", "CloudOwner", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", - "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), - new Holder<>(), new Holder<>()); - } - - @Test - public void createVfModule_MsoCloudifyManagerNotFound() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - instance.createVfModule("mtn13", "CloudOwner", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", - "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), - new Holder<>(), new Holder<>()); - } - - @Test - public void createVfModule() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname")) - .willReturn(aResponse().withBody("{ \"id\": \"123\" }").withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname/outputs")) - .willReturn(aResponse().withBody("{ \"deployment_id\": \"123\",\"outputs\":{\"abc\":\"abc\"} }") - .withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(get(urlMatching("/v2.0/api/v3/executions?.*")).willReturn(aResponse() - .withBody("{ \"items\": {\"id\": \"123\",\"workflow_id\":\"install\",\"status\":\"terminated\" } } ") - .withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/tokens")) - .willReturn(aResponse().withBodyFile("OpenstackResponse_Access.json").withStatus(HttpStatus.SC_OK))); - - instance.createVfModule("mtn13", "CloudOwner", "123", "vf", "v1", "", "vfname", "", "create", "3245", "234", - "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), - new Holder<>(), new Holder<>()); - } - - @Test - public void updateVfModuleVnfException() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - instance.updateVfModule("123", "CloudOwner", "1234", "fw", "v2", "vnf1", "create", "123", "12", "233", "234", - new HashMap<>(), msoRequest, new Holder<>(), new Holder<>()); - } - - @Test - public void healthCheckVNFTest() { - instance.healthCheck(); - } - - @Test - public void createVnfTest() { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - try { - instance.createVnf("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD", - "volumeGroupHeatStackId|1", map, Boolean.FALSE, Boolean.TRUE, Boolean.TRUE, msoRequest, - new Holder<>(), new Holder<>(), new Holder<>()); - } catch (Exception e) { - } - } - - @Test - public void updateVnfTest() { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - Map<String, Object> map = new HashMap<>(); - - map.put("key1", "value1"); - try { - instance.updateVnf("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD", - "volumeGroupHeatStackId|1", map, msoRequest, new Holder<>(), new Holder<>()); - } catch (Exception e) { - - } - } - - @Test - public void deleteVnfTest() { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - try { - instance.deleteVnf("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest); - } catch (Exception e) { - - } - } - -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java deleted file mode 100644 index 3bf784c50b..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java +++ /dev/null @@ -1,231 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Intel Corp. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.delete; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import java.util.HashMap; -import java.util.Map; -import javax.xml.ws.Holder; -import org.apache.http.HttpStatus; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.onap.so.adapters.vdu.VduModelInfo; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.cloud.CloudConfig; -import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.StackInfo; -import org.onap.so.openstack.exceptions.MsoException; -import org.springframework.beans.factory.annotation.Autowired; - -public class MsoVnfMulticloudAdapterImplTest extends BaseRestTestUtils { - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - @Autowired - private MsoVnfPluginAdapterImpl instance; - - @Autowired - private CloudConfig cloudConfig; - - private static final String UPDATE_STACK_RESPONSE = - "{\"template_type\": \"heat\", \"workload_id\": " + "\"workload-id\"}"; - private static final String GET_CREATE_STACK_RESPONSE = "{\"template_type\": \"heat\", \"workload_id\": " - + "\"workload-id\", \"workload_status\": \"CREATE_COMPLETE\"}"; - private static final String GET_UPDATE_STACK_RESPONSE = "{\"template_type\": \"heat\", \"workload_id\": " - + "\"workload-id\", \"workload_status\": \"UPDATE_COMPLETE\"}"; - - private static final String MULTICLOUD_CREATE_PATH = "/api/multicloud/v1/CloudOwner/MTN13/infra_workload"; - private static final String MULTICLOUD_UPDATE_PATH = - "/api/multicloud/v1/CloudOwner/MTN13/infra_workload/workload-id"; - private static final String MULTICLOUD_GET_PATH_BY_NAME = - "/api/multicloud/v1/CloudOwner/MTN13/infra_workload/vfname"; - private static final String MULTICLOUD_GET_PATH_BY_ID = - "/api/multicloud/v1/CloudOwner/MTN13/infra_workload/workload-id"; - - @Before - public void before() throws Exception { - super.orchestrator = "multicloud"; - super.cloudEndpoint = "/api/multicloud/v1/CloudOwner/MTN13/infra_workload"; - super.setUp(); - } - - @Test - public void createVfModule() throws Exception { - - Map<String, Object> stackInputs = new HashMap<>(); - stackInputs.put("oof_directives", "{}"); - stackInputs.put("sdnc_directives", "{}"); - stackInputs.put("user_directives", "{}"); - stackInputs.put("generic_vnf_id", "genVNFID"); - stackInputs.put("vf_module_id", "vfMODULEID"); - - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - wireMockServer.stubFor(get(urlPathEqualTo(MULTICLOUD_GET_PATH_BY_NAME)).willReturn( - aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_NOT_FOUND))); - - wireMockServer.stubFor(get(urlPathEqualTo(MULTICLOUD_GET_PATH_BY_ID)).inScenario("CREATE") - .whenScenarioStateIs("CREATING").willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(GET_CREATE_STACK_RESPONSE).withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(get(urlPathEqualTo(MULTICLOUD_GET_PATH_BY_ID)).inScenario("CREATE") - .whenScenarioStateIs("UPDATING").willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(GET_UPDATE_STACK_RESPONSE).withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_CREATE_PATH)).inScenario("CREATE") - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBodyFile("MulticloudResponse_Stack_Create.json").withStatus(HttpStatus.SC_CREATED)) - .willSetStateTo("CREATING")); - - wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_UPDATE_PATH)) - .inScenario("CREATE").willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(UPDATE_STACK_RESPONSE).withStatus(HttpStatus.SC_ACCEPTED)) - .willSetStateTo("UPDATING")); - - try { - instance.createVfModule("MTN13", "CloudOwner", "123", "vf", "v1", "genericVnfId", "vfname", "vfModuleId", - "create", null, "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", stackInputs, true, true, true, - msoRequest, new Holder<>(), new Holder<>(), new Holder<>()); - } catch (VnfException e) { - fail("createVfModule success expected, failed with exception: " + e.toString()); - } - wireMockServer.resetScenarios(); - } - - @Test - public void createVfModule2() throws Exception { - - Map<String, Object> stackInputs = new HashMap<>(); - stackInputs.put("oof_directives", "{}"); - stackInputs.put("sdnc_directives", "{}"); - stackInputs.put("user_directives", "{}"); - stackInputs.put("generic_vnf_id", "genVNFID"); - stackInputs.put("vf_module_id", "vfMODULEID"); - - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - wireMockServer.stubFor(get(urlPathEqualTo(MULTICLOUD_GET_PATH_BY_NAME)).willReturn( - aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_NOT_FOUND))); - - wireMockServer.stubFor(get(urlPathEqualTo(MULTICLOUD_GET_PATH_BY_ID)).inScenario("CREATE") - .whenScenarioStateIs("CREATING").willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(GET_CREATE_STACK_RESPONSE).withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(get(urlPathEqualTo(MULTICLOUD_GET_PATH_BY_ID)).inScenario("CREATE") - .whenScenarioStateIs("UPDATING").willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(GET_UPDATE_STACK_RESPONSE).withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_CREATE_PATH)).inScenario("CREATE") - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBodyFile("MulticloudResponse_Stack_Create2.json").withStatus(HttpStatus.SC_CREATED)) - .willSetStateTo("CREATING")); - - wireMockServer.stubFor(post(urlPathEqualTo(MULTICLOUD_UPDATE_PATH)) - .inScenario("CREATE").willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBody(UPDATE_STACK_RESPONSE).withStatus(HttpStatus.SC_ACCEPTED)) - .willSetStateTo("UPDATING")); - - try { - instance.createVfModule("MTN13", "CloudOwner", "123", "vf", "v1", "genericVnfId", "vfname", "vfModuleId", - "create", null, "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", stackInputs, true, true, true, - msoRequest, new Holder<>(), new Holder<>(), new Holder<>()); - } catch (VnfException e) { - fail("createVfModule success expected, failed with exception: " + e.toString()); - } - wireMockServer.resetScenarios(); - } - - @Test - public void createVfModuleAlreadyExists() throws Exception { - - Map<String, Object> stackInputs = new HashMap<>(); - stackInputs.put("oof_directives", "{}"); - stackInputs.put("sdnc_directives", "{}"); - stackInputs.put("user_directives", "{}"); - stackInputs.put("generic_vnf_id", "genVNFID"); - stackInputs.put("vf_module_id", "vfMODULEID"); - - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - wireMockServer.stubFor( - get(urlEqualTo("/api/multicloud/v1/CloudOwner/MTN13/infra_workload?name=vfname")).willReturn(aResponse() - // .withHeader() - .withBodyFile("MulticloudGetStackExists.json").withStatus(HttpStatus.SC_OK))); - - try { - instance.createVfModule("MTN13", "CloudOwner", "123", "vf", "v1", "genericVnfId", "vfname", "vfModuleId", - "create", null, "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", stackInputs, true, true, true, - msoRequest, new Holder<>(), new Holder<>(), new Holder<>()); - } catch (VnfException e) { - assertTrue(e.toString().contains( - "Resource vfname already exists in owner/cloud/tenant CloudOwner/MTN13/123 with ID vfname/vfname")); - return; - } - fail("VnfAlreadyExists Exception expected!"); - } - - @Test - public void deleteVfModule() throws Exception { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - wireMockServer.stubFor(get(urlPathEqualTo("/api/multicloud/v1/CloudOwner/MTN13/infra_workload/workload-id")) - .willReturn(aResponse().withBodyFile("MulticloudResponse_Stack.json").withStatus(HttpStatus.SC_OK))); - - wireMockServer.stubFor(delete(urlPathEqualTo("/api/multicloud/v1/CloudOwner/MTN13/infra_workload/workload-id")) - .willReturn(aResponse().withStatus(HttpStatus.SC_NO_CONTENT))); - - instance.deleteVfModule("MTN13", "CloudOwner", "123", "workload-id", "5aae1e49-805c-4f9f-bd78-055bf7451157", - "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId", msoRequest, new Holder<>()); - } - - @Test - public void queryVfModule() throws Exception { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - - wireMockServer.stubFor(get(urlPathEqualTo("/api/multicloud/v1/CloudOwner/MTN13/infra_workload/workload-id")) - .willReturn(aResponse().withBodyFile("MulticloudResponse_Stack.json").withStatus(HttpStatus.SC_OK))); - - instance.queryVnf("MTN13", "CloudOwner", "123", "workload-id", msoRequest, new Holder<>(), new Holder<>(), - new Holder<>(), new Holder<>()); - } - - // TODO Error Tests -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImplTest.java deleted file mode 100644 index a68efbe130..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImplTest.java +++ /dev/null @@ -1,166 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.delete; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_404; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess; -import java.util.HashMap; -import java.util.Map; -import javax.xml.ws.Holder; -import org.apache.http.HttpStatus; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.VnfRollback; -import org.springframework.beans.factory.annotation.Autowired; - -public class MsoVnfPluginAdapterImplTest extends BaseRestTestUtils { - - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - @Autowired - MsoVnfPluginAdapterImpl msoVnfPluginAdapter; - - String vnfName = "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"; - - @Test - public void createVfModule_ModelCustUuidIsNull() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = getMsoRequest(); - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", - vnfName, "", "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", null, map, Boolean.FALSE, - Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(), - new Holder<VnfRollback>()); - } - - @Test - public void createVfModule_ModelCustUuidIsNotFound() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = getMsoRequest(); - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", - vnfName, "", "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", - "88a6ca3ee0394ade9403f075db23167e", map, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, - new Holder<>(), new Holder<Map<String, String>>(), new Holder<VnfRollback>()); - } - - @Test - public void createVfModule_VduException() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = getMsoRequest(); - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", - vnfName, "", "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", - "9b339a61-69ca-465f-86b8-1c72c582b8e8", map, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, - new Holder<>(), new Holder<Map<String, String>>(), new Holder<VnfRollback>()); - } - - @Test - public void createVfModule_INSTANTIATED() throws Exception { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStackVfModule_200(wireMockServer); - - MsoRequest msoRequest = getMsoRequest(); - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", - vnfName, "", "VFMOD", null, "baseVfHeatStackId", "9b339a61-69ca-465f-86b8-1c72c582b8e8", map, - Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), - new Holder<Map<String, String>>(), new Holder<VnfRollback>()); - } - - @Test - public void createVfModule_queryVduNotFoundWithVolumeGroupId() throws Exception { - expectedException.expect(VnfException.class); - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - MsoRequest msoRequest = getMsoRequest(); - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", - vnfName, "", "VFMOD", "volumeGroupHeatStackId|1", "baseVfHeatStackId", - "9b339a61-69ca-465f-86b8-1c72c582b8e8", map, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, - new Holder<>(), new Holder<Map<String, String>>(), new Holder<VnfRollback>()); - } - - @Test - public void createVfModule_CreateVduException() throws Exception { - expectedException.expect(VnfException.class); - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStackVfModule_404(wireMockServer); - wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/stacks/volumeGroupHeatStackId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBodyFile("OpenstackResponse_Stack_Created_VfModule.json").withStatus(HttpStatus.SC_OK))); - MsoRequest msoRequest = getMsoRequest(); - Map<String, Object> map = new HashMap<>(); - map.put("key1", "value1"); - msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", - vnfName, "", "VFMOD", "volumeGroupHeatStackId", "baseVfHeatStackId", - "9b339a61-69ca-465f-86b8-1c72c582b8e8", map, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, - new Holder<>(), new Holder<Map<String, String>>(), new Holder<VnfRollback>()); - } - - @Test - public void deleteVfModule_QueryVduException() throws Exception { - expectedException.expect(VnfException.class); - MsoRequest msoRequest = getMsoRequest(); - msoVnfPluginAdapter.deleteVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", - "5aae1e49-805c-4f9f-bd78-055bf7451157", "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId", - msoRequest, new Holder<Map<String, String>>()); - } - - @Test - public void deleteVfModule_DeleteVduException() throws Exception { - expectedException.expect(VnfException.class); - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStackVfModule_200(wireMockServer); - wireMockServer.stubFor(get(urlPathEqualTo("/mockPublicUrl/stacks/vSAMP12")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withBodyFile("OpenstackResponse_Stack_Created_VfModule.json").withStatus(HttpStatus.SC_OK))); - wireMockServer.stubFor(delete( - urlPathEqualTo("/mockPublicUrl/stacks/DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR))); - MsoRequest msoRequest = getMsoRequest(); - msoVnfPluginAdapter.deleteVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", - "5aae1e49-805c-4f9f-bd78-055bf7451157", "11420693-3f69-4c61-b3ee-9787c744e760", "customizationId", - msoRequest, new Holder<Map<String, String>>()); - } - - private MsoRequest getMsoRequest() { - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId("12345"); - msoRequest.setServiceInstanceId("12345"); - return msoRequest; - } - -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/QueryTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/QueryTest.java deleted file mode 100644 index 7e7c130e33..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/QueryTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.hasProperty; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.when; -import java.util.Map; -import javax.xml.ws.Holder; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; -import org.onap.so.adapters.vnf.exceptions.VnfException; -import org.onap.so.openstack.beans.HeatStatus; -import org.onap.so.openstack.beans.StackInfo; -import org.onap.so.openstack.beans.VnfStatus; -import org.onap.so.openstack.exceptions.MsoException; -import org.onap.so.openstack.exceptions.MsoOpenstackException; -import org.onap.so.openstack.utils.MsoHeatUtils; - -@RunWith(MockitoJUnitRunner.class) -public class QueryTest { - - @Mock - private MsoHeatUtils heat; - @InjectMocks - private MsoVnfAdapterImpl vnfAdapter = new MsoVnfAdapterImpl(); - - @Rule - public ExpectedException thrown = ExpectedException.none(); - - @Test - public void testQueryCreatedVnf() throws VnfException, MsoException { - StackInfo info = new StackInfo("stackName", HeatStatus.CREATED); - when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(info); - String cloudId = "MT"; - String cloudOwner = "CloudOwner"; - String tenantId = "MSO_Test"; - String vnfName = "VNF_TEST1"; - Holder<Boolean> vnfExists = new Holder<>(); - Holder<String> vnfId = new Holder<>(); - Holder<VnfStatus> status = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - - vnfAdapter.queryVnf(cloudId, cloudOwner, tenantId, vnfName, null, vnfExists, vnfId, status, outputs); - - assertTrue(vnfExists.value); - } - - @Test - public void testQueryNotFoundVnf() throws VnfException, MsoException { - StackInfo info = new StackInfo("stackName", HeatStatus.NOTFOUND); - when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(info); - String cloudId = "MT"; - String cloudOwner = "CloudOwner"; - String tenantId = "MSO_Test"; - String vnfName = "VNF_TEST1"; - Holder<Boolean> vnfExists = new Holder<>(); - Holder<String> vnfId = new Holder<>(); - Holder<VnfStatus> status = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - - vnfAdapter.queryVnf(cloudId, cloudOwner, tenantId, vnfName, null, vnfExists, vnfId, status, outputs); - - assertFalse(vnfExists.value); - } - - @Test() - // @Ignore // 1802 merge - public void testQueryVnfWithException() throws VnfException, MsoException { - String cloudId = "MT"; - String cloudOwner = "CloudOwner"; - String tenantId = "MSO_Test"; - String vnfName = "VNF_TEST1"; - Holder<Boolean> vnfExists = new Holder<>(); - Holder<String> vnfId = new Holder<>(); - Holder<VnfStatus> status = new Holder<>(); - Holder<Map<String, String>> outputs = new Holder<>(); - thrown.expect(VnfException.class); - thrown.expectCause(hasProperty("context", is("QueryVNF"))); - when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())) - .thenThrow(new MsoOpenstackException(1, "test messsage", "test detail")); - vnfAdapter.queryVnf(cloudId, cloudOwner, tenantId, vnfName, null, vnfExists, vnfId, status, outputs); - } -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VnfAdapterRestTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VnfAdapterRestTest.java deleted file mode 100644 index 9655e90e46..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VnfAdapterRestTest.java +++ /dev/null @@ -1,557 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.github.tomakehurst.wiremock.WireMockServer; -import org.apache.http.HttpStatus; -import org.json.JSONException; -import org.junit.Ignore; -import org.junit.Test; -import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; -import org.onap.so.adapters.vnfrest.CreateVfModuleResponse; -import org.onap.so.adapters.vnfrest.DeleteVfModuleRequest; -import org.onap.so.adapters.vnfrest.DeleteVfModuleResponse; -import org.onap.so.adapters.vnfrest.QueryVfModuleResponse; -import org.onap.so.adapters.vnfrest.RollbackVfModuleRequest; -import org.onap.so.adapters.vnfrest.RollbackVfModuleResponse; -import org.onap.so.adapters.vnfrest.UpdateVfModuleRequest; -import org.onap.so.adapters.vnfrest.UpdateVfModuleResponse; -import org.onap.so.adapters.vnfrest.VfModuleExceptionResponse; -import org.onap.so.adapters.vnfrest.VfModuleRollback; -import org.onap.so.client.policy.JettisonStyleMapperProvider; -import org.onap.so.entity.MsoRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.patch; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static com.shazam.shazamcrest.MatcherAssert.assertThat; -import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; -import static org.junit.Assert.assertEquals; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeletePublicUrlStackByNameAndID_204; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteStacks; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetPublicUrlStackByNameAndID_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_404; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksBaseStack_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksStackId_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksStackId_404; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksVUSP_404; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksVfModuleWithLocationHeader_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksVfModule_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksWithBody_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksWithBody_404; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacks_404; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostStacks_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutStacks_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess; - -public class VnfAdapterRestTest extends BaseRestTestUtils { - - - @Autowired - private JettisonStyleMapperProvider jettisonTypeObjectMapper; - private static final String MESSAGE_ID = "62265093-277d-4388-9ba6-449838ade586-1517252396874"; - private static final String AAI_VNF_ID = "c93e0d34-5b63-45de-bbae-b0fe49dd3bd9"; - private static final String MSO_REQUEST_ID = "62265093-277d-4388-9ba6-449838ade586"; - private static final String MSO_SERVICE_INSTANCE_ID = "4147e06f-1b89-49c5-b21f-4faf8dc9805a"; - private static final String CLOUDSITE_ID = "mtn13"; - private static final String CLOUD_OWNER = "CloudOwner"; - private static final String TENANT_ID = "0422ffb57ba042c0800a29dc85ca70f8"; - private static final String VNF_TYPE = "MSOTADevInfra_vSAMP10a_Service/vSAMP10a 1"; - private static final String VNF_NAME = "MSO-DEV-VNF-1802-it3-pwt3-vSAMP10a-1XXX-Replace"; - private static final String VNF_VERSION = "1.0"; - private static final String VF_MODULE_ID = "1d48aaec-b7f3-4c24-ba4a-4e798ed3223c"; - private static final String VF_MODULE_NAME = "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001"; - private static final String VF_MODULE_TYPE = "vSAMP10aDEV::PCM::module-2"; - private static final String MODEL_CUSTOMIZATION_UUID = "cb82ffd8-252a-11e7-93ae-92361f002671"; - private static final String BASE_VF_MODULE_ID = "3d7ff7b4-720b-4604-be0a-1974fc58ed96"; - // vfModuleParams specific variables - private static final String NETWORK_NAME = "Dev-vSAMP10a-ntwk-1802-pwt3-v6-Replace-1001"; - private static final String SERVER_NAME = "Dev-vSAMP10a-addon2-1802-pwt3-v6-Replace-1001"; - private static final String IMAGE = "ubuntu_14.04_IPv6"; - private static final String EXN_DIRECT_NET_FQDN = "direct"; - private static final String EXN_HSL_NET_FQDN = "hsl"; - private static final String AVAILABILITY_ZONE_0 = "nova"; - private static final String VF_MODULE_INDEX = "0"; - - @Test - public void testCreateVfModule() throws JSONException, JsonParseException, JsonMappingException, IOException { - - CreateVfModuleRequest request = populateCreateVfModuleRequest(); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetStackVfModule_404(wireMockServer); - - mockOpenStackPostStacks_200(wireMockServer); - - mockOpenStackGetStackVfModule_200(wireMockServer); - - mockUpdateRequestDb(wireMockServer, "62265093-277d-4388-9ba6-449838ade586"); - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<CreateVfModuleRequest> entity = new HttpEntity<CreateVfModuleRequest>(request, headers); - - ResponseEntity<CreateVfModuleResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, CreateVfModuleResponse.class); - - ResponseEntity<CreateVfModuleResponse> responseV2 = - restTemplate.exchange(createURLWithPort("/services/rest/v2/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, CreateVfModuleResponse.class); - - CreateVfModuleResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/CreateVfModuleResponse.json"), CreateVfModuleResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - - assertEquals(Response.Status.OK.getStatusCode(), responseV2.getStatusCode().value()); - assertThat(responseV2.getBody(), sameBeanAs(expectedResponse)); - } - - @Test - public void testCreateVfModuleAsyncCall() throws Exception { - CreateVfModuleRequest request = populateCreateVfModuleRequest(); - request.setNotificationUrl(createURLWithPort("/mso/WorkflowMesssage")); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStackVfModule_404(wireMockServer); - mockOpenStackPostStacks_200(wireMockServer); - mockOpenStackGetStackVfModule_200(wireMockServer); - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<CreateVfModuleRequest> entity = new HttpEntity<CreateVfModuleRequest>(request, headers); - - ResponseEntity<CreateVfModuleResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, CreateVfModuleResponse.class); - - CreateVfModuleResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/CreateVfModuleResponse.json"), CreateVfModuleResponse.class); - - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testCreateVfModuleWithEnableBridgeNull() - throws JSONException, JsonParseException, JsonMappingException, IOException { - - CreateVfModuleRequest request = new CreateVfModuleRequest(); - request.setBackout(true); - request.setSkipAAI(true); - request.setFailIfExists(false); - MsoRequest msoReq = new MsoRequest(); - boolean failIfExists = true; - Boolean enableBridge = null; - Map<String, Object> vfModuleParams = new HashMap<>(); - - - vfModuleParams.put("vf_module_id", VF_MODULE_ID); - vfModuleParams.put("vnf_id", AAI_VNF_ID); - vfModuleParams.put("network_name", NETWORK_NAME); - vfModuleParams.put("vnf_name", VNF_NAME); - vfModuleParams.put("environment_context", ""); - vfModuleParams.put("server_name", SERVER_NAME); - vfModuleParams.put("image", IMAGE); - vfModuleParams.put("workload_context", ""); - vfModuleParams.put("vf_module_index", VF_MODULE_INDEX); - vfModuleParams.put("vf_module_name", VF_MODULE_NAME); - vfModuleParams.put("availability_zone_0", AVAILABILITY_ZONE_0); - vfModuleParams.put("exn_direct_net_fqdn", EXN_DIRECT_NET_FQDN); - vfModuleParams.put("exn_hsl_net_fqdn", EXN_HSL_NET_FQDN); - - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - request.setMsoRequest(msoReq); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setVnfId(AAI_VNF_ID); - request.setVnfVersion(VNF_VERSION); - request.setVfModuleId(VF_MODULE_ID); - request.setVfModuleName(VF_MODULE_NAME); - request.setBaseVfModuleId(BASE_VF_MODULE_ID); - request.setFailIfExists(failIfExists); - request.setEnableBridge(enableBridge); - request.setVfModuleParams(vfModuleParams); - request.setMessageId(MESSAGE_ID); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetStackVfModule_404(wireMockServer); - - mockOpenStackPostStacks_200(wireMockServer); - - mockOpenStackGetStackVfModule_200(wireMockServer); - - mockUpdateRequestDb(wireMockServer, "62265093-277d-4388-9ba6-449838ade586"); - - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<CreateVfModuleRequest> entity = new HttpEntity<CreateVfModuleRequest>(request, headers); - - ResponseEntity<CreateVfModuleResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, CreateVfModuleResponse.class); - - CreateVfModuleResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/CreateVfModuleResponse.json"), CreateVfModuleResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - } - - @Test - public void testCreateVfModuleFail() throws IOException { - - CreateVfModuleRequest request = new CreateVfModuleRequest(); - request.setBackout(true); - request.setSkipAAI(true); - request.setFailIfExists(false); - MsoRequest msoReq = new MsoRequest(); - boolean failIfExists = true; - boolean enableBridge = false; - Map<String, Object> vfModuleParams = new HashMap<>(); - - vfModuleParams.put("vf_module_id", VF_MODULE_ID); - vfModuleParams.put("vnf_id", AAI_VNF_ID); - vfModuleParams.put("network_name", NETWORK_NAME); - vfModuleParams.put("vnf_name", VNF_NAME); - vfModuleParams.put("environment_context", ""); - vfModuleParams.put("server_name", SERVER_NAME); - vfModuleParams.put("image", IMAGE); - vfModuleParams.put("workload_context", ""); - vfModuleParams.put("vf_module_index", VF_MODULE_INDEX); - vfModuleParams.put("vf_module_name", VF_MODULE_NAME); - vfModuleParams.put("availability_zone_0", AVAILABILITY_ZONE_0); - vfModuleParams.put("exn_direct_net_fqdn", EXN_DIRECT_NET_FQDN); - vfModuleParams.put("exn_hsl_net_fqdn", EXN_HSL_NET_FQDN); - - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - request.setMsoRequest(msoReq); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setVnfId(AAI_VNF_ID); - request.setVnfType(VNF_TYPE); - request.setVnfVersion(VNF_VERSION); - request.setVfModuleId(VF_MODULE_ID); - request.setVfModuleName(VF_MODULE_NAME); - request.setVfModuleType(VF_MODULE_TYPE); - request.setBaseVfModuleStackId(BASE_VF_MODULE_ID); - request.setFailIfExists(failIfExists); - request.setEnableBridge(enableBridge); - request.setVfModuleParams(vfModuleParams); - request.setMessageId(MESSAGE_ID); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetStackVfModule_404(wireMockServer); - - mockOpenStackGetStacks_404(wireMockServer); - - mockOpenStackPostStacks_200(wireMockServer); - - mockOpenStackGetStackVfModule_200(wireMockServer); - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<CreateVfModuleRequest> entity = new HttpEntity<CreateVfModuleRequest>(request, headers); - - ResponseEntity<VfModuleExceptionResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, VfModuleExceptionResponse.class); - - assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value()); - - mockOpenStackGetStacksWithBody_200(wireMockServer, "DELETE_IN_PROGRESS"); - - response = restTemplate.exchange(createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, VfModuleExceptionResponse.class); - - assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value()); - - mockOpenStackGetStacksWithBody_200(wireMockServer, "DELETE_FAILED"); - - response = restTemplate.exchange(createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, VfModuleExceptionResponse.class); - - assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value()); - - mockOpenStackGetStacksWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - - response = restTemplate.exchange(createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, VfModuleExceptionResponse.class); - - assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value()); - - mockOpenStackGetStacksWithBody_404(wireMockServer); - - response = restTemplate.exchange(createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules"), - HttpMethod.POST, entity, VfModuleExceptionResponse.class); - - assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value()); - - } - - @Test - public void testDeleteVfModule() throws IOException { - - DeleteVfModuleRequest request = new DeleteVfModuleRequest(); - MsoRequest msoRequest = new MsoRequest(); - String vfModuleStackId = "stackId"; - - msoRequest.setRequestId(MSO_REQUEST_ID); - msoRequest.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setVfModuleId(VF_MODULE_ID); - request.setVfModuleStackId(vfModuleStackId); - request.setVnfId(AAI_VNF_ID); - request.setMsoRequest(msoRequest); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackPostStacks_200(wireMockServer); - - mockOpenStackGetStacksStackId_404(wireMockServer); - - mockOpenStackGetPublicUrlStackByNameAndID_200(wireMockServer, wireMockPort); - - mockOpenStackDeletePublicUrlStackByNameAndID_204(wireMockServer); - - mockUpdateRequestDb(wireMockServer, "62265093-277d-4388-9ba6-449838ade586"); - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<DeleteVfModuleRequest> entity = new HttpEntity<DeleteVfModuleRequest>(request, headers); - - ResponseEntity<DeleteVfModuleResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules/" + VF_MODULE_ID), - HttpMethod.DELETE, entity, DeleteVfModuleResponse.class); - - ResponseEntity<DeleteVfModuleResponse> responseV2 = restTemplate.exchange( - createURLWithPort("/services/rest/v2/vnfs/" + AAI_VNF_ID + "/vf-modules/" + VF_MODULE_ID), - HttpMethod.DELETE, entity, DeleteVfModuleResponse.class); - - - DeleteVfModuleResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/DeleteVfModuleResponse.json"), DeleteVfModuleResponse.class); - - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - - assertEquals(Response.Status.OK.getStatusCode(), responseV2.getStatusCode().value()); - assertThat(responseV2.getBody(), sameBeanAs(expectedResponse)); - } - - @Test - public void testUpdateVfModule() throws IOException { - - UpdateVfModuleRequest request = new UpdateVfModuleRequest(); - MsoRequest msoRequest = new MsoRequest(); - String vfModuleStackId = "vfModuleStackId"; - Boolean failIfExists = false; - Boolean backout = false; - msoRequest.setRequestId(MSO_REQUEST_ID); - msoRequest.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - - Map<String, Object> vfModuleParams = new HashMap<>(); - - vfModuleParams.put("exn_direct_net_fqdn", EXN_DIRECT_NET_FQDN); - vfModuleParams.put("exn_hsl_net_fqdn", EXN_HSL_NET_FQDN); - - Map<String, String> vfModuleOutputs = new HashMap<String, String>(); - - vfModuleOutputs.put("output name", "output value"); - - request.setBackout(backout); - request.setCloudSiteId(CLOUDSITE_ID); - request.setFailIfExists(failIfExists); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setMsoRequest(msoRequest); - request.setTenantId(TENANT_ID); - request.setVfModuleId(VF_MODULE_ID); - request.setVfModuleName(VF_MODULE_NAME); - request.setVfModuleStackId(vfModuleStackId); - request.setBackout(backout); - request.setVfModuleParams(vfModuleParams); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetStacksVfModuleWithLocationHeader_200(wireMockServer, wireMockPort); - - mockOpenStackGetStacksVfModule_200(wireMockServer, wireMockPort); - - mockOpenStackGetStacksBaseStack_200(wireMockServer, wireMockPort); - - mockOpenStackPutStacks_200(wireMockServer); - - UpdateVfModuleResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/UpdateVfModuleResponse.json"), UpdateVfModuleResponse.class); - expectedResponse.setVfModuleOutputs(vfModuleOutputs); - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<UpdateVfModuleRequest> entity = new HttpEntity<UpdateVfModuleRequest>(request, headers); - - ResponseEntity<UpdateVfModuleResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules/" + VF_MODULE_TYPE), - HttpMethod.PUT, entity, UpdateVfModuleResponse.class); - - ResponseEntity<UpdateVfModuleResponse> responseV2 = restTemplate.exchange( - createURLWithPort("/services/rest/v2/vnfs/" + AAI_VNF_ID + "/vf-modules/" + VF_MODULE_TYPE), - HttpMethod.PUT, entity, UpdateVfModuleResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - - assertEquals(Response.Status.OK.getStatusCode(), responseV2.getStatusCode().value()); - assertThat(responseV2.getBody(), sameBeanAs(expectedResponse)); - - } - - @Test - public void testRollbackVfModule() throws IOException { - - - MsoRequest msoRequest = new MsoRequest(); - msoRequest.setRequestId(MSO_REQUEST_ID); - msoRequest.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - - VfModuleRollback vfModuleRollback = new VfModuleRollback(AAI_VNF_ID, VF_MODULE_ID, "StackId", false, TENANT_ID, - CLOUD_OWNER, CLOUDSITE_ID, msoRequest, "messageId"); - - RollbackVfModuleRequest request = new RollbackVfModuleRequest(); - request.setVfModuleRollback(vfModuleRollback); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - mockOpenStackGetStacksStackId_200(wireMockServer, wireMockPort); - - mockOpenStackDeleteStacks(wireMockServer); - - mockOpenStackGetStacksVUSP_404(wireMockServer); - - headers.add("Accept", MediaType.APPLICATION_JSON); - HttpEntity<RollbackVfModuleRequest> entity = new HttpEntity<RollbackVfModuleRequest>(request, headers); - - ResponseEntity<RollbackVfModuleResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules/" + VF_MODULE_ID + "/rollback"), - HttpMethod.DELETE, entity, RollbackVfModuleResponse.class); - - RollbackVfModuleResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/RollbackVfModuleResponse.json"), RollbackVfModuleResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - - } - - @Ignore - @Test - public void testQueryVfModule() throws IOException { - - String testUrl = createURLWithPort("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules/" + VF_MODULE_ID); - String testUri = UriBuilder.fromPath("/services/rest/v1/vnfs/" + AAI_VNF_ID + "/vf-modules/" + VF_MODULE_ID) - .host("localhost").port(wireMockPort).scheme("http") - // .queryParam("cloudSiteId", CLOUDSITE_ID).queryParam("tenantId", TENANT_ID) - .build().toString(); - System.out.println(testUri); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - - - headers.add("Accept", MediaType.APPLICATION_JSON); - // HttpEntity entity = new HttpEntity(null, headers); - ResponseEntity<QueryVfModuleResponse> response = - restTemplate.getForEntity(testUri, QueryVfModuleResponse.class); - // System.out.println(response); - - QueryVfModuleResponse expectedResponse = jettisonTypeObjectMapper.getMapper().readValue( - new File("src/test/resources/__files/QueryVfModuleResponse.json"), QueryVfModuleResponse.class); - - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - assertThat(response.getBody(), sameBeanAs(expectedResponse)); - } - - private CreateVfModuleRequest populateCreateVfModuleRequest() { - CreateVfModuleRequest request = new CreateVfModuleRequest(); - request.setBackout(true); - request.setSkipAAI(true); - request.setFailIfExists(false); - MsoRequest msoReq = new MsoRequest(); - boolean failIfExists = true; - boolean enableBridge = false; - Map<String, Object> vfModuleParams = new HashMap<>(); - - vfModuleParams.put("vf_module_id", VF_MODULE_ID); - vfModuleParams.put("vnf_id", AAI_VNF_ID); - vfModuleParams.put("network_name", NETWORK_NAME); - vfModuleParams.put("vnf_name", VNF_NAME); - vfModuleParams.put("environment_context", ""); - vfModuleParams.put("server_name", SERVER_NAME); - vfModuleParams.put("image", IMAGE); - vfModuleParams.put("workload_context", ""); - vfModuleParams.put("vf_module_index", VF_MODULE_INDEX); - vfModuleParams.put("vf_module_name", VF_MODULE_NAME); - vfModuleParams.put("availability_zone_0", AVAILABILITY_ZONE_0); - vfModuleParams.put("exn_direct_net_fqdn", EXN_DIRECT_NET_FQDN); - vfModuleParams.put("exn_hsl_net_fqdn", EXN_HSL_NET_FQDN); - - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - request.setMsoRequest(msoReq); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setVnfId(AAI_VNF_ID); - request.setVnfType(VNF_TYPE); - request.setVnfVersion(VNF_VERSION); - request.setVfModuleId(VF_MODULE_ID); - request.setVfModuleName(VF_MODULE_NAME); - request.setVfModuleType(VF_MODULE_TYPE); - request.setBaseVfModuleId(BASE_VF_MODULE_ID); - request.setFailIfExists(failIfExists); - request.setEnableBridge(enableBridge); - request.setVfModuleParams(vfModuleParams); - request.setMessageId(MESSAGE_ID); - - return request; - } - - public static void mockUpdateRequestDb(WireMockServer wireMockServer, String requestId) throws IOException { - wireMockServer.stubFor(patch(urlPathEqualTo("/infraActiveRequests/" + requestId)) - .willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_OK))); - } -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeAdapterRestTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeAdapterRestTest.java deleted file mode 100644 index c2e2b567f1..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeAdapterRestTest.java +++ /dev/null @@ -1,194 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import org.apache.http.HttpStatus; -import org.junit.Test; -import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.QueryVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.VolumeGroupExceptionResponse; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import java.io.IOException; -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.patch; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.junit.Assert.assertEquals; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackWithBody_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksWithBody_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostStacks_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutStack; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess; - -public class VolumeAdapterRestTest extends VolumeGroupAdapterCommon { - - @Test - public void testCreateVNFVolumes() throws IOException { - - wireMockServer.stubFor(patch(urlPathEqualTo("/infraActiveRequests/62265093-277d-4388-9ba6-449838ade586")) - .willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_OK))); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackPostStacks_200(wireMockServer); - mockOpenStackGetStackVfModule_200(wireMockServer); - CreateVolumeGroupRequest request = buildCreateVfModuleRequest(); - - HttpEntity<CreateVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<CreateVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/volume-groups"), HttpMethod.POST, entity, - CreateVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testCreateVNFVolumesAsync() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackPostStacks_200(wireMockServer); - mockOpenStackGetStackVfModule_200(wireMockServer); - CreateVolumeGroupRequest request = buildCreateVfModuleRequest(); - request.setNotificationUrl("http://localhost:8080"); - - HttpEntity<CreateVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<CreateVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/volume-groups"), HttpMethod.POST, entity, - CreateVolumeGroupResponse.class); - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testDeleteVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - DeleteVolumeGroupRequest request = buildDeleteVolumeGroupRequest(); - HttpEntity<DeleteVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<DeleteVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/volume-groups/" + VOLUME_GROUP_ID), - HttpMethod.DELETE, entity, DeleteVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testDeleteVNFVolumesAsync() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - DeleteVolumeGroupRequest request = buildDeleteVolumeGroupRequest(); - request.setNotificationUrl("http://localhost:8080"); - HttpEntity<DeleteVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<DeleteVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/volume-groups/" + VOLUME_GROUP_ID), - HttpMethod.DELETE, entity, DeleteVolumeGroupResponse.class); - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testRollbackVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - RollbackVolumeGroupRequest request = buildRollbackVolumeGroupRequest(); - HttpEntity<RollbackVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<RollbackVolumeGroupResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/volume-groups/" + VOLUME_GROUP_ID + "/rollback"), - HttpMethod.DELETE, entity, RollbackVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testRollbackVNFVolumesAsync() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - RollbackVolumeGroupRequest request = buildRollbackVolumeGroupRequest(); - request.setNotificationUrl("http://localhost:8080"); - HttpEntity<RollbackVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<RollbackVolumeGroupResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v1/volume-groups/" + VOLUME_GROUP_ID + "/rollback"), - HttpMethod.DELETE, entity, RollbackVolumeGroupResponse.class); - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testQueryVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStacksWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - javax.ws.rs.core.UriBuilder builder = UriBuilder.fromPath("/services/rest/v1/volume-groups/" + VOLUME_GROUP_ID); - builder.queryParam("cloudSiteId", CLOUDSITE_ID).queryParam("tenantId", TENANT_ID) - .queryParam("volumeGroupStackId", VOUME_GROUP_NAME).queryParam("skipAAI", true) - .queryParam("msoRequest.requestId", MSO_REQUEST_ID) - .queryParam("msoRequest.serviceInstanceId", MSO_SERVICE_INSTANCE_ID); - - ResponseEntity<QueryVolumeGroupResponse> response = restTemplate.exchange( - createURLWithPort(builder.build().toString()), HttpMethod.GET, null, QueryVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testQueryVNFVolumesError() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStacksWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - javax.ws.rs.core.UriBuilder builder = UriBuilder.fromPath("/services/rest/v1/volume-groups/" + VOLUME_GROUP_ID); - builder.queryParam("tenantId", TENANT_ID).queryParam("volumeGroupStackId", VOUME_GROUP_NAME) - .queryParam("skipAAI", true).queryParam("msoRequest.requestId", MSO_REQUEST_ID) - .queryParam("msoRequest.serviceInstanceId", MSO_SERVICE_INSTANCE_ID); - - ResponseEntity<VolumeGroupExceptionResponse> response = - restTemplate.exchange(createURLWithPort(builder.build().toString()), HttpMethod.GET, null, - VolumeGroupExceptionResponse.class); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testUpdateVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStacksWithBody_200(wireMockServer, "CREATE_COMPLETE"); - mockOpenStackPutStack(wireMockServer, VOUME_GROUP_NAME + "/stackId", 200); - mockOpenStackGetStackWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - UpdateVolumeGroupRequest request = buildUpdateVolumeGroupRequest(); - HttpEntity<UpdateVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<UpdateVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/volume-groups/" + VOLUME_GROUP_ID), - HttpMethod.PUT, entity, UpdateVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testUpdateVNFVolumesAsync() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStacksWithBody_200(wireMockServer, "CREATE_COMPLETE"); - mockOpenStackPutStack(wireMockServer, VOUME_GROUP_NAME + "/stackId", 200); - mockOpenStackGetStackWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - UpdateVolumeGroupRequest request = buildUpdateVolumeGroupRequest(); - request.setNotificationUrl("http://localhost:8080"); - HttpEntity<UpdateVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<UpdateVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v1/volume-groups/" + VOLUME_GROUP_ID), - HttpMethod.PUT, entity, UpdateVolumeGroupResponse.class); - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } - - -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2Test.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2Test.java deleted file mode 100644 index 6fd9f02cfe..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeAdapterRestV2Test.java +++ /dev/null @@ -1,190 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import org.apache.http.HttpStatus; -import org.junit.Test; -import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.QueryVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.VolumeGroupExceptionResponse; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import java.io.IOException; -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.patch; -import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.junit.Assert.assertEquals; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackWithBody_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStacksWithBody_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostStacks_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutStack; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess; - -public class VolumeAdapterRestV2Test extends VolumeGroupAdapterCommon { - - @Test - public void testCreateVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackPostStacks_200(wireMockServer); - mockOpenStackGetStackVfModule_200(wireMockServer); - wireMockServer.stubFor(patch(urlPathEqualTo("/infraActiveRequests/62265093-277d-4388-9ba6-449838ade586")) - .willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_OK))); - - CreateVolumeGroupRequest request = buildCreateVfModuleRequest(); - - HttpEntity<CreateVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<CreateVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v2/volume-groups"), HttpMethod.POST, entity, - CreateVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testCreateVNFVolumesAsync() throws IOException { - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackPostStacks_200(wireMockServer); - mockOpenStackGetStackVfModule_200(wireMockServer); - CreateVolumeGroupRequest request = buildCreateVfModuleRequest(); - request.setNotificationUrl("http://localhost:8080"); - HttpEntity<CreateVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<CreateVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v2/volume-groups"), HttpMethod.POST, entity, - CreateVolumeGroupResponse.class); - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testDeleteVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - DeleteVolumeGroupRequest request = buildDeleteVolumeGroupRequest(); - HttpEntity<DeleteVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<DeleteVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v2/volume-groups/" + VOLUME_GROUP_ID), - HttpMethod.DELETE, entity, DeleteVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testDeleteVNFVolumesAsync() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - DeleteVolumeGroupRequest request = buildDeleteVolumeGroupRequest(); - request.setNotificationUrl("http://localhost:8080"); - HttpEntity<DeleteVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<DeleteVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v2/volume-groups/" + VOLUME_GROUP_ID), - HttpMethod.DELETE, entity, DeleteVolumeGroupResponse.class); - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testRollbackVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - RollbackVolumeGroupRequest request = buildRollbackVolumeGroupRequest(); - HttpEntity<RollbackVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<RollbackVolumeGroupResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v2/volume-groups/" + VOLUME_GROUP_ID + "/rollback"), - HttpMethod.DELETE, entity, RollbackVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testRollbackVNFVolumesAsync() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - RollbackVolumeGroupRequest request = buildRollbackVolumeGroupRequest(); - request.setNotificationUrl("http://localhost:8080"); - HttpEntity<RollbackVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<RollbackVolumeGroupResponse> response = restTemplate.exchange( - createURLWithPort("/services/rest/v2/volume-groups/" + VOLUME_GROUP_ID + "/rollback"), - HttpMethod.DELETE, entity, RollbackVolumeGroupResponse.class); - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testQueryVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStacksWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - javax.ws.rs.core.UriBuilder builder = UriBuilder.fromPath("/services/rest/v2/volume-groups/" + VOLUME_GROUP_ID); - builder.queryParam("cloudSiteId", CLOUDSITE_ID).queryParam("tenantId", TENANT_ID) - .queryParam("volumeGroupStackId", VOUME_GROUP_NAME).queryParam("skipAAI", true) - .queryParam("msoRequest.requestId", MSO_REQUEST_ID) - .queryParam("msoRequest.serviceInstanceId", MSO_SERVICE_INSTANCE_ID); - - ResponseEntity<QueryVolumeGroupResponse> response = restTemplate.exchange( - createURLWithPort(builder.build().toString()), HttpMethod.GET, null, QueryVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testQueryVNFVolumesError() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStacksWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - javax.ws.rs.core.UriBuilder builder = UriBuilder.fromPath("/services/rest/v2/volume-groups/" + VOLUME_GROUP_ID); - builder.queryParam("tenantId", TENANT_ID).queryParam("volumeGroupStackId", VOUME_GROUP_NAME) - .queryParam("skipAAI", true).queryParam("msoRequest.requestId", MSO_REQUEST_ID) - .queryParam("msoRequest.serviceInstanceId", MSO_SERVICE_INSTANCE_ID); - - ResponseEntity<VolumeGroupExceptionResponse> response = - restTemplate.exchange(createURLWithPort(builder.build().toString()), HttpMethod.GET, null, - VolumeGroupExceptionResponse.class); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testUpdateVNFVolumes() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStacksWithBody_200(wireMockServer, "CREATE_COMPLETE"); - mockOpenStackPutStack(wireMockServer, VOUME_GROUP_NAME + "/stackId", 200); - mockOpenStackGetStackWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - UpdateVolumeGroupRequest request = buildUpdateVolumeGroupRequest(); - HttpEntity<UpdateVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<UpdateVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v2/volume-groups/" + VOLUME_GROUP_ID), - HttpMethod.PUT, entity, UpdateVolumeGroupResponse.class); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void testUpdateVNFVolumesAsync() throws IOException { - mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStacksWithBody_200(wireMockServer, "CREATE_COMPLETE"); - mockOpenStackPutStack(wireMockServer, VOUME_GROUP_NAME + "/stackId", 200); - mockOpenStackGetStackWithBody_200(wireMockServer, "UPDATE_COMPLETE"); - UpdateVolumeGroupRequest request = buildUpdateVolumeGroupRequest(); - request.setNotificationUrl("http://localhost:8080"); - HttpEntity<UpdateVolumeGroupRequest> entity = new HttpEntity<>(request, headers); - ResponseEntity<UpdateVolumeGroupResponse> response = - restTemplate.exchange(createURLWithPort("/services/rest/v2/volume-groups/" + VOLUME_GROUP_ID), - HttpMethod.PUT, entity, UpdateVolumeGroupResponse.class); - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - } -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeGroupAdapterCommon.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeGroupAdapterCommon.java deleted file mode 100644 index 14fa1df6c9..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/VolumeGroupAdapterCommon.java +++ /dev/null @@ -1,129 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf; - -import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.RollbackVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest; -import org.onap.so.adapters.vnfrest.VolumeGroupRollback; -import org.onap.so.entity.MsoRequest; -import java.util.HashMap; -import java.util.Map; - -public class VolumeGroupAdapterCommon extends BaseRestTestUtils { - - - - protected static final String MSO_REQUEST_ID = "62265093-277d-4388-9ba6-449838ade586"; - protected static final String MSO_SERVICE_INSTANCE_ID = "4147e06f-1b89-49c5-b21f-4faf8dc9805a"; - protected static final String CLOUDSITE_ID = "mtn13"; - protected static final String TENANT_ID = "0422ffb57ba042c0800a29dc85ca70f8"; - protected static final String VOUME_GROUP_NAME = "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001"; - protected static final String VOLUME_GROUP_ID = "0422ffb57ba042c0800a29dc85ca70v1"; - protected static final String VNF_TYPE = "TestVnfType"; - protected static final String VNF_VERSION = "1.0"; - protected static final String VF_MODULE_TYPE = "TestModule-0"; - protected static final String MODEL_CUSTOMIZATION_UUID = "9b339a61-69ca-465f-86b8-1c72c582b8e8"; - - protected UpdateVolumeGroupRequest buildUpdateVolumeGroupRequest() { - UpdateVolumeGroupRequest request = new UpdateVolumeGroupRequest(); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setVolumeGroupId(VOLUME_GROUP_ID); - request.setVnfType(VNF_TYPE); - request.setVnfVersion(VNF_VERSION); - request.setVfModuleType(VF_MODULE_TYPE); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setSkipAAI(true); - request.setVolumeGroupStackId(VOUME_GROUP_NAME); - Map<String, Object> volumeGroupParams = getVolumeGroupParamsMap(); - request.setVolumeGroupParams(volumeGroupParams); - MsoRequest msoReq = getMsoRequest(); - request.setMsoRequest(msoReq); - return request; - } - - protected RollbackVolumeGroupRequest buildRollbackVolumeGroupRequest() { - RollbackVolumeGroupRequest request = new RollbackVolumeGroupRequest(); - VolumeGroupRollback volumeGroupRollback = new VolumeGroupRollback(); - volumeGroupRollback.setCloudSiteId(CLOUDSITE_ID); - volumeGroupRollback.setMessageId(MSO_REQUEST_ID); - volumeGroupRollback.setTenantId(TENANT_ID); - MsoRequest msoReq = getMsoRequest(); - volumeGroupRollback.setVolumeGroupCreated(true); - volumeGroupRollback.setVolumeGroupId(VOLUME_GROUP_ID); - volumeGroupRollback.setVolumeGroupStackId(VOLUME_GROUP_ID); - volumeGroupRollback.setMsoRequest(msoReq); - request.setVolumeGroupRollback(volumeGroupRollback); - return request; - } - - protected DeleteVolumeGroupRequest buildDeleteVolumeGroupRequest() { - DeleteVolumeGroupRequest request = new DeleteVolumeGroupRequest(); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setVolumeGroupStackId("testStackId"); - request.setVolumeGroupId(VOLUME_GROUP_ID); - MsoRequest msoReq = getMsoRequest(); - request.setMsoRequest(msoReq); - return request; - } - - protected CreateVolumeGroupRequest buildCreateVfModuleRequest() { - CreateVolumeGroupRequest request = new CreateVolumeGroupRequest(); - request.setCloudSiteId(CLOUDSITE_ID); - request.setTenantId(TENANT_ID); - request.setVolumeGroupName(VOUME_GROUP_NAME); - request.setVolumeGroupId(VOLUME_GROUP_ID); - request.setVnfType(VNF_TYPE); - request.setVnfVersion(VNF_VERSION); - request.setVfModuleType(VF_MODULE_TYPE); - request.setModelCustomizationUuid(MODEL_CUSTOMIZATION_UUID); - request.setSkipAAI(true); - request.setFailIfExists(false); - request.setFailIfExists(true); - request.setEnableBridge(false); - request.setSuppressBackout(true); - Map<String, Object> volumeGroupParams = getVolumeGroupParamsMap(); - request.setVolumeGroupParams(volumeGroupParams); - MsoRequest msoReq = getMsoRequest(); - request.setMsoRequest(msoReq); - - return request; - } - - private Map<String, Object> getVolumeGroupParamsMap() { - Map<String, Object> volumeGroupParams = new HashMap<>(); - volumeGroupParams.put("fsb_volume_type_0", "volume_type"); - volumeGroupParams.put("fsb_volume_image_name_1", "vol_img_1"); - volumeGroupParams.put("fsb_volume_image_name_0", "vol_img_0"); - volumeGroupParams.put("fsb_volume_size_0", "100"); - return volumeGroupParams; - } - - private MsoRequest getMsoRequest() { - MsoRequest msoReq = new MsoRequest(); - msoReq.setRequestId(MSO_REQUEST_ID); - msoReq.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID); - return msoReq; - } -} diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java index 9f48144eb8..4fe49e38dd 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java @@ -143,6 +143,8 @@ public class ArchiveInfraRequestsScheduler { archivedInfra.setProductFamilyName(iar.getProductFamilyName()); archivedInfra.setTenantName(iar.getTenantName()); archivedInfra.setResourceStatusMessage(iar.getResourceStatusMessage()); + archivedInfra.setWorkflowName(iar.getWorkflowName()); + archivedInfra.setOperationName(iar.getOperationName()); newArchivedReqs.add(archivedInfra); oldInfraReqs.add(iar); diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V8.3__Add_Columns_Workflow_Name_Operation_Name.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V8.3__Add_Columns_Workflow_Name_Operation_Name.sql new file mode 100644 index 0000000000..d493bc01ac --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V8.3__Add_Columns_Workflow_Name_Operation_Name.sql @@ -0,0 +1,7 @@ +use requestdb; + +ALTER TABLE infra_active_requests ADD COLUMN IF NOT EXISTS WORKFLOW_NAME varchar(200); +ALTER TABLE archived_infra_requests ADD COLUMN IF NOT EXISTS WORKFLOW_NAME varchar(200); + +ALTER TABLE infra_active_requests ADD COLUMN IF NOT EXISTS OPERATION_NAME varchar(200); +ALTER TABLE archived_infra_requests ADD COLUMN IF NOT EXISTS OPERATION_NAME varchar(200);
\ No newline at end of file diff --git a/adapters/mso-ve-vnfm-adapter/pom.xml b/adapters/mso-ve-vnfm-adapter/pom.xml index 3d054d9eca..42d20dc021 100644 --- a/adapters/mso-ve-vnfm-adapter/pom.xml +++ b/adapters/mso-ve-vnfm-adapter/pom.xml @@ -35,7 +35,12 @@ </dependency> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-adapter-ext-clients</artifactId> + <artifactId>etsi-sol003-lcm-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>etsi-sol003-lcm-ext-clients</artifactId> <version>${project.version}</version> </dependency> <dependency> diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/aai/AaiConnection.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/aai/AaiConnection.java index 9b2a8c3d62..fd20a0f78e 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/aai/AaiConnection.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/aai/AaiConnection.java @@ -26,8 +26,10 @@ import java.util.List; import java.util.Optional; import org.apache.logging.log4j.util.Strings; import org.onap.aai.domain.yang.EsrSystemInfo; +import org.onap.aai.domain.yang.EsrSystemInfoList; import org.onap.aai.domain.yang.EsrVnfm; import org.onap.aai.domain.yang.EsrVnfmList; +import org.onap.aai.domain.yang.v18.GenericVnf; import org.onap.so.adapters.vevnfm.exception.VeVnfmException; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.AAIResourcesClient; @@ -72,7 +74,7 @@ public class AaiConnection { if (response.isPresent()) { final EsrVnfmList esrVnfmList = response.get(); - logger.info("The VNFM replied with: {}", esrVnfmList); + logger.info("The AAI ESR replied with: {}", esrVnfmList); final List<EsrVnfm> esrVnfm = esrVnfmList.getEsrVnfm(); final List<EsrSystemInfo> infos = new LinkedList<>(); @@ -94,10 +96,28 @@ public class AaiConnection { if (response.isPresent()) { final EsrVnfm esrVnfm = response.get(); - logger.info("The VNFM replied with: {}", esrVnfm); - return esrVnfm.getEsrSystemInfoList().getEsrSystemInfo(); + logger.info("The AAI ESR replied with: {}", esrVnfm); + final EsrSystemInfoList esrSystemInfoList = esrVnfm.getEsrSystemInfoList(); + + if (esrSystemInfoList != null) { + return esrSystemInfoList.getEsrSystemInfo(); + } } return Collections.emptyList(); } + + public boolean checkGenericVnfId(final String vnfId) { + final AAIResourcesClient resourcesClient = new AAIResourcesClient(); + final AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId); + final Optional<GenericVnf> response = resourcesClient.get(GenericVnf.class, resourceUri); + + if (response.isPresent()) { + final GenericVnf vnf = response.get(); + logger.info("The AAI replied with: {}", vnf); + return vnfId.equals(vnf.getVnfId()); + } + + return false; + } } diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/aai/AaiPropertiesExt.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/aai/AaiPropertiesExt.java index aa8c7f68c9..e8660086c0 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/aai/AaiPropertiesExt.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/aai/AaiPropertiesExt.java @@ -22,6 +22,7 @@ package org.onap.so.adapters.vevnfm.aai; import java.net.MalformedURLException; import java.net.URL; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; import org.onap.so.client.aai.AAIProperties; import org.onap.so.client.aai.AAIVersion; import org.onap.so.spring.SpringContextHelper; @@ -29,15 +30,18 @@ import org.springframework.context.ApplicationContext; public class AaiPropertiesExt implements AAIProperties { + private static final String MSO = "MSO"; + private final String endpoint; private final String encryptedBasicAuth; private final String encryptionKey; public AaiPropertiesExt() { final ApplicationContext context = SpringContextHelper.getAppContext(); - this.endpoint = context.getEnvironment().getProperty("aai.endpoint"); - this.encryptedBasicAuth = context.getEnvironment().getProperty("aai.auth"); - this.encryptionKey = context.getEnvironment().getProperty("mso.key"); + final ConfigProperties configProperties = context.getBean(ConfigProperties.class); + this.endpoint = configProperties.getAaiEndpoint(); + this.encryptedBasicAuth = configProperties.getAaiAuth(); + this.encryptionKey = configProperties.getMsoKey(); } @Override @@ -47,7 +51,7 @@ public class AaiPropertiesExt implements AAIProperties { @Override public String getSystemName() { - return "MSO"; + return MSO; } @Override diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/ConfigProperties.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/ConfigProperties.java new file mode 100644 index 0000000000..d4ca5af0f2 --- /dev/null +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/ConfigProperties.java @@ -0,0 +1,134 @@ +/*- + * ============LICENSE_START======================================================= + * SO + * ================================================================================ + * Copyright (C) 2020 Samsung. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.vevnfm.configuration; + +import org.onap.so.adapters.vevnfm.constant.NotificationVnfFilterType; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ConfigProperties { + + @Value("${vevnfmadapter.vnf-filter-json}") + private String vevnfmadapterVnfFilterJson; + + @Value("${vevnfmadapter.endpoint}") + private String vevnfmadapterEndpoint; + + @Value("${mso.key}") + private String msoKey; + + @Value("${aai.endpoint}") + private String aaiEndpoint; + + @Value("${aai.auth}") + private String aaiAuth; + + @Value("${vnfm.default-endpoint}") + private String vnfmDefaultEndpoint; + + @Value("${vnfm.subscription}") + private String vnfmSubscription; + + @Value("${vnfm.notification}") + private String vnfmNotification; + + @Value("${notification.vnf-filter-type}") + private NotificationVnfFilterType notificationVnfFilterType; + + @Value("${dmaap.endpoint}") + private String dmaapEndpoint; + + @Value("${dmaap.topic}") + private String dmaapTopic; + + @Value("${dmaap.closed-loop.control.name}") + private String dmaapClosedLoopControlName; + + @Value("${dmaap.version}") + private String dmaapVersion; + + @Value("${spring.security.usercredentials[0].username}") + private String springSecurityUsername; + + @Value("${spring.security.usercredentials[0].openpass}") + private String springSecurityOpenpass; + + public String getVevnfmadapterVnfFilterJson() { + return vevnfmadapterVnfFilterJson; + } + + public String getVevnfmadapterEndpoint() { + return vevnfmadapterEndpoint; + } + + public String getMsoKey() { + return msoKey; + } + + public String getAaiEndpoint() { + return aaiEndpoint; + } + + public String getAaiAuth() { + return aaiAuth; + } + + public String getVnfmDefaultEndpoint() { + return vnfmDefaultEndpoint; + } + + public String getVnfmSubscription() { + return vnfmSubscription; + } + + public String getVnfmNotification() { + return vnfmNotification; + } + + public NotificationVnfFilterType getNotificationVnfFilterType() { + return notificationVnfFilterType; + } + + public String getDmaapEndpoint() { + return dmaapEndpoint; + } + + public String getDmaapTopic() { + return dmaapTopic; + } + + public String getDmaapClosedLoopControlName() { + return dmaapClosedLoopControlName; + } + + public String getDmaapVersion() { + return dmaapVersion; + } + + public String getSpringSecurityUsername() { + return springSecurityUsername; + } + + public String getSpringSecurityOpenpass() { + return springSecurityOpenpass; + } +} diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/StartupConfiguration.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/StartupConfiguration.java index c033fc3f96..8b5afbf6a1 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/StartupConfiguration.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/configuration/StartupConfiguration.java @@ -36,14 +36,17 @@ public class StartupConfiguration { public static final String TEST_PROFILE = "test"; - @Autowired - private Environment environment; - - @Autowired - private StartupService startupService; + private final Environment environment; + private final StartupService startupService; + private final SubscriptionScheduler subscriptionScheduler; @Autowired - private SubscriptionScheduler subscriptionScheduler; + public StartupConfiguration(final Environment environment, final StartupService startupService, + final SubscriptionScheduler subscriptionScheduler) { + this.environment = environment; + this.startupService = startupService; + this.subscriptionScheduler = subscriptionScheduler; + } @EventListener(ApplicationReadyEvent.class) public void onApplicationReadyEvent() throws Exception { diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/package-info.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/constant/NotificationVnfFilterType.java index fdd8711170..57935a9fda 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/package-info.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/constant/NotificationVnfFilterType.java @@ -1,15 +1,15 @@ /*- * ============LICENSE_START======================================================= - * ONAP - SO + * SO * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020 Samsung. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,5 +17,25 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://org.onap.so/networkNotify") -package org.onap.so.adapters.network.async.client; + +package org.onap.so.adapters.vevnfm.constant; + +/** + * Select which incoming Notification with particular VNF id should be supported + */ +public enum NotificationVnfFilterType { + /** + * None + */ + NONE, + + /** + * Only those which are valid in AAI + */ + AAI_CHECKED, + + /** + * All + */ + ALL +} diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/controller/NotificationController.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/controller/NotificationController.java index cb324c32a9..1560b3be4d 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/controller/NotificationController.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/controller/NotificationController.java @@ -20,8 +20,11 @@ package org.onap.so.adapters.vevnfm.controller; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; +import org.onap.so.adapters.vevnfm.constant.NotificationVnfFilterType; import org.onap.so.adapters.vevnfm.service.DmaapService; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.vevnfm.service.VnfAaiChecker; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -35,13 +38,31 @@ public class NotificationController { private static final Logger logger = LoggerFactory.getLogger(NotificationController.class); + private final NotificationVnfFilterType notificationVnfFilterType; + private final VnfAaiChecker vnfAaiChecker; + private final DmaapService dmaapService; + @Autowired - private DmaapService dmaapService; + public NotificationController(final ConfigProperties configProperties, final VnfAaiChecker vnfAaiChecker, + final DmaapService dmaapService) { + this.notificationVnfFilterType = configProperties.getNotificationVnfFilterType(); + this.vnfAaiChecker = vnfAaiChecker; + this.dmaapService = dmaapService; + } @PostMapping("${vnfm.notification}") public ResponseEntity receiveNotification(@RequestBody final VnfLcmOperationOccurrenceNotification notification) { logger.info("Notification received {}", notification); - dmaapService.send(notification); + + final String vnfInstanceId = notification.getVnfInstanceId(); + + if (vnfAaiChecker.vnfCheck(notificationVnfFilterType, vnfInstanceId)) { + logger.info("The info with the VNF id '{}' is sent to DMaaP", vnfInstanceId); + dmaapService.send(notification); + } else { + logger.info("This VNF id '{}' is not supported", vnfInstanceId); + } + return ResponseEntity.ok().build(); } } diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/event/DmaapEvent.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/event/DmaapEvent.java index dc0c5502dd..8ef3f24d2f 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/event/DmaapEvent.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/event/DmaapEvent.java @@ -24,7 +24,7 @@ import static java.time.temporal.ChronoField.INSTANT_SECONDS; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.Instant; import java.util.UUID; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; public class DmaapEvent { diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/DmaapService.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/DmaapService.java index c685ae815a..c13811d9d0 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/DmaapService.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/DmaapService.java @@ -20,13 +20,13 @@ package org.onap.so.adapters.vevnfm.service; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; import org.onap.so.adapters.vevnfm.event.DmaapEvent; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; import org.onap.so.rest.service.HttpRestServiceProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -36,20 +36,20 @@ public class DmaapService { private static final Logger logger = LoggerFactory.getLogger(DmaapService.class); - @Value("${dmaap.endpoint}") - private String endpoint; - - @Value("${dmaap.topic}") - private String topic; - - @Value("${dmaap.closed-loop.control.name}") - private String closedLoopControlName; - - @Value("${dmaap.version}") - private String version; + private final String endpoint; + private final String topic; + private final String closedLoopControlName; + private final String version; + private final HttpRestServiceProvider restProvider; @Autowired - private HttpRestServiceProvider restProvider; + public DmaapService(final ConfigProperties configProperties, final HttpRestServiceProvider restProvider) { + this.endpoint = configProperties.getDmaapEndpoint(); + this.topic = configProperties.getDmaapTopic(); + this.closedLoopControlName = configProperties.getDmaapClosedLoopControlName(); + this.version = configProperties.getDmaapVersion(); + this.restProvider = restProvider; + } public void send(final VnfLcmOperationOccurrenceNotification notification) { try { diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/StartupService.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/StartupService.java index 92906ef35c..c128275e43 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/StartupService.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/StartupService.java @@ -24,11 +24,11 @@ import java.util.Collections; import java.util.List; import org.onap.aai.domain.yang.EsrSystemInfo; import org.onap.so.adapters.vevnfm.aai.AaiConnection; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; import org.onap.so.adapters.vevnfm.exception.VeVnfmException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.retry.annotation.Backoff; import org.springframework.retry.annotation.EnableRetry; import org.springframework.retry.annotation.Recover; @@ -41,11 +41,14 @@ public class StartupService { private static final Logger logger = LoggerFactory.getLogger(StartupService.class); - @Value("${vnfm.default-endpoint}") - private String vnfmDefaultEndpoint; + private final String vnfmDefaultEndpoint; + private final AaiConnection aaiConnection; @Autowired - private AaiConnection aaiConnection; + public StartupService(final ConfigProperties configProperties, final AaiConnection aaiConnection) { + this.vnfmDefaultEndpoint = configProperties.getVnfmDefaultEndpoint(); + this.aaiConnection = aaiConnection; + } @Retryable(value = {Exception.class}, maxAttempts = 5, backoff = @Backoff(delay = 5000, multiplier = 2)) public List<EsrSystemInfo> receiveVnfm() throws VeVnfmException { diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscribeSender.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscribeSender.java index d01c3c8f66..be71c04c89 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscribeSender.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscribeSender.java @@ -22,13 +22,13 @@ package org.onap.so.adapters.vevnfm.service; import com.fasterxml.jackson.annotation.JsonProperty; import org.onap.aai.domain.yang.EsrSystemInfo; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; import org.onap.so.adapters.vevnfm.exception.VeVnfmException; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; import org.onap.so.rest.service.HttpRestServiceProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -41,11 +41,14 @@ public class SubscribeSender { private static final Logger logger = LoggerFactory.getLogger(SubscribeSender.class); - @Value("${vnfm.subscription}") - private String vnfmSubscription; + private final String vnfmSubscription; + private final HttpRestServiceProvider restProvider; @Autowired - private HttpRestServiceProvider restProvider; + public SubscribeSender(final ConfigProperties configProperties, final HttpRestServiceProvider restProvider) { + this.vnfmSubscription = configProperties.getVnfmSubscription(); + this.restProvider = restProvider; + } public String send(final EsrSystemInfo info, final LccnSubscriptionRequest request) throws VeVnfmException { final ResponseEntity<SubscribeToManoResponse> response = diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java index 9760584d7a..32cd6ae22f 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java @@ -20,39 +20,45 @@ package org.onap.so.adapters.vevnfm.service; +import com.google.gson.Gson; import com.squareup.okhttp.Credentials; import java.util.Collections; import org.apache.logging.log4j.util.Strings; import org.onap.aai.domain.yang.EsrSystemInfo; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; import org.onap.so.adapters.vevnfm.exception.VeVnfmException; import org.onap.so.adapters.vevnfm.provider.AuthorizationHeadersProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthenticationParamsBasic; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsAuthenticationParamsBasic; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.SubscriptionsFilter; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @Service public class SubscriberService { - @Value("${vevnfmadapter.endpoint}") - private String endpoint; + private static final Gson gson = new Gson(); - @Value("${vnfm.notification}") - private String notification; - - @Value("${spring.security.usercredentials[0].username}") - private String username; - - @Value("${spring.security.usercredentials[0].openpass}") - private String openpass; - - @Autowired - private AuthorizationHeadersProvider headersProvider; + private final String vnfFilter; + private final String endpoint; + private final String notification; + private final String username; + private final String openpass; + private final AuthorizationHeadersProvider headersProvider; + private final SubscribeSender sender; @Autowired - private SubscribeSender sender; + public SubscriberService(final ConfigProperties configProperties, + final AuthorizationHeadersProvider headersProvider, final SubscribeSender sender) { + this.vnfFilter = configProperties.getVevnfmadapterVnfFilterJson(); + this.endpoint = configProperties.getVevnfmadapterEndpoint(); + this.notification = configProperties.getVnfmNotification(); + this.username = configProperties.getSpringSecurityUsername(); + this.openpass = configProperties.getSpringSecurityOpenpass(); + this.headersProvider = headersProvider; + this.sender = sender; + } private static String getAuthorization(final EsrSystemInfo info) { if (info == null) { @@ -91,6 +97,7 @@ public class SubscriberService { private LccnSubscriptionRequest createRequest() { final LccnSubscriptionRequest request = new LccnSubscriptionRequest(); + request.filter(getFilter()); request.callbackUri(getCallbackUri()); final SubscriptionsAuthenticationParamsBasic paramsBasic = new SubscriptionsAuthenticationParamsBasic(); final SubscriptionsAuthentication authentication = new SubscriptionsAuthentication(); @@ -103,6 +110,10 @@ public class SubscriberService { return request; } + private SubscriptionsFilter getFilter() { + return gson.fromJson(vnfFilter, SubscriptionsFilter.class); + } + private String getCallbackUri() { return endpoint + notification; } diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriptionScheduler.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriptionScheduler.java index d9f3acc3df..a696336011 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriptionScheduler.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriptionScheduler.java @@ -38,11 +38,14 @@ public class SubscriptionScheduler { private static final Logger logger = LoggerFactory.getLogger(SubscriptionScheduler.class); - @Autowired - private SubscriberService subscriberService; - + private final SubscriberService subscriberService; private List<EsrId> esrIds; + @Autowired + public SubscriptionScheduler(final SubscriberService subscriberService) { + this.subscriberService = subscriberService; + } + public void setInfos(final List<EsrSystemInfo> infos) { esrIds = new LinkedList<>(); diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/VnfAaiChecker.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/VnfAaiChecker.java new file mode 100644 index 0000000000..1442fa2862 --- /dev/null +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/VnfAaiChecker.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SO + * ================================================================================ + * Copyright (C) 2020 Samsung. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.vevnfm.service; + +import org.onap.so.adapters.vevnfm.aai.AaiConnection; +import org.onap.so.adapters.vevnfm.constant.NotificationVnfFilterType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class VnfAaiChecker { + + private final AaiConnection aaiConnection; + + @Autowired + public VnfAaiChecker(final AaiConnection aaiConnection) { + this.aaiConnection = aaiConnection; + } + + public boolean vnfCheck(final NotificationVnfFilterType filterType, final String vnfId) { + switch (filterType) { + case ALL: + return true; + case AAI_CHECKED: + return aaiConnection.checkGenericVnfId(vnfId); + case NONE: + return false; + default: + throw new IllegalArgumentException( + "The value of VnfNotificationFilterType is not supported: " + filterType); + } + } +} diff --git a/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml b/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml index a2a33bfb5c..c69c95187a 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml +++ b/adapters/mso-ve-vnfm-adapter/src/main/resources/application.yaml @@ -18,6 +18,7 @@ server: port: 9098 vevnfmadapter: + vnf-filter-json: '{notificationTypes:[VnfLcmOperationOccurrenceNotification],operationStates:[COMPLETED]}' endpoint: http://so-ve-vnfm-adapter.onap:9098 mso: @@ -32,6 +33,9 @@ vnfm: subscription: /vnflcm/v1/subscriptions notification: /lcm/v1/vnf/instances/notifications +notification: + vnf-filter-type: NONE + dmaap: endpoint: http://message-router.onap:30227 topic: /events/unauthenticated.DCAE_CL_OUTPUT diff --git a/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/controller/NotificationControllerTest.java b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/controller/NotificationControllerTest.java index 974e6ec544..27def126ef 100644 --- a/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/controller/NotificationControllerTest.java +++ b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/controller/NotificationControllerTest.java @@ -21,15 +21,14 @@ package org.onap.so.adapters.vevnfm.controller; import static org.junit.Assert.assertEquals; -import static org.springframework.test.web.client.ExpectedCount.once; import static org.springframework.test.web.client.match.MockRestRequestMatchers.anything; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; import org.onap.so.adapters.vevnfm.configuration.StartupConfiguration; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -53,8 +52,8 @@ public class NotificationControllerTest { private static final String MINIMAL_JSON_CONTENT = "{}"; private static final int ZERO = 0; - @Value("${vnfm.notification}") - private String notification; + @Autowired + private ConfigProperties configProperties; @Autowired private WebApplicationContext webApplicationContext; @@ -62,11 +61,13 @@ public class NotificationControllerTest { @Autowired private RestTemplate restTemplate; + private String notification; private MockMvc mvc; private MockRestServiceServer mockRestServer; @Before public void init() { + notification = configProperties.getVnfmNotification(); mvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); mockRestServer = MockRestServiceServer.bindTo(restTemplate).build(); } @@ -77,7 +78,7 @@ public class NotificationControllerTest { final MockHttpServletRequestBuilder request = MockMvcRequestBuilders.post(notification) .contentType(MediaType.APPLICATION_JSON).content(MINIMAL_JSON_CONTENT); - mockRestServer.expect(once(), anything()).andRespond(withSuccess()); + mockRestServer.expect(anything()).andRespond(withSuccess()); // when final MvcResult mvcResult = mvc.perform(request).andReturn(); diff --git a/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/StartupServiceTest.java b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/StartupServiceTest.java index 9b18cf96dc..5d5ffa6555 100644 --- a/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/StartupServiceTest.java +++ b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/StartupServiceTest.java @@ -34,16 +34,21 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.onap.aai.domain.yang.EsrSystemInfo; import org.onap.so.adapters.vevnfm.aai.AaiConnection; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; @RunWith(MockitoJUnitRunner.class) public class StartupServiceTest { private static final String URL = "rt"; + private static final String ENDPOINT = "localhost"; @Rule public ExpectedException thrown = ExpectedException.none(); @Mock + private ConfigProperties configProperties; + + @Mock private AaiConnection aaiConnection; @InjectMocks diff --git a/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/SubscribeSenderTest.java b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/SubscribeSenderTest.java index b7f1f982a2..e67e19fd8d 100644 --- a/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/SubscribeSenderTest.java +++ b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/SubscribeSenderTest.java @@ -33,11 +33,11 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.onap.aai.domain.yang.EsrSystemInfo; +import org.onap.so.adapters.vevnfm.configuration.ConfigProperties; import org.onap.so.adapters.vevnfm.configuration.StartupConfiguration; import org.onap.so.adapters.vevnfm.exception.VeVnfmException; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; @@ -64,8 +64,8 @@ public class SubscribeSenderTest { GSON = builder.create(); } - @Value("${vnfm.subscription}") - private String vnfmSubscription; + @Autowired + private ConfigProperties configProperties; @Autowired private SubscribeSender sender; @@ -73,10 +73,12 @@ public class SubscribeSenderTest { @Autowired private RestTemplate restTemplate; + private String vnfmSubscription; private MockRestServiceServer mockRestServer; @Before public void init() { + vnfmSubscription = configProperties.getVnfmSubscription(); mockRestServer = MockRestServiceServer.bindTo(restTemplate).build(); } diff --git a/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/VnfAaiCheckerTest.java b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/VnfAaiCheckerTest.java new file mode 100644 index 0000000000..da5992ee42 --- /dev/null +++ b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/service/VnfAaiCheckerTest.java @@ -0,0 +1,87 @@ +/*- + * ============LICENSE_START======================================================= + * SO + * ================================================================================ + * Copyright (C) 2020 Samsung. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.vevnfm.service; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.onap.so.adapters.vevnfm.aai.AaiConnection; +import org.onap.so.adapters.vevnfm.constant.NotificationVnfFilterType; + +@RunWith(MockitoJUnitRunner.class) +public class VnfAaiCheckerTest { + + private static final String VNF_ID = "t5h78w"; + + @Mock + private AaiConnection aaiConnection; + + @InjectMocks + private VnfAaiChecker checker; + + @Test + public void testAll() { + // when + final boolean response = checker.vnfCheck(NotificationVnfFilterType.ALL, VNF_ID); + + // then + assertTrue(response); + } + + @Test + public void testAaiCheckedPresent() { + // given + when(aaiConnection.checkGenericVnfId(eq(VNF_ID))).thenReturn(true); + + // when + final boolean response = checker.vnfCheck(NotificationVnfFilterType.AAI_CHECKED, VNF_ID); + + // then + assertTrue(response); + } + + @Test + public void testAaiCheckedAbsent() { + // given + when(aaiConnection.checkGenericVnfId(eq(VNF_ID))).thenReturn(false); + + // when + final boolean response = checker.vnfCheck(NotificationVnfFilterType.AAI_CHECKED, VNF_ID); + + // then + assertFalse(response); + } + + @Test + public void testNone() { + // when + final boolean response = checker.vnfCheck(NotificationVnfFilterType.NONE, VNF_ID); + + // then + assertFalse(response); + } +} diff --git a/adapters/mso-ve-vnfm-adapter/src/test/resources/application.yaml b/adapters/mso-ve-vnfm-adapter/src/test/resources/application.yaml new file mode 100644 index 0000000000..2c7f67e459 --- /dev/null +++ b/adapters/mso-ve-vnfm-adapter/src/test/resources/application.yaml @@ -0,0 +1,56 @@ +# +# Copyright © 2019, 2020 Samsung. +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +server: + port: 9098 + +vevnfmadapter: + vnf-filter-json: '{notificationTypes:[VnfLcmOperationOccurrenceNotification],operationStates:[COMPLETED]}' + endpoint: http://so-ve-vnfm-adapter.onap:9098 + +mso: + key: 07a7159d3bf51a0e53be7a8f89699be7 + +aai: + endpoint: https://aai.onap:30233 + auth: 75C4483F9C05E2C33A8602635FA532397EC44AB667A2B64DED4FEE08DD932F2E3C1FEE + +vnfm: + default-endpoint: https://so-vnfm-simulator.onap:9093 + subscription: /vnflcm/v1/subscriptions + notification: /lcm/v1/vnf/instances/notifications + +notification: + vnf-filter-type: ALL + +dmaap: + endpoint: http://message-router.onap:30227 + topic: /events/unauthenticated.DCAE_CL_OUTPUT + closed-loop: + control: + name: ClosedLoopControlName + version: 1.0.2 + +spring: + security: + usercredentials: + - username: admin + openpass: a4b3c2d1 + password: '$2a$10$vU.mWyNTsikAxXIA5c269ewCpAbYTiyMS0m1N.kn4F2CSGEnrKN7K' + role: USER + http: + converters: + preferred-json-mapper: gson diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiatedVnfInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiatedVnfInfo.java index 83a8a56756..e66bb90bbd 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiatedVnfInfo.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/InstantiatedVnfInfo.java @@ -13,7 +13,6 @@ package org.onap.so.adapters.vfc.model; import javax.validation.constraints.NotNull; import java.util.List; -import java.util.Map; public class InstantiatedVnfInfo { @NotNull diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLinkPortInfo.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLinkPortInfo.java index 20c8972c98..2dff432c3b 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLinkPortInfo.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/model/NsLinkPortInfo.java @@ -12,7 +12,6 @@ package org.onap.so.adapters.vfc.model; import javax.validation.constraints.NotNull; -import java.util.List; public class NsLinkPortInfo { @NotNull diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java index a708c2641c..54a2a98a00 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java @@ -28,7 +28,6 @@ import java.net.HttpURLConnection; import java.net.SocketTimeoutException; import java.util.Base64; import java.util.HashMap; -import java.util.List; import java.util.Map; import javax.ws.rs.core.UriBuilder; import org.onap.so.logger.LoggingAnchor; diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml b/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml deleted file mode 100644 index ab524ca808..0000000000 --- a/adapters/mso-vnfm-adapter/mso-vnfm-adapter-ext-clients/pom.xml +++ /dev/null @@ -1,325 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-adapter</artifactId> - <version>1.6.0-SNAPSHOT</version> - </parent> - <artifactId>mso-vnfm-adapter-ext-clients</artifactId> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <swagger-core-version>1.5.15</swagger-core-version> - <okhttp-version>2.7.5</okhttp-version> - <gson-fire-version>1.8.2</gson-fire-version> - <threetenbp-version>1.3.5</threetenbp-version> - <retrofit2-version>2.4.0</retrofit2-version> - <okhttp3-version>3.14.0</okhttp3-version> - <oltu-version>1.0.1</oltu-version> - </properties> - <name>mso-vnfm-adapter-ext-clients</name> - <description>Clients for the vnfm adpater to use towards REST endpoints which are external to the VNFM adapter/</description> - - <build> - <plugins> - <plugin> - <groupId>io.swagger</groupId> - <artifactId>swagger-codegen-maven-plugin</artifactId> - <version>2.3.1</version> - <executions> - <execution> - <id>sol003-vnf-lcm-api</id> - <goals> - <goal>generate</goal> - </goals> - <configuration> - <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleManagement-API.json</inputSpec> - <language>java</language> - <library>okhttp-gson</library> - <output>${project.build.directory}/generated-sources/sol003-vnf-lcm</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.model</modelPackage> - <configOptions> - <jackson>true</jackson> - <sourceFolder>src/gen/java/main</sourceFolder> - <withXml>true</withXml> - <useRxJava2>true</useRxJava2> - <serializableModel>true</serializableModel> - </configOptions> - </configuration> - </execution> - <execution> - <id>sol003-vnf-lcn-api</id> - <goals> - <goal>generate</goal> - </goals> - <configuration> - <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleManagementNotification-API.json</inputSpec> - <language>java</language> - <library>okhttp-gson</library> - <output>${project.build.directory}/generated-sources/sol003-vnf-lcn</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model</modelPackage> - <configOptions> - <sourceFolder>src/gen/java/main</sourceFolder> - <withXml>true</withXml> - <useRxJava2>true</useRxJava2> - <serializableModel>true</serializableModel> - </configOptions> - </configuration> - </execution> - <execution> - <id>sol003-vnf-grant-api</id> - <goals> - <goal>generate</goal> - </goals> - <configuration> - <inputSpec>${basedir}/src/main/resources/SOL003-VNFLifecycleOperationGranting-API.json</inputSpec> - <language>java</language> - <library>okhttp-gson</library> - <output>${project.build.directory}/generated-sources/sol003-vnf-grant</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.grant.model</modelPackage> - <configOptions> - <generateSupportingFiles>false</generateSupportingFiles> - <sourceFolder>src/gen/java/main</sourceFolder> - <withXml>true</withXml> - <useRxJava2>true</useRxJava2> - <serializableModel>true</serializableModel> - </configOptions> - </configuration> - </execution> - <execution> - <id>sol003-vnf-packagemanagement-api</id> - <goals> - <goal>generate</goal> - </goals> - <configuration> - <inputSpec>${basedir}/src/main/resources/SOL003-VNFPackageManagement-API.json</inputSpec> - <language>java</language> - <library>okhttp-gson</library> - <output>${project.build.directory}/generated-sources/sol003-vnf-packagemanagement</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model</modelPackage> - <configOptions> - <sourceFolder>src/gen/java/main</sourceFolder> - <withXml>true</withXml> - <useRxJava2>true</useRxJava2> - <serializableModel>true</serializableModel> - </configOptions> - </configuration> - </execution> - <execution> - <id>etsicatalog-api</id> - <goals> - <goal>generate</goal> - </goals> - <configuration> - <inputSpec>${basedir}/src/main/resources/ETSI-Catalog-API.json</inputSpec> - <language>java</language> - <library>okhttp-gson</library> - <output>${project.build.directory}/generated-sources/etsicatalog</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model</modelPackage> - <configOptions> - <sourceFolder>src/gen/java/main</sourceFolder> - <withXml>true</withXml> - <useRxJava2>true</useRxJava2> - <serializableModel>true</serializableModel> - </configOptions> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>add-source</id> - <phase>generate-sources</phase> - <goals> - <goal>add-source</goal> - </goals> - <configuration> - <sources> - <source>${project.basedir}/target/generated-sources/etsicatalog/src/gen/java/main</source> - <source>${project.basedir}/target/generated-sources/sol003-vnf-packagemanagement/src/gen/java/main</source> - <source>${project.basedir}/target/generated-sources/sol003-vnf-grant/src/gen/java/main</source> - <source>${project.basedir}/target/generated-sources/sol003-vnf-lcn/src/gen/java/main</source> - <source>${project.basedir}/target/generated-sources/sol003-vnf-lcm/src/gen/java/main</source> - - </sources> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>1.0.0</version> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId>io.swagger</groupId> - <artifactId>swagger-codegen-maven-plugin</artifactId> - <goals> - <goal>generate</goal> - </goals> - <versionRange>[2.2.0,)</versionRange> - </pluginExecutionFilter> - <action> - <execute> - <runOnIncremental>false</runOnIncremental> - </execute> - </action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - </plugins> - </pluginManagement> - </build> - - <dependencies> - <dependency> - <groupId>io.swagger</groupId> - <artifactId>swagger-annotations</artifactId> - <version>${swagger-core-version}</version> - </dependency> - <dependency> - <groupId>com.squareup.okhttp</groupId> - <artifactId>okhttp</artifactId> - <version>${okhttp-version}</version> - </dependency> - <dependency> - <groupId>com.squareup.okhttp</groupId> - <artifactId>logging-interceptor</artifactId> - <version>${okhttp-version}</version> - </dependency> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - </dependency> - <dependency> - <groupId>io.gsonfire</groupId> - <artifactId>gson-fire</artifactId> - <version>${gson-fire-version}</version> - </dependency> - <dependency> - <groupId>org.threeten</groupId> - <artifactId>threetenbp</artifactId> - <version>${threetenbp-version}</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - <!-- the test code is generated into the main source code :( --> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.squareup.retrofit2</groupId> - <artifactId>converter-gson</artifactId> - <version>${retrofit2-version}</version> - </dependency> - <dependency> - <groupId>com.squareup.retrofit2</groupId> - <artifactId>retrofit</artifactId> - <version>${retrofit2-version}</version> - </dependency> - <dependency> - <groupId>com.squareup.retrofit2</groupId> - <artifactId>converter-scalars</artifactId> - <version>${retrofit2-version}</version> - </dependency> - <dependency> - <groupId>com.squareup.retrofit2</groupId> - <artifactId>adapter-rxjava2</artifactId> - <version>${retrofit2-version}</version> - </dependency> - <dependency> - <groupId>com.squareup.okhttp3</groupId> - <artifactId>okhttp</artifactId> - <version>${okhttp3-version}</version> - </dependency> - <dependency> - <groupId>com.squareup.okhttp3</groupId> - <artifactId>logging-interceptor</artifactId> - <version>${okhttp3-version}</version> - </dependency> - <dependency> - <groupId>com.squareup.okhttp</groupId> - <artifactId>logging-interceptor</artifactId> - <version>${okhttp-version}</version> - </dependency> - - <!-- Will clean these dependencies before commit From here--> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.client</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.common</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.client</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.httpclient4</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.dynamicreg.client</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.dynamicreg.common</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.authzserver</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.resourceserver</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.resourceserver-filter</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.dynamicreg.server</artifactId> - <version>${oltu-version}</version> - </dependency> - <dependency> - <groupId>org.apache.oltu.oauth2</groupId> - <artifactId>org.apache.oltu.oauth2.jwt</artifactId> - <version>${oltu-version}</version> - </dependency> - <!-- To here--> - - - - </dependencies> -</project> diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties deleted file mode 100644 index 86cc3f0a0e..0000000000 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties +++ /dev/null @@ -1 +0,0 @@ -org.onap.so.adapters.vnfmadapter.extclients.aai.AaiPropertiesImpl
\ No newline at end of file diff --git a/adapters/mso-vnfm-adapter/pom.xml b/adapters/mso-vnfm-adapter/pom.xml deleted file mode 100644 index 3e295aa184..0000000000 --- a/adapters/mso-vnfm-adapter/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.onap.so</groupId> - <artifactId>adapters</artifactId> - <version>1.6.0-SNAPSHOT</version> - </parent> - <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-adapter</artifactId> - <name>MSO VNFM Adapter</name> - <description>MSO Adapter for VNFM</description> - <packaging>pom</packaging> - - <modules> - <module>mso-vnfm-adapter-api</module> - <module>mso-vnfm-adapter-ext-clients</module> - <module>mso-vnfm-etsi-adapter</module> - </modules> -</project> diff --git a/adapters/pom.xml b/adapters/pom.xml index 5d382fd4dd..7d2ad74c61 100644 --- a/adapters/pom.xml +++ b/adapters/pom.xml @@ -21,7 +21,7 @@ <module>mso-catalog-db-adapter</module> <module>mso-vfc-adapter</module> <module>mso-openstack-adapters</module> - <module>mso-vnfm-adapter</module> + <module>etsi-sol003-adapter</module> <module>mso-ve-vnfm-adapter</module> <module>mso-nssmf-adapter</module> <module>so-appc-orchestrator</module> diff --git a/adapters/so-appc-orchestrator/pom.xml b/adapters/so-appc-orchestrator/pom.xml index 66dcc4dd30..64eefaa151 100644 --- a/adapters/so-appc-orchestrator/pom.xml +++ b/adapters/so-appc-orchestrator/pom.xml @@ -14,7 +14,6 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> - <appc.client.version>1.7.1-SNAPSHOT</appc.client.version> </properties> <name>so-appc-orchestrator</name> <description>MSO APPC-C Orchestrator</description> diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java index f2c6b2f16a..37ad7db1c9 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ResourceStructure.java @@ -23,8 +23,6 @@ import org.onap.sdc.api.notification.INotificationData; import org.onap.sdc.api.notification.IResourceInstance; import org.onap.sdc.api.results.IDistributionClientDownloadResult; import org.onap.so.asdc.client.exceptions.ArtifactInstallerException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Abstract class to represent the resource structure. diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java index 9294677b95..3d6fbb21ef 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java @@ -343,6 +343,43 @@ public class ASDCRestInterfaceTest extends BaseTest { } @Test + public void test_E2ESlicing_Distribution() throws Exception { + wireMockServer.stubFor(post(urlPathMatching("/aai/.*")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json"))); + + wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec")) + .willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.ACCEPTED.value()))); + String resourceLocation = "src/test/resources/resource-examples/e2eSlicing/"; + ObjectMapper mapper = new ObjectMapper(); + + NotificationDataImpl request; + HttpEntity<NotificationDataImpl> entity; + ResponseEntity<String> response; + headers.add("resource-location", resourceLocation); + + request = mapper.readValue(new File(resourceLocation + "nsst-notification.json"), NotificationDataImpl.class); + entity = new HttpEntity<NotificationDataImpl>(request, headers); + response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), HttpMethod.POST, entity, + String.class); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + + request = mapper.readValue(new File(resourceLocation + "nst-notification.json"), NotificationDataImpl.class); + entity = new HttpEntity<NotificationDataImpl>(request, headers); + response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), HttpMethod.POST, entity, + String.class); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + + Optional<Service> service = serviceRepo.findById("7981375e-5e0a-4bf5-93fa-f3e3c02f2b11"); + assertTrue(service.isPresent()); + assertEquals("EmbbNst", service.get().getModelName()); + + service = serviceRepo.findById("637e9b93-208b-4b06-80f2-a2021c228174"); + assertTrue(service.isPresent()); + assertEquals("EmbbCn", service.get().getModelName()); + } + + @Test public void test_PublicNS_Distribution() throws Exception { wireMockServer.stubFor(post(urlPathMatching("/aai/.*")) .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json"))); diff --git a/asdc-controller/src/test/resources/resource-examples/e2eSlicing/eMBB.zip b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/eMBB.zip Binary files differnew file mode 100644 index 0000000000..ce0b901fdd --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/eMBB.zip diff --git a/asdc-controller/src/test/resources/resource-examples/e2eSlicing/nsst-notification.json b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/nsst-notification.json new file mode 100644 index 0000000000..49b1c10124 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/nsst-notification.json @@ -0,0 +1,32 @@ +{ + "distributionID": "28ffbae6-f44a-408c-9ec1-e329c4a48e77", + "serviceName": "EmbbCn", + "serviceVersion": "1.0", + "serviceUUID": "2763777c-27bd-4df7-93b8-c690e23f4d3f", + "serviceDescription": "EmbbCn", + "serviceInvariantUUID": "0402fb4c-4a0c-4ff2-ad2b-29218ea1d629", + "resources": [], + "serviceArtifacts": [ + { + "artifactName": "eMBB.zip", + "artifactType": "OTHER", + "artifactURL": "/eMBB.zip", + "artifactChecksum": "ZWRkMGM3NzNjMmE3NzliYTFiZGNmZjVlMDE4OWEzMTA\u003d", + "artifactDescription": "EmbbCn", + "artifactTimeout": 0, + "artifactVersion": "1", + "artifactUUID": "3f669cc1-dbe7-48ea-b606-42f497b2ac46" + }, + { + "artifactName": "service-Embbcn-csar.csar", + "artifactType": "TOSCA_CSAR", + "artifactURL": "/service-Embbcn-csar.csar", + "artifactChecksum": "NTk5MDZhNzJkOWIwZDQ0YTNlNWM0Y2MyODI5Mzk0ZWU\u003d", + "artifactDescription": "TOSCA definition package of the asset", + "artifactTimeout": 0, + "artifactVersion": "1", + "artifactUUID": "dc0f2a41-4f71-452f-91c7-0444e4d8c33b" + } + ], + "workloadContext": "Production" +}
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/e2eSlicing/nst-notification.json b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/nst-notification.json new file mode 100644 index 0000000000..8471a28b70 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/nst-notification.json @@ -0,0 +1,35 @@ +{ + "distributionID": "ece2fb37-6e4e-4989-b54e-9b0e00afb7cc", + "serviceName": "EmbbNst", + "serviceVersion": "1.0", + "serviceUUID": "e3958a85-65e0-4a77-8981-a51755aa9d39", + "serviceDescription": "Embb Nst Template", + "serviceInvariantUUID": "1899e5c1-df4e-43a8-a889-48c157dad7bc", + "resources": [ + { + "resourceInstanceName": "embbcn_proxy 0", + "resourceCustomizationUUID": "dd6f6ce9-1a23-4303-9466-22abf2a889dc", + "resourceName": "serviceProxy", + "resourceVersion": "1.0", + "resoucreType": "Service Proxy", + "resourceUUID": "4e8212a4-2a7a-4e76-9e0f-54411bc1c17d", + "resourceInvariantUUID": "b1fc926c-8cc3-4bda-8e50-27ba3536c47f", + "category": "Generic", + "subcategory": "Abstract", + "artifacts": [] + } + ], + "serviceArtifacts": [ + { + "artifactName": "service-Embbnst-csar.csar", + "artifactType": "TOSCA_CSAR", + "artifactURL": "/service-Embbnst-csar.csar", + "artifactChecksum": "YmEzMGFlOGY1MDBhMTg4MmFlYjkwODU1YjYzOTA5NDU\u003d", + "artifactDescription": "TOSCA definition package of the asset", + "artifactTimeout": 0, + "artifactVersion": "1", + "artifactUUID": "2a690bd3-4529-4437-9e9f-805eaaa25b4a" + } + ], + "workloadContext": "Production" +}
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/e2eSlicing/service-Embbcn-csar.csar b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/service-Embbcn-csar.csar Binary files differnew file mode 100644 index 0000000000..775f35046a --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/service-Embbcn-csar.csar diff --git a/asdc-controller/src/test/resources/resource-examples/e2eSlicing/service-Embbnst-csar.csar b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/service-Embbnst-csar.csar Binary files differnew file mode 100644 index 0000000000..e6e42e489f --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/e2eSlicing/service-Embbnst-csar.csar diff --git a/bpmn/MSOCommonBPMN/pom.xml b/bpmn/MSOCommonBPMN/pom.xml index 5d9c1a3acd..ec8ad3127c 100644 --- a/bpmn/MSOCommonBPMN/pom.xml +++ b/bpmn/MSOCommonBPMN/pom.xml @@ -1,6 +1,5 @@ <?xml version="1.0"?> -<project - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> @@ -23,7 +22,7 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> - <configuration> + <configuration> <compilerId>groovy-eclipse-compiler</compilerId> </configuration> diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy deleted file mode 100644 index e8f842471c..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy +++ /dev/null @@ -1,458 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.common.scripts - -import org.onap.so.logger.LoggingAnchor -import org.onap.so.client.HttpClientFactory -import org.onap.logging.filter.base.ErrorCode - -import javax.ws.rs.core.Response -import org.apache.commons.lang3.* -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.delegate.DelegateExecution -import org.onap.so.bpmn.core.UrnPropertiesReader -import org.onap.so.client.HttpClient -import org.onap.so.logger.MessageEnum -import org.slf4j.Logger -import org.slf4j.LoggerFactory -import org.onap.logging.filter.base.ONAPComponents; -import java.util.UUID -import org.onap.so.utils.Components - - -@Deprecated //Use vnfAdapterRestV2 -class VnfAdapterRestV1 extends AbstractServiceTaskProcessor { - private static final Logger logger = LoggerFactory.getLogger( VnfAdapterRestV1.class); - - - ExceptionUtil exceptionUtil = new ExceptionUtil() - - // VNF Response Processing - public void preProcessRequest (DelegateExecution execution) { - def method = getClass().getSimpleName() + '.preProcessRequest(' + - 'execution=' + execution.getId() + - ')' - logger.trace('Entered ' + method) - - def prefix="VNFREST_" - execution.setVariable("prefix", prefix) - setSuccessIndicator(execution, false) - - try { - String request = validateRequest(execution, "mso-request-id") - - // Get the request type (the name of the root element) from the request - - Node root = new XmlParser().parseText(request) - String requestType = root.name() - execution.setVariable(prefix + 'requestType', requestType) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'requestType = ' + requestType) - - logger.debug('VnfAdapterRestV1, request: ' + request) - // Get the messageId from the request - - String messageId = getChildText(root, 'messageId') - - if ('rollbackVolumeGroupRequest'.equals(requestType)) { - messageId = getMessageIdForVolumeGroupRollback(root) - } - - if (messageId == null || messageId.isEmpty()) { - String msg = getProcessKey(execution) + ': no messageId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - execution.setVariable('VNFAResponse_CORRELATOR', messageId) - logger.debug(getProcessKey(execution) + ': VNFAResponse_CORRELATOR = ' + messageId) - - // Get the notificationUrl from the request - - String notificationUrl = getChildText(root, 'notificationUrl') - - if (notificationUrl == null || notificationUrl.isEmpty()) { - String msg = getProcessKey(execution) + ': no notificationUrl in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - execution.setVariable(prefix + 'notificationUrl', notificationUrl) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'notificationUrl = ' + notificationUrl) - - // Determine the VnfAdapter endpoint - - String vnfAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.vnf.rest.endpoint", execution) - - if (vnfAdapterEndpoint == null || vnfAdapterEndpoint.isEmpty()) { - String msg = getProcessKey(execution) + ': mso:adapters:vnf:rest:endpoint URN mapping is not defined' - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - while (vnfAdapterEndpoint.endsWith('/')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, vnfAdapterEndpoint.length()-1) - } - - String vnfAdapterMethod = null - String vnfAdapterUrl = null - String vnfAdapterRequest = request - - if ('createVfModuleRequest'.equals(requestType)) { - String vnfId = getChildText(root, 'vnfId') - - if (vnfId == null || vnfId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vnfId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'POST' - vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + '/vf-modules' - - } else if ('updateVfModuleRequest'.equals(requestType)) { - String vnfId = getChildText(root, 'vnfId') - - if (vnfId == null || vnfId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vnfId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - String vfModuleId = getChildText(root, 'vfModuleId') - - if (vfModuleId == null || vfModuleId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'PUT' - vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + - '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') - - } else if ('deleteVfModuleRequest'.equals(requestType)) { - String vnfId = getChildText(root, 'vnfId') - - if (vnfId == null || vnfId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vnfId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - String vfModuleId = getChildText(root, 'vfModuleId') - - if (vfModuleId == null || vfModuleId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'DELETE' - vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + - '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') - - } else if ('rollbackVfModuleRequest'.equals(requestType)) { - Node vfModuleRollbackNode = getChild(root, 'vfModuleRollback') - - if (vfModuleRollbackNode == null) { - String msg = getProcessKey(execution) + ': no vfModuleRollback in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - String vnfId = getChildText(vfModuleRollbackNode, 'vnfId') - - if (vnfId == null || vnfId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vnfId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - String vfModuleId = getChildText(vfModuleRollbackNode, 'vfModuleId') - - if (vfModuleId == null || vfModuleId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'DELETE' - vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + - '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') + '/rollback' - - } else if ('createVolumeGroupRequest'.equals(requestType)) { - vnfAdapterMethod = 'POST' - if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) - } - vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups' - - } else if ('updateVolumeGroupRequest'.equals(requestType)) { - String volumeGroupId = getChildText(root, 'volumeGroupId') - - if (volumeGroupId == null || volumeGroupId.isEmpty()) { - String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'PUT' - if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) - } - vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') - - } else if ('deleteVolumeGroupRequest'.equals(requestType)) { - String volumeGroupId = getChildText(root, 'volumeGroupId') - - if (volumeGroupId == null || volumeGroupId.isEmpty()) { - String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'DELETE' - if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) - } - vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') - - } else if ('rollbackVolumeGroupRequest'.equals(requestType)) { - String volumeGroupId = getVolumeGroupIdFromRollbackRequest(root) - - if (volumeGroupId == null || volumeGroupId.isEmpty()) { - String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'DELETE' - if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) - } - vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') + '/rollback' - - } else { - String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - execution.setVariable(prefix + 'vnfAdapterMethod', vnfAdapterMethod) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterMethod = ' + vnfAdapterMethod) - execution.setVariable(prefix + 'vnfAdapterUrl', vnfAdapterUrl) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterUrl = ' + vnfAdapterUrl) - execution.setVariable(prefix + 'vnfAdapterRequest', vnfAdapterRequest) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterRequest = \n' + vnfAdapterRequest) - - // Get the Basic Auth credentials for the VnfAdapter - - String basicAuthValue = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution) - - if (basicAuthValue == null || basicAuthValue.isEmpty()) { - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), - getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined", "BPMN", - ErrorCode.UnknownError.getValue()); - } else { - try { - def encodedString = utils.getBasicAuth(basicAuthValue, UrnPropertiesReader.getVariable("mso.msoKey", execution)) - execution.setVariable(prefix + 'basicAuthHeaderValue', encodedString) - } catch (IOException ex) { - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), - getProcessKey(execution) + ": Unable to encode BasicAuth credentials for VnfAdapter", - "BPMN", ErrorCode.UnknownError.getValue(), ex); - } - } - - } catch (BpmnError e) { - logger.debug(" Rethrowing MSOWorkflowException") - throw e - } catch (Exception e) { - String msg = 'Caught exception in ' + method + ": " + e - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - logger.debug(msg) - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - } - - public String getVolumeGroupIdFromRollbackRequest(Node root) { - return root.'volumeGroupRollback'.'volumeGroupId'.text() - } - - public String getMessageIdForVolumeGroupRollback(Node root) { - return root.'volumeGroupRollback'.'messageId'.text() - } - - /** - * This method is used instead of an HTTP Connector task because the - * connector does not allow DELETE with a body. - */ - public void sendRequestToVnfAdapter(DelegateExecution execution) { - def method = getClass().getSimpleName() + '.sendRequestToVnfAdapter(' + - 'execution=' + execution.getId() + - ')' - logger.trace('Entered ' + method) - - String prefix = execution.getVariable('prefix') - - try { - String vnfAdapterMethod = execution.getVariable(prefix + 'vnfAdapterMethod') - String vnfAdapterUrl = execution.getVariable(prefix + 'vnfAdapterUrl') - String vnfAdapterRequest = execution.getVariable(prefix + 'vnfAdapterRequest') - - URL url = new URL(vnfAdapterUrl); - - HttpClient httpClient = new HttpClientFactory().newXmlClient(url, ONAPComponents.VNF_ADAPTER) - httpClient.addAdditionalHeader("Authorization", execution.getVariable(prefix + "basicAuthHeaderValue")) - - httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id")) - httpClient.addAdditionalHeader("X-ONAP-InvocationID", UUID.randomUUID().toString()) - httpClient.addAdditionalHeader("X-ONAP-PartnerName", "SO-VNFAdapter") - Response response; - - if ("GET".equals(vnfAdapterMethod)) { - response = httpClient.get() - } else if ("PUT".equals(vnfAdapterMethod)) { - response = httpClient.put(vnfAdapterRequest) - } else if ("POST".equals(vnfAdapterMethod)) { - response = httpClient.post(vnfAdapterRequest) - } else if ("DELETE".equals(vnfAdapterMethod)) { - response = httpClient.delete(vnfAdapterRequest) - } else { - String msg = 'Unsupported HTTP method "' + vnfAdapterMethod + '" in ' + method + ": " + e - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - execution.setVariable(prefix + "vnfAdapterStatusCode", response.getStatus()) - if(response.hasEntity()){ - execution.setVariable(prefix + "vnfAdapterResponse", response.readEntity(String.class)) - } - } catch (BpmnError e) { - throw e - } catch (Exception e) { - String msg = 'Caught exception in ' + method + ": " + e - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - } - - public void processCallback(DelegateExecution execution){ - def method = getClass().getSimpleName() + '.processCallback(' + - 'execution=' + execution.getId() + - ')' - logger.trace('Entered ' + method) - - String callback = execution.getVariable('VNFAResponse_MESSAGE') - - try { - logger.debug(getProcessKey(execution) + ": received callback:\n" + callback) - - // The XML callback is available to the calling flow in any case, - // even if a WorkflowException is generated. - execution.setVariable(getProcessKey(execution) + 'Response', callback) - // TODO: Should deprecate use of processKey+Response variable for the response. Will use "WorkflowResponse" instead. - execution.setVariable("WorkflowResponse", callback) - - callback = utils.removeXmlPreamble(callback) - - Node root = new XmlParser().parseText(callback) - if (root.name().endsWith('Exception')) { - vnfAdapterWorkflowException(execution, callback) - } - } catch (Exception e) { - logger.debug("Error encountered within VnfAdapterRest ProcessCallback method: {}", e.getMessage(), e) - exceptionUtil.buildAndThrowWorkflowException(execution, 7020, "Error encountered within VnfAdapterRest ProcessCallback method", ONAPComponents.SO) - } - } - - /** - * Tries to parse the response as XML to extract the information to create - * a WorkflowException. If the response cannot be parsed, a more generic - * WorkflowException is created. - */ - public void vnfAdapterWorkflowException(DelegateExecution execution, Object response) { - try { - Node root = new XmlParser().parseText(response) - String category = getChildText(root, "category") - category = category == null || category.isEmpty() ? "" : " category='" + category + "'" - String message = getChildText(root, "message") - message = message == null || message.isEmpty() ? "" : " message='" + message + "'" - String rolledBack = getChildText(root, "rolledBack") - rolledBack = rolledBack == null || rolledBack.isEmpty() ? "" : " rolledBack='" + rolledBack + "'" - exceptionUtil.buildWorkflowException(execution, 7020, "Received " + root.name() + - " from VnfAdapter:" + category + message + rolledBack, Components.OPENSTACK); - } catch (Exception e) { - response = response == null || String.valueOf(response).isEmpty() ? "NONE" : response - exceptionUtil.buildWorkflowException(execution, 7020, "Received error from VnfAdapter: " + response, Components.OPENSTACK) - } - } - - /** - * Gets the named child of the specified node. - * @param node the node - * @param name the child name - * @return the child node, or null if no such child exists - */ - private Node getChild(Node node, String name) { - for (Node child : node.children()) { - if (child.name() == name) { - return child - } - } - return null - } - - /** - * Gets the text of the named child of the specified node. - * @param node the node - * @param name the child name - * @return the child node text, or null if no such child exists - */ - private String getChildText(Node node, String name) { - Node child = getChild(node, name) - return child == null ? null : child.text() - } - - public Logger getLogger() { - return logger; - } -} diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterUtils.groovy deleted file mode 100644 index 91b29d3867..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterUtils.groovy +++ /dev/null @@ -1,97 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.common.scripts - -import org.onap.so.logger.LoggingAnchor -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.onap.so.bpmn.core.WorkflowException -import org.onap.logging.filter.base.ErrorCode -import org.onap.so.logger.MessageEnum -import org.slf4j.Logger -import org.slf4j.LoggerFactory - - - -class VnfAdapterUtils { - private static final Logger logger = LoggerFactory.getLogger( VnfAdapterUtils.class); - - - private AbstractServiceTaskProcessor taskProcessor - - public VnfAdapterUtils(AbstractServiceTaskProcessor taskProcessor) { - this.taskProcessor = taskProcessor - } - - ExceptionUtil exceptionUtil = new ExceptionUtil() - - public void validateVnfResponse(DelegateExecution execution, String responseVar, String responseCodeVar, String errorResponseVar) { - def method = getClass().getSimpleName() + '.validateVnfResponse(' + - 'execution=' + execution.getId() + - ', responseVar=' + responseVar + - ', responseCodeVar=' + responseCodeVar + - ', errorResponseVar=' + errorResponseVar + - ')' - logger.trace('Entered ' + method) - - try { - def prefix = execution.getVariable('prefix') - - def response = execution.getVariable(responseVar) - def responseCode = execution.getVariable(responseCodeVar) - def errorResponse = execution.getVariable(errorResponseVar) - - // The following if statement never appears to be true as any VNF Adapter error seems to be stored in 'errorResponse'. - // Also, the value is stored as a WorkflowException object, not a String. Added the else if to provide the proper - // functionality but leaving the original code in case it is hit under some circumstances. - if (response.contains("WorkflowException")) { - execution.setVariable(prefix + "ErrorResponse", response) - //execution.setVariable(prefix + "ResponseCode", responseCode) - logger.debug(" Sub Vnf flow Error WorkflowException Response - " + "\n" + response) - throw new BpmnError("MSOWorkflowException") - } else if (errorResponse != null && errorResponse instanceof WorkflowException) { - // Not sure the variables with the associated prefix are still used - execution.setVariable(prefix + "ErrorResponse", errorResponse.getErrorMessage()) - execution.setVariable(prefix + "ResponseCode", errorResponse.getErrorCode()) - logger.debug("Sub Vnf flow Error WorkflowException " + prefix + "ErrorResponse" + " - " + errorResponse.getErrorMessage()) - // this is the important part to ensure we hit the Fallout Handler - throw new BpmnError("MSOWorkflowException") - } else if (errorResponse != null && errorResponse instanceof WorkflowException) { - // Not sure the variables with the associated prefix are still used - execution.setVariable(prefix + "ErrorResponse", errorResponse.getErrorMessage()) - execution.setVariable(prefix + "ResponseCode", errorResponse.getErrorCode()) - logger.debug("Sub Vnf flow Error WorkflowException " + prefix + "ErrorResponse" + " - " + errorResponse.getErrorMessage()) - // this is the important part to ensure we hit the Fallout Handler - throw new BpmnError("MSOWorkflowException") - } - } catch (BpmnError e) { - throw e; - } catch (Exception e) { - logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), - 'Caught exception in ' + method, "BPMN", - ErrorCode.UnknownError.getValue(), "Exception is:\n" + e); - exceptionUtil.buildAndThrowWorkflowException(execution, 5000, 'Internal Error- Unable to validate VNF Response ' + e.getMessage()) - } - } - -} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java index 9e9c4b5cfa..d966528f6c 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java @@ -21,7 +21,6 @@ package org.onap.so.bpmn.appc.payload; import java.util.Optional; -import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersHealthCheck; import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersQuiesce; import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersResumeTraffic; import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersDistributeTraffic; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/ShallowCopy.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/ShallowCopy.java index 3fc0808741..55a9f348c0 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/ShallowCopy.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/ShallowCopy.java @@ -20,10 +20,8 @@ package org.onap.so.bpmn.servicedecomposition; -import com.fasterxml.jackson.databind.ObjectMapper; import javax.persistence.Id; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public interface ShallowCopy<T> { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java index 1105572e3a..e241696573 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/LineOfBusiness.java @@ -21,7 +21,6 @@ package org.onap.so.bpmn.servicedecomposition.bbobjects; import java.io.Serializable; -import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; import org.apache.commons.lang3.builder.EqualsBuilder; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java index 93d85daad1..fcc21f1df2 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/License.java @@ -23,10 +23,8 @@ package org.onap.so.bpmn.servicedecomposition.generalobjects; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; -import com.fasterxml.jackson.annotation.JsonInclude.Include; @JsonRootName("license") public class License implements Serializable { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/OrchestrationContext.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/OrchestrationContext.java index a98cdc712d..8f4a39a119 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/OrchestrationContext.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/OrchestrationContext.java @@ -23,7 +23,6 @@ package org.onap.so.bpmn.servicedecomposition.generalobjects; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; -import org.onap.so.bpmn.servicedecomposition.ShallowCopy; @JsonRootName("orchestration-context") public class OrchestrationContext implements Serializable { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/SolutionInfo.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/SolutionInfo.java index 643113573e..c9b8613be1 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/SolutionInfo.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/SolutionInfo.java @@ -23,7 +23,6 @@ package org.onap.so.bpmn.servicedecomposition.homingobjects; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; -import org.onap.so.bpmn.servicedecomposition.ShallowCopy; import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; @JsonRootName("solution") diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoVolumeGroup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoVolumeGroup.java index bb493f5aa9..4466a2c741 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoVolumeGroup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoVolumeGroup.java @@ -21,7 +21,6 @@ package org.onap.so.bpmn.servicedecomposition.modelinfo; import java.io.Serializable; -import com.fasterxml.jackson.annotation.JsonProperty; public class ModelInfoVolumeGroup extends ModelInfoVfModule implements Serializable { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/AssignFlows.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/AssignFlows.java index f23f62d763..9eef3ffbf5 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/AssignFlows.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/AssignFlows.java @@ -29,7 +29,7 @@ public enum AssignFlows { NETWORK_MACRO("AssignNetworkBB"), VOLUME_GROUP("AssignVolumeGroupBB"), NETWORK_COLLECTION("CreateNetworkCollectionBB"), - FABRIC_CONFIGURATION("AssignFabricConfigurationBB"), + FABRIC_CONFIGURATION("AddFabricConfigurationBB"), VRF_CONFIGURATION("AssignVrfConfigurationBBV2"); private final String flowName; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index f0954c3695..01a0c3aeea 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -77,7 +77,6 @@ import org.onap.so.serviceinstancebeans.CloudConfiguration; import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.ModelType; import org.onap.so.serviceinstancebeans.Networks; -import org.onap.so.serviceinstancebeans.Pnfs; import org.onap.so.serviceinstancebeans.RelatedInstance; import org.onap.so.serviceinstancebeans.RelatedInstanceList; import org.onap.so.serviceinstancebeans.RequestDetails; @@ -108,6 +107,7 @@ public class BBInputSetup implements JavaDelegate { private static final String NETWORK_COLLECTION = "NetworkCollection"; private static final String PREPROV = "PREPROV"; private static final String CREATEVOLUME = "CreateVolume"; + private static final String CONTROLLER = "Controller"; @Autowired private BBInputSetupUtils bbInputSetupUtils; @@ -631,18 +631,22 @@ public class BBInputSetup implements JavaDelegate { break; } } + VfModuleCustomization vfResourceCustomization = null; if (vnfResourceCustomization != null) { - VfModuleCustomization vfResourceCustomization = vnfResourceCustomization.getVfModuleCustomizations() - .stream() // Convert to steam + vfResourceCustomization = vnfResourceCustomization.getVfModuleCustomizations().stream() // Convert to steam .filter(x -> modelInfo.getModelCustomizationId().equalsIgnoreCase(x.getModelCustomizationUUID()))// find // what // we // want .findAny() // If 'findAny' then return found .orElse(null); - if (vfResourceCustomization != null) { - vfModule.setModelInfoVfModule(this.mapperLayer.mapCatalogVfModuleToVfModule(vfResourceCustomization)); - } + } + if (vfResourceCustomization == null) { + vfResourceCustomization = bbInputSetupUtils + .getVfModuleCustomizationByModelCuztomizationUUID(modelInfo.getModelCustomizationId()); + } + if (vfResourceCustomization != null) { + vfModule.setModelInfoVfModule(this.mapperLayer.mapCatalogVfModuleToVfModule(vfResourceCustomization)); } } @@ -1383,7 +1387,8 @@ public class BBInputSetup implements JavaDelegate { cloudRegion = mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion); } gBB.setCloudRegion(cloudRegion); - if (bbName.contains(VNF)) { + if (bbName.contains(VNF) || (bbName.contains(CONTROLLER) + && (VNF).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) { for (GenericVnf genericVnf : serviceInstance.getVnfs()) { if (lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID) != null && genericVnf.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) { @@ -1395,7 +1400,8 @@ public class BBInputSetup implements JavaDelegate { this.mapCatalogVnf(genericVnf, modelInfo, service); } } - } else if (bbName.contains(VF_MODULE)) { + } else if (bbName.contains(VF_MODULE) || (bbName.contains(CONTROLLER) + && (VF_MODULE).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) { for (GenericVnf vnf : serviceInstance.getVnfs()) { for (VfModule vfModule : vnf.getVfModules()) { if (lookupKeyMap.get(ResourceKey.VF_MODULE_ID) != null @@ -1499,7 +1505,8 @@ public class BBInputSetup implements JavaDelegate { BBInputSetupParameter parameter = new BBInputSetupParameter.Builder().setRequestId(executeBB.getRequestId()).setService(service) .setBbName(bbName).setServiceInstance(serviceInstance).setLookupKeyMap(lookupKeyMap).build(); - if (bbName.contains(VNF)) { + if (bbName.contains(VNF) || (bbName.contains(CONTROLLER) + && (VNF).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) { vnfs = findVnfsByKey(key, resources, vnfs); String vnfId = lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID); // This stores the vnf id in request db to be retrieved later when @@ -1527,7 +1534,8 @@ public class BBInputSetup implements JavaDelegate { resources.getPnfs().stream() .filter(pnfs -> Objects.equals(key, pnfs.getModelInfo().getModelCustomizationId())).findFirst() .ifPresent(pnfs -> BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance)); - } else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP)) { + } else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP) || (bbName.contains(CONTROLLER) + && (VF_MODULE).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) { Pair<Vnfs, VfModules> vnfsAndVfModules = getVfModulesAndItsVnfsByKey(key, resources); if (vnfsAndVfModules != null) { vfModules = vnfsAndVfModules.getValue1(); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java index 68161a8dd5..4379864bfe 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java @@ -23,7 +23,6 @@ package org.onap.so.bpmn.servicedecomposition.tasks; import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; -import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf; import org.onap.so.db.catalog.beans.OrchestrationStatus; import org.onap.so.serviceinstancebeans.Pnfs; @@ -37,10 +36,6 @@ final class BBInputSetupPnf { Pnf pnf = new Pnf(); pnf.setPnfId(pnfId); pnf.setPnfName(pnfs.getInstanceName()); - pnf.setModelInfoPnf(new ModelInfoPnf()); - pnf.getModelInfoPnf().setModelCustomizationUuid(pnfs.getModelInfo().getModelCustomizationId()); - pnf.getModelInfoPnf().setModelInvariantUuid(pnfs.getModelInfo().getModelInvariantId()); - pnf.getModelInfoPnf().setModelUuid(pnfs.getModelInfo().getModelVersionId()); pnf.setOrchestrationStatus(OrchestrationStatus.PRECREATED); serviceInstance.getPnfs().add(pnf); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerConfiguration.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerConfiguration.java index 165d9577af..b39ba5f63f 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerConfiguration.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerConfiguration.java @@ -22,7 +22,6 @@ package org.onap.so.client.appc; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Service; @Configuration public class ApplicationControllerConfiguration { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerSupport.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerSupport.java index 10d3d85ffc..144cb257a6 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerSupport.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/appc/ApplicationControllerSupport.java @@ -26,7 +26,6 @@ import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import org.springframework.stereotype.Component; import org.onap.appc.client.lcm.api.LifeCycleManagerStateful; import org.onap.appc.client.lcm.api.ResponseHandler; import org.onap.appc.client.lcm.model.Status; @@ -36,7 +35,6 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; -import org.springframework.stereotype.Service; public class ApplicationControllerSupport { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VfModuleCDSRequestProvider.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VfModuleCDSRequestProvider.java index bba8925f21..065ba36a03 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VfModuleCDSRequestProvider.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/VfModuleCDSRequestProvider.java @@ -31,7 +31,6 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.PayloadGenerationException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableBeanFactory; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import java.util.List; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java index 30fd2c8770..4455c9fe9d 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java @@ -329,7 +329,7 @@ public class ExceptionBuilder { } } - public void processVnfAdapterException(DelegateExecution execution) { + public void processOpenstackAdapterException(DelegateExecution execution) { StringBuilder workflowExceptionMessage = new StringBuilder(); logger.debug("Processing Vnf Adapter Exception"); try { diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterTask.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/OpenstackAdapterTask.bpmn index 69b68e534e..e437f13d7b 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterTask.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/OpenstackAdapterTask.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_GraPIIyxEeWmdMDkx6Uftw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> - <bpmn2:process id="vnfAdapterTask" name="vnfAdapterTask" isExecutable="true"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_GraPIIyxEeWmdMDkx6Uftw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> + <bpmn2:process id="openstackAdapterTask" name="openstackAdapterTask" isExecutable="true"> <bpmn2:endEvent id="EndEvent_6"> <bpmn2:incoming>SequenceFlow_13uy51h</bpmn2:incoming> </bpmn2:endEvent> @@ -24,10 +24,10 @@ <bpmn2:outgoing>SequenceFlow_0o8wnkx</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_13uy51h" name="Yes" sourceRef="ExclusiveGateway_1fn953y" targetRef="EndEvent_6"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackPollSuccess") == true }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("OpenstackPollSuccess") == true }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_0o8wnkx" name="No" sourceRef="ExclusiveGateway_1fn953y" targetRef="EndEvent_1dt01ez"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackPollSuccess") == false }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("OpenstackPollSuccess") == false }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:exclusiveGateway id="ExclusiveGateway_08a6you" name="Success?"> <bpmn2:incoming>SequenceFlow_1ff2y8j</bpmn2:incoming> @@ -35,10 +35,10 @@ <bpmn2:outgoing>SequenceFlow_007m32h</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_1p39f4r" name="Yes" sourceRef="ExclusiveGateway_08a6you" targetRef="ServiceTask_11iuzx9"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackInvokeSuccess") == true }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("OpenstackInvokeSuccess") == true }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_007m32h" name="No" sourceRef="ExclusiveGateway_08a6you" targetRef="EndEvent_0rxprkw"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackInvokeSuccess") == false }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("OpenstackInvokeSuccess") == false }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:subProcess id="SubProcess_0y17e8j" name="Error Handling" triggeredByEvent="true"> <bpmn2:startEvent id="StartEvent_17oglfe"> @@ -48,7 +48,7 @@ <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_040yoan"> <bpmn2:incoming>SequenceFlow_0y1by9x</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_006myq9</bpmn2:outgoing> - <bpmn2:compensateEventDefinition waitForCompletion="true" activityRef="executeOpenstackAction" /> + <bpmn2:compensateEventDefinition activityRef="executeOpenstackAction" /> </bpmn2:intermediateThrowEvent> <bpmn2:exclusiveGateway id="ExclusiveGateway_0qlnby0" name="Poll Rollback Status?" default="SequenceFlow_1piwh1c"> <bpmn2:incoming>SequenceFlow_006myq9</bpmn2:incoming> @@ -66,13 +66,13 @@ <bpmn2:incoming>SequenceFlow_1nku4uk</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1yx80cq</bpmn2:outgoing> </bpmn2:exclusiveGateway> - <bpmn2:serviceTask id="buildError" name=" Process Exception " camunda:expression="${ExceptionBuilder.processVnfAdapterException(execution)}"> + <bpmn2:serviceTask id="buildError" name=" Process Exception " camunda:expression="${ExceptionBuilder.processOpenstackAdapterException(execution)}"> <bpmn2:incoming>SequenceFlow_1yx80cq</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_1az3a2q</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0bnzfqb</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:sequenceFlow id="SequenceFlow_1ubla93" name="Yes" sourceRef="ExclusiveGateway_0qlnby0" targetRef="ServiceTask_120p27h"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("PollRollbackStatus") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("PollRollbackStatus") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_1piwh1c" name="No" sourceRef="ExclusiveGateway_0qlnby0" targetRef="ExclusiveGateway_0tuxj9l" /> <bpmn2:sequenceFlow id="SequenceFlow_1nku4uk" sourceRef="ServiceTask_120p27h" targetRef="ExclusiveGateway_0tuxj9l" /> @@ -88,7 +88,7 @@ <bpmn2:outgoing>SequenceFlow_1az3a2q</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0y1by9x" name="Yes" sourceRef="ExclusiveGateway_18ndby1" targetRef="IntermediateThrowEvent_040yoan"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("backout") == true }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("backout") == true }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_1az3a2q" name="No" sourceRef="ExclusiveGateway_18ndby1" targetRef="buildError" /> </bpmn2:subProcess> @@ -109,226 +109,226 @@ <bpmn2:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> <bpmn2:message id="Message_1" name="WorkflowMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="vnfAdapterTask"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="openstackAdapterTask"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_54" bpmnElement="StartEvent_1"> - <dc:Bounds x="110" y="146" width="36" height="36" /> + <dc:Bounds x="160" y="146" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="116" y="187" width="24" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_StartEvent_54" targetElement="ServiceTask_0rcy900_di"> - <di:waypoint xsi:type="dc:Point" x="146" y="164" /> - <di:waypoint xsi:type="dc:Point" x="253" y="163" /> + <di:waypoint x="196" y="164" /> + <di:waypoint x="303" y="163" /> <bpmndi:BPMNLabel> <dc:Bounds x="154.5" y="145.5" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_158" bpmnElement="EndEvent_6"> - <dc:Bounds x="929" y="146" width="36" height="36" /> + <dc:Bounds x="979" y="146" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="924" y="187" width="46" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0rcy900_di" bpmnElement="executeOpenstackAction"> - <dc:Bounds x="253" y="124" width="100" height="80" /> + <dc:Bounds x="303" y="124" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1ff2y8j_di" bpmnElement="SequenceFlow_1ff2y8j"> - <di:waypoint xsi:type="dc:Point" x="353" y="164" /> - <di:waypoint xsi:type="dc:Point" x="404" y="164" /> + <di:waypoint x="403" y="164" /> + <di:waypoint x="454" y="164" /> <bpmndi:BPMNLabel> <dc:Bounds x="333.5" y="139" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_11iuzx9_di" bpmnElement="ServiceTask_11iuzx9"> - <dc:Bounds x="541" y="124" width="100" height="80" /> + <dc:Bounds x="591" y="124" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0ecut35_di" bpmnElement="SequenceFlow_0ecut35"> - <di:waypoint xsi:type="dc:Point" x="641" y="164" /> - <di:waypoint xsi:type="dc:Point" x="676" y="164" /> + <di:waypoint x="691" y="164" /> + <di:waypoint x="726" y="164" /> <bpmndi:BPMNLabel> <dc:Bounds x="613.5" y="139" width="90" height="20" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1fn953y_di" bpmnElement="ExclusiveGateway_1fn953y" isMarkerVisible="true"> - <dc:Bounds x="676" y="139" width="50" height="50" /> + <dc:Bounds x="726" y="139" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="676" y="119" width="49" height="12" /> + <dc:Bounds x="727" y="119" width="48" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_13uy51h_di" bpmnElement="SequenceFlow_13uy51h"> - <di:waypoint xsi:type="dc:Point" x="726" y="164" /> - <di:waypoint xsi:type="dc:Point" x="929" y="164" /> + <di:waypoint x="776" y="164" /> + <di:waypoint x="979" y="164" /> <bpmndi:BPMNLabel> - <dc:Bounds x="746.6875" y="166" width="19" height="12" /> + <dc:Bounds x="797" y="166" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0o8wnkx_di" bpmnElement="SequenceFlow_0o8wnkx"> - <di:waypoint xsi:type="dc:Point" x="701" y="189" /> - <di:waypoint xsi:type="dc:Point" x="701" y="249" /> + <di:waypoint x="751" y="189" /> + <di:waypoint x="751" y="249" /> <bpmndi:BPMNLabel> - <dc:Bounds x="706" y="198" width="14" height="12" /> + <dc:Bounds x="756" y="198" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_120p27h_di" bpmnElement="ServiceTask_120p27h"> - <dc:Bounds x="496" y="443" width="100" height="80" /> + <dc:Bounds x="546" y="443" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_08a6you_di" bpmnElement="ExclusiveGateway_08a6you" isMarkerVisible="true"> - <dc:Bounds x="404" y="139" width="50" height="50" /> + <dc:Bounds x="454" y="139" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="409" y="117" width="49" height="12" /> + <dc:Bounds x="460" y="117" width="48" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1p39f4r_di" bpmnElement="SequenceFlow_1p39f4r"> - <di:waypoint xsi:type="dc:Point" x="454" y="164" /> - <di:waypoint xsi:type="dc:Point" x="541" y="164" /> + <di:waypoint x="504" y="164" /> + <di:waypoint x="591" y="164" /> <bpmndi:BPMNLabel> - <dc:Bounds x="472" y="168" width="19" height="12" /> + <dc:Bounds x="523" y="168" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_007m32h_di" bpmnElement="SequenceFlow_007m32h"> - <di:waypoint xsi:type="dc:Point" x="429" y="189" /> - <di:waypoint xsi:type="dc:Point" x="429" y="249" /> + <di:waypoint x="479" y="189" /> + <di:waypoint x="479" y="249" /> <bpmndi:BPMNLabel> - <dc:Bounds x="435" y="198" width="14" height="12" /> + <dc:Bounds x="485" y="198" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="SubProcess_09bkjg0_di" bpmnElement="SubProcess_0y17e8j" isExpanded="true"> - <dc:Bounds x="151" y="404" width="787" height="344" /> + <dc:Bounds x="201" y="404" width="787" height="344" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="BoundaryEvent_04c5efr_di" bpmnElement="BoundaryEvent_1ysr7mk"> - <dc:Bounds x="335" y="186" width="36" height="36" /> + <dc:Bounds x="385" y="186" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="353" y="226" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Association_1cnlu6p_di" bpmnElement="Association_1cnlu6p"> - <di:waypoint xsi:type="dc:Point" x="353" y="222" /> - <di:waypoint xsi:type="dc:Point" x="353" y="267" /> - <di:waypoint xsi:type="dc:Point" x="321" y="267" /> + <di:waypoint x="403" y="222" /> + <di:waypoint x="403" y="267" /> + <di:waypoint x="371" y="267" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0vacscp_di" bpmnElement="Task_0zbd85n"> - <dc:Bounds x="221" y="227" width="100" height="80" /> + <dc:Bounds x="271" y="227" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0lzcn0v_di" bpmnElement="EndEvent_0rxprkw"> - <dc:Bounds x="411" y="249" width="36" height="36" /> + <dc:Bounds x="461" y="249" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="429" y="288.658" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_14424k5_di" bpmnElement="EndEvent_1dt01ez"> - <dc:Bounds x="683" y="249" width="36" height="36" /> + <dc:Bounds x="733" y="249" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="701" y="288.658" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_1wrpebh_di" bpmnElement="StartEvent_17oglfe"> - <dc:Bounds x="181" y="599" width="36" height="36" /> + <dc:Bounds x="231" y="599" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="198.35199999999998" y="638.658" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateThrowEvent_0gltuh4_di" bpmnElement="IntermediateThrowEvent_040yoan"> - <dc:Bounds x="365" y="529" width="36" height="36" /> + <dc:Bounds x="415" y="529" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="382.352" y="569" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_0qlnby0_di" bpmnElement="ExclusiveGateway_0qlnby0" isMarkerVisible="true"> - <dc:Bounds x="429.352" y="522" width="50" height="50" /> + <dc:Bounds x="479" y="522" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="484" y="535" width="62" height="24" /> + <dc:Bounds x="533" y="535" width="65" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_02rhau9_di" bpmnElement="SequenceFlow_02rhau9"> - <di:waypoint xsi:type="dc:Point" x="217" y="617" /> - <di:waypoint xsi:type="dc:Point" x="284" y="617" /> + <di:waypoint x="267" y="617" /> + <di:waypoint x="334" y="617" /> <bpmndi:BPMNLabel> <dc:Bounds x="250.5" y="596" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_006myq9_di" bpmnElement="SequenceFlow_006myq9"> - <di:waypoint xsi:type="dc:Point" x="401" y="547" /> - <di:waypoint xsi:type="dc:Point" x="429" y="547" /> + <di:waypoint x="451" y="547" /> + <di:waypoint x="479" y="547" /> <bpmndi:BPMNLabel> <dc:Bounds x="415" y="526" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_0tuxj9l_di" bpmnElement="ExclusiveGateway_0tuxj9l" isMarkerVisible="true"> - <dc:Bounds x="608.352" y="522" width="50" height="50" /> + <dc:Bounds x="658" y="522" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="633.352" y="576" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_108cgfw_di" bpmnElement="buildError"> - <dc:Bounds x="695" y="577" width="100" height="80" /> + <dc:Bounds x="745" y="577" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1ubla93_di" bpmnElement="SequenceFlow_1ubla93"> - <di:waypoint xsi:type="dc:Point" x="454" y="522" /> - <di:waypoint xsi:type="dc:Point" x="454" y="483" /> - <di:waypoint xsi:type="dc:Point" x="496" y="483" /> + <di:waypoint x="504" y="522" /> + <di:waypoint x="504" y="483" /> + <di:waypoint x="546" y="483" /> <bpmndi:BPMNLabel> - <dc:Bounds x="461" y="489" width="19" height="12" /> + <dc:Bounds x="512" y="489" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1piwh1c_di" bpmnElement="SequenceFlow_1piwh1c"> - <di:waypoint xsi:type="dc:Point" x="454" y="572" /> - <di:waypoint xsi:type="dc:Point" x="454" y="603" /> - <di:waypoint xsi:type="dc:Point" x="633" y="603" /> - <di:waypoint xsi:type="dc:Point" x="633" y="572" /> + <di:waypoint x="504" y="572" /> + <di:waypoint x="504" y="603" /> + <di:waypoint x="683" y="603" /> + <di:waypoint x="683" y="572" /> <bpmndi:BPMNLabel> - <dc:Bounds x="460" y="576.85" width="14" height="12" /> + <dc:Bounds x="510" y="577" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1nku4uk_di" bpmnElement="SequenceFlow_1nku4uk"> - <di:waypoint xsi:type="dc:Point" x="596" y="483" /> - <di:waypoint xsi:type="dc:Point" x="633" y="483" /> - <di:waypoint xsi:type="dc:Point" x="633" y="522" /> + <di:waypoint x="646" y="483" /> + <di:waypoint x="683" y="483" /> + <di:waypoint x="683" y="522" /> <bpmndi:BPMNLabel> <dc:Bounds x="614.5" y="462" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1yx80cq_di" bpmnElement="SequenceFlow_1yx80cq"> - <di:waypoint xsi:type="dc:Point" x="658" y="547" /> - <di:waypoint xsi:type="dc:Point" x="745" y="547" /> - <di:waypoint xsi:type="dc:Point" x="745" y="577" /> + <di:waypoint x="708" y="547" /> + <di:waypoint x="795" y="547" /> + <di:waypoint x="795" y="577" /> <bpmndi:BPMNLabel> <dc:Bounds x="656.5" y="526" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0bnzfqb_di" bpmnElement="SequenceFlow_0bnzfqb"> - <di:waypoint xsi:type="dc:Point" x="795" y="617" /> - <di:waypoint xsi:type="dc:Point" x="870" y="617" /> + <di:waypoint x="845" y="617" /> + <di:waypoint x="920" y="617" /> <bpmndi:BPMNLabel> <dc:Bounds x="787.5" y="596" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_1l1f6zj_di" bpmnElement="EndEvent_1yiy2fi"> - <dc:Bounds x="870" y="599" width="36" height="36" /> + <dc:Bounds x="920" y="599" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="887.352" y="639" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_18ndby1_di" bpmnElement="ExclusiveGateway_18ndby1" isMarkerVisible="true"> - <dc:Bounds x="284.352" y="592" width="50" height="50" /> + <dc:Bounds x="334" y="592" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="338" y="605" width="54" height="24" /> + <dc:Bounds x="388" y="605" width="54" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0y1by9x_di" bpmnElement="SequenceFlow_0y1by9x"> - <di:waypoint xsi:type="dc:Point" x="309" y="592" /> - <di:waypoint xsi:type="dc:Point" x="309" y="547" /> - <di:waypoint xsi:type="dc:Point" x="365" y="547" /> + <di:waypoint x="359" y="592" /> + <di:waypoint x="359" y="547" /> + <di:waypoint x="415" y="547" /> <bpmndi:BPMNLabel> - <dc:Bounds x="315" y="558" width="19" height="12" /> + <dc:Bounds x="366" y="558" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1az3a2q_di" bpmnElement="SequenceFlow_1az3a2q"> - <di:waypoint xsi:type="dc:Point" x="309" y="642" /> - <di:waypoint xsi:type="dc:Point" x="309" y="686" /> - <di:waypoint xsi:type="dc:Point" x="745" y="686" /> - <di:waypoint xsi:type="dc:Point" x="745" y="657" /> + <di:waypoint x="359" y="642" /> + <di:waypoint x="359" y="686" /> + <di:waypoint x="795" y="686" /> + <di:waypoint x="795" y="657" /> <bpmndi:BPMNLabel> - <dc:Bounds x="318" y="657" width="14" height="12" /> + <dc:Bounds x="368" y="657" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterRestV1.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterRestV1.bpmn deleted file mode 100644 index db93df9f09..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterRestV1.bpmn +++ /dev/null @@ -1,441 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" id="_GraPIIyxEeWmdMDkx6Uftw" exporter="camunda modeler" exporterVersion="2.7.0" targetNamespace="http://camunda.org/schema/1.0/bpmn"> - <bpmn2:process id="vnfAdapterRestV1" name="vnfAdapterRestV1" isExecutable="true"> - <bpmn2:scriptTask id="ScriptTask_2" name="Log Response" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* -def vnfAdapterRestV1 = new VnfAdapterRestV1() -def statusCode = execution.getVariable('VNFREST_vnfAdapterStatusCode') -String response = String.valueOf(execution.getVariable('VNFREST_vnfAdapterResponse')) -def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') -def processKey = vnfAdapterRestV1.getProcessKey(execution) -vnfAdapterRestV1.getLogger().debug("{} received response from VnfAdapter: statusCode= {} response={}", processKey, statusCode, (response.isEmpty() ? "" : "\n" + response))]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:scriptTask id="ScriptTask_3" name="Workflow Exception (no connection)"> - <bpmn2:incoming>SequenceFlow_17</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_35</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* -def exceptionUtil = new ExceptionUtil() -exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Failed to communicate with VnfAdapter")]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:scriptTask id="ScriptTask_4" name="Workflow Exception (bad response)" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_36</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* - -String res = execution.getVariable(VNFREST_vnfAdapterResponse) - -def vnfAdapterRestV1 = new VnfAdapterRestV1() -vnfAdapterRestV1.vnfAdapterWorkflowException(execution, res)]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_14" name="" sourceRef="ScriptTask_2" targetRef="ExclusiveGateway_1"/> - <bpmn2:exclusiveGateway id="ExclusiveGateway_1" default="SequenceFlow_23"> - <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_17</bpmn2:outgoing> - <bpmn2:outgoing>SequenceFlow_23</bpmn2:outgoing> - <bpmn2:outgoing>SequenceFlow_24</bpmn2:outgoing> - </bpmn2:exclusiveGateway> - <bpmn2:sequenceFlow id="SequenceFlow_17" name="404" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_3"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("VNFREST_vnfAdapterStatusCode") == '404'}]]></bpmn2:conditionExpression> - </bpmn2:sequenceFlow> - <bpmn2:sequenceFlow id="SequenceFlow_23" name="other" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_4"/> - <bpmn2:sequenceFlow id="SequenceFlow_24" name="2xx" sourceRef="ExclusiveGateway_1" targetRef="waitForAsyncMessage"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("VNFREST_vnfAdapterStatusCode") == '200' || execution.getVariable("VNFREST_vnfAdapterStatusCode") == '202'}]]></bpmn2:conditionExpression> - </bpmn2:sequenceFlow> - <bpmn2:boundaryEvent id="BoundaryEvent_1" name="Timeout" attachedToRef="waitForAsyncMessage"> - <bpmn2:outgoing>SequenceFlow_27</bpmn2:outgoing> - <bpmn2:timerEventDefinition id="TimerEventDefinition_1"> - <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression"><![CDATA[${UrnPropertiesReader.getVariable("mso.po.timeout", execution)}]]></bpmn2:timeDuration> - </bpmn2:timerEventDefinition> - </bpmn2:boundaryEvent> - <bpmn2:subProcess id="waitForAsyncMessage" name="Wait for Callback"> - <bpmn2:incoming>SequenceFlow_24</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_28</bpmn2:outgoing> - <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1" name="Catch Event"> - <bpmn2:incoming>SequenceFlow_25</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_26</bpmn2:outgoing> - <bpmn2:messageEventDefinition id="MessageEventDefinition_1" messageRef="Message_1"/> - </bpmn2:intermediateCatchEvent> - <bpmn2:sequenceFlow id="SequenceFlow_26" name="" sourceRef="IntermediateCatchEvent_1" targetRef="EndEvent_2"/> - <bpmn2:startEvent id="StartEvent_3"> - <bpmn2:outgoing>SequenceFlow_25</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:sequenceFlow id="SequenceFlow_25" name="" sourceRef="StartEvent_3" targetRef="IntermediateCatchEvent_1"/> - <bpmn2:endEvent id="EndEvent_2"> - <bpmn2:incoming>SequenceFlow_26</bpmn2:incoming> - </bpmn2:endEvent> - </bpmn2:subProcess> - <bpmn2:sequenceFlow id="SequenceFlow_27" name="" sourceRef="BoundaryEvent_1" targetRef="ScriptTask_5"/> - <bpmn2:scriptTask id="ScriptTask_5" name="Workflow Exception (timeout)" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_27</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_34</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* -def exceptionUtil = new ExceptionUtil() -exceptionUtil.buildAndThrowWorkflowException(execution, 7010, "VnfAdapter Callback Timeout Error")]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_28" name="" sourceRef="waitForAsyncMessage" targetRef="ScriptTask_6"/> - <bpmn2:scriptTask id="ScriptTask_6" name="Process Callback" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_28</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_33</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* -def vnfAdapterRestV1 = new VnfAdapterRestV1() -vnfAdapterRestV1.processCallback(execution) -]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_33" name="" sourceRef="ScriptTask_6" targetRef="ExclusiveGateway_2"/> - <bpmn2:sequenceFlow id="SequenceFlow_34" name="" sourceRef="ScriptTask_5" targetRef="EndEvent_8"/> - <bpmn2:endEvent id="EndEvent_8"> - <bpmn2:incoming>SequenceFlow_34</bpmn2:incoming> - <bpmn2:errorEventDefinition id="_ErrorEventDefinition_21" errorRef="Error_1"/> - </bpmn2:endEvent> - <bpmn2:sequenceFlow id="SequenceFlow_35" name="" sourceRef="ScriptTask_3" targetRef="EndEvent_9"/> - <bpmn2:endEvent id="EndEvent_9"> - <bpmn2:incoming>SequenceFlow_35</bpmn2:incoming> - <bpmn2:errorEventDefinition id="_ErrorEventDefinition_22" errorRef="Error_1"/> - </bpmn2:endEvent> - <bpmn2:endEvent id="EndEvent_10"> - <bpmn2:incoming>SequenceFlow_36</bpmn2:incoming> - <bpmn2:errorEventDefinition id="_ErrorEventDefinition_23" errorRef="Error_1"/> - </bpmn2:endEvent> - <bpmn2:sequenceFlow id="SequenceFlow_36" name="" sourceRef="ScriptTask_4" targetRef="EndEvent_10"/> - <bpmn2:endEvent id="EndEvent_7"> - <bpmn2:incoming>SequenceFlow_32</bpmn2:incoming> - <bpmn2:errorEventDefinition id="_ErrorEventDefinition_20" errorRef="Error_1"/> - </bpmn2:endEvent> - <bpmn2:exclusiveGateway id="ExclusiveGateway_2" name="Callback
Exception?" default="SequenceFlow_31"> - <bpmn2:incoming>SequenceFlow_33</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_31</bpmn2:outgoing> - <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing> - </bpmn2:exclusiveGateway> - <bpmn2:sequenceFlow id="SequenceFlow_31" name="no" sourceRef="ExclusiveGateway_2" targetRef="ScriptTask_setSuccess"/> - <bpmn2:sequenceFlow id="SequenceFlow_32" name="yes" sourceRef="ExclusiveGateway_2" targetRef="EndEvent_7"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("WorkflowException") != null}]]></bpmn2:conditionExpression> - </bpmn2:sequenceFlow> - <bpmn2:scriptTask id="ScriptTask_setSuccess" name="Set Success Indicator" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_31</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* -def vnfAdapterRestV1 = new VnfAdapterRestV1() -vnfAdapterRestV1.setSuccessIndicator(execution, true)]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="ScriptTask_setSuccess" targetRef="EndEvent_6"/> - <bpmn2:endEvent id="EndEvent_6" name="End Flow"> - <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> - </bpmn2:endEvent> - <bpmn2:scriptTask id="ScriptTask_7" name="Send Request to Vnf Adapter" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* -def vnfAdapterRestV1 = new VnfAdapterRestV1() -vnfAdapterRestV1.sendRequestToVnfAdapter(execution)]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_3" name="" sourceRef="ScriptTask_7" targetRef="ScriptTask_2"/> - <bpmn2:subProcess id="SubProcess_1" name="Error Handling Sub Process" triggeredByEvent="true"> - <bpmn2:scriptTask id="ScriptTask_8" name="Process Error" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* -def exUtil = new ExceptionUtil() -exUtil.processSubflowsBPMNException(execution) -]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="ScriptTask_8" targetRef="EndEvent_1"/> - <bpmn2:endEvent id="EndEvent_1"> - <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming> - </bpmn2:endEvent> - <bpmn2:startEvent id="StartEvent_2"> - <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> - <bpmn2:errorEventDefinition id="_ErrorEventDefinition_89"/> - </bpmn2:startEvent> - <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="StartEvent_2" targetRef="ScriptTask_8"/> - </bpmn2:subProcess> - <bpmn2:scriptTask id="ScriptTask_1" name="Pre-Process Request" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* -def vnfAdapterRestV1 = new VnfAdapterRestV1() -vnfAdapterRestV1.preProcessRequest(execution) -]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="ScriptTask_1" targetRef="ScriptTask_7"/> - <bpmn2:startEvent id="StartEvent_1" name="Start"> - <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing> - </bpmn2:startEvent> - <bpmn2:sequenceFlow id="SequenceFlow_9" name="" sourceRef="StartEvent_1" targetRef="ScriptTask_1"/> - </bpmn2:process> - <bpmn2:error id="Error_1" errorCode="MSOWorkflowException" name="MSO Workflow Exception"/> - <bpmn2:message id="Message_1" name="WorkflowMessage"/> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="vnfAdapterRestV1"> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_56" bpmnElement="ScriptTask_1"> - <dc:Bounds height="80.0" width="100.0" x="204.0" y="148.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_SubProcess_14" bpmnElement="waitForAsyncMessage" isExpanded="true"> - <dc:Bounds height="154.0" width="265.0" x="744.0" y="275.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_58" bpmnElement="ScriptTask_6"> - <dc:Bounds height="80.0" width="100.0" x="1046.0" y="311.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_59" bpmnElement="ScriptTask_5"> - <dc:Bounds height="80.0" width="100.0" x="827.0" y="492.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_24" bpmnElement="BoundaryEvent_1"> - <dc:Bounds height="36.0" width="36.0" x="859.0" y="411.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="52.0" x="894.0" y="441.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_IntermediateCatchEvent_20" bpmnElement="IntermediateCatchEvent_1"> - <dc:Bounds height="36.0" width="36.0" x="863.0" y="330.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="76.0" x="843.0" y="371.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_78" bpmnElement="ScriptTask_4"> - <dc:Bounds height="80.0" width="97.0" x="744.0" y="148.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_79" bpmnElement="ScriptTask_2"> - <dc:Bounds height="80.0" width="100.0" x="492.0" y="148.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_54" bpmnElement="StartEvent_1"> - <dc:Bounds height="36.0" width="36.0" x="84.0" y="170.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="34.0" x="85.0" y="211.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_168" bpmnElement="ScriptTask_3"> - <dc:Bounds height="80.0" width="97.0" x="744.0" y="24.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_StartEvent_54" targetElement="_BPMNShape_ScriptTask_56"> - <di:waypoint xsi:type="dc:Point" x="120.0" y="188.0"/> - <di:waypoint xsi:type="dc:Point" x="204.0" y="188.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="130.0" y="188.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_105" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true"> - <dc:Bounds height="50.0" width="50.0" x="624.0" y="162.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="649.0" y="217.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_79" targetElement="_BPMNShape_ExclusiveGateway_105"> - <di:waypoint xsi:type="dc:Point" x="592.0" y="188.0"/> - <di:waypoint xsi:type="dc:Point" x="624.0" y="187.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="611.0" y="187.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_17" sourceElement="_BPMNShape_ExclusiveGateway_105" targetElement="_BPMNShape_ScriptTask_168"> - <di:waypoint xsi:type="dc:Point" x="649.0" y="162.0"/> - <di:waypoint xsi:type="dc:Point" x="649.0" y="64.0"/> - <di:waypoint xsi:type="dc:Point" x="744.0" y="64.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="27.0" x="688.0" y="64.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_ExclusiveGateway_105" targetElement="_BPMNShape_ScriptTask_78"> - <di:waypoint xsi:type="dc:Point" x="674.0" y="187.0"/> - <di:waypoint xsi:type="dc:Point" x="709.0" y="187.0"/> - <di:waypoint xsi:type="dc:Point" x="709.0" y="188.0"/> - <di:waypoint xsi:type="dc:Point" x="744.0" y="188.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="35.0" x="684.0" y="188.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_25" bpmnElement="SequenceFlow_24" sourceElement="_BPMNShape_ExclusiveGateway_105" targetElement="_BPMNShape_SubProcess_14"> - <di:waypoint xsi:type="dc:Point" x="649.0" y="212.0"/> - <di:waypoint xsi:type="dc:Point" x="649.0" y="353.0"/> - <di:waypoint xsi:type="dc:Point" x="708.0" y="353.0"/> - <di:waypoint xsi:type="dc:Point" x="744.0" y="353.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="27.0" x="688.0" y="328.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_55" bpmnElement="StartEvent_3"> - <dc:Bounds height="36.0" width="36.0" x="768.0" y="330.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="786.0" y="371.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_27" bpmnElement="SequenceFlow_25" sourceElement="_BPMNShape_StartEvent_55" targetElement="_BPMNShape_IntermediateCatchEvent_20"> - <di:waypoint xsi:type="dc:Point" x="804.0" y="348.0"/> - <di:waypoint xsi:type="dc:Point" x="863.0" y="348.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="833.0" y="348.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_156" bpmnElement="EndEvent_2"> - <dc:Bounds height="36.0" width="36.0" x="948.0" y="330.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="966.0" y="371.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_26" sourceElement="_BPMNShape_IntermediateCatchEvent_20" targetElement="_BPMNShape_EndEvent_156"> - <di:waypoint xsi:type="dc:Point" x="899.0" y="348.0"/> - <di:waypoint xsi:type="dc:Point" x="929.0" y="348.0"/> - <di:waypoint xsi:type="dc:Point" x="929.0" y="347.0"/> - <di:waypoint xsi:type="dc:Point" x="948.0" y="348.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="926.0" y="348.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_27" sourceElement="_BPMNShape_BoundaryEvent_24" targetElement="_BPMNShape_ScriptTask_59"> - <di:waypoint xsi:type="dc:Point" x="877.0" y="447.0"/> - <di:waypoint xsi:type="dc:Point" x="877.0" y="492.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="874.0" y="472.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_30" bpmnElement="SequenceFlow_28" sourceElement="_BPMNShape_SubProcess_14" targetElement="_BPMNShape_ScriptTask_58"> - <di:waypoint xsi:type="dc:Point" x="1008.0" y="351.0"/> - <di:waypoint xsi:type="dc:Point" x="1046.0" y="351.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="1023.0" y="351.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_106" bpmnElement="ExclusiveGateway_2" isMarkerVisible="true"> - <dc:Bounds height="50.0" width="50.0" x="1188.0" y="325.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="38.0" width="71.0" x="1179.0" y="288.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_158" bpmnElement="EndEvent_6"> - <dc:Bounds height="36.0" width="36.0" x="1463.0" y="333.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="60.0" x="1451.0" y="374.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_33" bpmnElement="SequenceFlow_31" sourceElement="_BPMNShape_ExclusiveGateway_106" targetElement="_BPMNShape_ScriptTask_236"> - <di:waypoint xsi:type="dc:Point" x="1238.0" y="350.0"/> - <di:waypoint xsi:type="dc:Point" x="1308.0" y="350.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="20.0" x="1248.0" y="350.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_159" bpmnElement="EndEvent_7"> - <dc:Bounds height="36.0" width="36.0" x="1196.0" y="426.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="1214.0" y="467.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_34" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ExclusiveGateway_106" targetElement="_BPMNShape_EndEvent_159"> - <di:waypoint xsi:type="dc:Point" x="1213.0" y="375.0"/> - <di:waypoint xsi:type="dc:Point" x="1213.0" y="392.0"/> - <di:waypoint xsi:type="dc:Point" x="1214.0" y="392.0"/> - <di:waypoint xsi:type="dc:Point" x="1214.0" y="426.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="22.0" width="27.0" x="1223.0" y="390.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_33" sourceElement="_BPMNShape_ScriptTask_58" targetElement="_BPMNShape_ExclusiveGateway_106"> - <di:waypoint xsi:type="dc:Point" x="1146.0" y="351.0"/> - <di:waypoint xsi:type="dc:Point" x="1173.0" y="351.0"/> - <di:waypoint xsi:type="dc:Point" x="1173.0" y="350.0"/> - <di:waypoint xsi:type="dc:Point" x="1188.0" y="350.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="1170.0" y="350.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_160" bpmnElement="EndEvent_8"> - <dc:Bounds height="36.0" width="36.0" x="974.0" y="514.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="992.0" y="555.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_36" bpmnElement="SequenceFlow_34" sourceElement="_BPMNShape_ScriptTask_59" targetElement="_BPMNShape_EndEvent_160"> - <di:waypoint xsi:type="dc:Point" x="927.0" y="532.0"/> - <di:waypoint xsi:type="dc:Point" x="974.0" y="532.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="951.0" y="532.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_161" bpmnElement="EndEvent_9"> - <dc:Bounds height="36.0" width="36.0" x="891.0" y="46.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="909.0" y="87.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_37" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_ScriptTask_168" targetElement="_BPMNShape_EndEvent_161"> - <di:waypoint xsi:type="dc:Point" x="840.0" y="64.0"/> - <di:waypoint xsi:type="dc:Point" x="891.0" y="64.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="865.0" y="64.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_162" bpmnElement="EndEvent_10"> - <dc:Bounds height="36.0" width="36.0" x="892.0" y="170.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="910.0" y="211.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_38" bpmnElement="SequenceFlow_36" sourceElement="_BPMNShape_ScriptTask_78" targetElement="_BPMNShape_EndEvent_162"> - <di:waypoint xsi:type="dc:Point" x="840.0" y="188.0"/> - <di:waypoint xsi:type="dc:Point" x="892.0" y="188.0"/> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_236" bpmnElement="ScriptTask_setSuccess"> - <dc:Bounds height="83.0" width="97.0" x="1308.0" y="309.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_ScriptTask_236" targetElement="_BPMNShape_EndEvent_158"> - <di:waypoint xsi:type="dc:Point" x="1404.0" y="350.0"/> - <di:waypoint xsi:type="dc:Point" x="1422.0" y="350.0"/> - <di:waypoint xsi:type="dc:Point" x="1422.0" y="351.0"/> - <di:waypoint xsi:type="dc:Point" x="1463.0" y="351.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="1419.0" y="351.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_237" bpmnElement="ScriptTask_7"> - <dc:Bounds height="83.0" width="97.0" x="360.0" y="146.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_56" targetElement="_BPMNShape_ScriptTask_237"> - <di:waypoint xsi:type="dc:Point" x="304.0" y="188.0"/> - <di:waypoint xsi:type="dc:Point" x="344.0" y="188.0"/> - <di:waypoint xsi:type="dc:Point" x="344.0" y="187.0"/> - <di:waypoint xsi:type="dc:Point" x="360.0" y="187.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="317.0" y="188.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_3" sourceElement="_BPMNShape_ScriptTask_237" targetElement="_BPMNShape_ScriptTask_79"> - <di:waypoint xsi:type="dc:Point" x="456.0" y="187.0"/> - <di:waypoint xsi:type="dc:Point" x="474.0" y="187.0"/> - <di:waypoint xsi:type="dc:Point" x="474.0" y="188.0"/> - <di:waypoint xsi:type="dc:Point" x="492.0" y="188.0"/> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_SubProcess_24" bpmnElement="SubProcess_1" isExpanded="true"> - <dc:Bounds height="181.0" width="382.0" x="180.0" y="532.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_66" bpmnElement="StartEvent_2"> - <dc:Bounds height="36.0" width="36.0" x="225.0" y="605.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="243.0" y="646.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_207" bpmnElement="EndEvent_1"> - <dc:Bounds height="36.0" width="36.0" x="477.0" y="605.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="0.0" width="0.0" x="495.0" y="646.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_266" bpmnElement="ScriptTask_8"> - <dc:Bounds height="83.0" width="97.0" x="323.0" y="581.0"/> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_StartEvent_66" targetElement="_BPMNShape_ScriptTask_266"> - <di:waypoint xsi:type="dc:Point" x="261.0" y="623.0"/> - <di:waypoint xsi:type="dc:Point" x="323.0" y="622.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="273.0" y="623.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_266" targetElement="_BPMNShape_EndEvent_207"> - <di:waypoint xsi:type="dc:Point" x="419.0" y="622.0"/> - <di:waypoint xsi:type="dc:Point" x="477.0" y="623.0"/> - <bpmndi:BPMNLabel> - <dc:Bounds height="6.0" width="6.0" x="445.0" y="623.0"/> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn2:definitions>
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy index 59b34c4074..79b40ba385 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy @@ -57,9 +57,10 @@ abstract class MsoGroovyTest { protected static final String CLOUD_OWNER = Defaults.CLOUD_OWNER.toString(); protected void init(String procName){ - mockExecution = setupMock(procName) - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + // mockExecution = setupMock(procName) + // when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") client = mock(AAIResourcesClient.class) + mockExecution = mock(ExecutionEntity.class) } protected ExecutionEntity setupMock(String procName) { diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy index 99b178c044..39aadd29d7 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy @@ -25,7 +25,7 @@ import org.junit.rules.ExpectedException import static org.mockito.Mockito.* import javax.ws.rs.NotFoundException - +import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.junit.Before @@ -57,6 +57,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { void init() throws IOException { super.init("UpdateAAIVfModule") when(updateAAIVfModule.getAAIClient()).thenReturn(client) + mockExecution = setupMock("UpdateAAIVfModule") } @Test @@ -110,7 +111,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { when(mockExecution.getVariable(prefix + "getVfModuleResponse")).thenReturn(vfModule) doNothing().when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) updateAAIVfModule.updateVfModule(mockExecution) - verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 200) + verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 200) } @Test @@ -126,7 +127,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { doThrow(new NotFoundException("Vf Module not found")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) thrown.expect(BpmnError.class) updateAAIVfModule.updateVfModule(mockExecution) - verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 404) + verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 404) } @@ -143,7 +144,6 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { doThrow(new IllegalStateException("Error in AAI client")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) thrown.expect(BpmnError.class) updateAAIVfModule.updateVfModule(mockExecution) - verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 500) - + verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 500) } } diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1Test.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1Test.groovy deleted file mode 100644 index 75ddca5e98..0000000000 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1Test.groovy +++ /dev/null @@ -1,135 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.common.scripts - -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.junit.Before -import org.junit.Test -import org.junit.runner.RunWith -import org.mockito.MockitoAnnotations -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.mockito.runners.MockitoJUnitRunner -import org.onap.so.bpmn.mock.FileUtil - -import static org.mockito.Mockito.* -import static org.junit.Assert.*; - -@RunWith(MockitoJUnitRunner.class) -public class VnfAdapterRestV1Test { - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - - @Test - public void testPreProcessRequest() { - - String sdncAdapterWorkflowRequest = FileUtil.readResourceFile("__files/vnfAdapterMocks/vnfadapter_request.xml"); - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - when(mockExecution.getVariable("prefix")).thenReturn("VNFREST_") - when(mockExecution.getVariable("mso-request-id")).thenReturn("testMsoRequestId") - when(mockExecution.getVariable("VNFREST_Request")).thenReturn(sdncAdapterWorkflowRequest) - when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C") - when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - - when(mockExecution.getVariable("mso.adapters.vnf.rest.endpoint")).thenReturn("http://localhost:18080/vnfs/rest/v1/vnfs") - - when(mockExecution.getVariable("mso.adapters.sdnc.timeout")).thenReturn("PT5M") - - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("testProcessKey")).thenReturn("testProcessKey") - - - VnfAdapterRestV1 vnfAdapterRestV1 = new VnfAdapterRestV1() - vnfAdapterRestV1.preProcessRequest(mockExecution) - - MockitoDebuggerImpl debugger = new MockitoDebuggerImpl() - //debugger.printInvocations(mockExecution) - - - verify(mockExecution).setVariable("prefix","VNFREST_") - - verify(mockExecution).setVariable("VNFREST_SuccessIndicator",false) - verify(mockExecution).setVariable("VNFREST_requestType","createVfModuleRequest") - verify(mockExecution).setVariable("VNFAResponse_CORRELATOR","8892cffa-3514-45d4-b2b0-0fde9a96e323-1511813289000") - verify(mockExecution).setVariable("VNFREST_vnfAdapterMethod","POST") - verify(mockExecution).setVariable("VNFREST_notificationUrl","http://localhost:18080/mso/WorkflowMessage/VNFAResponse/8892cffa-3514-45d4-b2b0-0fde9a96e323-1511813289000") - verify(mockExecution).setVariable("VNFREST_vnfAdapterUrl","http://localhost:18080/vnfs/rest/v1/vnfs/6d2e2469-8708-47c3-a0d4-73fa28a8a50b/vf-modules") - - } - - String rollbackReq = """ -<rollbackVolumeGroupRequest> - <volumeGroupRollback> - <volumeGroupId>8a07b246-155e-4b08-b56e-76e98a3c2d66</volumeGroupId> - <volumeGroupStackId>phmaz401me6-vpevre-VOLUMEGROUP/dbd560b6-b03f-4a17-92e7-8942459a60c1</volumeGroupStackId> - <cloudSiteId>mtrnj1b</cloudSiteId> - <cloudOwnerId>CloudOwner</cloudOwnerId> - <tenantId>cfb5e0a790374c9a98a1c0d2044206a7</tenantId> - <volumeGroupCreated>true</volumeGroupCreated> - <msoRequest> - <requestId>1e1a72ca-7300-4ac4-b718-30351f3b6845</requestId> - <serviceInstanceId>15eb2c68-f771-4030-b185-cff179fdad44</serviceInstanceId> - </msoRequest> - <messageId>683ca1ac-2145-4a00-9484-20d48bd701aa</messageId> - </volumeGroupRollback> - <skipAAI>true</skipAAI> - <notificationUrl>http://localhost:8080/mso/WorkflowMessage/VNFAResponse/683ca1ac-2145-4a00-9484-20d48bd701aa</notificationUrl> -</rollbackVolumeGroupRequest> -""" - - @Test - public void testGetVolumeGroupId() { - Node root = new XmlParser().parseText(rollbackReq) - VnfAdapterRestV1 vnfAdapterRestV1 = new VnfAdapterRestV1() - def volGrpId = vnfAdapterRestV1.getVolumeGroupIdFromRollbackRequest(root) - assertEquals('8a07b246-155e-4b08-b56e-76e98a3c2d66', volGrpId) - } - - - @Test - public void testGetMessageId() { - Node root = new XmlParser().parseText(rollbackReq) - - VnfAdapterRestV1 p = new VnfAdapterRestV1() - def messageId = p.getMessageIdForVolumeGroupRollback(root) - assertEquals('683ca1ac-2145-4a00-9484-20d48bd701aa', messageId) - } - - @Test - public void testProcessCallback() { - - String sdncAdapterWorkflowRequest = FileUtil.readResourceFile("__files/vnfAdapterMocks/vnfAdapterCallback.xml"); - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - when(mockExecution.getVariable("VNFAResponse_MESSAGE")).thenReturn(sdncAdapterWorkflowRequest) - when(mockExecution.getVariable("testProcessKey")).thenReturn("testProcessKey") - - VnfAdapterRestV1 vnfAdapterRestV1 = new VnfAdapterRestV1() - vnfAdapterRestV1.processCallback(mockExecution) - - verify(mockExecution).setVariable("testProcessKeyResponse" ,sdncAdapterWorkflowRequest) - - } -} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnfTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnfTest.java index aa9943b9b1..0eef9cccd8 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnfTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnfTest.java @@ -29,7 +29,6 @@ import org.mockito.junit.MockitoJUnitRunner; import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.db.catalog.beans.OrchestrationStatus; -import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.Pnfs; import static org.mockito.Mockito.doReturn; @@ -39,22 +38,11 @@ public class BBInputSetupPnfTest { @Mock private Pnfs pnfs; - @Mock - private ModelInfo modelInfo; - @Test public void populatePnfShouldSetRequiredFields() { final String pnfId = "PNF_id1"; final String pnfName = "PNF_name1"; - final String modelCustomizationId = "8421fe03-fd1b-4bf7-845a-c3fe91edb031"; - final String modelInvariantId = "3360a2a5-22ff-44c7-8935-08c8e5ecbd06"; - final String modelVersionId = "b80c3a52-abd4-436c-a22e-9c5da768781a"; - - doReturn(modelCustomizationId).when(modelInfo).getModelCustomizationId(); - doReturn(modelInvariantId).when(modelInfo).getModelInvariantId(); - doReturn(modelVersionId).when(modelInfo).getModelVersionId(); doReturn(pnfName).when(pnfs).getInstanceName(); - doReturn(modelInfo).when(pnfs).getModelInfo(); ServiceInstance serviceInstance = new ServiceInstance(); BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance); @@ -65,9 +53,6 @@ public class BBInputSetupPnfTest { assertEquals(pnfId, pnf.getPnfId()); assertEquals(pnfName, pnf.getPnfName()); - assertEquals(modelCustomizationId, pnf.getModelInfoPnf().getModelCustomizationUuid()); - assertEquals(modelInvariantId, pnf.getModelInfoPnf().getModelInvariantUuid()); - assertEquals(modelVersionId, pnf.getModelInfoPnf().getModelUuid()); assertEquals(OrchestrationStatus.PRECREATED, pnf.getOrchestrationStatus()); } } diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index df7337c0d9..c730844aac 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -2484,6 +2484,58 @@ public class BBInputSetupTest { } @Test + public void test_getGBBMacroNoUserParamsExistingService_forControllerExecutionBB() throws Exception { + // given + String requestAction = "unassignInstance"; + GeneralBuildingBlock gBB = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"), + GeneralBuildingBlock.class); + L3Network network = new L3Network(); + network.setNetworkId("networkId"); + gBB.getServiceInstance().getNetworks().add(network); + ServiceInstance serviceInstance = gBB.getServiceInstance(); + ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"), + ExecuteBuildingBlock.class); + RequestDetails requestDetails = mapper + .readValue(new File(RESOURCE_PATH + "RequestDetailsInput_serviceMacro.json"), RequestDetails.class); + requestDetails.getRequestParameters().setUserParams(null); + Map<ResourceKey, String> lookupKeyMap = prepareLookupKeyMap(); + Service service = Mockito.mock(Service.class); + CloudConfiguration cloudConfiguration = new CloudConfiguration(); + cloudConfiguration.setLcpCloudRegionId("cloudRegionId"); + org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance(); + org.onap.aai.domain.yang.L3Network aaiNetwork = new org.onap.aai.domain.yang.L3Network(); + aaiNetwork.setModelCustomizationId("modelCustId"); + GenericVnf vnf = new GenericVnf(); + vnf.setVnfId("vnfId"); + gBB.getServiceInstance().getVnfs().add(vnf); + org.onap.aai.domain.yang.GenericVnf aaiVnf = new org.onap.aai.domain.yang.GenericVnf(); + aaiVnf.setModelCustomizationId("modelCustId"); + + ConfigurationResourceKeys configResourceKeys = prepareConfigurationResourceKeys(); + executeBB.setConfigurationResourceKeys(configResourceKeys).setRequestDetails(requestDetails); + BuildingBlock buildingBlock = executeBB.getBuildingBlock(); + buildingBlock.setBpmnFlowName("ControllerExecutionBB").setKey("ab153b6e-c364-44c0-bef6-1f2982117f04"); + buildingBlock.setBpmnScope("VNF"); + + aaiServiceInstance.setModelVersionId("modelVersionId"); + doReturn(service).when(SPY_bbInputSetupUtils) + .getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId()); + doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils) + .getAAIServiceInstanceById(lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID)); + doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance); + doReturn(gBB).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(any(BBInputSetupParameter.class)); + doReturn(aaiVnf).when(SPY_bbInputSetupUtils).getAAIGenericVnf(vnf.getVnfId()); + doNothing().when(SPY_bbInputSetup).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class), + any(Service.class)); + // when + SPY_bbInputSetup.getGBBMacroExistingService(executeBB, lookupKeyMap, + executeBB.getBuildingBlock().getBpmnFlowName(), requestAction, cloudConfiguration); + // then + verify(SPY_bbInputSetup, times(1)).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class), + any(Service.class)); + } + + @Test public void test_getGBBMacroNoUserParamsExistingService_forActivateVnfBB() throws Exception { // given String requestAction = "unassignInstance"; @@ -2535,6 +2587,66 @@ public class BBInputSetupTest { } @Test + public void test_getGBBMacroNoUserParamsExistingService_forControllerExecutionBB_VFModule() throws Exception { + // given + String requestAction = "unassignInstance"; + GeneralBuildingBlock gBB = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"), + GeneralBuildingBlock.class); + L3Network network = new L3Network(); + network.setNetworkId("networkId"); + gBB.getServiceInstance().getNetworks().add(network); + ServiceInstance serviceInstance = gBB.getServiceInstance(); + ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"), + ExecuteBuildingBlock.class); + RequestDetails requestDetails = mapper + .readValue(new File(RESOURCE_PATH + "RequestDetailsInput_serviceMacro.json"), RequestDetails.class); + requestDetails.getRequestParameters().setUserParams(null); + Map<ResourceKey, String> lookupKeyMap = prepareLookupKeyMap(); + Service service = Mockito.mock(Service.class); + CloudConfiguration cloudConfiguration = new CloudConfiguration(); + cloudConfiguration.setLcpCloudRegionId("cloudRegionId"); + org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance(); + org.onap.aai.domain.yang.L3Network aaiNetwork = new org.onap.aai.domain.yang.L3Network(); + aaiNetwork.setModelCustomizationId("modelCustId"); + GenericVnf vnf = new GenericVnf(); + vnf.setVnfId("vnfId"); + gBB.getServiceInstance().getVnfs().add(vnf); + org.onap.aai.domain.yang.GenericVnf aaiVnf = new org.onap.aai.domain.yang.GenericVnf(); + aaiVnf.setModelCustomizationId("modelCustId"); + VfModule vfModule = new VfModule(); + vfModule.setVfModuleId("vfModuleId"); + gBB.getServiceInstance().getVnfs().get(0).getVfModules().add(vfModule); + org.onap.aai.domain.yang.VfModule aaiVfModule = new org.onap.aai.domain.yang.VfModule(); + aaiVfModule.setModelCustomizationId("modelCustId"); + + ConfigurationResourceKeys configResourceKeys = prepareConfigurationResourceKeys(); + executeBB.setConfigurationResourceKeys(configResourceKeys).setRequestDetails(requestDetails); + BuildingBlock buildingBlock = executeBB.getBuildingBlock(); + buildingBlock.setBpmnFlowName("ControllerExecutionBB").setKey("a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f"); + buildingBlock.setBpmnScope("VfModule"); + + aaiServiceInstance.setModelVersionId("modelVersionId"); + doReturn(service).when(SPY_bbInputSetupUtils) + .getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId()); + doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils) + .getAAIServiceInstanceById(lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID)); + doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance); + doReturn(gBB).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(any(BBInputSetupParameter.class)); + doReturn(aaiVnf).when(SPY_bbInputSetupUtils).getAAIGenericVnf(vnf.getVnfId()); + doNothing().when(SPY_bbInputSetup).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class), + any(Service.class)); + doReturn(aaiVfModule).when(SPY_bbInputSetupUtils).getAAIVfModule(vnf.getVnfId(), vfModule.getVfModuleId()); + // when + SPY_bbInputSetup.getGBBMacroExistingService(executeBB, lookupKeyMap, + executeBB.getBuildingBlock().getBpmnFlowName(), requestAction, cloudConfiguration); + // then + verify(SPY_bbInputSetup, times(1)).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class), + any(Service.class)); + verify(SPY_bbInputSetup, times(1)).mapCatalogVfModule(any(VfModule.class), any(ModelInfo.class), + any(Service.class), any(String.class)); + } + + @Test public void test_getGBBMacroNoUserParamsExistingService_forUnassignVfModuleBB() throws Exception { // given String requestAction = "unassignInstance"; @@ -2947,6 +3059,31 @@ public class BBInputSetupTest { } @Test + public void testMapCatalogVfModuleIfNoVfUnderVnf() { + String vnfModelCustomizationUUID = "vnfResourceCustUUID"; + String vfModuleCustomizationUUID = "vfModelCustomizationUUID"; + VfModule vfModule = new VfModule(); + ModelInfo modelInfo = new ModelInfo(); + modelInfo.setModelCustomizationUuid(vfModuleCustomizationUUID); + Service service = new Service(); + VnfResourceCustomization vnfResourceCust = new VnfResourceCustomization(); + vnfResourceCust.setModelCustomizationUUID(vnfModelCustomizationUUID); + VfModuleCustomization vfModuleCust = new VfModuleCustomization(); + vfModuleCust.setModelCustomizationUUID(vfModuleCustomizationUUID); + ModelInfoVfModule modelInfoVfModule = new ModelInfoVfModule(); + doReturn(vfModuleCust).when(SPY_bbInputSetupUtils) + .getVfModuleCustomizationByModelCuztomizationUUID(vfModuleCustomizationUUID); + doReturn(modelInfoVfModule).when(bbInputSetupMapperLayer).mapCatalogVfModuleToVfModule(vfModuleCust); + + SPY_bbInputSetup.mapCatalogVfModule(vfModule, modelInfo, service, vnfModelCustomizationUUID); + + assertThat(vfModule.getModelInfoVfModule(), sameBeanAs(modelInfoVfModule)); + + verify(SPY_bbInputSetupUtils, times(1)) + .getVfModuleCustomizationByModelCuztomizationUUID(modelInfo.getModelCustomizationId()); + } + + @Test public void testPopulateVfModule() throws Exception { String vnfId = "vnfId"; String vfModuleId = "vfModuleId"; diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java index a534e57b3a..486a2755c3 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java @@ -20,9 +20,6 @@ package org.onap.so.bpmn.common.workflow.service; -import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.ProcessEngines; - public class WorkflowAsyncCommonResource extends WorkflowAsyncResource { diff --git a/bpmn/pom.xml b/bpmn/pom.xml index e680cb025c..4ef4eb74dd 100644 --- a/bpmn/pom.xml +++ b/bpmn/pom.xml @@ -25,7 +25,6 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <sdnc.northbound.version>1.5.2</sdnc.northbound.version> - <appc.client.version>1.7.1-SNAPSHOT</appc.client.version> </properties> <modules> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn index 4fcf13d98d..ccd6b0bd48 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/AbstractCDSProcessingBB.bpmn @@ -10,11 +10,11 @@ <bpmn:endEvent id="EndEvent_1h3epjc"> <bpmn:incoming>SequenceFlow_161g9uz</bpmn:incoming> </bpmn:endEvent> - <bpmn:serviceTask id="Task_06n9c9v" name="Get Required data to call CDS Client" camunda:expression="${AbstractCDSProcessingBBUtils.constructExecutionServiceInputObject(execution)}"> + <bpmn:serviceTask id="Task_06n9c9v" name="Get Required data to call CDS Client" camunda:expression="${AbstractCDSProcessingBBUtils.constructExecutionServiceInputObject(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_02v5z4h</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0gksy4i</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:serviceTask id="Task_0kjfr5o" name="CDS (Call SelfServiceAPI) " camunda:expression="${AbstractCDSProcessingBBUtils.sendRequestToCDSClient(execution)}"> + <bpmn:serviceTask id="Task_0kjfr5o" name="CDS (Call SelfServiceAPI) " camunda:expression="${AbstractCDSProcessingBBUtils.sendRequestToCDSClient(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_0gksy4i</bpmn:incoming> <bpmn:outgoing>SequenceFlow_161g9uz</bpmn:outgoing> </bpmn:serviceTask> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigAssignVnfBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigAssignVnfBB.bpmn index 88e5eadef2..ba94fb38d7 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigAssignVnfBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigAssignVnfBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1ahlzqg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1ahlzqg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.1"> <bpmn:process id="ConfigAssignVnfBB" name="ConfigAssignVnfBB" isExecutable="true"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_0gmfit3</bpmn:outgoing> @@ -14,6 +14,7 @@ <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:out source="ControllerStatus" target="ControllerStatus" /> <camunda:in source="executionObject" target="executionObject" /> + <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_05qembo</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0cvsnuu</bpmn:outgoing> @@ -34,7 +35,7 @@ </bpmn:exclusiveGateway> <bpmn:sequenceFlow id="SequenceFlow_0cvsnuu" sourceRef="CallActivity_1gfzi2g" targetRef="ExclusiveGateway_13q340y" /> <bpmn:sequenceFlow id="SequenceFlow_07tqu82" name="success" sourceRef="ExclusiveGateway_13q340y" targetRef="Task_1hs1mn0"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("ControllerStatus").equals("Success")}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("ControllerStatus").equals("Success")}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:endEvent id="EndEvent_0mnaj50"> <bpmn:incoming>SequenceFlow_15gxql1</bpmn:incoming> @@ -49,15 +50,15 @@ <dc:Bounds x="507" y="187" width="36" height="36" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0gmfit3_di" bpmnElement="SequenceFlow_0gmfit3"> - <di:waypoint xsi:type="dc:Point" x="543" y="205" /> - <di:waypoint xsi:type="dc:Point" x="614" y="205" /> + <di:waypoint x="543" y="205" /> + <di:waypoint x="614" y="205" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0lgvk82_di" bpmnElement="EndEvent_0lgvk82"> <dc:Bounds x="1307" y="187" width="36" height="36" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1mkhog2_di" bpmnElement="SequenceFlow_1mkhog2"> - <di:waypoint xsi:type="dc:Point" x="1218" y="205" /> - <di:waypoint xsi:type="dc:Point" x="1307" y="205" /> + <di:waypoint x="1218" y="205" /> + <di:waypoint x="1307" y="205" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1gfzi2g_di" bpmnElement="CallActivity_1gfzi2g"> <dc:Bounds x="788" y="165" width="100" height="80" /> @@ -66,8 +67,8 @@ <dc:Bounds x="1118" y="165" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_05qembo_di" bpmnElement="SequenceFlow_05qembo"> - <di:waypoint xsi:type="dc:Point" x="714" y="205" /> - <di:waypoint xsi:type="dc:Point" x="788" y="205" /> + <di:waypoint x="714" y="205" /> + <di:waypoint x="788" y="205" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_01mv1si_di" bpmnElement="Task_0bhf6tp"> <dc:Bounds x="614" y="165" width="100" height="80" /> @@ -76,12 +77,12 @@ <dc:Bounds x="978" y="180" width="50" height="50" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0cvsnuu_di" bpmnElement="SequenceFlow_0cvsnuu"> - <di:waypoint xsi:type="dc:Point" x="888" y="205" /> - <di:waypoint xsi:type="dc:Point" x="978" y="205" /> + <di:waypoint x="888" y="205" /> + <di:waypoint x="978" y="205" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_07tqu82_di" bpmnElement="SequenceFlow_07tqu82"> - <di:waypoint xsi:type="dc:Point" x="1028" y="205" /> - <di:waypoint xsi:type="dc:Point" x="1118" y="205" /> + <di:waypoint x="1028" y="205" /> + <di:waypoint x="1118" y="205" /> <bpmndi:BPMNLabel> <dc:Bounds x="1053" y="187" width="41" height="14" /> </bpmndi:BPMNLabel> @@ -90,8 +91,8 @@ <dc:Bounds x="985" y="327" width="36" height="36" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_15gxql1_di" bpmnElement="SequenceFlow_15gxql1"> - <di:waypoint xsi:type="dc:Point" x="1003" y="230" /> - <di:waypoint xsi:type="dc:Point" x="1003" y="327" /> + <di:waypoint x="1003" y="230" /> + <di:waypoint x="1003" y="327" /> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigDeployVnfBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigDeployVnfBB.bpmn index 3993eca467..05fdb03818 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigDeployVnfBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ConfigDeployVnfBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1556kf5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1556kf5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.1"> <bpmn:process id="ConfigDeployVnfBB" name="ConfigDeployVnfBB" isExecutable="true"> <bpmn:startEvent id="Start" name="Start"> <bpmn:outgoing>SequenceFlow_0pd4jka</bpmn:outgoing> @@ -19,6 +19,7 @@ <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:in source="executionObject" target="executionObject" /> <camunda:out source="ControllerStatus" target="ControllerStatus" /> + <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0kruy8t</bpmn:incoming> <bpmn:outgoing>SequenceFlow_03xbj4e</bpmn:outgoing> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn index 279fdc0983..f12a3d241f 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ControllerExecutionBB.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1ahlzqg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.14.0"> - <bpmn:process id="ControllerExecution" name="ControllerExecutionBB" isExecutable="true"> + <bpmn:process id="ControllerExecutionBB" name="ControllerExecutionBB" isExecutable="true"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_0gmfit3</bpmn:outgoing> </bpmn:startEvent> @@ -86,7 +86,7 @@ </bpmn:process> <bpmn:error id="Error_0aovtfv" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ControllerExecution"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ControllerExecutionBB"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> <dc:Bounds x="160" y="323" width="36" height="36" /> <bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateNetworkBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateNetworkBB.bpmn index 1ea311549c..12b038e738 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateNetworkBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateNetworkBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="CreateNetworkBB" name="CreateNetworkBB" isExecutable="true"> <bpmn2:startEvent id="createNetwork_startEvent"> <bpmn2:outgoing>SequenceFlow_1maepy7</bpmn2:outgoing> @@ -11,7 +11,7 @@ <bpmn2:incoming>SequenceFlow_1oc7wcr</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0n42zi5</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:serviceTask id="Create_Network_ServiceTask" name=" AIC Create (network) " camunda:expression="${NetworkAdapterCreateTasks.createNetwork(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn2:serviceTask id="Create_Network_ServiceTask" name="Prepare Request" camunda:expression="${NetworkAdapterCreateTasks.createNetwork(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn2:incoming>SequenceFlow_1eqfh23</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1fm99t6</bpmn2:outgoing> </bpmn2:serviceTask> @@ -31,19 +31,19 @@ <bpmn2:sequenceFlow id="SequenceFlow_1yy4aik" sourceRef="QueryNetworkPolicy_ServiceTask" targetRef="QueryNetworkTableRef_ServiceTask" /> <bpmn2:sequenceFlow id="SequenceFlow_0sissul" sourceRef="Update_Network_AAI_ServiceTask" targetRef="createNetwork_EndEvent" /> <bpmn2:sequenceFlow id="SequenceFlow_1maepy7" sourceRef="createNetwork_startEvent" targetRef="ServiceTask_get_cloud_region" /> - <bpmn2:intermediateThrowEvent id="ThrowEvent_ToCollectAAIData" name="ThrowEvent_ToCollectAAIData"> + <bpmn2:intermediateThrowEvent id="ThrowEvent_ToCollectAAIData" name="Query AAI"> <bpmn2:incoming>SequenceFlow_03ebe6c</bpmn2:incoming> <bpmn2:linkEventDefinition name="CatchEvent_Collect_AAI_Data" /> </bpmn2:intermediateThrowEvent> - <bpmn2:intermediateCatchEvent id="CatchEvent_Collect_AAI_Data" name="CatchEvent_Collect_AAI_Data"> + <bpmn2:intermediateCatchEvent id="CatchEvent_Collect_AAI_Data" name="Query AAI"> <bpmn2:outgoing>SequenceFlow_1oc7wcr</bpmn2:outgoing> <bpmn2:linkEventDefinition name="CatchEvent_Collect_AAI_Data" /> </bpmn2:intermediateCatchEvent> - <bpmn2:intermediateCatchEvent id="CatchEvent_Create_Network" name="CatchEvent_Create_Network"> + <bpmn2:intermediateCatchEvent id="CatchEvent_Create_Network" name="Create Network"> <bpmn2:outgoing>SequenceFlow_1eqfh23</bpmn2:outgoing> <bpmn2:linkEventDefinition name="CatchEvent_Create_Network" /> </bpmn2:intermediateCatchEvent> - <bpmn2:intermediateThrowEvent id="ThrowEvent_ToCreateNetwork" name="ThrowEvent_ToCreateNetwork"> + <bpmn2:intermediateThrowEvent id="ThrowEvent_ToCreateNetwork" name="Create Network"> <bpmn2:incoming>SequenceFlow_0y0w60u</bpmn2:incoming> <bpmn2:linkEventDefinition name="CatchEvent_Create_Network" /> </bpmn2:intermediateThrowEvent> @@ -55,12 +55,12 @@ <bpmn2:outgoing>SequenceFlow_03ebe6c</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:sequenceFlow id="SequenceFlow_03ebe6c" sourceRef="ServiceTask_get_cloud_region" targetRef="ThrowEvent_ToCollectAAIData" /> - <bpmn2:callActivity id="CallActivity_0aj19il" name="Call NetworkAdapterRestV1" calledElement="NetworkAdapterRestV1"> + <bpmn2:callActivity id="CallActivity_0aj19il" name="Network Adapter" calledElement="NetworkAdapter"> <bpmn2:extensionElements> <camunda:in source="networkAdapterRequest" target="networkAdapterRequest" /> <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:out source="createNetworkResponse" target="createNetworkResponse" /> - <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" /> </bpmn2:extensionElements> <bpmn2:incoming>SequenceFlow_1fm99t6</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0qpu80i</bpmn2:outgoing> @@ -83,148 +83,148 @@ <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateNetworkBB"> <bpmndi:BPMNShape id="StartEvent_0lbwmd1_di" bpmnElement="createNetwork_startEvent"> - <dc:Bounds x="236" y="-55" width="36" height="36" /> + <dc:Bounds x="176" y="105" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="229" y="-14" width="50" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_10l9a3s_di" bpmnElement="createNetwork_EndEvent"> - <dc:Bounds x="997" y="326" width="36" height="36" /> + <dc:Bounds x="937" y="486" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="971" y="362" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1k7d8ih_di" bpmnElement="QueryVpnBinding_ServiceTask"> - <dc:Bounds x="340" y="91" width="100" height="80" /> + <dc:Bounds x="280" y="251" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1911vum_di" bpmnElement="Create_Network_ServiceTask"> - <dc:Bounds x="346" y="304" width="100" height="80" /> + <dc:Bounds x="286" y="464" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1glneas_di" bpmnElement="QueryNetworkPolicy_ServiceTask"> - <dc:Bounds x="503" y="91" width="100" height="80" /> + <dc:Bounds x="443" y="251" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_00rw5co_di" bpmnElement="QueryNetworkTableRef_ServiceTask"> - <dc:Bounds x="663" y="91" width="100" height="80" /> + <dc:Bounds x="603" y="251" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0q51h0f_di" bpmnElement="Update_Network_AAI_ServiceTask"> - <dc:Bounds x="836" y="304" width="100" height="80" /> + <dc:Bounds x="776" y="464" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0n42zi5_di" bpmnElement="SequenceFlow_0n42zi5"> - <di:waypoint xsi:type="dc:Point" x="440" y="131" /> - <di:waypoint xsi:type="dc:Point" x="503" y="131" /> + <di:waypoint x="380" y="291" /> + <di:waypoint x="443" y="291" /> <bpmndi:BPMNLabel> <dc:Bounds x="472" y="106" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1yy4aik_di" bpmnElement="SequenceFlow_1yy4aik"> - <di:waypoint xsi:type="dc:Point" x="603" y="131" /> - <di:waypoint xsi:type="dc:Point" x="663" y="131" /> + <di:waypoint x="543" y="291" /> + <di:waypoint x="603" y="291" /> <bpmndi:BPMNLabel> <dc:Bounds x="633" y="106" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0sissul_di" bpmnElement="SequenceFlow_0sissul"> - <di:waypoint xsi:type="dc:Point" x="936" y="344" /> - <di:waypoint xsi:type="dc:Point" x="997" y="344" /> + <di:waypoint x="876" y="504" /> + <di:waypoint x="937" y="504" /> <bpmndi:BPMNLabel> <dc:Bounds x="921.5" y="329" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1maepy7_di" bpmnElement="SequenceFlow_1maepy7"> - <di:waypoint xsi:type="dc:Point" x="272" y="-37" /> - <di:waypoint xsi:type="dc:Point" x="426" y="-37" /> + <di:waypoint x="212" y="123" /> + <di:waypoint x="366" y="123" /> <bpmndi:BPMNLabel> <dc:Bounds x="304" y="-52" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="IntermediateThrowEvent_0fexg2g_di" bpmnElement="ThrowEvent_ToCollectAAIData"> - <dc:Bounds x="666" y="-55" width="36" height="36" /> + <dc:Bounds x="606" y="105" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="709" y="-43" width="85" height="24" /> + <dc:Bounds x="608" y="146" width="31" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateCatchEvent_1plrukk_di" bpmnElement="CatchEvent_Collect_AAI_Data"> - <dc:Bounds x="236" y="113" width="36" height="36" /> + <dc:Bounds x="176" y="273" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="216" y="154" width="81" height="24" /> + <dc:Bounds x="181" y="314" width="31" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateCatchEvent_1n0vun1_di" bpmnElement="CatchEvent_Create_Network"> - <dc:Bounds x="236" y="326" width="36" height="36" /> + <dc:Bounds x="176" y="486" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="213" y="367" width="87" height="24" /> + <dc:Bounds x="173" y="527" width="41" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateThrowEvent_04qwhex_di" bpmnElement="ThrowEvent_ToCreateNetwork"> - <dc:Bounds x="962" y="113" width="36" height="36" /> + <dc:Bounds x="902" y="273" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1005" y="125" width="86" height="24" /> + <dc:Bounds x="899" y="314" width="41" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1h9kkhb_di" bpmnElement="SequenceFlow_1h9kkhb"> - <di:waypoint xsi:type="dc:Point" x="763" y="131" /> - <di:waypoint xsi:type="dc:Point" x="817" y="131" /> + <di:waypoint x="703" y="291" /> + <di:waypoint x="757" y="291" /> <bpmndi:BPMNLabel> <dc:Bounds x="745" y="116" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1oc7wcr_di" bpmnElement="SequenceFlow_1oc7wcr"> - <di:waypoint xsi:type="dc:Point" x="272" y="131" /> - <di:waypoint xsi:type="dc:Point" x="340" y="131" /> + <di:waypoint x="212" y="291" /> + <di:waypoint x="280" y="291" /> <bpmndi:BPMNLabel> <dc:Bounds x="306" y="106" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1eqfh23_di" bpmnElement="SequenceFlow_1eqfh23"> - <di:waypoint xsi:type="dc:Point" x="272" y="344" /> - <di:waypoint xsi:type="dc:Point" x="346" y="344" /> + <di:waypoint x="212" y="504" /> + <di:waypoint x="286" y="504" /> <bpmndi:BPMNLabel> <dc:Bounds x="309" y="319" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_02qnccl_di" bpmnElement="ServiceTask_get_cloud_region"> - <dc:Bounds x="426" y="-77" width="100" height="80" /> + <dc:Bounds x="366" y="83" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_03ebe6c_di" bpmnElement="SequenceFlow_03ebe6c"> - <di:waypoint xsi:type="dc:Point" x="526" y="-37" /> - <di:waypoint xsi:type="dc:Point" x="666" y="-37" /> + <di:waypoint x="466" y="123" /> + <di:waypoint x="606" y="123" /> <bpmndi:BPMNLabel> <dc:Bounds x="551" y="-52" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_0aj19il_di" bpmnElement="CallActivity_0aj19il"> - <dc:Bounds x="503" y="304" width="100" height="80" /> + <dc:Bounds x="443" y="464" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1k8gsz5_di" bpmnElement="ServiceTask_1k8gsz5"> - <dc:Bounds x="663" y="304" width="100" height="80" /> + <dc:Bounds x="603" y="464" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0qpu80i_di" bpmnElement="SequenceFlow_0qpu80i"> - <di:waypoint xsi:type="dc:Point" x="603" y="344" /> - <di:waypoint xsi:type="dc:Point" x="663" y="344" /> + <di:waypoint x="543" y="504" /> + <di:waypoint x="603" y="504" /> <bpmndi:BPMNLabel> <dc:Bounds x="633" y="323" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_16152be_di" bpmnElement="SequenceFlow_16152be"> - <di:waypoint xsi:type="dc:Point" x="763" y="344" /> - <di:waypoint xsi:type="dc:Point" x="836" y="344" /> + <di:waypoint x="703" y="504" /> + <di:waypoint x="776" y="504" /> <bpmndi:BPMNLabel> <dc:Bounds x="799.5" y="323" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1fm99t6_di" bpmnElement="SequenceFlow_1fm99t6"> - <di:waypoint xsi:type="dc:Point" x="446" y="344" /> - <di:waypoint xsi:type="dc:Point" x="503" y="344" /> + <di:waypoint x="386" y="504" /> + <di:waypoint x="443" y="504" /> <bpmndi:BPMNLabel> <dc:Bounds x="474.5" y="323" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0u4ie2q_di" bpmnElement="QueryNetworkSubnet_ServiceTask"> - <dc:Bounds x="817" y="91" width="100" height="80" /> + <dc:Bounds x="757" y="251" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0y0w60u_di" bpmnElement="SequenceFlow_0y0w60u"> - <di:waypoint xsi:type="dc:Point" x="917" y="131" /> - <di:waypoint xsi:type="dc:Point" x="962" y="131" /> + <di:waypoint x="857" y="291" /> + <di:waypoint x="902" y="291" /> <bpmndi:BPMNLabel> <dc:Bounds x="939.5" y="110" width="0" height="12" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn index 97fad57e7d..d77e141364 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0"> <bpmn:process id="CreateVfModuleBB" name="CreateVfModuleBB" isExecutable="true"> <bpmn:startEvent id="CreateVfModuleBB_Start"> <bpmn:outgoing>SequenceFlow_1xr6chl</bpmn:outgoing> @@ -12,7 +12,7 @@ <bpmn:endEvent id="CreateVfModuleBB_End"> <bpmn:incoming>SequenceFlow_1vbwdaw</bpmn:incoming> </bpmn:endEvent> - <bpmn:serviceTask id="CreateVfModule" name="Create VF Module (VNF)" camunda:expression="${VnfAdapterCreateTasks.createVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:serviceTask id="CreateVfModule" name="Prepare Request" camunda:expression="${VnfAdapterCreateTasks.createVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_15hn8si</bpmn:incoming> <bpmn:outgoing>SequenceFlow_16g4dz0</bpmn:outgoing> </bpmn:serviceTask> @@ -83,148 +83,148 @@ <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateVfModuleBB"> <bpmndi:BPMNShape id="StartEvent_0kxwniy_di" bpmnElement="CreateVfModuleBB_Start"> - <dc:Bounds x="59" y="88" width="36" height="36" /> + <dc:Bounds x="159" y="88" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="77" y="124" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_13t22km_di" bpmnElement="QueryVfModule"> - <dc:Bounds x="416" y="66" width="100" height="80" /> + <dc:Bounds x="516" y="66" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1xr6chl_di" bpmnElement="SequenceFlow_1xr6chl"> - <di:waypoint xsi:type="dc:Point" x="95" y="106" /> - <di:waypoint xsi:type="dc:Point" x="216" y="106" /> + <di:waypoint x="195" y="106" /> + <di:waypoint x="316" y="106" /> <bpmndi:BPMNLabel> <dc:Bounds x="156" y="91" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0qdq7wj_di" bpmnElement="CreateVfModuleBB_End"> - <dc:Bounds x="1118" y="293" width="36" height="36" /> + <dc:Bounds x="1218" y="293" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1136" y="333" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1dgenhy_di" bpmnElement="CreateVfModule"> - <dc:Bounds x="612" y="66" width="100" height="80" /> + <dc:Bounds x="712" y="66" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_15hn8si_di" bpmnElement="SequenceFlow_15hn8si"> - <di:waypoint xsi:type="dc:Point" x="516" y="106" /> - <di:waypoint xsi:type="dc:Point" x="612" y="106" /> + <di:waypoint x="616" y="106" /> + <di:waypoint x="712" y="106" /> <bpmndi:BPMNLabel> <dc:Bounds x="519" y="91" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1s4rpyp_di" bpmnElement="SequenceFlow_1s4rpyp"> - <di:waypoint xsi:type="dc:Point" x="316" y="106" /> - <di:waypoint xsi:type="dc:Point" x="416" y="106" /> + <di:waypoint x="416" y="106" /> + <di:waypoint x="516" y="106" /> <bpmndi:BPMNLabel> <dc:Bounds x="321" y="91" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_1frb5h2_di" bpmnElement="QueryVnf"> - <dc:Bounds x="216" y="66" width="100" height="80" /> + <dc:Bounds x="316" y="66" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_16g4dz0_di" bpmnElement="SequenceFlow_16g4dz0"> - <di:waypoint xsi:type="dc:Point" x="712" y="106" /> - <di:waypoint xsi:type="dc:Point" x="790" y="106" /> + <di:waypoint x="812" y="106" /> + <di:waypoint x="890" y="106" /> <bpmndi:BPMNLabel> <dc:Bounds x="751" y="91" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0ecr393_di" bpmnElement="SequenceFlow_0ecr393"> - <di:waypoint xsi:type="dc:Point" x="890" y="107" /> - <di:waypoint xsi:type="dc:Point" x="994" y="107" /> - <di:waypoint xsi:type="dc:Point" x="994" y="209" /> - <di:waypoint xsi:type="dc:Point" x="73" y="209" /> - <di:waypoint xsi:type="dc:Point" x="73" y="306" /> - <di:waypoint xsi:type="dc:Point" x="142" y="306" /> + <di:waypoint x="990" y="107" /> + <di:waypoint x="1094" y="107" /> + <di:waypoint x="1094" y="209" /> + <di:waypoint x="173" y="209" /> + <di:waypoint x="173" y="306" /> + <di:waypoint x="242" y="306" /> <bpmndi:BPMNLabel> <dc:Bounds x="534" y="194" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1i1pfzb_di" bpmnElement="VnfAdapter"> - <dc:Bounds x="790" y="66" width="100" height="80" /> + <dc:Bounds x="890" y="66" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0fpfn71_di" bpmnElement="UpdateVfModuleStatus"> - <dc:Bounds x="942" y="271" width="100" height="80" /> + <dc:Bounds x="1042" y="271" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_04k1b85_di" bpmnElement="UpdateVfModuleHeatStackId"> - <dc:Bounds x="777" y="271" width="100" height="80" /> + <dc:Bounds x="877" y="271" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SubProcess_1getwnf_di" bpmnElement="SubProcess_1getwnf" isExpanded="true"> - <dc:Bounds x="136" y="439" width="231" height="135" /> + <dc:Bounds x="236" y="439" width="231" height="135" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_1c8o652_di" bpmnElement="StartEvent_1c8o652"> - <dc:Bounds x="175" y="497" width="36" height="36" /> + <dc:Bounds x="275" y="497" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="148" y="533" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1emam1w_di" bpmnElement="EndEvent_1emam1w"> - <dc:Bounds x="312" y="497" width="36" height="36" /> + <dc:Bounds x="412" y="497" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="285" y="533" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0gcots6_di" bpmnElement="SequenceFlow_0gcots6"> - <di:waypoint xsi:type="dc:Point" x="211" y="515" /> - <di:waypoint xsi:type="dc:Point" x="312" y="515" /> + <di:waypoint x="311" y="515" /> + <di:waypoint x="412" y="515" /> <bpmndi:BPMNLabel> <dc:Bounds x="262" y="494" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0rds4rj_di" bpmnElement="SequenceFlow_0rds4rj"> - <di:waypoint xsi:type="dc:Point" x="877" y="311" /> - <di:waypoint xsi:type="dc:Point" x="942" y="311" /> + <di:waypoint x="977" y="311" /> + <di:waypoint x="1042" y="311" /> <bpmndi:BPMNLabel> <dc:Bounds x="910" y="296" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1vbwdaw_di" bpmnElement="SequenceFlow_1vbwdaw"> - <di:waypoint xsi:type="dc:Point" x="1042" y="311" /> - <di:waypoint xsi:type="dc:Point" x="1083" y="311" /> - <di:waypoint xsi:type="dc:Point" x="1083" y="311" /> - <di:waypoint xsi:type="dc:Point" x="1118" y="311" /> + <di:waypoint x="1142" y="311" /> + <di:waypoint x="1183" y="311" /> + <di:waypoint x="1183" y="311" /> + <di:waypoint x="1218" y="311" /> <bpmndi:BPMNLabel> <dc:Bounds x="1098" y="311" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_1v8zx4s_di" bpmnElement="CreateNetworkPolicies"> - <dc:Bounds x="142" y="271" width="100" height="80" /> + <dc:Bounds x="242" y="271" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0xqhep5_di" bpmnElement="SequenceFlow_0xqhep5"> - <di:waypoint xsi:type="dc:Point" x="242" y="311" /> - <di:waypoint xsi:type="dc:Point" x="295" y="311" /> + <di:waypoint x="342" y="311" /> + <di:waypoint x="395" y="311" /> <bpmndi:BPMNLabel> <dc:Bounds x="269" y="296" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_015ayw5_di" bpmnElement="UpdateVnfIpv4OamAddress"> - <dc:Bounds x="295" y="271" width="100" height="80" /> + <dc:Bounds x="395" y="271" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1yo6mvv_di" bpmnElement="SequenceFlow_1yo6mvv"> - <di:waypoint xsi:type="dc:Point" x="395" y="311" /> - <di:waypoint xsi:type="dc:Point" x="464" y="311" /> + <di:waypoint x="495" y="311" /> + <di:waypoint x="564" y="311" /> <bpmndi:BPMNLabel> <dc:Bounds x="430" y="296" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0mlfsc9_di" bpmnElement="UpdateVnfManagementV6Address"> - <dc:Bounds x="464" y="271" width="100" height="80" /> + <dc:Bounds x="564" y="271" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1i03uy2_di" bpmnElement="SequenceFlow_1i03uy2"> - <di:waypoint xsi:type="dc:Point" x="564" y="311" /> - <di:waypoint xsi:type="dc:Point" x="612" y="311" /> + <di:waypoint x="664" y="311" /> + <di:waypoint x="712" y="311" /> <bpmndi:BPMNLabel> <dc:Bounds x="588" y="296" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0wctnhw_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn"> - <dc:Bounds x="612" y="271" width="100" height="80" /> + <dc:Bounds x="712" y="271" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_15do1tu_di" bpmnElement="SequenceFlow_15do1tu"> - <di:waypoint xsi:type="dc:Point" x="712" y="311" /> - <di:waypoint xsi:type="dc:Point" x="777" y="311" /> + <di:waypoint x="812" y="311" /> + <di:waypoint x="877" y="311" /> <bpmndi:BPMNLabel> <dc:Bounds x="745" y="286" width="0" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn index 7a05163b0f..37459cdc7e 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0"> <bpmn:process id="DeleteNetworkBB" name="DeleteNetworkBB" isExecutable="true"> <bpmn:startEvent id="deleteNetwork_startEvent"> <bpmn:outgoing>SequenceFlow_1mc3d3f</bpmn:outgoing> @@ -17,12 +17,12 @@ <bpmn:incoming>SequenceFlow_0nhd7b7</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_0nhd7b7" sourceRef="updateNetworkAAI" targetRef="deleteNetwork_endEvent" /> - <bpmn:callActivity id="CallActivity_1a77pxk" name="AIC Delete (network) " calledElement="NetworkAdapterRestV1"> + <bpmn:callActivity id="CallActivity_1a77pxk" name="Network Adapter" calledElement="NetworkAdapter"> <bpmn:extensionElements> <camunda:in source="networkAdapterRequest" target="networkAdapterRequest" /> <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:out source="deleteNetworkResponse" target="deleteNetworkResponse" /> - <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_16ti327</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0gnafn2</bpmn:outgoing> @@ -52,8 +52,8 @@ <dc:Bounds x="626" y="103" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1mc3d3f_di" bpmnElement="SequenceFlow_1mc3d3f"> - <di:waypoint xsi:type="dc:Point" x="192" y="143" /> - <di:waypoint xsi:type="dc:Point" x="312" y="143" /> + <di:waypoint x="192" y="143" /> + <di:waypoint x="312" y="143" /> <bpmndi:BPMNLabel> <dc:Bounds x="207" y="122" width="90" height="12" /> </bpmndi:BPMNLabel> @@ -68,8 +68,8 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0nhd7b7_di" bpmnElement="SequenceFlow_0nhd7b7"> - <di:waypoint xsi:type="dc:Point" x="726" y="143" /> - <di:waypoint xsi:type="dc:Point" x="862" y="143" /> + <di:waypoint x="726" y="143" /> + <di:waypoint x="862" y="143" /> <bpmndi:BPMNLabel> <dc:Bounds x="749" y="122" width="90" height="12" /> </bpmndi:BPMNLabel> @@ -78,15 +78,15 @@ <dc:Bounds x="470" y="103" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_16ti327_di" bpmnElement="SequenceFlow_16ti327"> - <di:waypoint xsi:type="dc:Point" x="412" y="143" /> - <di:waypoint xsi:type="dc:Point" x="470" y="143" /> + <di:waypoint x="412" y="143" /> + <di:waypoint x="470" y="143" /> <bpmndi:BPMNLabel> <dc:Bounds x="396" y="122" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0gnafn2_di" bpmnElement="SequenceFlow_0gnafn2"> - <di:waypoint xsi:type="dc:Point" x="570" y="143" /> - <di:waypoint xsi:type="dc:Point" x="626" y="143" /> + <di:waypoint x="570" y="143" /> + <di:waypoint x="626" y="143" /> <bpmndi:BPMNLabel> <dc:Bounds x="553" y="122" width="90" height="12" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/NetworkAdapter.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/NetworkAdapter.bpmn new file mode 100644 index 0000000000..fe071a25ba --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/NetworkAdapter.bpmn @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0gecuy2" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0"> + <bpmn:process id="NetworkAdapter" name="NetworkAdapter" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1"> + <bpmn:outgoing>Flow_1te2q0o</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:sequenceFlow id="Flow_1te2q0o" sourceRef="StartEvent_1" targetRef="Activity_045o7mr" /> + <bpmn:sequenceFlow id="Flow_16y1hyp" sourceRef="Activity_045o7mr" targetRef="Activity_1ml9k96" /> + <bpmn:sequenceFlow id="Flow_03mucze" sourceRef="Activity_1ml9k96" targetRef="Activity_124f192" /> + <bpmn:endEvent id="Event_0mfsd2x"> + <bpmn:incoming>Flow_0dcm3bq</bpmn:incoming> + </bpmn:endEvent> + <bpmn:sequenceFlow id="Flow_0dcm3bq" sourceRef="Activity_124f192" targetRef="Event_0mfsd2x" /> + <bpmn:serviceTask id="Activity_045o7mr" name="Pre Process Request" camunda:expression="${NetworkAdapterImpl.preProcessNetworkAdapter(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>Flow_1te2q0o</bpmn:incoming> + <bpmn:outgoing>Flow_16y1hyp</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:serviceTask id="Activity_124f192" name="Post Process Response" camunda:expression="${NetworkAdapterImpl.postProcessNetworkAdapter(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>Flow_03mucze</bpmn:incoming> + <bpmn:outgoing>Flow_0dcm3bq</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:callActivity id="Activity_1ml9k96" name="Openstack Adapter" calledElement="openstackAdapterTask"> + <bpmn:extensionElements> + <camunda:in source="networkAdapterRequest" target="openstackAdapterTaskRequest" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="WorkflowResponse" target="WorkflowResponse" /> + </bpmn:extensionElements> + <bpmn:incoming>Flow_16y1hyp</bpmn:incoming> + <bpmn:outgoing>Flow_03mucze</bpmn:outgoing> + </bpmn:callActivity> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="NetworkAdapter"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> + <dc:Bounds x="179" y="82" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="Flow_1te2q0o_di" bpmnElement="Flow_1te2q0o"> + <di:waypoint x="215" y="100" /> + <di:waypoint x="300" y="100" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_16y1hyp_di" bpmnElement="Flow_16y1hyp"> + <di:waypoint x="400" y="100" /> + <di:waypoint x="490" y="100" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_03mucze_di" bpmnElement="Flow_03mucze"> + <di:waypoint x="590" y="100" /> + <di:waypoint x="680" y="100" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="Event_0mfsd2x_di" bpmnElement="Event_0mfsd2x"> + <dc:Bounds x="872" y="82" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="Flow_0dcm3bq_di" bpmnElement="Flow_0dcm3bq"> + <di:waypoint x="780" y="100" /> + <di:waypoint x="872" y="100" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="Activity_1gfh44k_di" bpmnElement="Activity_045o7mr"> + <dc:Bounds x="300" y="60" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1m5d1dj_di" bpmnElement="Activity_124f192"> + <dc:Bounds x="680" y="60" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_037d53l_di" bpmnElement="Activity_1ml9k96"> + <dc:Bounds x="490" y="60" width="100" height="80" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UpdateNetworkBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UpdateNetworkBB.bpmn index 1235469b42..f4ffa18267 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UpdateNetworkBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/UpdateNetworkBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="UpdateNetworkBB" name="UpdateNetworkBB" isExecutable="true"> <bpmn2:startEvent id="UpdateNetworkBB_Start" name="Start"> <bpmn2:outgoing>SequenceFlow_074w2et</bpmn2:outgoing> @@ -48,11 +48,12 @@ <bpmn2:endEvent id="UpdateNetworkBB_End" name="End"> <bpmn2:incoming>SequenceFlow_06ei0em</bpmn2:incoming> </bpmn2:endEvent> - <bpmn2:callActivity id="CallActivity_NetworkAdapterRestV1" name="Call NetworkAdapterRestV1" calledElement="NetworkAdapterRestV1"> + <bpmn2:callActivity id="CallActivity_NetworkAdapterRestV1" name="Network Adapter" calledElement="NetworkAdapter"> <bpmn2:extensionElements> <camunda:in source="networkAdapterRequest" target="networkAdapterRequest" /> <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:out source="updateNetworkResponse" target="updateNetworkResponse" /> + <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" /> </bpmn2:extensionElements> <bpmn2:incoming>SequenceFlow_07hq1eg</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_183ph5i</bpmn2:outgoing> @@ -61,7 +62,7 @@ <bpmn2:incoming>SequenceFlow_183ph5i</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_001ursg</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:serviceTask id="Create_Network_ServiceTask" name=" AIC Update (network) " camunda:expression="${NetworkAdapterUpdateTasks.updateNetwork(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn2:serviceTask id="Create_Network_ServiceTask" name="Prepare Request" camunda:expression="${NetworkAdapterUpdateTasks.updateNetwork(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn2:incoming>SequenceFlow_0qrtpcy</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_07hq1eg</bpmn2:outgoing> </bpmn2:serviceTask> @@ -98,8 +99,8 @@ <dc:Bounds x="278" y="55" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_074w2et_di" bpmnElement="SequenceFlow_074w2et"> - <di:waypoint xsi:type="dc:Point" x="180" y="95" /> - <di:waypoint xsi:type="dc:Point" x="278" y="95" /> + <di:waypoint x="180" y="95" /> + <di:waypoint x="278" y="95" /> <bpmndi:BPMNLabel> <dc:Bounds x="229" y="74" width="0" height="12" /> </bpmndi:BPMNLabel> @@ -117,8 +118,8 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1trqq6d_di" bpmnElement="SequenceFlow_1trqq6d"> - <di:waypoint xsi:type="dc:Point" x="180" y="233" /> - <di:waypoint xsi:type="dc:Point" x="280" y="233" /> + <di:waypoint x="180" y="233" /> + <di:waypoint x="280" y="233" /> <bpmndi:BPMNLabel> <dc:Bounds x="185" y="212" width="90" height="12" /> </bpmndi:BPMNLabel> @@ -130,15 +131,15 @@ <dc:Bounds x="455" y="193" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1io4cl7_di" bpmnElement="SequenceFlow_1io4cl7"> - <di:waypoint xsi:type="dc:Point" x="380" y="233" /> - <di:waypoint xsi:type="dc:Point" x="455" y="233" /> + <di:waypoint x="380" y="233" /> + <di:waypoint x="455" y="233" /> <bpmndi:BPMNLabel> <dc:Bounds x="417.5" y="212" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_16fm47t_di" bpmnElement="SequenceFlow_16fm47t"> - <di:waypoint xsi:type="dc:Point" x="555" y="233" /> - <di:waypoint xsi:type="dc:Point" x="625" y="233" /> + <di:waypoint x="555" y="233" /> + <di:waypoint x="625" y="233" /> <bpmndi:BPMNLabel> <dc:Bounds x="590" y="212" width="0" height="12" /> </bpmndi:BPMNLabel> @@ -153,8 +154,8 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_00xbxe7_di" bpmnElement="SequenceFlow_00xbxe7"> - <di:waypoint xsi:type="dc:Point" x="725" y="233" /> - <di:waypoint xsi:type="dc:Point" x="785" y="233" /> + <di:waypoint x="725" y="233" /> + <di:waypoint x="785" y="233" /> <bpmndi:BPMNLabel> <dc:Bounds x="755" y="212" width="0" height="12" /> </bpmndi:BPMNLabel> @@ -184,38 +185,38 @@ <dc:Bounds x="278" y="362" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0qrtpcy_di" bpmnElement="SequenceFlow_0qrtpcy"> - <di:waypoint xsi:type="dc:Point" x="180" y="402" /> - <di:waypoint xsi:type="dc:Point" x="229" y="402" /> - <di:waypoint xsi:type="dc:Point" x="229" y="402" /> - <di:waypoint xsi:type="dc:Point" x="278" y="402" /> + <di:waypoint x="180" y="402" /> + <di:waypoint x="229" y="402" /> + <di:waypoint x="229" y="402" /> + <di:waypoint x="278" y="402" /> <bpmndi:BPMNLabel> <dc:Bounds x="199" y="396" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_001ursg_di" bpmnElement="SequenceFlow_001ursg"> - <di:waypoint xsi:type="dc:Point" x="725" y="402" /> - <di:waypoint xsi:type="dc:Point" x="806" y="402" /> + <di:waypoint x="725" y="402" /> + <di:waypoint x="806" y="402" /> <bpmndi:BPMNLabel> <dc:Bounds x="720.5" y="381" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_06ei0em_di" bpmnElement="SequenceFlow_06ei0em"> - <di:waypoint xsi:type="dc:Point" x="906" y="402" /> - <di:waypoint xsi:type="dc:Point" x="983" y="402" /> + <di:waypoint x="906" y="402" /> + <di:waypoint x="983" y="402" /> <bpmndi:BPMNLabel> <dc:Bounds x="899.5" y="381" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_07hq1eg_di" bpmnElement="SequenceFlow_07hq1eg"> - <di:waypoint xsi:type="dc:Point" x="378" y="402" /> - <di:waypoint xsi:type="dc:Point" x="445" y="402" /> + <di:waypoint x="378" y="402" /> + <di:waypoint x="445" y="402" /> <bpmndi:BPMNLabel> <dc:Bounds x="411.5" y="381" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_183ph5i_di" bpmnElement="SequenceFlow_183ph5i"> - <di:waypoint xsi:type="dc:Point" x="545" y="402" /> - <di:waypoint xsi:type="dc:Point" x="625" y="402" /> + <di:waypoint x="545" y="402" /> + <di:waypoint x="625" y="402" /> <bpmndi:BPMNLabel> <dc:Bounds x="585" y="381" width="0" height="12" /> </bpmndi:BPMNLabel> @@ -224,15 +225,15 @@ <dc:Bounds x="455" y="55" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0rvstwt_di" bpmnElement="SequenceFlow_0rvstwt"> - <di:waypoint xsi:type="dc:Point" x="378" y="95" /> - <di:waypoint xsi:type="dc:Point" x="455" y="95" /> + <di:waypoint x="378" y="95" /> + <di:waypoint x="455" y="95" /> <bpmndi:BPMNLabel> <dc:Bounds x="416.5" y="74" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1eacnem_di" bpmnElement="SequenceFlow_1eacnem"> - <di:waypoint xsi:type="dc:Point" x="555" y="95" /> - <di:waypoint xsi:type="dc:Point" x="665" y="95" /> + <di:waypoint x="555" y="95" /> + <di:waypoint x="665" y="95" /> <bpmndi:BPMNLabel> <dc:Bounds x="610" y="74" width="0" height="12" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/VnfAdapter.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/VnfAdapter.bpmn index e139e94660..3448e8d577 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/VnfAdapter.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/VnfAdapter.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0"> <bpmn:process id="VnfAdapter" name="Vnf Adapter" isExecutable="true"> <bpmn:startEvent id="VnfAdapter_Start"> <bpmn:outgoing>SequenceFlow_1xr6chl</bpmn:outgoing> @@ -27,10 +27,10 @@ <bpmn:outgoing>SequenceFlow_1ivhukd</bpmn:outgoing> </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_1ivhukd" sourceRef="PostProcessResponse" targetRef="VnfAdapter_End" /> - <bpmn:callActivity id="Call_vnfAdapterTask" name=" Cloud Create (vnf) " calledElement="vnfAdapterTask"> + <bpmn:callActivity id="Call_openstackAdapterTask" name="Openstack Adapter" calledElement="openstackAdapterTask"> <bpmn:extensionElements> <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:in source="VNFREST_Request" target="vnfAdapterTaskRequest" /> + <camunda:in source="VNFREST_Request" target="openstackAdapterTaskRequest" /> <camunda:out source="WorkflowResponse" target="WorkflowResponse" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> @@ -38,8 +38,8 @@ <bpmn:incoming>SequenceFlow_0qaaf5k</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0j1zvis</bpmn:outgoing> </bpmn:callActivity> - <bpmn:sequenceFlow id="SequenceFlow_0qaaf5k" sourceRef="PreProcessRequest" targetRef="Call_vnfAdapterTask" /> - <bpmn:sequenceFlow id="SequenceFlow_0j1zvis" sourceRef="Call_vnfAdapterTask" targetRef="PostProcessResponse" /> + <bpmn:sequenceFlow id="SequenceFlow_0qaaf5k" sourceRef="PreProcessRequest" targetRef="Call_openstackAdapterTask" /> + <bpmn:sequenceFlow id="SequenceFlow_0j1zvis" sourceRef="Call_openstackAdapterTask" targetRef="PostProcessResponse" /> </bpmn:process> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VnfAdapter"> @@ -53,8 +53,8 @@ <dc:Bounds x="396" y="275" width="233" height="135" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1xr6chl_di" bpmnElement="SequenceFlow_1xr6chl"> - <di:waypoint xsi:type="dc:Point" x="192" y="121" /> - <di:waypoint xsi:type="dc:Point" x="272" y="121" /> + <di:waypoint x="192" y="121" /> + <di:waypoint x="272" y="121" /> <bpmndi:BPMNLabel> <dc:Bounds x="244" y="360" width="90" height="0" /> </bpmndi:BPMNLabel> @@ -72,10 +72,10 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1abat8l_di" bpmnElement="SequenceFlow_1abat8l"> - <di:waypoint xsi:type="dc:Point" x="470" y="337" /> - <di:waypoint xsi:type="dc:Point" x="509" y="337" /> - <di:waypoint xsi:type="dc:Point" x="509" y="337" /> - <di:waypoint xsi:type="dc:Point" x="549" y="337" /> + <di:waypoint x="470" y="337" /> + <di:waypoint x="509" y="337" /> + <di:waypoint x="509" y="337" /> + <di:waypoint x="549" y="337" /> <bpmndi:BPMNLabel> <dc:Bounds x="536" y="591" width="90" height="0" /> </bpmndi:BPMNLabel> @@ -93,25 +93,25 @@ <dc:Bounds x="657" y="81" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1ivhukd_di" bpmnElement="SequenceFlow_1ivhukd"> - <di:waypoint xsi:type="dc:Point" x="757" y="121" /> - <di:waypoint xsi:type="dc:Point" x="837" y="121" /> + <di:waypoint x="757" y="121" /> + <di:waypoint x="837" y="121" /> <bpmndi:BPMNLabel> <dc:Bounds x="809" y="354" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="CallActivity_0n6wnin_di" bpmnElement="Call_vnfAdapterTask"> + <bpmndi:BPMNShape id="CallActivity_0n6wnin_di" bpmnElement="Call_openstackAdapterTask"> <dc:Bounds x="463" y="81" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0qaaf5k_di" bpmnElement="SequenceFlow_0qaaf5k"> - <di:waypoint xsi:type="dc:Point" x="372" y="121" /> - <di:waypoint xsi:type="dc:Point" x="463" y="121" /> + <di:waypoint x="372" y="121" /> + <di:waypoint x="463" y="121" /> <bpmndi:BPMNLabel> <dc:Bounds x="429.5" y="354" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0j1zvis_di" bpmnElement="SequenceFlow_0j1zvis"> - <di:waypoint xsi:type="dc:Point" x="563" y="121" /> - <di:waypoint xsi:type="dc:Point" x="657" y="121" /> + <di:waypoint x="563" y="121" /> + <di:waypoint x="657" y="121" /> <bpmndi:BPMNLabel> <dc:Bounds x="622" y="354" width="90" height="12" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VnfAdapterTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VnfAdapterTest.java index 4dbf4d46ff..51384c6a87 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VnfAdapterTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VnfAdapterTest.java @@ -32,12 +32,12 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; public class VnfAdapterTest extends BaseBPMNTest { @Test public void vnfAdapterCreatedTest() { - mockSubprocess("vnfAdapterTask", "Mocked vnfAdapterTask", "GenericStub"); + mockSubprocess("openstackAdapterTask", "Mocked openstackAdapterTask", "GenericStub"); ProcessInstance pi = runtimeService.startProcessInstanceByKey("VnfAdapter", variables); assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("VnfAdapter_Start", "PreProcessRequest", "Call_vnfAdapterTask", - "PostProcessResponse", "VnfAdapter_End"); + assertThat(pi).isStarted().hasPassedInOrder("VnfAdapter_Start", "PreProcessRequest", + "Call_openstackAdapterTask", "PostProcessResponse", "VnfAdapter_End"); assertThat(pi).isEnded(); } diff --git a/bpmn/so-bpmn-infrastructure-common/pom.xml b/bpmn/so-bpmn-infrastructure-common/pom.xml index 1a4e9c6ee8..86df60bb54 100644 --- a/bpmn/so-bpmn-infrastructure-common/pom.xml +++ b/bpmn/so-bpmn-infrastructure-common/pom.xml @@ -32,11 +32,11 @@ </execution> </executions> </plugin> - <plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> - <configuration> + <configuration> <compilerId>groovy-eclipse-compiler</compilerId> </configuration> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy index 5c8ece88fe..4d1807b796 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy @@ -78,1355 +78,1323 @@ import groovy.xml.XmlUtil public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor { private static final Logger logger = LoggerFactory.getLogger( DoCreateNetworkInstance.class); - String Prefix="CRENWKI_" - ExceptionUtil exceptionUtil = new ExceptionUtil() - JsonUtils jsonUtil = new JsonUtils() - VidUtils vidUtils = new VidUtils(this) - NetworkUtils networkUtils = new NetworkUtils() - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - - def className = getClass().getSimpleName() - - /** - * This method is executed during the preProcessRequest task of the <class>DoCreateNetworkInstance.bpmn</class> process. - * @param execution - */ - public InitializeProcessVariables(DelegateExecution execution){ - /* Initialize all the process variables in this block */ - - execution.setVariable(Prefix + "networkRequest", "") - execution.setVariable(Prefix + "rollbackEnabled", null) - execution.setVariable(Prefix + "networkInputs", "") - //execution.setVariable(Prefix + "requestId", "") - execution.setVariable(Prefix + "messageId", "") - execution.setVariable(Prefix + "source", "") - execution.setVariable("BasicAuthHeaderValuePO", "") - execution.setVariable("BasicAuthHeaderValueSDNC", "") - execution.setVariable(Prefix + "serviceInstanceId","") - execution.setVariable("GENGS_type", "") - execution.setVariable(Prefix + "rsrc_endpoint", null) - execution.setVariable(Prefix + "networkOutputs", "") - execution.setVariable(Prefix + "networkId","") - execution.setVariable(Prefix + "networkName","") - - // AAI query Name - execution.setVariable(Prefix + "queryNameAAIRequest","") - execution.setVariable(Prefix + "queryNameAAIResponse", "") - execution.setVariable(Prefix + "aaiNameReturnCode", "") - execution.setVariable(Prefix + "isAAIqueryNameGood", false) - - // AAI query Cloud Region - execution.setVariable(Prefix + "queryCloudRegionRequest","") - execution.setVariable(Prefix + "queryCloudRegionReturnCode","") - execution.setVariable(Prefix + "queryCloudRegionResponse","") - execution.setVariable(Prefix + "cloudRegionPo","") - execution.setVariable(Prefix + "cloudRegionSdnc","") - execution.setVariable(Prefix + "isCloudRegionGood", false) - - // AAI query Id - execution.setVariable(Prefix + "queryIdAAIRequest","") - execution.setVariable(Prefix + "queryIdAAIResponse", "") - execution.setVariable(Prefix + "aaiIdReturnCode", "") - - // AAI query vpn binding - execution.setVariable(Prefix + "queryVpnBindingAAIRequest","") - execution.setVariable(Prefix + "queryVpnBindingAAIResponse", "") - execution.setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "") - execution.setVariable(Prefix + "vpnBindings", null) - execution.setVariable(Prefix + "vpnCount", 0) - execution.setVariable(Prefix + "routeCollection", "") - - // AAI query network policy - execution.setVariable(Prefix + "queryNetworkPolicyAAIRequest","") - execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", "") - execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "") - execution.setVariable(Prefix + "networkPolicyUriList", null) - execution.setVariable(Prefix + "networkPolicyCount", 0) - execution.setVariable(Prefix + "networkCollection", "") - - // AAI query route table reference - execution.setVariable(Prefix + "queryNetworkTableRefAAIRequest","") - execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", "") - execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "") - execution.setVariable(Prefix + "networkTableRefUriList", null) - execution.setVariable(Prefix + "networkTableRefCount", 0) - execution.setVariable(Prefix + "tableRefCollection", "") - - // AAI requery Id - execution.setVariable(Prefix + "requeryIdAAIRequest","") - execution.setVariable(Prefix + "requeryIdAAIResponse", "") - execution.setVariable(Prefix + "aaiRequeryIdReturnCode", "") - - // AAI update contrail - execution.setVariable(Prefix + "updateContrailAAIUrlRequest","") - execution.setVariable(Prefix + "updateContrailAAIPayloadRequest","") - execution.setVariable(Prefix + "updateContrailAAIResponse", "") - execution.setVariable(Prefix + "aaiUpdateContrailReturnCode", "") - - execution.setVariable(Prefix + "createNetworkRequest", "") - execution.setVariable(Prefix + "createNetworkResponse", "") - execution.setVariable(Prefix + "rollbackNetworkRequest", "") - //execution.setVariable(Prefix + "rollbackNetworkResponse", "") - execution.setVariable(Prefix + "networkReturnCode", "") - //execution.setVariable(Prefix + "rollbackNetworkReturnCode", "") - execution.setVariable(Prefix + "isNetworkRollbackNeeded", false) - - execution.setVariable(Prefix + "assignSDNCRequest", "") - execution.setVariable(Prefix + "assignSDNCResponse", "") - execution.setVariable(Prefix + "rollbackSDNCRequest", "") - //execution.setVariable(Prefix + "rollbackSDNCResponse", "") - execution.setVariable(Prefix + "sdncReturnCode", "") - //execution.setVariable(Prefix + "rollbackSDNCReturnCode", "") - execution.setVariable(Prefix + "isSdncRollbackNeeded", false) - execution.setVariable(Prefix + "sdncResponseSuccess", false) - - execution.setVariable(Prefix + "activateSDNCRequest", "") - execution.setVariable(Prefix + "activateSDNCResponse", "") - execution.setVariable(Prefix + "rollbackActivateSDNCRequest", "") - //execution.setVariable(Prefix + "rollbackActivateSDNCResponse", "") - execution.setVariable(Prefix + "sdncActivateReturnCode", "") - //execution.setVariable(Prefix + "rollbackActivateSDNCReturnCode", "") - execution.setVariable(Prefix + "isSdncActivateRollbackNeeded", false) - execution.setVariable(Prefix + "sdncActivateResponseSuccess", false) - - execution.setVariable(Prefix + "orchestrationStatus", "") - execution.setVariable(Prefix + "isVnfBindingPresent", false) - execution.setVariable(Prefix + "Success", false) - - execution.setVariable(Prefix + "isException", false) - - } - - // ************************************************** - // Pre or Prepare Request Section - // ************************************************** - /** - * This method is executed during the preProcessRequest task of the <class>DoCreateNetworkInstance.bpmn</class> process. - * @param execution - */ - public void preProcessRequest (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - logger.trace("Inside preProcessRequest() of " + className + ".groovy") - - try { - // initialize flow variables - InitializeProcessVariables(execution) - - // GET Incoming request & validate 3 kinds of format. - execution.setVariable("action", "CREATE") - String networkRequest = execution.getVariable("bpmnRequest") - if (networkRequest != null) { - if (networkRequest.contains("requestDetails")) { - // JSON format request is sent, create xml - try { - def prettyJson = JsonOutput.prettyPrint(networkRequest.toString()) - logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson) - networkRequest = vidUtils.createXmlNetworkRequestInfra(execution, networkRequest) - - } catch (Exception ex) { - String dataErrorMessage = " Invalid json format Request - " + ex.getMessage() - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - } else { - // XML format request is sent - - } - } else { - // vIPR format request is sent, create xml from individual variables - networkRequest = vidUtils.createXmlNetworkRequestInstance(execution) - } - - networkRequest = utils.formatXml(networkRequest) - execution.setVariable(Prefix + "networkRequest", networkRequest) - logger.debug(Prefix + "networkRequest - " + '\n' + networkRequest) - - // validate 'backout-on-failure' to override 'mso.rollback' - boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, networkRequest) - execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled) - logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled) - - String networkInputs = utils.getNodeXml(networkRequest, "network-inputs", false).replace("tag0:","").replace(":tag0","") - execution.setVariable(Prefix + "networkInputs", networkInputs) - logger.debug(Prefix + "networkInputs - " + '\n' + networkInputs) - - // prepare messageId - String messageId = execution.getVariable("testMessageId") // for testing - if (messageId == null || messageId == "") { - messageId = UUID.randomUUID() - logger.debug(Prefix + "messageId, random generated: " + messageId) - } else { - logger.debug(Prefix + "messageId, pre-assigned: " + messageId) - } - execution.setVariable(Prefix + "messageId", messageId) - - String source = utils.getNodeText(networkRequest, "source") - execution.setVariable(Prefix + "source", source) - logger.debug(Prefix + "source - " + source) - - // validate cloud region - String lcpCloudRegionId = utils.getNodeText(networkRequest, "aic-cloud-region") - if ((lcpCloudRegionId == null) || (lcpCloudRegionId == "") || (lcpCloudRegionId == "null")) { - String dataErrorMessage = "Missing value/element: 'lcpCloudRegionId' or 'cloudConfiguration' or 'aic-cloud-region'." - logger.debug(" Invalid Request - " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - // validate service instance id - String serviceInstanceId = utils.getNodeText(networkRequest, "service-instance-id") - if ((serviceInstanceId == null) || (serviceInstanceId == "") || (serviceInstanceId == "null")) { - String dataErrorMessage = "Missing value/element: 'serviceInstanceId'." - logger.debug(" Invalid Request - " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - // PO Authorization Info / headers Authorization= - String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution) - - try { - def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey",execution)) - execution.setVariable("BasicAuthHeaderValuePO",encodedString) - execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) - - } catch (IOException ex) { - String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - " - String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage() - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - // Set variables for Generic Get Sub Flow use - execution.setVariable(Prefix + "serviceInstanceId", serviceInstanceId) - logger.debug(Prefix + "serviceInstanceId - " + serviceInstanceId) - - execution.setVariable("GENGS_type", "service-instance") - logger.debug("GENGS_type - " + "service-instance") - logger.debug(" Url for SDNC adapter: " + UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint",execution)) - - String sdncVersion = execution.getVariable("sdncVersion") - logger.debug("sdncVersion? : " + sdncVersion) - - // build 'networkOutputs' - String networkId = utils.getNodeText(networkRequest, "network-id") - if ((networkId == null) || (networkId == "null")) { - networkId = "" - } - String networkName = utils.getNodeText(networkRequest, "network-name") - if ((networkName == null) || (networkName == "null")) { - networkName = "" - } - String networkOutputs = - """<network-outputs> + String Prefix="CRENWKI_" + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + VidUtils vidUtils = new VidUtils(this) + NetworkUtils networkUtils = new NetworkUtils() + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + + def className = getClass().getSimpleName() + + /** + * This method is executed during the preProcessRequest task of the <class>DoCreateNetworkInstance.bpmn</class> process. + * @param execution + */ + public InitializeProcessVariables(DelegateExecution execution){ + /* Initialize all the process variables in this block */ + + execution.setVariable(Prefix + "networkRequest", "") + execution.setVariable(Prefix + "rollbackEnabled", null) + execution.setVariable(Prefix + "networkInputs", "") + //execution.setVariable(Prefix + "requestId", "") + execution.setVariable(Prefix + "messageId", "") + execution.setVariable(Prefix + "source", "") + execution.setVariable("BasicAuthHeaderValuePO", "") + execution.setVariable("BasicAuthHeaderValueSDNC", "") + execution.setVariable(Prefix + "serviceInstanceId","") + execution.setVariable("GENGS_type", "") + execution.setVariable(Prefix + "rsrc_endpoint", null) + execution.setVariable(Prefix + "networkOutputs", "") + execution.setVariable(Prefix + "networkId","") + execution.setVariable(Prefix + "networkName","") + + // AAI query Name + execution.setVariable(Prefix + "queryNameAAIRequest","") + execution.setVariable(Prefix + "queryNameAAIResponse", "") + execution.setVariable(Prefix + "aaiNameReturnCode", "") + execution.setVariable(Prefix + "isAAIqueryNameGood", false) + + // AAI query Cloud Region + execution.setVariable(Prefix + "queryCloudRegionRequest","") + execution.setVariable(Prefix + "queryCloudRegionReturnCode","") + execution.setVariable(Prefix + "queryCloudRegionResponse","") + execution.setVariable(Prefix + "cloudRegionPo","") + execution.setVariable(Prefix + "cloudRegionSdnc","") + execution.setVariable(Prefix + "isCloudRegionGood", false) + + // AAI query Id + execution.setVariable(Prefix + "queryIdAAIRequest","") + execution.setVariable(Prefix + "queryIdAAIResponse", "") + execution.setVariable(Prefix + "aaiIdReturnCode", "") + + // AAI query vpn binding + execution.setVariable(Prefix + "queryVpnBindingAAIRequest","") + execution.setVariable(Prefix + "queryVpnBindingAAIResponse", "") + execution.setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "") + execution.setVariable(Prefix + "vpnBindings", null) + execution.setVariable(Prefix + "vpnCount", 0) + execution.setVariable(Prefix + "routeCollection", "") + + // AAI query network policy + execution.setVariable(Prefix + "queryNetworkPolicyAAIRequest","") + execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", "") + execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "") + execution.setVariable(Prefix + "networkPolicyUriList", null) + execution.setVariable(Prefix + "networkPolicyCount", 0) + execution.setVariable(Prefix + "networkCollection", "") + + // AAI query route table reference + execution.setVariable(Prefix + "queryNetworkTableRefAAIRequest","") + execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", "") + execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "") + execution.setVariable(Prefix + "networkTableRefUriList", null) + execution.setVariable(Prefix + "networkTableRefCount", 0) + execution.setVariable(Prefix + "tableRefCollection", "") + + // AAI requery Id + execution.setVariable(Prefix + "requeryIdAAIRequest","") + execution.setVariable(Prefix + "requeryIdAAIResponse", "") + execution.setVariable(Prefix + "aaiRequeryIdReturnCode", "") + + // AAI update contrail + execution.setVariable(Prefix + "updateContrailAAIUrlRequest","") + execution.setVariable(Prefix + "updateContrailAAIPayloadRequest","") + execution.setVariable(Prefix + "updateContrailAAIResponse", "") + execution.setVariable(Prefix + "aaiUpdateContrailReturnCode", "") + + execution.setVariable(Prefix + "createNetworkRequest", "") + execution.setVariable(Prefix + "createNetworkResponse", "") + execution.setVariable(Prefix + "rollbackNetworkRequest", "") + //execution.setVariable(Prefix + "rollbackNetworkResponse", "") + execution.setVariable(Prefix + "networkReturnCode", "") + //execution.setVariable(Prefix + "rollbackNetworkReturnCode", "") + execution.setVariable(Prefix + "isNetworkRollbackNeeded", false) + + execution.setVariable(Prefix + "assignSDNCRequest", "") + execution.setVariable(Prefix + "assignSDNCResponse", "") + execution.setVariable(Prefix + "rollbackSDNCRequest", "") + //execution.setVariable(Prefix + "rollbackSDNCResponse", "") + execution.setVariable(Prefix + "sdncReturnCode", "") + //execution.setVariable(Prefix + "rollbackSDNCReturnCode", "") + execution.setVariable(Prefix + "isSdncRollbackNeeded", false) + execution.setVariable(Prefix + "sdncResponseSuccess", false) + + execution.setVariable(Prefix + "activateSDNCRequest", "") + execution.setVariable(Prefix + "activateSDNCResponse", "") + execution.setVariable(Prefix + "rollbackActivateSDNCRequest", "") + //execution.setVariable(Prefix + "rollbackActivateSDNCResponse", "") + execution.setVariable(Prefix + "sdncActivateReturnCode", "") + //execution.setVariable(Prefix + "rollbackActivateSDNCReturnCode", "") + execution.setVariable(Prefix + "isSdncActivateRollbackNeeded", false) + execution.setVariable(Prefix + "sdncActivateResponseSuccess", false) + + execution.setVariable(Prefix + "orchestrationStatus", "") + execution.setVariable(Prefix + "isVnfBindingPresent", false) + execution.setVariable(Prefix + "Success", false) + + execution.setVariable(Prefix + "isException", false) + + } + + // ************************************************** + // Pre or Prepare Request Section + // ************************************************** + /** + * This method is executed during the preProcessRequest task of the <class>DoCreateNetworkInstance.bpmn</class> process. + * @param execution + */ + public void preProcessRequest (DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + logger.trace("Inside preProcessRequest() of " + className + ".groovy") + + try { + // initialize flow variables + InitializeProcessVariables(execution) + + // GET Incoming request & validate 3 kinds of format. + execution.setVariable("action", "CREATE") + String networkRequest = execution.getVariable("bpmnRequest") + if (networkRequest != null) { + if (networkRequest.contains("requestDetails")) { + // JSON format request is sent, create xml + try { + def prettyJson = JsonOutput.prettyPrint(networkRequest.toString()) + logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson) + networkRequest = vidUtils.createXmlNetworkRequestInfra(execution, networkRequest) + + } catch (Exception ex) { + String dataErrorMessage = " Invalid json format Request - " + ex.getMessage() + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + } else { + // XML format request is sent + + } + } else { + // vIPR format request is sent, create xml from individual variables + networkRequest = vidUtils.createXmlNetworkRequestInstance(execution) + } + + networkRequest = utils.formatXml(networkRequest) + execution.setVariable(Prefix + "networkRequest", networkRequest) + logger.debug(Prefix + "networkRequest - " + '\n' + networkRequest) + + // validate 'backout-on-failure' to override 'mso.rollback' + boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, networkRequest) + execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled) + logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled) + + String networkInputs = utils.getNodeXml(networkRequest, "network-inputs", false).replace("tag0:","").replace(":tag0","") + execution.setVariable(Prefix + "networkInputs", networkInputs) + logger.debug(Prefix + "networkInputs - " + '\n' + networkInputs) + + // prepare messageId + String messageId = execution.getVariable("testMessageId") // for testing + if (messageId == null || messageId == "") { + messageId = UUID.randomUUID() + logger.debug(Prefix + "messageId, random generated: " + messageId) + } else { + logger.debug(Prefix + "messageId, pre-assigned: " + messageId) + } + execution.setVariable(Prefix + "messageId", messageId) + + String source = utils.getNodeText(networkRequest, "source") + execution.setVariable(Prefix + "source", source) + logger.debug(Prefix + "source - " + source) + + // validate cloud region + String lcpCloudRegionId = utils.getNodeText(networkRequest, "aic-cloud-region") + if ((lcpCloudRegionId == null) || (lcpCloudRegionId == "") || (lcpCloudRegionId == "null")) { + String dataErrorMessage = "Missing value/element: 'lcpCloudRegionId' or 'cloudConfiguration' or 'aic-cloud-region'." + logger.debug(" Invalid Request - " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + + // validate service instance id + String serviceInstanceId = utils.getNodeText(networkRequest, "service-instance-id") + if ((serviceInstanceId == null) || (serviceInstanceId == "") || (serviceInstanceId == "null")) { + String dataErrorMessage = "Missing value/element: 'serviceInstanceId'." + logger.debug(" Invalid Request - " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + + // PO Authorization Info / headers Authorization= + String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution) + + try { + def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey",execution)) + execution.setVariable("BasicAuthHeaderValuePO",encodedString) + execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) + + } catch (IOException ex) { + String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - " + String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage() + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + + // Set variables for Generic Get Sub Flow use + execution.setVariable(Prefix + "serviceInstanceId", serviceInstanceId) + logger.debug(Prefix + "serviceInstanceId - " + serviceInstanceId) + + execution.setVariable("GENGS_type", "service-instance") + logger.debug("GENGS_type - " + "service-instance") + logger.debug(" Url for SDNC adapter: " + UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint",execution)) + + String sdncVersion = execution.getVariable("sdncVersion") + logger.debug("sdncVersion? : " + sdncVersion) + + // build 'networkOutputs' + String networkId = utils.getNodeText(networkRequest, "network-id") + if ((networkId == null) || (networkId == "null")) { + networkId = "" + } + String networkName = utils.getNodeText(networkRequest, "network-name") + if ((networkName == null) || (networkName == "null")) { + networkName = "" + } + String networkOutputs = + """<network-outputs> <network-id>${MsoUtils.xmlEscape(networkId)}</network-id> <network-name>${MsoUtils.xmlEscape(networkName)}</network-name> </network-outputs>""" - execution.setVariable(Prefix + "networkOutputs", networkOutputs) - logger.debug(Prefix + "networkOutputs - " + '\n' + networkOutputs) - execution.setVariable(Prefix + "networkId", networkId) - execution.setVariable(Prefix + "networkName", networkName) + execution.setVariable(Prefix + "networkOutputs", networkOutputs) + logger.debug(Prefix + "networkOutputs - " + '\n' + networkOutputs) + execution.setVariable(Prefix + "networkId", networkId) + execution.setVariable(Prefix + "networkName", networkName) - } catch (BpmnError e) { - throw e; + } catch (BpmnError e) { + throw e; - } catch (Exception ex) { - sendSyncError(execution) - // caught exception - String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + sendSyncError(execution) + // caught exception + String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - /** - * Gets the service instance uri from aai - */ - public void getServiceInstance(DelegateExecution execution) { - try { - String serviceInstanceId = execution.getVariable('CRENWKI_serviceInstanceId') + /** + * Gets the service instance uri from aai + */ + public void getServiceInstance(DelegateExecution execution) { + try { + String serviceInstanceId = execution.getVariable('CRENWKI_serviceInstanceId') - AAIResourcesClient resourceClient = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId) + AAIResourcesClient resourceClient = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId) - if(!resourceClient.exists(uri)){ - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai") - }else{ - Map<String, String> keys = uri.getURIKeys() - execution.setVariable("serviceType", keys.get("service-type")) - execution.setVariable("subscriberName", keys.get("global-customer-id")) - } + if(!resourceClient.exists(uri)){ + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai") + }else{ + Map<String, String> keys = uri.getURIKeys() + execution.setVariable("serviceType", keys.get("service-type")) + execution.setVariable("subscriberName", keys.get("global-customer-id")) + } - }catch(BpmnError e) { - throw e; - }catch (Exception ex){ - String msg = "Exception in getServiceInstance. " + ex.getMessage() - logger.debug(msg) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) - } - } + }catch(BpmnError e) { + throw e; + }catch (Exception ex){ + String msg = "Exception in getServiceInstance. " + ex.getMessage() + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } - public void callRESTQueryAAINetworkName (DelegateExecution execution) { + public void callRESTQueryAAINetworkName (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.debug(" ***** Inside callRESTQueryAAINetworkName() of DoCreateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTQueryAAINetworkName() of DoCreateNetworkInstance ***** " ) - try{ - // get variables - String networkInputs = execution.getVariable(Prefix + "networkInputs") - String networkName = utils.getNodeText(networkInputs, "network-name") + try{ + // get variables + String networkInputs = execution.getVariable(Prefix + "networkInputs") + String networkName = utils.getNodeText(networkInputs, "network-name") - AAIResourcesClient client = new AAIResourcesClient() - AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName) - L3Networks networks = client.get(uri, NotFoundException.class).asBean(L3Networks.class).get() - L3Network network = networks.getL3Network().get(0) + AAIResourcesClient client = new AAIResourcesClient() + AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName) + L3Networks networks = client.get(uri, NotFoundException.class).asBean(L3Networks.class).get() + L3Network network = networks.getL3Network().get(0) - execution.setVariable(Prefix + "isAAIqueryNameGood", true) - String orchestrationStatus = network.getOrchestrationStatus() - execution.setVariable(Prefix + "orchestrationStatus", orchestrationStatus.toUpperCase()) - logger.debug(Prefix + "orchestrationStatus - " + orchestrationStatus.toUpperCase()) - execution.setVariable("orchestrationStatus", orchestrationStatus) + execution.setVariable(Prefix + "isAAIqueryNameGood", true) + String orchestrationStatus = network.getOrchestrationStatus() + execution.setVariable(Prefix + "orchestrationStatus", orchestrationStatus.toUpperCase()) + logger.debug(Prefix + "orchestrationStatus - " + orchestrationStatus.toUpperCase()) + execution.setVariable("orchestrationStatus", orchestrationStatus) - logger.debug(Prefix + "isAAIqueryNameGood? : " + execution.getVariable(Prefix + "isAAIqueryNameGood")) + logger.debug(Prefix + "isAAIqueryNameGood? : " + execution.getVariable(Prefix + "isAAIqueryNameGood")) - } catch (NotFoundException e) { - logger.debug(" QueryAAINetworkName return code = '404' (Not Found). Proceed with the Create !!! ") + } catch (NotFoundException e) { + logger.debug(" QueryAAINetworkName return code = '404' (Not Found). Proceed with the Create !!! ") - } catch (Exception ex) { - // try error - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow - callRESTQueryAAINetworkName() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + // try error + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow - callRESTQueryAAINetworkName() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void callRESTQueryAAICloudRegion (DelegateExecution execution) { + public void callRESTQueryAAICloudRegion (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.debug(" ***** Inside callRESTQueryAAICloudRegion() of DoCreateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTQueryAAICloudRegion() of DoCreateNetworkInstance ***** " ) - try { - String networkInputs = execution.getVariable(Prefix + "networkInputs") - String cloudRegion = utils.getNodeText(networkInputs, "aic-cloud-region") + try { + String networkInputs = execution.getVariable(Prefix + "networkInputs") + String cloudRegion = utils.getNodeText(networkInputs, "aic-cloud-region") - // Prepare AA&I url - AaiUtil aaiUtil = new AaiUtil(this) + // Prepare AA&I url + AaiUtil aaiUtil = new AaiUtil(this) - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion) - def queryCloudRegionRequest = aaiUtil.createAaiUri(uri) + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion) + def queryCloudRegionRequest = aaiUtil.createAaiUri(uri) - execution.setVariable(Prefix + "queryCloudRegionRequest", queryCloudRegionRequest) + execution.setVariable(Prefix + "queryCloudRegionRequest", queryCloudRegionRequest) - String cloudRegionPo = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion) - String cloudRegionSdnc = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "SDNC", cloudRegion) + String cloudRegionPo = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion) + String cloudRegionSdnc = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "SDNC", cloudRegion) - if ((cloudRegionPo != "ERROR") && (cloudRegionSdnc != "ERROR")) { - execution.setVariable(Prefix + "cloudRegionPo", cloudRegionPo) - execution.setVariable(Prefix + "cloudRegionSdnc", cloudRegionSdnc) - execution.setVariable(Prefix + "isCloudRegionGood", true) + if ((cloudRegionPo != "ERROR") && (cloudRegionSdnc != "ERROR")) { + execution.setVariable(Prefix + "cloudRegionPo", cloudRegionPo) + execution.setVariable(Prefix + "cloudRegionSdnc", cloudRegionSdnc) + execution.setVariable(Prefix + "isCloudRegionGood", true) - } else { - String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode") - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } else { + String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode") + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } + } - logger.debug(" is Cloud Region Good: " + execution.getVariable(Prefix + "isCloudRegionGood")) + logger.debug(" is Cloud Region Good: " + execution.getVariable(Prefix + "isCloudRegionGood")) - } catch (BpmnError e) { - throw e; + } catch (BpmnError e) { + throw e; - } catch (Exception ex) { - // try error - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow - callRESTQueryAAICloudRegion() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + // try error + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow - callRESTQueryAAICloudRegion() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void callRESTQueryAAINetworkId(DelegateExecution execution) { + public void callRESTQueryAAINetworkId(DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.debug(" ***** Inside callRESTQueryAAINetworkId() of DoCreateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTQueryAAINetworkId() of DoCreateNetworkInstance ***** " ) - try { - // get variables - String networkId = "" - String assignSDNCResponse = execution.getVariable(Prefix + "assignSDNCResponse") - if (execution.getVariable("sdncVersion") != "1610") { - String networkResponseInformation = "" - try { - networkResponseInformation = utils.getNodeXml(assignSDNCResponse, "network-response-information", false).replace("tag0:","").replace(":tag0","") - networkId = utils.getNodeText(networkResponseInformation, "instance-id") - } catch (Exception ex) { - String dataErrorMessage = " SNDC Response network validation for 'instance-id' (network-id) failed: Empty <network-response-information>" - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } + try { + // get variables + String networkId = "" + String assignSDNCResponse = execution.getVariable(Prefix + "assignSDNCResponse") + if (execution.getVariable("sdncVersion") != "1610") { + String networkResponseInformation = "" + try { + networkResponseInformation = utils.getNodeXml(assignSDNCResponse, "network-response-information", false).replace("tag0:","").replace(":tag0","") + networkId = utils.getNodeText(networkResponseInformation, "instance-id") + } catch (Exception ex) { + String dataErrorMessage = " SNDC Response network validation for 'instance-id' (network-id) failed: Empty <network-response-information>" + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } - } else { - networkId = utils.getNodeText(assignSDNCResponse, "network-id") - } - if (networkId == null || networkId == "null") { - String dataErrorMessage = "SNDC Response did not contains 'instance-id' or 'network-id' element, or the value is null." - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } else { - logger.debug(" SNDC Response network validation for 'instance-id' (network-id)' is good: " + networkId) - } + } else { + networkId = utils.getNodeText(assignSDNCResponse, "network-id") + } + if (networkId == null || networkId == "null") { + String dataErrorMessage = "SNDC Response did not contains 'instance-id' or 'network-id' element, or the value is null." + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } else { + logger.debug(" SNDC Response network validation for 'instance-id' (network-id)' is good: " + networkId) + } - execution.setVariable(Prefix + "networkId", networkId) - String networkName = utils.getNodeText(assignSDNCResponse, "network-name") - execution.setVariable(Prefix + "networkName", networkName) + execution.setVariable(Prefix + "networkId", networkId) + String networkName = utils.getNodeText(assignSDNCResponse, "network-name") + execution.setVariable(Prefix + "networkName", networkName) - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ONE) - L3Network network = client.get(uri, NotFoundException.class).asBean(L3Network.class).get() + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ONE) + L3Network network = client.get(uri, NotFoundException.class).asBean(L3Network.class).get() - execution.setVariable(Prefix + "queryIdAAIResponse", network) + execution.setVariable(Prefix + "queryIdAAIResponse", network) - String netId = network.getNetworkId() - execution.setVariable(Prefix + "networkId", netId) - String netName = network.getNetworkName() - execution.setVariable(Prefix + "networkName", netName) + String netId = network.getNetworkId() + execution.setVariable(Prefix + "networkId", netId) + String netName = network.getNetworkName() + execution.setVariable(Prefix + "networkName", netName) - } catch (NotFoundException e) { - String dataErrorMessage = "Response Error from QueryAAINetworkId is 404 (Not Found)." - logger.debug(" AAI Query Failed. " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } catch (NotFoundException e) { + String dataErrorMessage = "Response Error from QueryAAINetworkId is 404 (Not Found)." + logger.debug(" AAI Query Failed. " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkId() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkId() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void callRESTReQueryAAINetworkId(DelegateExecution execution) { + public void callRESTReQueryAAINetworkId(DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.debug(" ***** Inside callRESTReQueryAAINetworkId() of DoCreateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTReQueryAAINetworkId() of DoCreateNetworkInstance ***** " ) - try { - // get variables - String networkId = execution.getVariable(Prefix + "networkId") - String netId = networkId + try { + // get variables + String networkId = execution.getVariable(Prefix + "networkId") + String netId = networkId - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ONE) - L3Network network = client.get(uri, NotFoundException.class).asBean(L3Network.class).get() + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ONE) + L3Network network = client.get(uri, NotFoundException.class).asBean(L3Network.class).get() - execution.setVariable(Prefix + "aaiRequeryIdReturnCode", "200") - execution.setVariable(Prefix + "requeryIdAAIResponse", network) + execution.setVariable(Prefix + "aaiRequeryIdReturnCode", "200") + execution.setVariable(Prefix + "requeryIdAAIResponse", network) - String netName = network.getNetworkName() - String networkOutputs = - """<network-outputs> + String netName = network.getNetworkName() + String networkOutputs = + """<network-outputs> <network-id>${MsoUtils.xmlEscape(netId)}</network-id> <network-name>${MsoUtils.xmlEscape(netName)}</network-name> </network-outputs>""" - execution.setVariable(Prefix + "networkOutputs", networkOutputs) - logger.debug(" networkOutputs - " + '\n' + networkOutputs) + execution.setVariable(Prefix + "networkOutputs", networkOutputs) + logger.debug(" networkOutputs - " + '\n' + networkOutputs) - } catch (NotFoundException e) { - String dataErrorMessage = "Response Error from ReQueryAAINetworkId is 404 (Not Found)." - logger.debug(" AAI ReQuery Failed. - " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } catch (NotFoundException e) { + String dataErrorMessage = "Response Error from ReQueryAAINetworkId is 404 (Not Found)." + logger.debug(" AAI ReQuery Failed. - " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTReQueryAAINetworkId() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTReQueryAAINetworkId() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void callRESTQueryAAINetworkVpnBinding(DelegateExecution execution) { + public void callRESTQueryAAINetworkVpnBinding(DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.debug(" ***** Inside callRESTQueryAAINetworkVpnBinding() of DoCreateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTQueryAAINetworkVpnBinding() of DoCreateNetworkInstance ***** " ) - try { + try { - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, execution.getVariable(Prefix + "networkId")) - Optional<Relationships> relationships = client.get(uri, NotFoundException.class).getRelationships() - if(relationships.isPresent()){ - List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.VPN_BINDING) + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, execution.getVariable(Prefix + "networkId")) + Optional<Relationships> relationships = client.get(uri, NotFoundException.class).getRelationships() + if(relationships.isPresent()){ + List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.VPN_BINDING) - logger.debug(Prefix + "vpnCount - " + uris.size()) + logger.debug(Prefix + "vpnCount - " + uris.size()) - if (uris.size() > 0) { - String routeTargets = "" - for(AAIResourceUri u : uris) { + if (uris.size() > 0) { + String routeTargets = "" + for(AAIResourceUri u : uris) { - AAIResultWrapper wrapper = client.get(u.depth(Depth.TWO), NotFoundException.class) - Optional<VpnBinding> binding = wrapper.asBean(VpnBinding.class) + AAIResultWrapper wrapper = client.get(u.depth(Depth.TWO), NotFoundException.class) + Optional<VpnBinding> binding = wrapper.asBean(VpnBinding.class) - String routeTarget = "" - String routeRole = "" - if(binding.get().getRouteTargets() != null) { - List<RouteTarget> targets = binding.get().getRouteTargets().getRouteTarget() - for(RouteTarget target : targets) { - routeTarget = target.getGlobalRouteTarget() - routeRole = target.getRouteTargetRole() - routeTargets += "<routeTargets>" + '\n' + - " <routeTarget>" + routeTarget + "</routeTarget>" + '\n' + - " <routeTargetRole>" + routeRole + "</routeTargetRole>" + '\n' + - "</routeTargets>" + '\n' - } - } + String routeTarget = "" + String routeRole = "" + if(binding.get().getRouteTargets() != null) { + List<RouteTarget> targets = binding.get().getRouteTargets().getRouteTarget() + for(RouteTarget target : targets) { + routeTarget = target.getGlobalRouteTarget() + routeRole = target.getRouteTargetRole() + routeTargets += "<routeTargets>" + '\n' + + " <routeTarget>" + routeTarget + "</routeTarget>" + '\n' + + " <routeTargetRole>" + routeRole + "</routeTargetRole>" + '\n' + + "</routeTargets>" + '\n' + } + } - } // end loop + } // end loop - execution.setVariable(Prefix + "routeCollection", routeTargets) - logger.debug(Prefix + "routeCollection - " + '\n' + routeTargets) + execution.setVariable(Prefix + "routeCollection", routeTargets) + logger.debug(Prefix + "routeCollection - " + '\n' + routeTargets) - } else { - // reset return code to success - execution.setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200") - AaiUtil aaiUriUtil = new AaiUtil(this) - String schemaVersion = aaiUriUtil.getNamespace() - String aaiStubResponse = - """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> + } else { + // reset return code to success + execution.setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200") + AaiUtil aaiUriUtil = new AaiUtil(this) + String schemaVersion = aaiUriUtil.getNamespace() + String aaiStubResponse = + """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> <vpn-binding xmlns="${schemaVersion}"> <global-route-target/> </vpn-binding> </rest:payload>""" - String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) - execution.setVariable(Prefix + "queryVpnBindingAAIResponse", aaiStubResponseAsXml) - execution.setVariable(Prefix + "routeCollection", "<routeTargets/>") - logger.debug(" No vpnBinding, using this stub as response - " + '\n' + aaiStubResponseAsXml) + String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) + execution.setVariable(Prefix + "queryVpnBindingAAIResponse", aaiStubResponseAsXml) + execution.setVariable(Prefix + "routeCollection", "<routeTargets/>") + logger.debug(" No vpnBinding, using this stub as response - " + '\n' + aaiStubResponseAsXml) - } - } + } + } - } catch (NotFoundException e) { - logger.debug("Response Error from AAINetworkVpnBinding is 404 (Not Found).") - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Response Error from AAINetworkVpnBinding is 404 (Not Found).") - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkVpnBinding() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (NotFoundException e) { + logger.debug("Response Error from AAINetworkVpnBinding is 404 (Not Found).") + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Response Error from AAINetworkVpnBinding is 404 (Not Found).") + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkVpnBinding() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void callRESTQueryAAINetworkPolicy(DelegateExecution execution) { + public void callRESTQueryAAINetworkPolicy(DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.debug(" ***** Inside callRESTQueryAAINetworkPolicy() of DoCreateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTQueryAAINetworkPolicy() of DoCreateNetworkInstance ***** " ) - try { - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, execution.getVariable(Prefix + "networkId")) - Optional<Relationships> relationships = client.get(uri, NotFoundException.class).getRelationships() - if(relationships.isPresent()){ - List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.NETWORK_POLICY) + try { + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, execution.getVariable(Prefix + "networkId")) + Optional<Relationships> relationships = client.get(uri, NotFoundException.class).getRelationships() + if(relationships.isPresent()){ + List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.NETWORK_POLICY) - execution.setVariable(Prefix + "networkPolicyCount", uris.size()) - logger.debug(Prefix + "networkPolicyCount - " + uris.size()) + execution.setVariable(Prefix + "networkPolicyCount", uris.size()) + logger.debug(Prefix + "networkPolicyCount - " + uris.size()) - if (uris.size() > 0) { + if (uris.size() > 0) { - String networkPolicies = "" - // AII loop call using list vpnBindings - for(AAIResourceUri u : uris) { + String networkPolicies = "" + // AII loop call using list vpnBindings + for(AAIResourceUri u : uris) { - NetworkPolicy p = client.get(u, NotFoundException.class).asBean(NetworkPolicy.class).get() + NetworkPolicy p = client.get(u, NotFoundException.class).asBean(NetworkPolicy.class).get() - execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200") + execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200") - String networkPolicy = p.getNetworkPolicyFqdn() - networkPolicies += "<policyFqdns>" + networkPolicy + "</policyFqdns>" + '\n' + String networkPolicy = p.getNetworkPolicyFqdn() + networkPolicies += "<policyFqdns>" + networkPolicy + "</policyFqdns>" + '\n' - } // end loop + } // end loop - execution.setVariable(Prefix + "networkCollection", networkPolicies) - logger.debug(Prefix + "networkCollection - " + '\n' + networkPolicies) + execution.setVariable(Prefix + "networkCollection", networkPolicies) + logger.debug(Prefix + "networkCollection - " + '\n' + networkPolicies) - } else { - // reset return code to success - execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200") - AaiUtil aaiUriUtil = new AaiUtil(this) - String schemaVersion = aaiUriUtil.getNamespace() - String aaiStubResponse = - """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> + } else { + // reset return code to success + execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200") + AaiUtil aaiUriUtil = new AaiUtil(this) + String schemaVersion = aaiUriUtil.getNamespace() + String aaiStubResponse = + """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> <network-policy xmlns="${schemaVersion}"> <network-policy-fqdn/> </network-policy> </rest:payload>""" - String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) - execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", aaiStubResponseAsXml) - execution.setVariable(Prefix + "networkCollection", "<policyFqdns/>") - logger.debug(" No net policies, using this stub as response - " + '\n' + aaiStubResponseAsXml) + String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) + execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", aaiStubResponseAsXml) + execution.setVariable(Prefix + "networkCollection", "<policyFqdns/>") + logger.debug(" No net policies, using this stub as response - " + '\n' + aaiStubResponseAsXml) - } - } - } catch (NotFoundException e) { - String dataErrorMessage = "Response Error from QueryAAINetworkPolicy is 404 (Not Found)." - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + } + } catch (NotFoundException e) { + String dataErrorMessage = "Response Error from QueryAAINetworkPolicy is 404 (Not Found)." + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkPolicy() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkPolicy() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void callRESTQueryAAINetworkTableRef(DelegateExecution execution) { + public void callRESTQueryAAINetworkTableRef(DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.debug(" ***** Inside callRESTQueryAAINetworkTableRef() of DoCreateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTQueryAAINetworkTableRef() of DoCreateNetworkInstance ***** " ) - try { + try { - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, execution.getVariable(Prefix + "networkId")) - Optional<Relationships> relationships = client.get(uri, NotFoundException.class).getRelationships() - if(relationships.isPresent()){ - List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.ROUTE_TABLE_REFERENCE) + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, execution.getVariable(Prefix + "networkId")) + Optional<Relationships> relationships = client.get(uri, NotFoundException.class).getRelationships() + if(relationships.isPresent()){ + List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.ROUTE_TABLE_REFERENCE) - execution.setVariable(Prefix + "networkTableRefCount", uris.size()) - logger.debug(Prefix + "networkTableRefCount - " + uris.size()) + execution.setVariable(Prefix + "networkTableRefCount", uris.size()) + logger.debug(Prefix + "networkTableRefCount - " + uris.size()) - if (uris.size() > 0) { + if (uris.size() > 0) { - // AII loop call using list vpnBindings - String networkTableRefs = "" - for(AAIResourceUri u : uris) { + // AII loop call using list vpnBindings + String networkTableRefs = "" + for(AAIResourceUri u : uris) { - RouteTableReference rt = client.get(u, NotFoundException.class).asBean(RouteTableReference.class).get() + RouteTableReference rt = client.get(u, NotFoundException.class).asBean(RouteTableReference.class).get() - String networkTableRef = rt.getRouteTableReferenceFqdn() - networkTableRefs += "<routeTableFqdns>" + networkTableRef + "</routeTableFqdns>" + '\n' + String networkTableRef = rt.getRouteTableReferenceFqdn() + networkTableRefs += "<routeTableFqdns>" + networkTableRef + "</routeTableFqdns>" + '\n' - } // end loop + } // end loop - execution.setVariable(Prefix + "tableRefCollection", networkTableRefs) - logger.debug(Prefix + "tableRefCollection - " + '\n' + networkTableRefs) + execution.setVariable(Prefix + "tableRefCollection", networkTableRefs) + logger.debug(Prefix + "tableRefCollection - " + '\n' + networkTableRefs) - } else { - // reset return code to success - execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200") - AaiUtil aaiUriUtil = new AaiUtil(this) - String schemaVersion = aaiUriUtil.getNamespace() - String aaiStubResponse = - """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> + } else { + // reset return code to success + execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200") + AaiUtil aaiUriUtil = new AaiUtil(this) + String schemaVersion = aaiUriUtil.getNamespace() + String aaiStubResponse = + """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> <route-table-references xmlns="${schemaVersion}"> <route-table-reference-fqdn/> </route-table-references> </rest:payload>""" - String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) - execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", aaiStubResponseAsXml) - execution.setVariable(Prefix + "tableRefCollection", "<routeTableFqdns/>") - logger.debug(" No net table references, using this stub as response - " + '\n' + aaiStubResponseAsXml) - - } - } - - } catch (NotFoundException e) { - String dataErrorMessage = "Response Error from QueryAAINetworkTableRef is 404 (Not Found)." - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkTableRef() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - - public void callRESTUpdateContrailAAINetwork(DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace(" ***** Inside callRESTUpdateContrailAAINetwork() of DoCreateNetworkInstance ***** " ) - - try { - // get variables - String networkId = execution.getVariable(Prefix + "networkId") - L3Network requeryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") - String createNetworkResponse = execution.getVariable(Prefix + "createNetworkResponse") - - L3Network l3Network = new L3Network() - if (StringUtils.isBlank(requeryIdAAIResponse.getHeatStackId())) { - if (utils.nodeExists(createNetworkResponse, 'networkStackId')) { - l3Network.setHeatStackId(utils.getNodeText(createNetworkResponse, 'networkStackId')) - } - } - if (StringUtils.isBlank(requeryIdAAIResponse.getNeutronNetworkId())) { - if (utils.nodeExists(createNetworkResponse, 'neutronNetworkId')) { - l3Network.setNeutronNetworkId(utils.getNodeText(createNetworkResponse, 'neutronNetworkId')) - } - } - if (StringUtils.isBlank(requeryIdAAIResponse.getContrailNetworkFqdn())) { - if (utils.nodeExists(createNetworkResponse, 'networkFqdn')) { - l3Network.setContrailNetworkFqdn(utils.getNodeText(createNetworkResponse, 'networkFqdn')) - } - } - - String status = utils.getNodeText(createNetworkResponse, 'orchestration-status') - if(status.equals("pending-create") || status.equals("PendingCreate")){ - l3Network.setOrchestrationStatus("Created") - }else{ - l3Network.setOrchestrationStatus("Active") - } - - logger.debug("Updating l3-network in AAI" ) - - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId) - client.update(uri, l3Network) - - if(requeryIdAAIResponse.getSubnets() != null){ - for(Subnet s:requeryIdAAIResponse.getSubnets().getSubnet()){ - String subnetOrchStatus = s.getOrchestrationStatus() - String subnetId = s.getSubnetId() - Subnet subnet = new Subnet() - subnet.setNeutronSubnetId(networkUtils.extractNeutSubId(createNetworkResponse, subnetId)) - if(subnetOrchStatus.equals("pending-create") || subnetOrchStatus.equals("PendingCreate") ){ - subnet.setOrchestrationStatus("Created") - }else{ - subnet.setOrchestrationStatus("Active") - } - - logger.debug("Updating subnet in AAI" ) - AAIResourceUri subUri = AAIUriFactory.createResourceUri(AAIObjectType.SUBNET, networkId, subnetId) - client.update(subUri, subnet) - - } - } - - String rollbackEnabled = execution.getVariable(Prefix + "rollbackEnabled") - if (rollbackEnabled == "true") { - execution.setVariable(Prefix + "isPONR", false) - } else { - execution.setVariable(Prefix + "isPONR", true) - } - logger.debug(Prefix + "isPONR" + ": " + execution.getVariable(Prefix + "isPONR")) - - } catch (BpmnError e) { - throw e; - } catch (NotFoundException e) { - String dataErrorMessage = " Response Error from UpdateContrailAAINetwork is 404 (Not Found)." - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTUpdateContrailAAINetwork() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } - } - - public void prepareCreateNetworkRequest (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside prepareCreateNetworkRequest() of DoCreateNetworkInstance") - - try { - - // get variables - String requestId = execution.getVariable("msoRequestId") - if (requestId == null) { - requestId = execution.getVariable("mso-request-id") - } - String messageId = execution.getVariable(Prefix + "messageId") - String source = execution.getVariable(Prefix + "source") - - String requestInput = execution.getVariable(Prefix + "networkRequest") - L3Network queryIdResponse = execution.getVariable(Prefix + "queryIdAAIResponse") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionPo") - String backoutOnFailure = execution.getVariable(Prefix + "rollbackEnabled") - - // Prepare Network request - String routeCollection = execution.getVariable(Prefix + "routeCollection") - String policyCollection = execution.getVariable(Prefix + "networkCollection") - String tableCollection = execution.getVariable(Prefix + "tableRefCollection") - String createNetworkRequest = networkUtils.CreateNetworkRequestV2(execution, requestId, messageId, requestInput, queryIdResponse, routeCollection, policyCollection, tableCollection, cloudRegionId, backoutOnFailure, source ) - // Format Response - String buildDeleteNetworkRequestAsString = utils.formatXml(createNetworkRequest) - buildDeleteNetworkRequestAsString = buildDeleteNetworkRequestAsString.replace(":w1aac13n0", "").replace("w1aac13n0:", "") - - execution.setVariable(Prefix + "createNetworkRequest", buildDeleteNetworkRequestAsString) - logger.debug(Prefix + "createNetworkRequest - " + "\n" + buildDeleteNetworkRequestAsString) - - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareCreateNetworkRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) + execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", aaiStubResponseAsXml) + execution.setVariable(Prefix + "tableRefCollection", "<routeTableFqdns/>") + logger.debug(" No net table references, using this stub as response - " + '\n' + aaiStubResponseAsXml) + + } + } + + } catch (NotFoundException e) { + String dataErrorMessage = "Response Error from QueryAAINetworkTableRef is 404 (Not Found)." + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkTableRef() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + + } + + } + + + public void callRESTUpdateContrailAAINetwork(DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + + logger.trace(" ***** Inside callRESTUpdateContrailAAINetwork() of DoCreateNetworkInstance ***** " ) + + try { + // get variables + String networkId = execution.getVariable(Prefix + "networkId") + L3Network requeryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") + String createNetworkResponse = execution.getVariable(Prefix + "createNetworkResponse") + + L3Network l3Network = new L3Network() + if (StringUtils.isBlank(requeryIdAAIResponse.getHeatStackId())) { + if (utils.nodeExists(createNetworkResponse, 'networkStackId')) { + l3Network.setHeatStackId(utils.getNodeText(createNetworkResponse, 'networkStackId')) + } + } + if (StringUtils.isBlank(requeryIdAAIResponse.getNeutronNetworkId())) { + if (utils.nodeExists(createNetworkResponse, 'neutronNetworkId')) { + l3Network.setNeutronNetworkId(utils.getNodeText(createNetworkResponse, 'neutronNetworkId')) + } + } + if (StringUtils.isBlank(requeryIdAAIResponse.getContrailNetworkFqdn())) { + if (utils.nodeExists(createNetworkResponse, 'networkFqdn')) { + l3Network.setContrailNetworkFqdn(utils.getNodeText(createNetworkResponse, 'networkFqdn')) + } + } + + String status = utils.getNodeText(createNetworkResponse, 'orchestration-status') + if(status.equals("pending-create") || status.equals("PendingCreate")){ + l3Network.setOrchestrationStatus("Created") + }else{ + l3Network.setOrchestrationStatus("Active") + } + + logger.debug("Updating l3-network in AAI" ) + + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId) + client.update(uri, l3Network) + + if(requeryIdAAIResponse.getSubnets() != null){ + for(Subnet s:requeryIdAAIResponse.getSubnets().getSubnet()){ + String subnetOrchStatus = s.getOrchestrationStatus() + String subnetId = s.getSubnetId() + Subnet subnet = new Subnet() + subnet.setNeutronSubnetId(networkUtils.extractNeutSubId(createNetworkResponse, subnetId)) + if(subnetOrchStatus.equals("pending-create") || subnetOrchStatus.equals("PendingCreate") ){ + subnet.setOrchestrationStatus("Created") + }else{ + subnet.setOrchestrationStatus("Active") + } + + logger.debug("Updating subnet in AAI" ) + AAIResourceUri subUri = AAIUriFactory.createResourceUri(AAIObjectType.SUBNET, networkId, subnetId) + client.update(subUri, subnet) + + } + } + + String rollbackEnabled = execution.getVariable(Prefix + "rollbackEnabled") + if (rollbackEnabled == "true") { + execution.setVariable(Prefix + "isPONR", false) + } else { + execution.setVariable(Prefix + "isPONR", true) + } + logger.debug(Prefix + "isPONR" + ": " + execution.getVariable(Prefix + "isPONR")) + + } catch (BpmnError e) { + throw e; + } catch (NotFoundException e) { + String dataErrorMessage = " Response Error from UpdateContrailAAINetwork is 404 (Not Found)." + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTUpdateContrailAAINetwork() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } + } + + public void prepareCreateNetworkRequest (DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + + logger.trace("Inside prepareCreateNetworkRequest() of DoCreateNetworkInstance") + + try { + + // get variables + String requestId = execution.getVariable("msoRequestId") + if (requestId == null) { + requestId = execution.getVariable("mso-request-id") + } + String messageId = execution.getVariable(Prefix + "messageId") + String source = execution.getVariable(Prefix + "source") + + String requestInput = execution.getVariable(Prefix + "networkRequest") + L3Network queryIdResponse = execution.getVariable(Prefix + "queryIdAAIResponse") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionPo") + String backoutOnFailure = execution.getVariable(Prefix + "rollbackEnabled") + + // Prepare Network request + String routeCollection = execution.getVariable(Prefix + "routeCollection") + String policyCollection = execution.getVariable(Prefix + "networkCollection") + String tableCollection = execution.getVariable(Prefix + "tableRefCollection") + String createNetworkRequest = networkUtils.CreateNetworkRequestV2(execution, requestId, messageId, requestInput, queryIdResponse, routeCollection, policyCollection, tableCollection, cloudRegionId, backoutOnFailure, source ) + // Format Response + String buildDeleteNetworkRequestAsString = utils.formatXml(createNetworkRequest) + buildDeleteNetworkRequestAsString = buildDeleteNetworkRequestAsString.replace(":w1aac13n0", "").replace("w1aac13n0:", "") + + execution.setVariable(Prefix + "createNetworkRequest", buildDeleteNetworkRequestAsString) + logger.debug(Prefix + "createNetworkRequest - " + "\n" + buildDeleteNetworkRequestAsString) + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareCreateNetworkRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void prepareSDNCRequest (DelegateExecution execution) { + public void prepareSDNCRequest (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside prepareSDNCRequest() of DoCreateNetworkInstance") + logger.trace("Inside prepareSDNCRequest() of DoCreateNetworkInstance") - try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String createNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + try { + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String createNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String networkId = execution.getVariable(Prefix + "networkId") - String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") + String networkId = execution.getVariable(Prefix + "networkId") + String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") - // get/set 'msoRequestId' and 'mso-request-id' - String requestId = execution.getVariable("msoRequestId") - if (requestId != null) { - execution.setVariable("mso-request-id", requestId) - } else { - requestId = execution.getVariable("mso-request-id") - } - execution.setVariable(Prefix + "requestId", requestId) + // get/set 'msoRequestId' and 'mso-request-id' + String requestId = execution.getVariable("msoRequestId") + if (requestId != null) { + execution.setVariable("mso-request-id", requestId) + } else { + requestId = execution.getVariable("mso-request-id") + } + execution.setVariable(Prefix + "requestId", requestId) - // 1. prepare assign topology via SDNC Adapter SUBFLOW call - String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, createNetworkInput, serviceInstanceId, sdncCallback, "assign", "NetworkActivateRequest", cloudRegionId, networkId, null, null) + // 1. prepare assign topology via SDNC Adapter SUBFLOW call + String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, createNetworkInput, serviceInstanceId, sdncCallback, "assign", "NetworkActivateRequest", cloudRegionId, networkId, null, null) - String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) - execution.setVariable(Prefix + "assignSDNCRequest", sndcTopologyCreateRequesAsString) - logger.debug(Prefix + "assignSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString) + String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) + execution.setVariable(Prefix + "assignSDNCRequest", sndcTopologyCreateRequesAsString) + logger.debug(Prefix + "assignSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSDNCRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSDNCRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void prepareRpcSDNCRequest (DelegateExecution execution) { + public void prepareRpcSDNCRequest (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside prepareRpcSDNCRequest() of DoCreateNetworkInstance") + logger.trace("Inside prepareRpcSDNCRequest() of DoCreateNetworkInstance") - try { - // get variables + try { + // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String createNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String createNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String networkId = execution.getVariable(Prefix + "networkId") - String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") + String networkId = execution.getVariable(Prefix + "networkId") + String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") - // 1. prepare assign topology via SDNC Adapter SUBFLOW call - String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "assign", "CreateNetworkInstance", cloudRegionId, networkId, null) + // 1. prepare assign topology via SDNC Adapter SUBFLOW call + String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "assign", "CreateNetworkInstance", cloudRegionId, networkId, null) - String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) - execution.setVariable(Prefix + "assignSDNCRequest", sndcTopologyCreateRequesAsString) - logger.debug(Prefix + "assignSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString) + String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) + execution.setVariable(Prefix + "assignSDNCRequest", sndcTopologyCreateRequesAsString) + logger.debug(Prefix + "assignSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void prepareRpcSDNCActivateRequest (DelegateExecution execution) { + public void prepareRpcSDNCActivateRequest (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside prepareRpcSDNCActivateRequest() of DoCreateNetworkInstance") + logger.trace("Inside prepareRpcSDNCActivateRequest() of DoCreateNetworkInstance") - try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String createNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String networkId = execution.getVariable(Prefix + "networkId") - String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") + try { + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String createNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + String networkId = execution.getVariable(Prefix + "networkId") + String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") - // 1. prepare assign topology via SDNC Adapter SUBFLOW call - String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "activate", "CreateNetworkInstance", cloudRegionId, networkId, null) + // 1. prepare assign topology via SDNC Adapter SUBFLOW call + String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "activate", "CreateNetworkInstance", cloudRegionId, networkId, null) - String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) - execution.setVariable(Prefix + "activateSDNCRequest", sndcTopologyCreateRequesAsString) - logger.debug(Prefix + "activateSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString) + String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) + execution.setVariable(Prefix + "activateSDNCRequest", sndcTopologyCreateRequesAsString) + logger.debug(Prefix + "activateSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCActivateRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCActivateRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - // ************************************************** - // Post or Validate Response Section - // ************************************************** + // ************************************************** + // Post or Validate Response Section + // ************************************************** - public void validateCreateNetworkResponse (DelegateExecution execution) { + public void validateCreateNetworkResponse (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside validateNetworkResponse() of DoCreateNetworkInstance") + logger.trace("Inside validateNetworkResponse() of DoCreateNetworkInstance") - try { - String returnCode = execution.getVariable(Prefix + "networkReturnCode") - String networkResponse = execution.getVariable(Prefix + "createNetworkResponse") - if (networkResponse==null) { - networkResponse="" // reset - } + try { + String networkResponse = execution.getVariable(Prefix + "createNetworkResponse") + if (networkResponse==null) { + networkResponse="" // reset + } - logger.debug(" Network Adapter create responseCode: " + returnCode) + execution.setVariable(Prefix + "isNetworkRollbackNeeded", true) + execution.setVariable(Prefix + "createNetworkResponse", networkResponse) + logger.debug(" Network Adapter create Success Response - " + "\n" + networkResponse) - String errorMessage = "" - if (returnCode == "200") { - execution.setVariable(Prefix + "isNetworkRollbackNeeded", true) - execution.setVariable(Prefix + "createNetworkResponse", networkResponse) - logger.debug(" Network Adapter create Success Response - " + "\n" + networkResponse) - - // prepare rollback data - String rollbackData = utils.getNodeXml(networkResponse, "rollback", false).replace("tag0:","").replace(":tag0","") - rollbackData = rollbackData.replace("rollback>", "networkRollback>") - String rollbackNetwork = - """<rollbackNetworkRequest> + // prepare rollback data + String rollbackData = utils.getNodeXml(networkResponse, "rollback", false).replace("tag0:","").replace(":tag0","") + rollbackData = rollbackData.replace("rollback>", "networkRollback>") + String rollbackNetwork = + """<rollbackNetworkRequest> ${rollbackData} </rollbackNetworkRequest>""" - String rollbackNetworkXml = utils.formatXml(rollbackNetwork) - execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkXml) - logger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml) - - } else { // network error - if (returnCode.toInteger() > 399 && returnCode.toInteger() < 600) { //4xx, 5xx - if (networkResponse.contains("createNetworkError")) { - networkResponse = networkResponse.replace('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>', '') - errorMessage = utils.getNodeText(networkResponse, "message") - errorMessage = "Received error from Network Adapter: " + errorMessage - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage) - - } else { // CatchAll exception - if (returnCode == "500") { - errorMessage = "JBWEB000065: HTTP Status 500." - } else { - errorMessage = "Return code is " + returnCode - } - errorMessage = "Received error from Network Adapter: " + errorMessage - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage) - - } - - } else { // CatchAll exception - String dataErrorMessage = "Received error from Network Adapter. Return code is: " + returnCode - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - - } - - } + String rollbackNetworkXml = utils.formatXml(rollbackNetwork) + execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkXml) + logger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml) - } catch (BpmnError e) { - throw e; + } catch (BpmnError e) { + throw e; - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. validateCreateNetworkResponse() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. validateCreateNetworkResponse() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void validateSDNCResponse (DelegateExecution execution) { + public void validateSDNCResponse (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside validateSDNCResponse() of DoCreateNetworkInstance") + logger.trace("Inside validateSDNCResponse() of DoCreateNetworkInstance") - String response = execution.getVariable(Prefix + "assignSDNCResponse") - boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - WorkflowException workflowException = execution.getVariable("WorkflowException") + String response = execution.getVariable(Prefix + "assignSDNCResponse") + boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") + WorkflowException workflowException = execution.getVariable("WorkflowException") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) - // reset variable - String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "assignSDNCResponse") - assignSDNCResponseDecodeXml = assignSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") - execution.setVariable(Prefix + "assignSDNCResponse", assignSDNCResponseDecodeXml) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) + // reset variable + String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "assignSDNCResponse") + assignSDNCResponseDecodeXml = assignSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") + execution.setVariable(Prefix + "assignSDNCResponse", assignSDNCResponseDecodeXml) - if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess' - execution.setVariable(Prefix + "isSdncRollbackNeeded", true) - logger.debug("Successfully Validated SDNC Response") + if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess' + execution.setVariable(Prefix + "isSdncRollbackNeeded", true) + logger.debug("Successfully Validated SDNC Response") - } else { - logger.debug("Did NOT Successfully Validated SDNC Response") - throw new BpmnError("MSOWorkflowException") - } + } else { + logger.debug("Did NOT Successfully Validated SDNC Response") + throw new BpmnError("MSOWorkflowException") + } - } + } - public void validateRpcSDNCActivateResponse (DelegateExecution execution) { + public void validateRpcSDNCActivateResponse (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside validateRpcSDNCActivateResponse() of DoCreateNetworkInstance") + logger.trace("Inside validateRpcSDNCActivateResponse() of DoCreateNetworkInstance") - String response = execution.getVariable(Prefix + "activateSDNCResponse") - boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - WorkflowException workflowException = execution.getVariable("WorkflowException") + String response = execution.getVariable(Prefix + "activateSDNCResponse") + boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") + WorkflowException workflowException = execution.getVariable("WorkflowException") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) - // reset variable - String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "activateSDNCResponse") - assignSDNCResponseDecodeXml = assignSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") - execution.setVariable(Prefix + "activateSDNCResponse", assignSDNCResponseDecodeXml) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) + // reset variable + String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "activateSDNCResponse") + assignSDNCResponseDecodeXml = assignSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") + execution.setVariable(Prefix + "activateSDNCResponse", assignSDNCResponseDecodeXml) - if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess' - execution.setVariable(Prefix + "isSdncActivateRollbackNeeded", true) - logger.debug("Successfully Validated Rpc SDNC Activate Response") + if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess' + execution.setVariable(Prefix + "isSdncActivateRollbackNeeded", true) + logger.debug("Successfully Validated Rpc SDNC Activate Response") - } else { - logger.debug("Did NOT Successfully Validated Rpc SDNC Activate Response") - throw new BpmnError("MSOWorkflowException") - } + } else { + logger.debug("Did NOT Successfully Validated Rpc SDNC Activate Response") + throw new BpmnError("MSOWorkflowException") + } - } + } - public void prepareSDNCRollbackRequest (DelegateExecution execution) { + public void prepareSDNCRollbackRequest (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside prepareSDNCRollbackRequest() of DoCreateNetworkInstance") + logger.trace("Inside prepareSDNCRollbackRequest() of DoCreateNetworkInstance") - try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String createNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String assignSDNCResponse = execution.getVariable(Prefix + "assignSDNCResponse") - String networkId = execution.getVariable(Prefix + "networkId") - if (networkId == 'null') {networkId = ""} - String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") + try { + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String createNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + String assignSDNCResponse = execution.getVariable(Prefix + "assignSDNCResponse") + String networkId = execution.getVariable(Prefix + "networkId") + if (networkId == 'null') {networkId = ""} + String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") - // 2. prepare rollback topology via SDNC Adapter SUBFLOW call - String sndcTopologyRollbackRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, createNetworkInput, serviceInstanceId, sdncCallback, "rollback", "NetworkActivateRequest", cloudRegionId, networkId, null, null) - String sndcTopologyRollbackRequestAsString = utils.formatXml(sndcTopologyRollbackRequest) - execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRequestAsString) - logger.debug(" Preparing request for SDNC Topology 'rollback-NetworkActivateRequest' rollback . . . - " + "\n" + sndcTopologyRollbackRequestAsString) + // 2. prepare rollback topology via SDNC Adapter SUBFLOW call + String sndcTopologyRollbackRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, createNetworkInput, serviceInstanceId, sdncCallback, "rollback", "NetworkActivateRequest", cloudRegionId, networkId, null, null) + String sndcTopologyRollbackRequestAsString = utils.formatXml(sndcTopologyRollbackRequest) + execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRequestAsString) + logger.debug(" Preparing request for SDNC Topology 'rollback-NetworkActivateRequest' rollback . . . - " + "\n" + sndcTopologyRollbackRequestAsString) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSDNCRollbackRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSDNCRollbackRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void prepareRpcSDNCRollbackRequest (DelegateExecution execution) { + public void prepareRpcSDNCRollbackRequest (DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside prepareRpcSDNCRollbackRequest() of DoCreateNetworkInstance") + logger.trace("Inside prepareRpcSDNCRollbackRequest() of DoCreateNetworkInstance") - try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String createNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String assignSDNCResponse = execution.getVariable(Prefix + "assignSDNCResponse") - String networkId = execution.getVariable(Prefix + "networkId") - if (networkId == 'null') {networkId = ""} - String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") + try { + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String createNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + String assignSDNCResponse = execution.getVariable(Prefix + "assignSDNCResponse") + String networkId = execution.getVariable(Prefix + "networkId") + if (networkId == 'null') {networkId = ""} + String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") - // 2. prepare rollback topology via SDNC Adapter SUBFLOW call - String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "unassign", "DeleteNetworkInstance", cloudRegionId, networkId, null) - String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) - execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRpcRequestAsString) - logger.debug(" Preparing request for SDNC Topology 'unassign-DeleteNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString) + // 2. prepare rollback topology via SDNC Adapter SUBFLOW call + String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "unassign", "DeleteNetworkInstance", cloudRegionId, networkId, null) + String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) + execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRpcRequestAsString) + logger.debug(" Preparing request for SDNC Topology 'unassign-DeleteNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCRollbackRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCRollbackRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void prepareRpcSDNCActivateRollback(DelegateExecution execution) { + public void prepareRpcSDNCActivateRollback(DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside prepareRpcSDNCActivateRollback() of DoCreateNetworkInstance") + logger.trace("Inside prepareRpcSDNCActivateRollback() of DoCreateNetworkInstance") - try { + try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String createNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String activateSDNCResponse = execution.getVariable(Prefix + "activateSDNCResponse") - String networkId = execution.getVariable(Prefix + "networkId") - if (networkId == 'null') {networkId = ""} - String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") - - // 2. prepare rollback topology via SDNC Adapter SUBFLOW call - String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "deactivate", "DeleteNetworkInstance", cloudRegionId, networkId, null) - String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) - execution.setVariable(Prefix + "rollbackActivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString) - logger.debug(" Preparing request for RPC SDNC Topology 'deactivate-DeleteNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString) - - - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCActivateRollback() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - - } - - } + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String createNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + String activateSDNCResponse = execution.getVariable(Prefix + "activateSDNCResponse") + String networkId = execution.getVariable(Prefix + "networkId") + if (networkId == 'null') {networkId = ""} + String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId") + + // 2. prepare rollback topology via SDNC Adapter SUBFLOW call + String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "deactivate", "DeleteNetworkInstance", cloudRegionId, networkId, null) + String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) + execution.setVariable(Prefix + "rollbackActivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString) + logger.debug(" Preparing request for RPC SDNC Topology 'deactivate-DeleteNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString) + + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCActivateRollback() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + + } + + } - public void prepareRollbackData(DelegateExecution execution) { + public void prepareRollbackData(DelegateExecution execution) { - execution.setVariable("prefix",Prefix) - - logger.trace("Inside prepareRollbackData() of DoCreateNetworkInstance") - - try { - - Map<String, String> rollbackData = new HashMap<String, String>(); - String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") - if (rollbackSDNCRequest != null) { - if (rollbackSDNCRequest != "") { - rollbackData.put("rollbackSDNCRequest", execution.getVariable(Prefix + "rollbackSDNCRequest")) - } - } - String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") - if (rollbackNetworkRequest != null) { - if (rollbackNetworkRequest != "") { - rollbackData.put("rollbackNetworkRequest", execution.getVariable(Prefix + "rollbackNetworkRequest")) - } - } - String rollbackActivateSDNCRequest = execution.getVariable(Prefix + "rollbackActivateSDNCRequest") - if (rollbackActivateSDNCRequest != null) { - if (rollbackActivateSDNCRequest != "") { - rollbackData.put("rollbackActivateSDNCRequest", execution.getVariable(Prefix + "rollbackActivateSDNCRequest")) - } - } - execution.setVariable("rollbackData", rollbackData) - logger.debug("** rollbackData : " + rollbackData) - - execution.setVariable("WorkflowException", execution.getVariable(Prefix + "WorkflowException")) - logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException")) - - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRollbackData() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void postProcessResponse(DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside postProcessResponse() of DoCreateNetworkInstance") - - try { - - //Conditions: - // 1. Silent Success: execution.getVariable("CRENWKI_orchestrationStatus") == "ACTIVE" - // 2. Success: execution.getVariable("WorkflowException") == null (NULL) - // 3. WorkflowException: execution.getVariable("WorkflowException") != null (NOT NULL) - - logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException")) - // successful flow - if (execution.getVariable(Prefix + "isException") == false) { - // set rollback data - execution.setVariable("orchestrationStatus", "") - execution.setVariable("networkId", execution.getVariable(Prefix + "networkId")) - execution.setVariable("networkName", execution.getVariable(Prefix + "networkName")) - prepareSuccessRollbackData(execution) // populate rollbackData - execution.setVariable("WorkflowException", null) - execution.setVariable(Prefix + "Success", true) - logger.debug(" ***** postProcessResponse(), GOOD !!!") - } else { - // inside sub-flow logic - execution.setVariable(Prefix + "Success", false) - execution.setVariable("rollbackData", null) - String exceptionMessage = " Exception encountered in MSO Bpmn. " - if (execution.getVariable("workflowException") != null) { // Output of Rollback flow. - logger.debug(" ***** workflowException: " + execution.getVariable("workflowException")) - WorkflowException wfex = execution.getVariable("workflowException") - exceptionMessage = wfex.getErrorMessage() - } else { - if (execution.getVariable(Prefix + "WorkflowException") != null) { - WorkflowException pwfex = execution.getVariable(Prefix + "WorkflowException") - exceptionMessage = pwfex.getErrorMessage() - } - } - // going to the Main flow: a-la-carte or macro - logger.debug(" ***** postProcessResponse(), BAD !!!") - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - throw new BpmnError("MSOWorkflowException") - } + execution.setVariable("prefix",Prefix) + + logger.trace("Inside prepareRollbackData() of DoCreateNetworkInstance") + + try { + + Map<String, String> rollbackData = new HashMap<String, String>(); + String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") + if (rollbackSDNCRequest != null) { + if (rollbackSDNCRequest != "") { + rollbackData.put("rollbackSDNCRequest", execution.getVariable(Prefix + "rollbackSDNCRequest")) + } + } + String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") + if (rollbackNetworkRequest != null) { + if (rollbackNetworkRequest != "") { + rollbackData.put("rollbackNetworkRequest", execution.getVariable(Prefix + "rollbackNetworkRequest")) + } + } + String rollbackActivateSDNCRequest = execution.getVariable(Prefix + "rollbackActivateSDNCRequest") + if (rollbackActivateSDNCRequest != null) { + if (rollbackActivateSDNCRequest != "") { + rollbackData.put("rollbackActivateSDNCRequest", execution.getVariable(Prefix + "rollbackActivateSDNCRequest")) + } + } + execution.setVariable("rollbackData", rollbackData) + logger.debug("** rollbackData : " + rollbackData) + + execution.setVariable("WorkflowException", execution.getVariable(Prefix + "WorkflowException")) + logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException")) + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRollbackData() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + + } + + } + + public void postProcessResponse(DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + + logger.trace("Inside postProcessResponse() of DoCreateNetworkInstance") + + try { + + //Conditions: + // 1. Silent Success: execution.getVariable("CRENWKI_orchestrationStatus") == "ACTIVE" + // 2. Success: execution.getVariable("WorkflowException") == null (NULL) + // 3. WorkflowException: execution.getVariable("WorkflowException") != null (NOT NULL) + + logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException")) + // successful flow + if (execution.getVariable(Prefix + "isException") == false) { + // set rollback data + execution.setVariable("orchestrationStatus", "") + execution.setVariable("networkId", execution.getVariable(Prefix + "networkId")) + execution.setVariable("networkName", execution.getVariable(Prefix + "networkName")) + prepareSuccessRollbackData(execution) // populate rollbackData + execution.setVariable("WorkflowException", null) + execution.setVariable(Prefix + "Success", true) + logger.debug(" ***** postProcessResponse(), GOOD !!!") + } else { + // inside sub-flow logic + execution.setVariable(Prefix + "Success", false) + execution.setVariable("rollbackData", null) + String exceptionMessage = " Exception encountered in MSO Bpmn. " + if (execution.getVariable("workflowException") != null) { // Output of Rollback flow. + logger.debug(" ***** workflowException: " + execution.getVariable("workflowException")) + WorkflowException wfex = execution.getVariable("workflowException") + exceptionMessage = wfex.getErrorMessage() + } else { + if (execution.getVariable(Prefix + "WorkflowException") != null) { + WorkflowException pwfex = execution.getVariable(Prefix + "WorkflowException") + exceptionMessage = pwfex.getErrorMessage() + } + } + // going to the Main flow: a-la-carte or macro + logger.debug(" ***** postProcessResponse(), BAD !!!") + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + throw new BpmnError("MSOWorkflowException") + } - } catch(BpmnError b){ - logger.debug("Rethrowing MSOWorkflowException") - throw b + } catch(BpmnError b){ + logger.debug("Rethrowing MSOWorkflowException") + throw b - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. postProcessResponse() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - throw new BpmnError("MSOWorkflowException") - - } - - - - } - - public void prepareSuccessRollbackData(DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside prepareSuccessRollbackData() of DoCreateNetworkInstance") - - try { - - if (execution.getVariable("sdncVersion") != '1610') { - prepareRpcSDNCRollbackRequest(execution) - prepareRpcSDNCActivateRollback(execution) - } else { - prepareSDNCRollbackRequest(execution) - } - - Map<String, String> rollbackData = new HashMap<String, String>(); - String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") - if (rollbackSDNCRequest != null) { - if (rollbackSDNCRequest != "") { - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - } - } - String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") - if (rollbackNetworkRequest != null) { - if (rollbackNetworkRequest != "") { - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - } - } - String rollbackActivateSDNCRequest = execution.getVariable(Prefix + "rollbackActivateSDNCRequest") - if (rollbackActivateSDNCRequest != null) { - if (rollbackActivateSDNCRequest != "") { - rollbackData.put("rollbackActivateSDNCRequest", rollbackActivateSDNCRequest) - } - } - execution.setVariable("rollbackData", rollbackData) - - logger.debug("** 'rollbackData' for Full Rollback : " + rollbackData) - execution.setVariable("WorkflowException", null) - - - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void setExceptionFlag(DelegateExecution execution){ - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside setExceptionFlag() of DoCreateNetworkInstance") - - try { - - execution.setVariable(Prefix + "isException", true) - - if (execution.getVariable("SavedWorkflowException1") != null) { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) - } else { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) - } - logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException")) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. postProcessResponse() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + throw new BpmnError("MSOWorkflowException") + + } + + + + } + + public void prepareSuccessRollbackData(DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + + logger.trace("Inside prepareSuccessRollbackData() of DoCreateNetworkInstance") + + try { + + if (execution.getVariable("sdncVersion") != '1610') { + prepareRpcSDNCRollbackRequest(execution) + prepareRpcSDNCActivateRollback(execution) + } else { + prepareSDNCRollbackRequest(execution) + } + + Map<String, String> rollbackData = new HashMap<String, String>(); + String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") + if (rollbackSDNCRequest != null) { + if (rollbackSDNCRequest != "") { + rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) + } + } + String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") + if (rollbackNetworkRequest != null) { + if (rollbackNetworkRequest != "") { + rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) + } + } + String rollbackActivateSDNCRequest = execution.getVariable(Prefix + "rollbackActivateSDNCRequest") + if (rollbackActivateSDNCRequest != null) { + if (rollbackActivateSDNCRequest != "") { + rollbackData.put("rollbackActivateSDNCRequest", rollbackActivateSDNCRequest) + } + } + execution.setVariable("rollbackData", rollbackData) + + logger.debug("** 'rollbackData' for Full Rollback : " + rollbackData) + execution.setVariable("WorkflowException", null) + + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + + } + + } + + public void setExceptionFlag(DelegateExecution execution){ + + execution.setVariable("prefix",Prefix) + + logger.trace("Inside setExceptionFlag() of DoCreateNetworkInstance") + + try { + + execution.setVariable(Prefix + "isException", true) + + if (execution.getVariable("SavedWorkflowException1") != null) { + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) + } else { + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) + } + logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException")) - } catch(Exception ex){ - String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. setExceptionFlag(): " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } catch(Exception ex){ + String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. setExceptionFlag(): " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } - } + } - // ******************************* - // Build Error Section - // ******************************* + // ******************************* + // Build Error Section + // ******************************* - public void processJavaException(DelegateExecution execution){ + public void processJavaException(DelegateExecution execution){ - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - try{ - logger.debug( "Caught a Java Exception in " + Prefix) - logger.debug("Started processJavaException Method") - logger.debug("Variables List: " + execution.getVariables()) - execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") + try{ + logger.debug( "Caught a Java Exception in " + Prefix) + logger.debug("Started processJavaException Method") + logger.debug("Variables List: " + execution.getVariables()) + execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated + exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") - }catch(Exception e){ - logger.debug("Caught Exception during processJavaException Method: " + e) - execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix) - } - logger.debug( "Completed processJavaException Method in " + Prefix) - } + }catch(Exception e){ + logger.debug("Caught Exception during processJavaException Method: " + e) + execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated + exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix) + } + logger.debug( "Completed processJavaException Method in " + Prefix) + } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy index e34e505e55..313e2f4cb7 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy @@ -48,333 +48,312 @@ import org.camunda.bpm.engine.delegate.DelegateExecution public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcessor { private static final Logger logger = LoggerFactory.getLogger( DoCreateNetworkInstanceRollback.class); - String Prefix="CRENWKIR_" - ExceptionUtil exceptionUtil = new ExceptionUtil() - JsonUtils jsonUtil = new JsonUtils() - VidUtils vidUtils = new VidUtils(this) - NetworkUtils networkUtils = new NetworkUtils() - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - - def className = getClass().getSimpleName() - - /** - * This method is executed during the preProcessRequest task of the <class>DoCreateNetworkInstanceRollback.bpmn</class> process. - * @param execution - */ - public InitializeProcessVariables(DelegateExecution execution){ - /* Initialize all the process variables in this block */ - - execution.setVariable(Prefix + "rollbackNetworkRequest", null) - execution.setVariable(Prefix + "rollbackSDNCRequest", null) - execution.setVariable(Prefix + "rollbackActivateSDNCRequest", null) - execution.setVariable(Prefix + "WorkflowException", null) - - execution.setVariable(Prefix + "rollbackNetworkRequest", "") - execution.setVariable(Prefix + "rollbackNetworkResponse", "") - execution.setVariable(Prefix + "rollbackNetworkReturnCode", "") - - execution.setVariable(Prefix + "rollbackSDNCRequest", "") - execution.setVariable(Prefix + "rollbackSDNCResponse", "") - execution.setVariable(Prefix + "rollbackSDNCReturnCode", "") - - execution.setVariable(Prefix + "rollbackActivateSDNCRequest", "") - execution.setVariable(Prefix + "rollbackActivateSDNCResponse", "") - execution.setVariable(Prefix + "rollbackActivateSDNCReturnCode", "") - - execution.setVariable(Prefix + "Success", false) - execution.setVariable(Prefix + "fullRollback", false) - execution.setVariable(Prefix + "networkId", "") - execution.setVariable(Prefix + "urlRollbackPoNetwork", "") - - } - - // ************************************************** - // Pre or Prepare Request Section - // ************************************************** - /** - * This method is executed during the preProcessRequest task of the <class>DoCreateNetworkInstanceRollback.bpmn</class> process. - * @param execution - */ - public void preProcessRequest (DelegateExecution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - execution.setVariable("prefix",Prefix) - - logger.trace("Inside preProcessRequest() of " + className + ".groovy") - - try { - // initialize flow variables - InitializeProcessVariables(execution) - - // GET Incoming request/variables - String rollbackNetworkRequest = null - String rollbackSDNCRequest = null - String rollbackActivateSDNCRequest = null - - // Partial Rollback - Map<String, String> rollbackData = execution.getVariable("rollbackData") - if (rollbackData != null && rollbackData instanceof Map) { - - if(rollbackData.containsKey("rollbackSDNCRequest")) { - rollbackSDNCRequest = rollbackData["rollbackSDNCRequest"] - } - - if(rollbackData.containsKey("rollbackNetworkRequest")) { - rollbackNetworkRequest = rollbackData["rollbackNetworkRequest"] - } - - if(rollbackData.containsKey("rollbackActivateSDNCRequest")) { - rollbackActivateSDNCRequest = rollbackData["rollbackActivateSDNCRequest"] - } - - } - - execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkRequest) - execution.setVariable(Prefix + "rollbackSDNCRequest", rollbackSDNCRequest) - execution.setVariable(Prefix + "rollbackActivateSDNCRequest", rollbackActivateSDNCRequest) - logger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData")) - - String sdncVersion = execution.getVariable("sdncVersion") - logger.debug("sdncVersion? : " + sdncVersion) - - // PO Authorization Info / headers Authorization= - String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution) - try { - def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey", execution)) - execution.setVariable("BasicAuthHeaderValuePO",encodedString) - execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) - - } catch (IOException ex) { - String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - " - String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage() - logger.debug(dataErrorMessage ) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - if (execution.getVariable("SavedWorkflowException1") != null) { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) - } else { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) - } - logger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException")) - if(execution.getVariable(Prefix + "WorkflowException") != null) { - // called by: DoCreateNetworkInstance, partial rollback - execution.setVariable(Prefix + "fullRollback", false) - - } else { - // called by: Macro - Full Rollback, WorkflowException = null - execution.setVariable(Prefix + "fullRollback", true) - - } - logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback")) - - - } catch (BpmnError e) { - throw e; - - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void callPONetworkAdapter (DelegateExecution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - execution.setVariable("prefix",Prefix) - - logger.trace("Inside callPONetworkAdapter() of " + className + "") - - try { - String poUrl = UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint",execution) - String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") - String networkId = utils.getNodeText(rollbackSDNCRequest, "network-id") - - String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") - - String urlRollbackPoNetwork = poUrl+ "/" + networkId + "/rollback" - logger.debug("'urlRollbackPoNetwork': " + urlRollbackPoNetwork) - execution.setVariable(Prefix + "urlRollbackPoNetwork", urlRollbackPoNetwork) - - URL url = new URL(urlRollbackPoNetwork) - HttpClient httpClient = new HttpClientFactory().newXmlClient(url, ONAPComponents.OPENSTACK_ADAPTER) - httpClient.addAdditionalHeader("Authorization", execution.getVariable("BasicAuthHeaderValuePO")) - Response response = httpClient.delete(rollbackNetworkRequest) - - execution.setVariable(Prefix + "rollbackNetworkReturnCode", response.getStatus()) - - logger.debug(" Network Adapter rollback responseCode: " + response.getStatus()) - - - } catch (Exception ex) { - String exceptionMessage = "Exception Encountered in callPONetworkAdapter() of DoCreateNetworkInstanceRollback flow - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } - - } - - - public void validateRollbackResponses (DelegateExecution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - execution.setVariable("prefix",Prefix) - - logger.trace("Inside validateRollbackResponses() of DoCreateNetworkInstanceRollback") - - try { - // validate PO network rollback response - String rollbackNetworkErrorMessages = "" - String rollbackNetworkReturnCode = "200" - if (execution.getVariable(Prefix + "rollbackNetworkRequest") != null) { - rollbackNetworkReturnCode = execution.getVariable(Prefix + "rollbackNetworkReturnCode") - logger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode) - if (rollbackNetworkReturnCode != "200") { - rollbackNetworkErrorMessages = " + PO Network rollback failed. " - } else { - rollbackNetworkErrorMessages = " + PO Network rollback completed." - } - } - - // validate SDNC rollback response - String rollbackSdncErrorMessages = "" - String rollbackSDNCReturnCode = "200" - if (execution.getVariable(Prefix + "rollbackSDNCRequest") != null) { - rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode") - String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse") - String rollbackSDNCReturnInnerCode = "" - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - rollbackSDNCResponse = rollbackSDNCResponse - rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") - if (rollbackSDNCReturnCode == "200") { - if (utils.nodeExists(rollbackSDNCResponse, "response-code")) { - rollbackSDNCReturnInnerCode = utils.getNodeText(rollbackSDNCResponse, "response-code") - if (rollbackSDNCReturnInnerCode == "200" || rollbackSDNCReturnInnerCode == "" || rollbackSDNCReturnInnerCode == "0") { - rollbackSdncErrorMessages = " + SNDC assign rollback completed." - } else { - rollbackSdncErrorMessages = " + SDNC assign rollback failed. " - } - } else { - rollbackSdncErrorMessages = " + SNDC assign rollback completed." - } - } else { - rollbackSdncErrorMessages = " + SDNC assign rollback failed. " - } - logger.debug(" SDNC assign rollback Code - " + rollbackSDNCReturnCode) - logger.debug(" SDNC assign rollback Response - " + rollbackSDNCResponse) - } - - // validate SDNC activate rollback response - String rollbackActivateSdncErrorMessages = "" - String rollbackActivateSDNCReturnCode = "200" - if (execution.getVariable(Prefix + "rollbackActivateSDNCRequest") != null) { - rollbackActivateSDNCReturnCode = execution.getVariable(Prefix + "rollbackActivateSDNCReturnCode") - String rollbackActivateSDNCResponse = execution.getVariable(Prefix + "rollbackActivateSDNCResponse") - String rollbackActivateSDNCReturnInnerCode = "" - rollbackActivateSDNCResponse = rollbackActivateSDNCResponse - rollbackActivateSDNCResponse = rollbackActivateSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") - if (rollbackActivateSDNCReturnCode == "200") { - if (utils.nodeExists(rollbackActivateSDNCResponse, "response-code")) { - rollbackActivateSDNCReturnInnerCode = utils.getNodeText(rollbackActivateSDNCResponse, "response-code") - if (rollbackActivateSDNCReturnInnerCode == "200" || rollbackActivateSDNCReturnInnerCode == "" || rollbackActivateSDNCReturnInnerCode == "0") { - rollbackActivateSdncErrorMessages = " + SNDC activate rollback completed." - } else { - rollbackActivateSdncErrorMessages = " + SDNC activate rollback failed. " - } - } else { - rollbackActivateSdncErrorMessages = " + SNDC activate rollback completed." - } - } else { - rollbackActivateSdncErrorMessages = " + SDNC activate rollback failed. " - } - logger.debug(" SDNC activate rollback Code - " + rollbackActivateSDNCReturnCode) - logger.debug(" SDNC activate rollback Response - " + rollbackActivateSDNCResponse) - } - - - String statusMessage = "" - int errorCode = 7000 - logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback")) - if (execution.getVariable(Prefix + "fullRollback") == false) { - // original WorkflowException, - WorkflowException wfe = execution.getVariable(Prefix + "WorkflowException") - if (wfe != null) { - // rollback due to failure in DoCreate - Partial rollback - statusMessage = wfe.getErrorMessage() - errorCode = wfe.getErrorCode() - } else { - statusMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception." - errorCode = '7000' - } - - // set if all rolledbacks are successful - if (rollbackNetworkReturnCode == "200" && rollbackSDNCReturnCode == "200" && rollbackActivateSDNCReturnCode == "200") { - execution.setVariable("rolledBack", true) - execution.setVariable("wasDeleted", true) - - } else { - execution.setVariable("rolledBack", false) - execution.setVariable("wasDeleted", true) - } - - statusMessage = statusMessage + rollbackActivateSdncErrorMessages + rollbackNetworkErrorMessages + rollbackSdncErrorMessages - logger.debug("Final DoCreateNetworkInstanceRollback status message: " + statusMessage) - String processKey = getProcessKey(execution); - WorkflowException exception = new WorkflowException(processKey, errorCode, statusMessage); - execution.setVariable("workflowException", exception); - - } else { - // rollback due to failures in Main flow (Macro) - Full rollback - // WorkflowException = null - if (rollbackNetworkReturnCode == "200" && rollbackSDNCReturnCode == "200" && rollbackActivateSDNCReturnCode == "200") { - execution.setVariable("rollbackSuccessful", true) - execution.setVariable("rollbackError", false) - } else { - String exceptionMessage = "Network Create Rollback was not Successful. " + String Prefix="CRENWKIR_" + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + VidUtils vidUtils = new VidUtils(this) + NetworkUtils networkUtils = new NetworkUtils() + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + + def className = getClass().getSimpleName() + + /** + * This method is executed during the preProcessRequest task of the <class>DoCreateNetworkInstanceRollback.bpmn</class> process. + * @param execution + */ + public InitializeProcessVariables(DelegateExecution execution){ + /* Initialize all the process variables in this block */ + + execution.setVariable(Prefix + "rollbackNetworkRequest", null) + execution.setVariable(Prefix + "rollbackSDNCRequest", null) + execution.setVariable(Prefix + "rollbackActivateSDNCRequest", null) + execution.setVariable(Prefix + "WorkflowException", null) + + execution.setVariable(Prefix + "rollbackNetworkRequest", "") + execution.setVariable(Prefix + "rollbackNetworkResponse", "") + execution.setVariable(Prefix + "rollbackNetworkReturnCode", "") + + execution.setVariable(Prefix + "rollbackSDNCRequest", "") + execution.setVariable(Prefix + "rollbackSDNCResponse", "") + execution.setVariable(Prefix + "rollbackSDNCReturnCode", "") + + execution.setVariable(Prefix + "rollbackActivateSDNCRequest", "") + execution.setVariable(Prefix + "rollbackActivateSDNCResponse", "") + execution.setVariable(Prefix + "rollbackActivateSDNCReturnCode", "") + + execution.setVariable(Prefix + "Success", false) + execution.setVariable(Prefix + "fullRollback", false) + execution.setVariable(Prefix + "networkId", "") + execution.setVariable(Prefix + "urlRollbackPoNetwork", "") + } + + // ************************************************** + // Pre or Prepare Request Section + // ************************************************** + /** + * This method is executed during the preProcessRequest task of the <class>DoCreateNetworkInstanceRollback.bpmn</class> process. + * @param execution + */ + public void preProcessRequest (DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + execution.setVariable("prefix",Prefix) + + logger.trace("Inside preProcessRequest() of " + className + ".groovy") + + try { + // initialize flow variables + InitializeProcessVariables(execution) + + // GET Incoming request/variables + String rollbackNetworkRequest = null + String rollbackSDNCRequest = null + String rollbackActivateSDNCRequest = null + + // Partial Rollback + Map<String, String> rollbackData = execution.getVariable("rollbackData") + if (rollbackData != null && rollbackData instanceof Map) { + + if(rollbackData.containsKey("rollbackSDNCRequest")) { + rollbackSDNCRequest = rollbackData["rollbackSDNCRequest"] + } + + if(rollbackData.containsKey("rollbackNetworkRequest")) { + rollbackNetworkRequest = rollbackData["rollbackNetworkRequest"] + } + + if(rollbackData.containsKey("rollbackActivateSDNCRequest")) { + rollbackActivateSDNCRequest = rollbackData["rollbackActivateSDNCRequest"] + } + + } + + execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkRequest) + execution.setVariable(Prefix + "rollbackSDNCRequest", rollbackSDNCRequest) + execution.setVariable(Prefix + "rollbackActivateSDNCRequest", rollbackActivateSDNCRequest) + logger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData")) + + String sdncVersion = execution.getVariable("sdncVersion") + logger.debug("sdncVersion? : " + sdncVersion) + + // PO Authorization Info / headers Authorization= + String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution) + try { + def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey", execution)) + execution.setVariable("BasicAuthHeaderValuePO",encodedString) + execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) + + } catch (IOException ex) { + String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - " + String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage() + logger.debug(dataErrorMessage ) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + + if (execution.getVariable("SavedWorkflowException1") != null) { + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) + } else { + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) + } + logger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException")) + if(execution.getVariable(Prefix + "WorkflowException") != null) { + // called by: DoCreateNetworkInstance, partial rollback + execution.setVariable(Prefix + "fullRollback", false) + + } else { + // called by: Macro - Full Rollback, WorkflowException = null + execution.setVariable(Prefix + "fullRollback", true) + + } + logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback")) + + + } catch (BpmnError e) { + throw e; + + } catch (Exception ex) { + // caught exception + String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + + } + + } + + public void setNetworkAdapterResponseCode (DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + execution.setVariable("prefix",Prefix) + try { + + execution.setVariable(Prefix + "rollbackNetworkReturnCode", "200") + + } catch (Exception ex) { + String exceptionMessage = "Exception Encountered in callPONetworkAdapter() of DoCreateNetworkInstanceRollback flow - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } + + } + + + public void validateRollbackResponses (DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + execution.setVariable("prefix",Prefix) + + logger.trace("Inside validateRollbackResponses() of DoCreateNetworkInstanceRollback") + + try { + // validate PO network rollback response + String rollbackNetworkErrorMessages = "" + String rollbackNetworkReturnCode = "200" + if (execution.getVariable(Prefix + "rollbackNetworkRequest") != null) { + rollbackNetworkReturnCode = execution.getVariable(Prefix + "rollbackNetworkReturnCode") + logger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode) + if (rollbackNetworkReturnCode != "200") { + rollbackNetworkErrorMessages = " + PO Network rollback failed. " + } else { + rollbackNetworkErrorMessages = " + PO Network rollback completed." + } + } + + // validate SDNC rollback response + String rollbackSdncErrorMessages = "" + String rollbackSDNCReturnCode = "200" + if (execution.getVariable(Prefix + "rollbackSDNCRequest") != null) { + rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode") + String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse") + String rollbackSDNCReturnInnerCode = "" + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + rollbackSDNCResponse = rollbackSDNCResponse + rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") + if (rollbackSDNCReturnCode == "200") { + if (utils.nodeExists(rollbackSDNCResponse, "response-code")) { + rollbackSDNCReturnInnerCode = utils.getNodeText(rollbackSDNCResponse, "response-code") + if (rollbackSDNCReturnInnerCode == "200" || rollbackSDNCReturnInnerCode == "" || rollbackSDNCReturnInnerCode == "0") { + rollbackSdncErrorMessages = " + SNDC assign rollback completed." + } else { + rollbackSdncErrorMessages = " + SDNC assign rollback failed. " + } + } else { + rollbackSdncErrorMessages = " + SNDC assign rollback completed." + } + } else { + rollbackSdncErrorMessages = " + SDNC assign rollback failed. " + } + logger.debug(" SDNC assign rollback Code - " + rollbackSDNCReturnCode) + logger.debug(" SDNC assign rollback Response - " + rollbackSDNCResponse) + } + + // validate SDNC activate rollback response + String rollbackActivateSdncErrorMessages = "" + String rollbackActivateSDNCReturnCode = "200" + if (execution.getVariable(Prefix + "rollbackActivateSDNCRequest") != null) { + rollbackActivateSDNCReturnCode = execution.getVariable(Prefix + "rollbackActivateSDNCReturnCode") + String rollbackActivateSDNCResponse = execution.getVariable(Prefix + "rollbackActivateSDNCResponse") + String rollbackActivateSDNCReturnInnerCode = "" + rollbackActivateSDNCResponse = rollbackActivateSDNCResponse + rollbackActivateSDNCResponse = rollbackActivateSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") + if (rollbackActivateSDNCReturnCode == "200") { + if (utils.nodeExists(rollbackActivateSDNCResponse, "response-code")) { + rollbackActivateSDNCReturnInnerCode = utils.getNodeText(rollbackActivateSDNCResponse, "response-code") + if (rollbackActivateSDNCReturnInnerCode == "200" || rollbackActivateSDNCReturnInnerCode == "" || rollbackActivateSDNCReturnInnerCode == "0") { + rollbackActivateSdncErrorMessages = " + SNDC activate rollback completed." + } else { + rollbackActivateSdncErrorMessages = " + SDNC activate rollback failed. " + } + } else { + rollbackActivateSdncErrorMessages = " + SNDC activate rollback completed." + } + } else { + rollbackActivateSdncErrorMessages = " + SDNC activate rollback failed. " + } + logger.debug(" SDNC activate rollback Code - " + rollbackActivateSDNCReturnCode) + logger.debug(" SDNC activate rollback Response - " + rollbackActivateSDNCResponse) + } + + + String statusMessage = "" + int errorCode = 7000 + logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback")) + if (execution.getVariable(Prefix + "fullRollback") == false) { + // original WorkflowException, + WorkflowException wfe = execution.getVariable(Prefix + "WorkflowException") + if (wfe != null) { + // rollback due to failure in DoCreate - Partial rollback + statusMessage = wfe.getErrorMessage() + errorCode = wfe.getErrorCode() + } else { + statusMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception." + errorCode = '7000' + } + + // set if all rolledbacks are successful + if (rollbackNetworkReturnCode == "200" && rollbackSDNCReturnCode == "200" && rollbackActivateSDNCReturnCode == "200") { + execution.setVariable("rolledBack", true) + execution.setVariable("wasDeleted", true) + + } else { + execution.setVariable("rolledBack", false) + execution.setVariable("wasDeleted", true) + } + + statusMessage = statusMessage + rollbackActivateSdncErrorMessages + rollbackNetworkErrorMessages + rollbackSdncErrorMessages + logger.debug("Final DoCreateNetworkInstanceRollback status message: " + statusMessage) + String processKey = getProcessKey(execution); + WorkflowException exception = new WorkflowException(processKey, errorCode, statusMessage); + execution.setVariable("workflowException", exception); + + } else { + // rollback due to failures in Main flow (Macro) - Full rollback + // WorkflowException = null + if (rollbackNetworkReturnCode == "200" && rollbackSDNCReturnCode == "200" && rollbackActivateSDNCReturnCode == "200") { + execution.setVariable("rollbackSuccessful", true) + execution.setVariable("rollbackError", false) + } else { + String exceptionMessage = "Network Create Rollback was not Successful. " logger.debug(exceptionMessage) - execution.setVariable("rollbackSuccessful", false) - execution.setVariable("rollbackError", true) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - throw new BpmnError("MSOWorkflowException") - } + execution.setVariable("rollbackSuccessful", false) + execution.setVariable("rollbackError", true) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + throw new BpmnError("MSOWorkflowException") + } - } + } - } catch (Exception ex) { - String errorMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception." - String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstanceRollback flow. validateRollbackResponses() - " + errorMessage + ": " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String errorMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception." + String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstanceRollback flow. validateRollbackResponses() - " + errorMessage + ": " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - // ******************************* - // Build Error Section - // ******************************* + // ******************************* + // Build Error Section + // ******************************* - public void processJavaException(DelegateExecution execution){ - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - execution.setVariable("prefix",Prefix) + public void processJavaException(DelegateExecution execution){ + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + execution.setVariable("prefix",Prefix) - try{ - logger.debug("Caught a Java Exception in " + Prefix) - logger.debug("Started processJavaException Method") - logger.debug("Variables List: " + execution.getVariables()) - execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") + try{ + logger.debug("Caught a Java Exception in " + Prefix) + logger.debug("Started processJavaException Method") + logger.debug("Variables List: " + execution.getVariables()) + execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated + exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") - }catch(Exception e){ - logger.debug("Caught Exception during processJavaException Method: " + e) - execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix) - } - logger.debug("Completed processJavaException Method in " + Prefix) - } + }catch(Exception e){ + logger.debug("Caught Exception during processJavaException Method: " + e) + execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated + exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix) + } + logger.debug("Completed processJavaException Method in " + Prefix) + } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy index 89c5be8d6e..0d49d91910 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy @@ -59,346 +59,346 @@ import javax.ws.rs.core.Response public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor { private static final Logger logger = LoggerFactory.getLogger( DoDeleteNetworkInstance.class); - String Prefix= "DELNWKI_" - String groovyClassName = "DoDeleteNetworkInstance" - ExceptionUtil exceptionUtil = new ExceptionUtil() - JsonUtils jsonUtil = new JsonUtils() - VidUtils vidUtils = new VidUtils(this) - NetworkUtils networkUtils = new NetworkUtils() - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - - public InitializeProcessVariables(DelegateExecution execution){ - /* Initialize all the process variables in this block */ - - execution.setVariable(Prefix + "networkRequest", "") - execution.setVariable(Prefix + "isSilentSuccess", false) - execution.setVariable(Prefix + "Success", false) - - execution.setVariable(Prefix + "requestId", "") - execution.setVariable(Prefix + "source", "") - execution.setVariable(Prefix + "lcpCloudRegion", "") - execution.setVariable(Prefix + "networkInputs", "") - execution.setVariable(Prefix + "tenantId", "") - - execution.setVariable(Prefix + "queryAAIResponse", "") - execution.setVariable(Prefix + "aaiReturnCode", "") - execution.setVariable(Prefix + "isAAIGood", false) - execution.setVariable(Prefix + "isVfRelationshipExist", false) - - // AAI query Cloud Region - execution.setVariable(Prefix + "queryCloudRegionRequest","") - execution.setVariable(Prefix + "queryCloudRegionReturnCode","") - execution.setVariable(Prefix + "queryCloudRegionResponse","") - execution.setVariable(Prefix + "cloudRegionPo","") - execution.setVariable(Prefix + "cloudRegionSdnc","") - - execution.setVariable(Prefix + "deleteNetworkRequest", "") - execution.setVariable(Prefix + "deleteNetworkResponse", "") - execution.setVariable(Prefix + "networkReturnCode", "") - execution.setVariable(Prefix + "rollbackNetworkRequest", "") - - execution.setVariable(Prefix + "deleteSDNCRequest", "") - execution.setVariable(Prefix + "deleteSDNCResponse", "") - execution.setVariable(Prefix + "sdncReturnCode", "") - execution.setVariable(Prefix + "sdncResponseSuccess", false) - - execution.setVariable(Prefix + "deactivateSDNCRequest", "") - execution.setVariable(Prefix + "deactivateSDNCResponse", "") - execution.setVariable(Prefix + "deactivateSdncReturnCode", "") - execution.setVariable(Prefix + "isSdncDeactivateRollbackNeeded", "") - - execution.setVariable(Prefix + "rollbackDeactivateSDNCRequest", "") - execution.setVariable(Prefix + "isException", false) - - - } - - // ************************************************** - // Pre or Prepare Request Section - // ************************************************** - - public void preProcessRequest (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside preProcessRequest() of " + groovyClassName + " Request ") - - // initialize flow variables - InitializeProcessVariables(execution) - - try { - // get incoming message/input - execution.setVariable("action", "DELETE") - String deleteNetwork = execution.getVariable("bpmnRequest") - if (deleteNetwork != null) { - if (deleteNetwork.contains("requestDetails")) { - // JSON format request is sent, create xml - try { - def prettyJson = JsonOutput.prettyPrint(deleteNetwork.toString()) - logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson) - deleteNetwork = vidUtils.createXmlNetworkRequestInfra(execution, deleteNetwork) - - } catch (Exception ex) { - String dataErrorMessage = " Invalid json format Request - " + ex.getMessage() - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - } else { - // XML format request is sent - - } - } else { - // vIPR format request is sent, create xml from individual variables - deleteNetwork = vidUtils.createXmlNetworkRequestInstance(execution) - } - - deleteNetwork = utils.formatXml(deleteNetwork) - logger.debug(deleteNetwork) - execution.setVariable(Prefix + "networkRequest", deleteNetwork) - logger.debug(Prefix + "networkRequest - " + '\n' + deleteNetwork) - - // validate 'backout-on-failure' to override 'mso.rollback' - boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, deleteNetwork) - execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled) - logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled) - - String networkInputs = utils.getNodeXml(deleteNetwork, "network-inputs", false).replace("tag0:","").replace(":tag0","") - execution.setVariable(Prefix + "networkInputs", networkInputs) - - // prepare messageId - String messageId = execution.getVariable("testMessageId") // for testing - if (messageId == null || messageId == "") { - messageId = UUID.randomUUID() - logger.debug(Prefix + "messageId, random generated: " + messageId) - } else { - logger.debug(Prefix + "messageId, pre-assigned: " + messageId) - } - execution.setVariable(Prefix + "messageId", messageId) - - String source = utils.getNodeText(deleteNetwork, "source") - execution.setVariable(Prefix + "source", source) - logger.debug(Prefix + "source - " + source) - - String networkId = "" - if (utils.nodeExists(networkInputs, "network-id")) { - networkId = utils.getNodeText(networkInputs, "network-id") - if (networkId == null || networkId == "" || networkId == 'null' ) { - sendSyncError(execution) - // missing value of network-id - String dataErrorMessage = "network-request has missing 'network-id' element/value." - logger.debug(" Invalid Request - " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - } - - // lcpCloudRegion or tenantId not sent, will be extracted from query AA&I - def lcpCloudRegion = null - if (utils.nodeExists(networkInputs, "aic-cloud-region")) { - lcpCloudRegion = utils.getNodeText(networkInputs, "aic-cloud-region") - if (lcpCloudRegion == 'null') { - lcpCloudRegion = null - } - } - execution.setVariable(Prefix + "lcpCloudRegion", lcpCloudRegion) - logger.debug("lcpCloudRegion : " + lcpCloudRegion) - - String tenantId = null - if (utils.nodeExists(networkInputs, "tenant-id")) { - tenantId = utils.getNodeText(networkInputs, "tenant-id") - if (tenantId == 'null') { - tenantId = null - } - - } - execution.setVariable(Prefix + "tenantId", tenantId) - logger.debug("tenantId : " + tenantId) - - String sdncVersion = execution.getVariable("sdncVersion") - logger.debug("sdncVersion? : " + sdncVersion) - - // PO Authorization Info / headers Authorization= - String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution) - - try { - def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey", execution)) - execution.setVariable("BasicAuthHeaderValuePO",encodedString) - execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) - - } catch (IOException ex) { - String dataErrorMessage = " Unable to encode PO/SDNC user/password string - " + ex.getMessage() - logger.debug(dataErrorMessage ) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - } catch (BpmnError e) { - throw e; - - } catch (Exception ex){ - // caught exception - String exceptionMessage = "Exception Encountered in DoDeleteNetworkInstance, PreProcessRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - - public void callRESTQueryAAI (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.debug(" ***** Inside callRESTQueryAAI() of DoDoDeleteNetworkInstance ***** " ) - - // get variables - String networkInputs = execution.getVariable(Prefix + "networkInputs") - String networkId = utils.getNodeText(networkInputs, "network-id") - networkId = UriUtils.encode(networkId,"UTF-8") - ExceptionUtil exceptionUtil = new ExceptionUtil() - Boolean isVfRelationshipExist = false - try { - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ALL) - Optional<L3Network> l3Network = getAAIClient().get(L3Network.class,uri); - AAIResultWrapper wrapper = getAAIClient().get(uri); - Optional<Relationships> relationships = wrapper.getRelationships() - - if (l3Network.isPresent()) { - execution.setVariable(Prefix + "aaiReturnCode", 200) - execution.setVariable(Prefix + "queryAAIResponse", l3Network.get()) - execution.setVariable(Prefix + "isAAIGood", true) - if (relationships.isPresent()){ - if(!relationships.get().getRelatedAAIUris(AAIObjectType.VF_MODULE).isEmpty()){ - execution.setVariable(Prefix + "isVfRelationshipExist", true) - isVfRelationshipExist = true - String relationshipMessage = "AAI Query Success Response but 'vf-module' relationship exist, not allowed to delete: network Id: " + networkId - exceptionUtil.buildWorkflowException(execution, 2500, relationshipMessage) - }else{ - List<AAIResourceUri> tenantURIList = relationships.get().getRelatedAAIUris(AAIObjectType.TENANT) - for(AAIResourceUri tenantURI: tenantURIList){ - if(execution.getVariable(Prefix + "tenantId") == null) { - String tenantId = tenantURI.getURIKeys().get("tenant-id") - execution.setVariable(Prefix + "tenantId", tenantId) - logger.debug(" Get AAI getTenantId() : " + tenantId) - } - } - List<AAIResourceUri> cloudRegionURIList = relationships.get().getRelatedAAIUris(AAIObjectType.CLOUD_REGION) - for(AAIResourceUri tenantURI: cloudRegionURIList){ - if(execution.getVariable(Prefix + "lcpCloudRegion") == null) { - String lcpCloudRegion = tenantURI.getURIKeys().get("cloud-region-id") - execution.setVariable(Prefix + "lcpCloudRegion", lcpCloudRegion) - logger.debug(" Get AAI getCloudRegion() : " + lcpCloudRegion) - } - } - } - } - logger.debug(Prefix + "isVfRelationshipExist - " + isVfRelationshipExist) - } else { - // not found // empty aai response - execution.setVariable(Prefix + "aaiReturnCode", 404) - execution.setVariable(Prefix + "isAAIGood", false) - execution.setVariable(Prefix + "isSilentSuccess", true) - logger.debug(" AAI Query is Silent Success") - } - logger.debug(" AAI Query call, isAAIGood? : " + execution.getVariable(Prefix + "isAAIGood")) - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Exception Encountered in DoDeleteNetworkInstance, callRESTQueryAAI() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void callRESTQueryAAICloudRegion (DelegateExecution execution) { - - execution.setVariable("prefix", Prefix) - - logger.debug(" ***** Inside callRESTQueryAAICloudRegion of DoDeleteNetworkInstance ***** " ) - - try { - String networkInputs = execution.getVariable(Prefix + "networkInputs") - // String cloudRegion = utils.getNodeText(networkInputs, "aic-cloud-region") - String cloudRegion = execution.getVariable(Prefix + "lcpCloudRegion") - // Prepare AA&I url - AaiUtil aaiUtil = new AaiUtil(this) - - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion) - def queryCloudRegionRequest = aaiUtil.createAaiUri(uri) - - execution.setVariable(Prefix + "queryCloudRegionRequest", queryCloudRegionRequest) - - String cloudRegionPo = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion) - String cloudRegionSdnc = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "SDNC", cloudRegion) - - if ((cloudRegionPo != "ERROR") && (cloudRegionSdnc != "ERROR")) { - execution.setVariable(Prefix + "cloudRegionPo", cloudRegionPo) - execution.setVariable(Prefix + "cloudRegionSdnc", cloudRegionSdnc) - - } else { - String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode") - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - - } - - } catch (BpmnError e) { - throw e; - - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, callRESTQueryAAICloudRegion(). Unexpected Response from AAI - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void prepareNetworkRequest (DelegateExecution execution) { - - execution.setVariable("prefix", Prefix) - - logger.trace("Inside prepareNetworkRequest of DoDeleteNetworkInstance ") - ExceptionUtil exceptionUtil = new ExceptionUtil() - try { - // get variables - String networkRequest = execution.getVariable(Prefix + "networkRequest") - String cloudSiteId = execution.getVariable(Prefix + "cloudRegionPo") - String tenantId = execution.getVariable(Prefix + "tenantId") - - L3Network l3Network = execution.getVariable(Prefix + "queryAAIResponse") - String networkType = l3Network.getNetworkType() - String networkId = l3Network.getNetworkId() - - String networkStackId = "" - networkStackId = l3Network.getHeatStackId() - if (networkStackId == 'null' || networkStackId == "" || networkStackId == null) { - networkStackId = "force_delete" - } - - String requestId = execution.getVariable("msoRequestId") - if (requestId != null) { - execution.setVariable("mso-request-id", requestId) - } else { - requestId = execution.getVariable("mso-request-id") - } - String serviceInstanceId = execution.getVariable("serviceInstanceId") - - // Added new Elements - String messageId = execution.getVariable(Prefix + "messageId") - String notificationUrl = "" //TODO - is this coming from URN? What variable/value to use? - //String notificationUrl = execution.getVariable("URN_?????") //TODO - is this coming from URN? What variable/value to use? - - String modelCustomizationUuid = "" - if (utils.nodeExists(networkRequest, "networkModelInfo")) { - String networkModelInfo = utils.getNodeXml(networkRequest, "networkModelInfo", false).replace("tag0:","").replace(":tag0","") - modelCustomizationUuid = utils.getNodeText(networkModelInfo, "modelCustomizationUuid") - } else { - modelCustomizationUuid = utils.getNodeText(networkRequest, "modelCustomizationId") - } + String Prefix= "DELNWKI_" + String groovyClassName = "DoDeleteNetworkInstance" + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + VidUtils vidUtils = new VidUtils(this) + NetworkUtils networkUtils = new NetworkUtils() + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + + public InitializeProcessVariables(DelegateExecution execution){ + /* Initialize all the process variables in this block */ + + execution.setVariable(Prefix + "networkRequest", "") + execution.setVariable(Prefix + "isSilentSuccess", false) + execution.setVariable(Prefix + "Success", false) + + execution.setVariable(Prefix + "requestId", "") + execution.setVariable(Prefix + "source", "") + execution.setVariable(Prefix + "lcpCloudRegion", "") + execution.setVariable(Prefix + "networkInputs", "") + execution.setVariable(Prefix + "tenantId", "") + + execution.setVariable(Prefix + "queryAAIResponse", "") + execution.setVariable(Prefix + "aaiReturnCode", "") + execution.setVariable(Prefix + "isAAIGood", false) + execution.setVariable(Prefix + "isVfRelationshipExist", false) + + // AAI query Cloud Region + execution.setVariable(Prefix + "queryCloudRegionRequest","") + execution.setVariable(Prefix + "queryCloudRegionReturnCode","") + execution.setVariable(Prefix + "queryCloudRegionResponse","") + execution.setVariable(Prefix + "cloudRegionPo","") + execution.setVariable(Prefix + "cloudRegionSdnc","") + + execution.setVariable(Prefix + "deleteNetworkRequest", "") + execution.setVariable(Prefix + "deleteNetworkResponse", "") + execution.setVariable(Prefix + "networkReturnCode", "") + execution.setVariable(Prefix + "rollbackNetworkRequest", "") + + execution.setVariable(Prefix + "deleteSDNCRequest", "") + execution.setVariable(Prefix + "deleteSDNCResponse", "") + execution.setVariable(Prefix + "sdncReturnCode", "") + execution.setVariable(Prefix + "sdncResponseSuccess", false) + + execution.setVariable(Prefix + "deactivateSDNCRequest", "") + execution.setVariable(Prefix + "deactivateSDNCResponse", "") + execution.setVariable(Prefix + "deactivateSdncReturnCode", "") + execution.setVariable(Prefix + "isSdncDeactivateRollbackNeeded", "") + + execution.setVariable(Prefix + "rollbackDeactivateSDNCRequest", "") + execution.setVariable(Prefix + "isException", false) + + + } + + // ************************************************** + // Pre or Prepare Request Section + // ************************************************** + + public void preProcessRequest (DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + + logger.trace("Inside preProcessRequest() of " + groovyClassName + " Request ") + + // initialize flow variables + InitializeProcessVariables(execution) + + try { + // get incoming message/input + execution.setVariable("action", "DELETE") + String deleteNetwork = execution.getVariable("bpmnRequest") + if (deleteNetwork != null) { + if (deleteNetwork.contains("requestDetails")) { + // JSON format request is sent, create xml + try { + def prettyJson = JsonOutput.prettyPrint(deleteNetwork.toString()) + logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson) + deleteNetwork = vidUtils.createXmlNetworkRequestInfra(execution, deleteNetwork) + + } catch (Exception ex) { + String dataErrorMessage = " Invalid json format Request - " + ex.getMessage() + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + } else { + // XML format request is sent + + } + } else { + // vIPR format request is sent, create xml from individual variables + deleteNetwork = vidUtils.createXmlNetworkRequestInstance(execution) + } + + deleteNetwork = utils.formatXml(deleteNetwork) + logger.debug(deleteNetwork) + execution.setVariable(Prefix + "networkRequest", deleteNetwork) + logger.debug(Prefix + "networkRequest - " + '\n' + deleteNetwork) + + // validate 'backout-on-failure' to override 'mso.rollback' + boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, deleteNetwork) + execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled) + logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled) + + String networkInputs = utils.getNodeXml(deleteNetwork, "network-inputs", false).replace("tag0:","").replace(":tag0","") + execution.setVariable(Prefix + "networkInputs", networkInputs) + + // prepare messageId + String messageId = execution.getVariable("testMessageId") // for testing + if (messageId == null || messageId == "") { + messageId = UUID.randomUUID() + logger.debug(Prefix + "messageId, random generated: " + messageId) + } else { + logger.debug(Prefix + "messageId, pre-assigned: " + messageId) + } + execution.setVariable(Prefix + "messageId", messageId) + + String source = utils.getNodeText(deleteNetwork, "source") + execution.setVariable(Prefix + "source", source) + logger.debug(Prefix + "source - " + source) + + String networkId = "" + if (utils.nodeExists(networkInputs, "network-id")) { + networkId = utils.getNodeText(networkInputs, "network-id") + if (networkId == null || networkId == "" || networkId == 'null' ) { + sendSyncError(execution) + // missing value of network-id + String dataErrorMessage = "network-request has missing 'network-id' element/value." + logger.debug(" Invalid Request - " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + } + + // lcpCloudRegion or tenantId not sent, will be extracted from query AA&I + def lcpCloudRegion = null + if (utils.nodeExists(networkInputs, "aic-cloud-region")) { + lcpCloudRegion = utils.getNodeText(networkInputs, "aic-cloud-region") + if (lcpCloudRegion == 'null') { + lcpCloudRegion = null + } + } + execution.setVariable(Prefix + "lcpCloudRegion", lcpCloudRegion) + logger.debug("lcpCloudRegion : " + lcpCloudRegion) + + String tenantId = null + if (utils.nodeExists(networkInputs, "tenant-id")) { + tenantId = utils.getNodeText(networkInputs, "tenant-id") + if (tenantId == 'null') { + tenantId = null + } + + } + execution.setVariable(Prefix + "tenantId", tenantId) + logger.debug("tenantId : " + tenantId) + + String sdncVersion = execution.getVariable("sdncVersion") + logger.debug("sdncVersion? : " + sdncVersion) + + // PO Authorization Info / headers Authorization= + String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution) + + try { + def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey", execution)) + execution.setVariable("BasicAuthHeaderValuePO",encodedString) + execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) + + } catch (IOException ex) { + String dataErrorMessage = " Unable to encode PO/SDNC user/password string - " + ex.getMessage() + logger.debug(dataErrorMessage ) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + + } catch (BpmnError e) { + throw e; + + } catch (Exception ex){ + // caught exception + String exceptionMessage = "Exception Encountered in DoDeleteNetworkInstance, PreProcessRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - String deleteNetworkRequest = """ + } + + } + + + public void callRESTQueryAAI (DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + + logger.debug(" ***** Inside callRESTQueryAAI() of DoDoDeleteNetworkInstance ***** " ) + + // get variables + String networkInputs = execution.getVariable(Prefix + "networkInputs") + String networkId = utils.getNodeText(networkInputs, "network-id") + networkId = UriUtils.encode(networkId,"UTF-8") + ExceptionUtil exceptionUtil = new ExceptionUtil() + Boolean isVfRelationshipExist = false + try { + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ALL) + Optional<L3Network> l3Network = getAAIClient().get(L3Network.class,uri); + AAIResultWrapper wrapper = getAAIClient().get(uri); + Optional<Relationships> relationships = wrapper.getRelationships() + + if (l3Network.isPresent()) { + execution.setVariable(Prefix + "aaiReturnCode", 200) + execution.setVariable(Prefix + "queryAAIResponse", l3Network.get()) + execution.setVariable(Prefix + "isAAIGood", true) + if (relationships.isPresent()){ + if(!relationships.get().getRelatedAAIUris(AAIObjectType.VF_MODULE).isEmpty()){ + execution.setVariable(Prefix + "isVfRelationshipExist", true) + isVfRelationshipExist = true + String relationshipMessage = "AAI Query Success Response but 'vf-module' relationship exist, not allowed to delete: network Id: " + networkId + exceptionUtil.buildWorkflowException(execution, 2500, relationshipMessage) + }else{ + List<AAIResourceUri> tenantURIList = relationships.get().getRelatedAAIUris(AAIObjectType.TENANT) + for(AAIResourceUri tenantURI: tenantURIList){ + if(execution.getVariable(Prefix + "tenantId") == null) { + String tenantId = tenantURI.getURIKeys().get("tenant-id") + execution.setVariable(Prefix + "tenantId", tenantId) + logger.debug(" Get AAI getTenantId() : " + tenantId) + } + } + List<AAIResourceUri> cloudRegionURIList = relationships.get().getRelatedAAIUris(AAIObjectType.CLOUD_REGION) + for(AAIResourceUri tenantURI: cloudRegionURIList){ + if(execution.getVariable(Prefix + "lcpCloudRegion") == null) { + String lcpCloudRegion = tenantURI.getURIKeys().get("cloud-region-id") + execution.setVariable(Prefix + "lcpCloudRegion", lcpCloudRegion) + logger.debug(" Get AAI getCloudRegion() : " + lcpCloudRegion) + } + } + } + } + logger.debug(Prefix + "isVfRelationshipExist - " + isVfRelationshipExist) + } else { + // not found // empty aai response + execution.setVariable(Prefix + "aaiReturnCode", 404) + execution.setVariable(Prefix + "isAAIGood", false) + execution.setVariable(Prefix + "isSilentSuccess", true) + logger.debug(" AAI Query is Silent Success") + } + logger.debug(" AAI Query call, isAAIGood? : " + execution.getVariable(Prefix + "isAAIGood")) + } catch (Exception ex) { + // caught exception + String exceptionMessage = "Exception Encountered in DoDeleteNetworkInstance, callRESTQueryAAI() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + + } + + } + + public void callRESTQueryAAICloudRegion (DelegateExecution execution) { + + execution.setVariable("prefix", Prefix) + + logger.debug(" ***** Inside callRESTQueryAAICloudRegion of DoDeleteNetworkInstance ***** " ) + + try { + String networkInputs = execution.getVariable(Prefix + "networkInputs") + // String cloudRegion = utils.getNodeText(networkInputs, "aic-cloud-region") + String cloudRegion = execution.getVariable(Prefix + "lcpCloudRegion") + // Prepare AA&I url + AaiUtil aaiUtil = new AaiUtil(this) + + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion) + def queryCloudRegionRequest = aaiUtil.createAaiUri(uri) + + execution.setVariable(Prefix + "queryCloudRegionRequest", queryCloudRegionRequest) + + String cloudRegionPo = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion) + String cloudRegionSdnc = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "SDNC", cloudRegion) + + if ((cloudRegionPo != "ERROR") && (cloudRegionSdnc != "ERROR")) { + execution.setVariable(Prefix + "cloudRegionPo", cloudRegionPo) + execution.setVariable(Prefix + "cloudRegionSdnc", cloudRegionSdnc) + + } else { + String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode") + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + + } + + } catch (BpmnError e) { + throw e; + + } catch (Exception ex) { + // caught exception + String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, callRESTQueryAAICloudRegion(). Unexpected Response from AAI - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + + } + + } + + public void prepareNetworkRequest (DelegateExecution execution) { + + execution.setVariable("prefix", Prefix) + + logger.trace("Inside prepareNetworkRequest of DoDeleteNetworkInstance ") + ExceptionUtil exceptionUtil = new ExceptionUtil() + try { + // get variables + String networkRequest = execution.getVariable(Prefix + "networkRequest") + String cloudSiteId = execution.getVariable(Prefix + "cloudRegionPo") + String tenantId = execution.getVariable(Prefix + "tenantId") + + L3Network l3Network = execution.getVariable(Prefix + "queryAAIResponse") + String networkType = l3Network.getNetworkType() + String networkId = l3Network.getNetworkId() + + String networkStackId = "" + networkStackId = l3Network.getHeatStackId() + if (networkStackId == 'null' || networkStackId == "" || networkStackId == null) { + networkStackId = "force_delete" + } + + String requestId = execution.getVariable("msoRequestId") + if (requestId != null) { + execution.setVariable("mso-request-id", requestId) + } else { + requestId = execution.getVariable("mso-request-id") + } + String serviceInstanceId = execution.getVariable("serviceInstanceId") + + // Added new Elements + String messageId = execution.getVariable(Prefix + "messageId") + String notificationUrl = "" //TODO - is this coming from URN? What variable/value to use? + //String notificationUrl = execution.getVariable("URN_?????") //TODO - is this coming from URN? What variable/value to use? + + String modelCustomizationUuid = "" + if (utils.nodeExists(networkRequest, "networkModelInfo")) { + String networkModelInfo = utils.getNodeXml(networkRequest, "networkModelInfo", false).replace("tag0:","").replace(":tag0","") + modelCustomizationUuid = utils.getNodeText(networkModelInfo, "modelCustomizationUuid") + } else { + modelCustomizationUuid = utils.getNodeText(networkRequest, "modelCustomizationId") + } + + String deleteNetworkRequest = """ <deleteNetworkRequest> <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> @@ -416,645 +416,567 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor { </deleteNetworkRequest> """.trim() - logger.debug(Prefix + "deleteNetworkRequest - " + "\n" + deleteNetworkRequest) - // Format Response - String buildDeleteNetworkRequestAsString = utils.formatXml(deleteNetworkRequest) - logger.debug(buildDeleteNetworkRequestAsString) - logger.debug(Prefix + "deleteNetworkRequestAsString - " + "\n" + buildDeleteNetworkRequestAsString) - - String restURL = UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution) - execution.setVariable("mso.adapters.network.rest.endpoint", restURL + "/" + networkId) - logger.debug("mso.adapters.network.rest.endpoint - " + "\n" + restURL + "/" + networkId) - - execution.setVariable(Prefix + "deleteNetworkRequest", buildDeleteNetworkRequestAsString) - logger.debug(Prefix + "deleteNetworkRequest - " + "\n" + buildDeleteNetworkRequestAsString) - } - catch (Exception ex) { - // caught exception - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareNetworkRequest(). Unexpected Response from AAI - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - } - - /** - * This method is used instead of an HTTP Connector task because the - * connector does not allow DELETE with a body. - */ - public void sendRequestToVnfAdapter(DelegateExecution execution) { - def method = getClass().getSimpleName() + '.sendRequestToVnfAdapter(' + - 'execution=' + execution.getId() + - ')' - - logger.trace('Entered ' + method) - - try { - - String vnfAdapterUrl = UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint",execution) - String vnfAdapterRequest = execution.getVariable(Prefix + "deleteNetworkRequest") - - URL url = new URL(vnfAdapterUrl) - HttpClient httpClient = new HttpClientFactory().newXmlClient(url, ONAPComponents.OPENSTACK_ADAPTER) - httpClient.accept = "application/xml" - httpClient.addAdditionalHeader("Authorization", execution.getVariable("BasicAuthHeaderValuePO")) - Response response = httpClient.delete(vnfAdapterRequest) - - execution.setVariable(Prefix + "deleteNetworkResponse", response.readEntity(String.class)) - execution.setVariable(Prefix + "networkReturnCode", response.getStatus()) - - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, sendRequestToVnfAdapter() - " + ex.getMessage() - logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage, - "BPMN", ErrorCode.UnknownError.getValue(), - "Exception is:\n" + ex); - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - } - - - public void prepareSDNCRequest (DelegateExecution execution) { - - execution.setVariable("prefix", Prefix) - - logger.trace("Inside prepareSDNCRequest of DoDeleteNetworkInstance ") - - try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") - - String networkId = "" - if (utils.nodeExists(deleteNetworkInput, "network-id")) { - networkId = utils.getNodeText(deleteNetworkInput, "network-id") - } - if (networkId == 'null') {networkId = ""} - - String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") - - // get/set 'msoRequestId' and 'mso-request-id' - String requestId = execution.getVariable("msoRequestId") - if (requestId != null) { - execution.setVariable("mso-request-id", requestId) - } else { - requestId = execution.getVariable("mso-request-id") - } - execution.setVariable(Prefix + "requestId", requestId) - logger.debug(Prefix + "requestId " + requestId) - L3Network queryAAIResponse = execution.getVariable(Prefix + "queryAAIResponse") - - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - // 1. prepare delete topology via SDNC Adapter SUBFLOW call - String sndcTopologyDeleteRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "delete", "DisconnectNetworkRequest", cloudRegionId, networkId, queryAAIResponse, null) - String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyDeleteRequest) - logger.debug(sndcTopologyDeleteRequesAsString) - execution.setVariable(Prefix + "deleteSDNCRequest", sndcTopologyDeleteRequesAsString) - logger.debug(Prefix + "deleteSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString) - - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRequest() - " + ex.getMessage() - logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage, - "BPMN", ErrorCode.UnknownError.getValue(), - "Exception is:\n" + ex); - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void prepareRpcSDNCRequest (DelegateExecution execution) { + logger.debug(Prefix + "deleteNetworkRequest - " + "\n" + deleteNetworkRequest) + // Format Response + String buildDeleteNetworkRequestAsString = utils.formatXml(deleteNetworkRequest) + logger.debug(buildDeleteNetworkRequestAsString) + logger.debug(Prefix + "deleteNetworkRequestAsString - " + "\n" + buildDeleteNetworkRequestAsString) - execution.setVariable("prefix", Prefix) + String restURL = UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution) + execution.setVariable("mso.adapters.network.rest.endpoint", restURL + "/" + networkId) + logger.debug("mso.adapters.network.rest.endpoint - " + "\n" + restURL + "/" + networkId) - logger.trace("Inside prepareRpcSDNCRequest of DoDeleteNetworkInstance ") - - try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") - - String networkId = "" - if (utils.nodeExists(deleteNetworkInput, "network-id")) { - networkId = utils.getNodeText(deleteNetworkInput, "network-id") - } - if (networkId == 'null') {networkId = ""} - - String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") - - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - // 1. prepare delete topology via SDNC Adapter SUBFLOW call - String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "unassign", "DeleteNetworkInstance", cloudRegionId, networkId, null) - String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) - logger.debug(sndcTopologyDeleteRequesAsString) - execution.setVariable(Prefix + "deleteSDNCRequest", sndcTopologyDeleteRequesAsString) - logger.debug(Prefix + "deleteSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString) - - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRequest() - " + ex.getMessage() - logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage, - "BPMN", ErrorCode.UnknownError.getValue(), - "Exception is:\n" + ex); - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } + execution.setVariable(Prefix + "deleteNetworkRequest", buildDeleteNetworkRequestAsString) + logger.debug(Prefix + "deleteNetworkRequest - " + "\n" + buildDeleteNetworkRequestAsString) + } + catch (Exception ex) { + // caught exception + String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareNetworkRequest(). Unexpected Response from AAI - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } + } + + /** + * This method is used instead of an HTTP Connector task because the + * connector does not allow DELETE with a body. + */ + public void sendRequestToVnfAdapter(DelegateExecution execution) { + def method = getClass().getSimpleName() + '.sendRequestToVnfAdapter(' + + 'execution=' + execution.getId() + + ')' + + logger.trace('Entered ' + method) + + try { + + String vnfAdapterUrl = UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint",execution) + String vnfAdapterRequest = execution.getVariable(Prefix + "deleteNetworkRequest") + + URL url = new URL(vnfAdapterUrl) + HttpClient httpClient = new HttpClientFactory().newXmlClient(url, ONAPComponents.OPENSTACK_ADAPTER) + httpClient.accept = "application/xml" + httpClient.addAdditionalHeader("Authorization", execution.getVariable("BasicAuthHeaderValuePO")) + Response response = httpClient.delete(vnfAdapterRequest) + + execution.setVariable(Prefix + "deleteNetworkResponse", response.readEntity(String.class)) + execution.setVariable(Prefix + "networkReturnCode", response.getStatus()) + + } catch (Exception ex) { + // caught exception + String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, sendRequestToVnfAdapter() - " + ex.getMessage() + logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage, + "BPMN", ErrorCode.UnknownError.getValue(), + "Exception is:\n" + ex); + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - public void prepareRpcSDNCDeactivate(DelegateExecution execution) { + } + } + + + public void prepareSDNCRequest (DelegateExecution execution) { + + execution.setVariable("prefix", Prefix) + + logger.trace("Inside prepareSDNCRequest of DoDeleteNetworkInstance ") + + try { + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") + + String networkId = "" + if (utils.nodeExists(deleteNetworkInput, "network-id")) { + networkId = utils.getNodeText(deleteNetworkInput, "network-id") + } + if (networkId == 'null') {networkId = ""} + + String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") + + // get/set 'msoRequestId' and 'mso-request-id' + String requestId = execution.getVariable("msoRequestId") + if (requestId != null) { + execution.setVariable("mso-request-id", requestId) + } else { + requestId = execution.getVariable("mso-request-id") + } + execution.setVariable(Prefix + "requestId", requestId) + logger.debug(Prefix + "requestId " + requestId) + L3Network queryAAIResponse = execution.getVariable(Prefix + "queryAAIResponse") + + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + // 1. prepare delete topology via SDNC Adapter SUBFLOW call + String sndcTopologyDeleteRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "delete", "DisconnectNetworkRequest", cloudRegionId, networkId, queryAAIResponse, null) + String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyDeleteRequest) + logger.debug(sndcTopologyDeleteRequesAsString) + execution.setVariable(Prefix + "deleteSDNCRequest", sndcTopologyDeleteRequesAsString) + logger.debug(Prefix + "deleteSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString) + + } catch (Exception ex) { + // caught exception + String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRequest() - " + ex.getMessage() + logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage, + "BPMN", ErrorCode.UnknownError.getValue(), + "Exception is:\n" + ex); + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - execution.setVariable("prefix",Prefix) + } - logger.trace("Inside prepareRpcSDNCDeactivate() of DoDeleteNetworkInstance ") - - try { - - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String networkId = "" - if (utils.nodeExists(deleteNetworkInput, "network-id")) { - networkId = utils.getNodeText(deleteNetworkInput, "network-id") - } - if (networkId == 'null') {networkId = ""} - String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") + } - String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "deactivate", "DeleteNetworkInstance", cloudRegionId, networkId, null) - String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) - execution.setVariable(Prefix + "deactivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString) - logger.debug(" Preparing request for RPC SDNC Topology deactivate - " + "\n" + sndcTopologyRollbackRpcRequestAsString) + public void prepareRpcSDNCRequest (DelegateExecution execution) { + execution.setVariable("prefix", Prefix) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCActivateRollback() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + logger.trace("Inside prepareRpcSDNCRequest of DoDeleteNetworkInstance ") - } + try { + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") - } + String networkId = "" + if (utils.nodeExists(deleteNetworkInput, "network-id")) { + networkId = utils.getNodeText(deleteNetworkInput, "network-id") + } + if (networkId == 'null') {networkId = ""} - // ************************************************** - // Post or Validate Response Section - // ************************************************** + String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") - public void validateNetworkResponse (DelegateExecution execution) { + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + // 1. prepare delete topology via SDNC Adapter SUBFLOW call + String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "unassign", "DeleteNetworkInstance", cloudRegionId, networkId, null) + String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) + logger.debug(sndcTopologyDeleteRequesAsString) + execution.setVariable(Prefix + "deleteSDNCRequest", sndcTopologyDeleteRequesAsString) + logger.debug(Prefix + "deleteSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString) - execution.setVariable("prefix", Prefix) + } catch (Exception ex) { + // caught exception + String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRequest() - " + ex.getMessage() + logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage, + "BPMN", ErrorCode.UnknownError.getValue(), + "Exception is:\n" + ex); + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - logger.trace("Inside validateNetworkResponse of DoDeleteNetworkInstance ") + } - try { - String returnCode = execution.getVariable(Prefix + "networkReturnCode") - String networkResponse = execution.getVariable(Prefix + "deleteNetworkResponse") + } - logger.debug(" Network Adapter responseCode: " + returnCode) - logger.debug("Network Adapter Response - " + "\n" + networkResponse) - logger.debug(networkResponse) - String errorMessage = "" - if (returnCode == "200") { - logger.debug(" Network Adapter Response is successful - " + "\n" + networkResponse) + public void prepareRpcSDNCDeactivate(DelegateExecution execution) { - // prepare rollback data - String rollbackData = utils.getNodeXml(networkResponse, "rollback", false).replace("tag0:","").replace(":tag0","") - if ((rollbackData == null) || (rollbackData.isEmpty())) { - logger.debug(" Network Adapter 'rollback' data is not Sent: " + "\n" + networkResponse) - execution.setVariable(Prefix + "rollbackNetworkRequest", "") - } else { - String rollbackNetwork = - """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.onap.so/network"> - ${rollbackData} - </NetworkAdapter:rollbackNetwork>""" - String rollbackNetworkXml = utils.formatXml(rollbackNetwork) - execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkXml) - logger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml) - } + execution.setVariable("prefix",Prefix) + logger.trace("Inside prepareRpcSDNCDeactivate() of DoDeleteNetworkInstance ") - } else { // network error - if (returnCode.toInteger() > 399 && returnCode.toInteger() < 600) { //4xx, 5xx - if (networkResponse.contains("deleteNetworkError") ) { - networkResponse = networkResponse.replace('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>', '') - errorMessage = utils.getNodeText(networkResponse, "message") - errorMessage = "Received error from Network Adapter: " + errorMessage - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage) + try { - } else { // CatchAll exception - if (returnCode == "500") { - errorMessage = "JBWEB000065: HTTP Status 500." - } else { - errorMessage = "Return code is " + returnCode - } - errorMessage = "Received error from Network Adapter: " + errorMessage - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage) + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + String networkId = "" + if (utils.nodeExists(deleteNetworkInput, "network-id")) { + networkId = utils.getNodeText(deleteNetworkInput, "network-id") + } + if (networkId == 'null') {networkId = ""} + String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") - } + String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "deactivate", "DeleteNetworkInstance", cloudRegionId, networkId, null) + String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) + execution.setVariable(Prefix + "deactivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString) + logger.debug(" Preparing request for RPC SDNC Topology deactivate - " + "\n" + sndcTopologyRollbackRpcRequestAsString) - } else { // CatchAll exception - String dataErrorMessage = "Received error from Network Adapter. Return code is: " + returnCode - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCActivateRollback() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } - } catch (BpmnError e) { - throw e; + } - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, validateNetworkResponse() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + public void validateSDNCResponse (DelegateExecution execution) { - } + execution.setVariable("prefix", Prefix) - } + logger.trace("Inside validateSDNCResponse of DoDeleteNetworkInstance ") - public void validateSDNCResponse (DelegateExecution execution) { + String response = execution.getVariable(Prefix + "deleteSDNCResponse") + boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") + WorkflowException workflowException = execution.getVariable("WorkflowException") - execution.setVariable("prefix", Prefix) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) + // reset variable + String deleteSDNCResponseDecodeXml = execution.getVariable(Prefix + "deleteSDNCResponse") + deleteSDNCResponseDecodeXml = deleteSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") + execution.setVariable(Prefix + "deleteSDNCResponse", deleteSDNCResponseDecodeXml) - logger.trace("Inside validateSDNCResponse of DoDeleteNetworkInstance ") + if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, prefix+'sdncResponseSuccess' + execution.setVariable(Prefix + "isSdncRollbackNeeded", true) // + execution.setVariable(Prefix + "isPONR", true) + logger.debug("Successfully Validated SDNC Response") + } else { + logger.debug("Did NOT Successfully Validated SDNC Response") + throw new BpmnError("MSOWorkflowException") + } - String response = execution.getVariable(Prefix + "deleteSDNCResponse") - boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - WorkflowException workflowException = execution.getVariable("WorkflowException") + } - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) - // reset variable - String deleteSDNCResponseDecodeXml = execution.getVariable(Prefix + "deleteSDNCResponse") - deleteSDNCResponseDecodeXml = deleteSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") - execution.setVariable(Prefix + "deleteSDNCResponse", deleteSDNCResponseDecodeXml) + public void validateRpcSDNCDeactivateResponse (DelegateExecution execution) { - if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, prefix+'sdncResponseSuccess' - execution.setVariable(Prefix + "isSdncRollbackNeeded", true) // - execution.setVariable(Prefix + "isPONR", true) - logger.debug("Successfully Validated SDNC Response") - } else { - logger.debug("Did NOT Successfully Validated SDNC Response") - throw new BpmnError("MSOWorkflowException") - } + execution.setVariable("prefix",Prefix) - } + logger.trace("Inside validateRpcSDNCDeactivateResponse() of DoDeleteNetworkInstance ") - public void validateRpcSDNCDeactivateResponse (DelegateExecution execution) { + String response = execution.getVariable(Prefix + "deactivateSDNCResponse") + boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") + WorkflowException workflowException = execution.getVariable("WorkflowException") - execution.setVariable("prefix",Prefix) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) + // reset variable + String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "deactivateSDNCResponse") + assignSDNCResponseDecodeXml = assignSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") + execution.setVariable(Prefix + "deactivateSDNCResponse", assignSDNCResponseDecodeXml) - logger.trace("Inside validateRpcSDNCDeactivateResponse() of DoDeleteNetworkInstance ") + if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess' + execution.setVariable(Prefix + "isSdncDeactivateRollbackNeeded", true) + logger.debug("Successfully Validated Rpc SDNC Activate Response") - String response = execution.getVariable(Prefix + "deactivateSDNCResponse") - boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - WorkflowException workflowException = execution.getVariable("WorkflowException") + } else { + logger.debug("Did NOT Successfully Validated Rpc SDNC Deactivate Response") + throw new BpmnError("MSOWorkflowException") + } - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) - // reset variable - String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "deactivateSDNCResponse") - assignSDNCResponseDecodeXml = assignSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") - execution.setVariable(Prefix + "deactivateSDNCResponse", assignSDNCResponseDecodeXml) + } - if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess' - execution.setVariable(Prefix + "isSdncDeactivateRollbackNeeded", true) - logger.debug("Successfully Validated Rpc SDNC Activate Response") + public void prepareRpcSDNCDeactivateRollback(DelegateExecution execution) { - } else { - logger.debug("Did NOT Successfully Validated Rpc SDNC Deactivate Response") - throw new BpmnError("MSOWorkflowException") - } + execution.setVariable("prefix",Prefix) - } + logger.trace("Inside prepareRpcSDNCDeactivateRollback() of DoDeleteNetworkInstance ") - public void prepareRpcSDNCDeactivateRollback(DelegateExecution execution) { + try { - execution.setVariable("prefix",Prefix) + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + String deactivateSDNCResponse = execution.getVariable(Prefix + "deactivateSDNCResponse") + String networkId = utils.getNodeText(deactivateSDNCResponse, "network-id") + if (networkId == 'null') {networkId = ""} + String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") - logger.trace("Inside prepareRpcSDNCDeactivateRollback() of DoDeleteNetworkInstance ") - - try { + // 2. prepare rollback topology via SDNC Adapter SUBFLOW call + String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "activate", "CreateNetworkInstance", cloudRegionId, networkId, null) + String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) + execution.setVariable(Prefix + "rollbackDeactivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString) + logger.debug(" Preparing request for RPC SDNC Topology 'activate-CreateNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString) - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String deactivateSDNCResponse = execution.getVariable(Prefix + "deactivateSDNCResponse") - String networkId = utils.getNodeText(deactivateSDNCResponse, "network-id") - if (networkId == 'null') {networkId = ""} - String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") - // 2. prepare rollback topology via SDNC Adapter SUBFLOW call - String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "activate", "CreateNetworkInstance", cloudRegionId, networkId, null) - String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) - execution.setVariable(Prefix + "rollbackDeactivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString) - logger.debug(" Preparing request for RPC SDNC Topology 'activate-CreateNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCDeactivateRollback() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCDeactivateRollback() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } - } + public void prepareRollbackData(DelegateExecution execution) { - } + execution.setVariable("prefix",Prefix) - public void prepareRollbackData(DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) + logger.trace("Inside prepareRollbackData() of DoDeleteNetworkInstance ") - logger.trace("Inside prepareRollbackData() of DoDeleteNetworkInstance ") + try { - try { + Map<String, String> rollbackData = new HashMap<String, String>(); + String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") + if (rollbackNetworkRequest != null) { + if (rollbackNetworkRequest != "") { + rollbackData.put("rollbackNetworkRequest", execution.getVariable(Prefix + "rollbackNetworkRequest")) + } + } + String rollbackDeactivateSDNCRequest = execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest") + if (rollbackDeactivateSDNCRequest != null) { + if (rollbackDeactivateSDNCRequest != "") { + rollbackData.put("rollbackDeactivateSDNCRequest", execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")) + } + } + execution.setVariable("rollbackData", rollbackData) + logger.debug("** rollbackData : " + rollbackData) - Map<String, String> rollbackData = new HashMap<String, String>(); - String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") - if (rollbackNetworkRequest != null) { - if (rollbackNetworkRequest != "") { - rollbackData.put("rollbackNetworkRequest", execution.getVariable(Prefix + "rollbackNetworkRequest")) - } - } - String rollbackDeactivateSDNCRequest = execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest") - if (rollbackDeactivateSDNCRequest != null) { - if (rollbackDeactivateSDNCRequest != "") { - rollbackData.put("rollbackDeactivateSDNCRequest", execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")) - } - } - execution.setVariable("rollbackData", rollbackData) - logger.debug("** rollbackData : " + rollbackData) - - execution.setVariable("WorkflowException", execution.getVariable("WorkflowException")) - logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException")) - - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRollbackData() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - - } - - } + execution.setVariable("WorkflowException", execution.getVariable("WorkflowException")) + logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException")) - public void postProcessResponse (DelegateExecution execution) { - - execution.setVariable("prefix", Prefix) - - logger.trace("Inside postProcessResponse of DoDeleteNetworkInstance ") - - try { - - logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException")) - if (execution.getVariable(Prefix + "isException") == false) { - execution.setVariable(Prefix + "Success", true) - execution.setVariable("WorkflowException", null) - if (execution.getVariable(Prefix + "isSilentSuccess") == true) { - execution.setVariable("rolledBack", false) - } else { - execution.setVariable("rolledBack", true) - } - prepareSuccessRollbackData(execution) // populate rollbackData - - } else { - execution.setVariable(Prefix + "Success", false) - execution.setVariable("rollbackData", null) - String exceptionMessage = " Exception encountered in MSO Bpmn. " - if (execution.getVariable("workflowException") != null) { // Output of Rollback flow. - logger.debug(" ***** workflowException: " + execution.getVariable("workflowException")) - WorkflowException wfex = execution.getVariable("workflowException") - exceptionMessage = wfex.getErrorMessage() - } else { - if (execution.getVariable(Prefix + "WorkflowException") != null) { - WorkflowException pwfex = execution.getVariable(Prefix + "WorkflowException") - exceptionMessage = pwfex.getErrorMessage() - } else { - if (execution.getVariable("WorkflowException") != null) { - WorkflowException pwfex = execution.getVariable("WorkflowException") - exceptionMessage = pwfex.getErrorMessage() - } - } - } - - // going to the Main flow: a-la-carte or macro - logger.debug(" ***** postProcessResponse(), BAD !!!") - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - throw new BpmnError("MSOWorkflowException") - - } - - } catch(BpmnError b){ - logger.debug("Rethrowing MSOWorkflowException") - throw b - - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, postProcessResponse() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - throw new BpmnError("MSOWorkflowException") + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRollbackData() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) } - } - - public void prepareSuccessRollbackData(DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside prepareSuccessRollbackData() of DoDeleteNetworkInstance ") - - try { - - if (execution.getVariable("sdncVersion") != '1610') { - prepareRpcSDNCDeactivateRollback(execution) - prepareRpcSDNCUnassignRollback(execution) - } else { - prepareSDNCRollback(execution) - } - - Map<String, String> rollbackData = new HashMap<String, String>(); - String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") - if (rollbackSDNCRequest != null) { - if (rollbackSDNCRequest != "") { - rollbackData.put("rollbackSDNCRequest", execution.getVariable(Prefix + "rollbackSDNCRequest")) - } - } - String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") - if (rollbackNetworkRequest != null) { - if (rollbackNetworkRequest != "") { - rollbackData.put("rollbackNetworkRequest", execution.getVariable(Prefix + "rollbackNetworkRequest")) - } - } - String rollbackDeactivateSDNCRequest = execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest") - if (rollbackDeactivateSDNCRequest != null) { - if (rollbackDeactivateSDNCRequest != "") { - rollbackData.put("rollbackDeactivateSDNCRequest", execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")) - } - } - execution.setVariable("rollbackData", rollbackData) - - logger.debug("** rollbackData : " + rollbackData) - execution.setVariable("WorkflowException", null) + } + + public void postProcessResponse (DelegateExecution execution) { + + execution.setVariable("prefix", Prefix) + + logger.trace("Inside postProcessResponse of DoDeleteNetworkInstance ") + + try { + + logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException")) + if (execution.getVariable(Prefix + "isException") == false) { + execution.setVariable(Prefix + "Success", true) + execution.setVariable("WorkflowException", null) + if (execution.getVariable(Prefix + "isSilentSuccess") == true) { + execution.setVariable("rolledBack", false) + } else { + execution.setVariable("rolledBack", true) + } + prepareSuccessRollbackData(execution) // populate rollbackData + + } else { + execution.setVariable(Prefix + "Success", false) + execution.setVariable("rollbackData", null) + String exceptionMessage = " Exception encountered in MSO Bpmn. " + if (execution.getVariable("workflowException") != null) { // Output of Rollback flow. + logger.debug(" ***** workflowException: " + execution.getVariable("workflowException")) + WorkflowException wfex = execution.getVariable("workflowException") + exceptionMessage = wfex.getErrorMessage() + } else { + if (execution.getVariable(Prefix + "WorkflowException") != null) { + WorkflowException pwfex = execution.getVariable(Prefix + "WorkflowException") + exceptionMessage = pwfex.getErrorMessage() + } else { + if (execution.getVariable("WorkflowException") != null) { + WorkflowException pwfex = execution.getVariable("WorkflowException") + exceptionMessage = pwfex.getErrorMessage() + } + } + } + + // going to the Main flow: a-la-carte or macro + logger.debug(" ***** postProcessResponse(), BAD !!!") + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + throw new BpmnError("MSOWorkflowException") + + } + + } catch(BpmnError b){ + logger.debug("Rethrowing MSOWorkflowException") + throw b + + } catch (Exception ex) { + // caught exception + String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, postProcessResponse() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + throw new BpmnError("MSOWorkflowException") + } - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } + + public void prepareSuccessRollbackData(DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + + logger.trace("Inside prepareSuccessRollbackData() of DoDeleteNetworkInstance ") + + try { + + if (execution.getVariable("sdncVersion") != '1610') { + prepareRpcSDNCDeactivateRollback(execution) + prepareRpcSDNCUnassignRollback(execution) + } else { + prepareSDNCRollback(execution) + } + + Map<String, String> rollbackData = new HashMap<String, String>(); + String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") + if (rollbackSDNCRequest != null) { + if (rollbackSDNCRequest != "") { + rollbackData.put("rollbackSDNCRequest", execution.getVariable(Prefix + "rollbackSDNCRequest")) + } + } + String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") + if (rollbackNetworkRequest != null) { + if (rollbackNetworkRequest != "") { + rollbackData.put("rollbackNetworkRequest", execution.getVariable(Prefix + "rollbackNetworkRequest")) + } + } + String rollbackDeactivateSDNCRequest = execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest") + if (rollbackDeactivateSDNCRequest != null) { + if (rollbackDeactivateSDNCRequest != "") { + rollbackData.put("rollbackDeactivateSDNCRequest", execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")) + } + } + execution.setVariable("rollbackData", rollbackData) + + logger.debug("** rollbackData : " + rollbackData) + execution.setVariable("WorkflowException", null) + + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void prepareRpcSDNCUnassignRollback(DelegateExecution execution) { + public void prepareRpcSDNCUnassignRollback(DelegateExecution execution) { - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside prepareRpcSDNCUnassignRollbac() of DoDeleteNetworkInstance ") + logger.trace("Inside prepareRpcSDNCUnassignRollbac() of DoDeleteNetworkInstance ") - try { + try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") - String deleteSDNCResponse = execution.getVariable(Prefix + "deleteSDNCResponse") - String networkId = utils.getNodeText(deleteSDNCResponse, "network-id") - if (networkId == 'null') {networkId = ""} - String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") + String deleteSDNCResponse = execution.getVariable(Prefix + "deleteSDNCResponse") + String networkId = utils.getNodeText(deleteSDNCResponse, "network-id") + if (networkId == 'null') {networkId = ""} + String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - // 1. prepare delete topology via SDNC Adapter SUBFLOW call - String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "assign", "CreateNetworkInstance", cloudRegionId, networkId, null) - String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) - logger.debug(sndcTopologyDeleteRequesAsString) - execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyDeleteRequesAsString) - logger.debug(Prefix + "rollbackSDNCRequest" + "\n" + sndcTopologyDeleteRequesAsString) - logger.debug(" Preparing request for RPC SDNC Topology 'assign-CreateNetworkInstance' rollback . . . - " + "\n" + sndcTopologyDeleteRequesAsString) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + // 1. prepare delete topology via SDNC Adapter SUBFLOW call + String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "assign", "CreateNetworkInstance", cloudRegionId, networkId, null) + String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyRollbackRpcRequest) + logger.debug(sndcTopologyDeleteRequesAsString) + execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyDeleteRequesAsString) + logger.debug(Prefix + "rollbackSDNCRequest" + "\n" + sndcTopologyDeleteRequesAsString) + logger.debug(" Preparing request for RPC SDNC Topology 'assign-CreateNetworkInstance' rollback . . . - " + "\n" + sndcTopologyDeleteRequesAsString) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCUnassignRollback() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCUnassignRollback() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void prepareSDNCRollback (DelegateExecution execution) { + public void prepareSDNCRollback (DelegateExecution execution) { - execution.setVariable("prefix", Prefix) + execution.setVariable("prefix", Prefix) - logger.trace("Inside prepareSDNCRollback of DoDeleteNetworkInstance ") + logger.trace("Inside prepareSDNCRollback of DoDeleteNetworkInstance ") - try { + try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String deleteNetworkInput = execution.getVariable(Prefix + "networkRequest") - String networkId = "" - if (utils.nodeExists(deleteNetworkInput, "network-id")) { - networkId = utils.getNodeText(deleteNetworkInput, "network-id") - } - if (networkId == 'null') {networkId = ""} + String networkId = "" + if (utils.nodeExists(deleteNetworkInput, "network-id")) { + networkId = utils.getNodeText(deleteNetworkInput, "network-id") + } + if (networkId == 'null') {networkId = ""} - String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") + String serviceInstanceId = utils.getNodeText(deleteNetworkInput, "service-instance-id") - // get/set 'msoRequestId' and 'mso-request-id' - String requestId = execution.getVariable("msoRequestId") - if (requestId != null) { - execution.setVariable("mso-request-id", requestId) - } else { - requestId = execution.getVariable("mso-request-id") - } - execution.setVariable(Prefix + "requestId", requestId) + // get/set 'msoRequestId' and 'mso-request-id' + String requestId = execution.getVariable("msoRequestId") + if (requestId != null) { + execution.setVariable("mso-request-id", requestId) + } else { + requestId = execution.getVariable("mso-request-id") + } + execution.setVariable(Prefix + "requestId", requestId) - L3Network queryAAIResponse = execution.getVariable(Prefix + "queryAAIResponse") + L3Network queryAAIResponse = execution.getVariable(Prefix + "queryAAIResponse") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - // 1. prepare delete topology via SDNC Adapter SUBFLOW call - String sndcTopologyDeleteRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "rollback", "DisconnectNetworkRequest", cloudRegionId, networkId, queryAAIResponse, null) - String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyDeleteRequest) - logger.debug(sndcTopologyDeleteRequesAsString) - execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyDeleteRequesAsString) - logger.debug(Prefix + "rollbackSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString) - logger.debug(" Preparing request for RPC SDNC Topology 'rollback-DisconnectNetworkRequest' rollback . . . - " + "\n" + sndcTopologyDeleteRequesAsString) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + // 1. prepare delete topology via SDNC Adapter SUBFLOW call + String sndcTopologyDeleteRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "rollback", "DisconnectNetworkRequest", cloudRegionId, networkId, queryAAIResponse, null) + String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyDeleteRequest) + logger.debug(sndcTopologyDeleteRequesAsString) + execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyDeleteRequesAsString) + logger.debug(Prefix + "rollbackSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString) + logger.debug(" Preparing request for RPC SDNC Topology 'rollback-DisconnectNetworkRequest' rollback . . . - " + "\n" + sndcTopologyDeleteRequesAsString) - } catch (Exception ex) { - // caught exception - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRollback() - " + ex.getMessage() - logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage, - "BPMN", ErrorCode.UnknownError.getValue(), - "Exception is:\n" + ex); - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + // caught exception + String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRollback() - " + ex.getMessage() + logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage, + "BPMN", ErrorCode.UnknownError.getValue(), + "Exception is:\n" + ex); + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void setExceptionFlag(DelegateExecution execution){ + public void setExceptionFlag(DelegateExecution execution){ - execution.setVariable("prefix",Prefix) + execution.setVariable("prefix",Prefix) - logger.trace("Inside setExceptionFlag() of DoDeleteNetworkInstance ") + logger.trace("Inside setExceptionFlag() of DoDeleteNetworkInstance ") - try { + try { - execution.setVariable(Prefix + "isException", true) + execution.setVariable(Prefix + "isException", true) - if (execution.getVariable("SavedWorkflowException1") != null) { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) - } else { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) - } - logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException")) + if (execution.getVariable("SavedWorkflowException1") != null) { + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) + } else { + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) + } + logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException")) - } catch(Exception ex){ - String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance flow. setExceptionFlag(): " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } catch(Exception ex){ + String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance flow. setExceptionFlag(): " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } - } + } - // ******************************* - // Build Error Section - // ******************************* + // ******************************* + // Build Error Section + // ******************************* - public void processJavaException(DelegateExecution execution){ + public void processJavaException(DelegateExecution execution){ - execution.setVariable("prefix",Prefix) - try{ - logger.debug("Caught a Java Exception") - logger.debug("Started processJavaException Method") - logger.debug("Variables List: " + execution.getVariables()) - execution.setVariable("UnexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") + execution.setVariable("prefix",Prefix) + try{ + logger.debug("Caught a Java Exception") + logger.debug("Started processJavaException Method") + logger.debug("Variables List: " + execution.getVariables()) + execution.setVariable("UnexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated + exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") - }catch(Exception e){ - logger.debug("Caught Exception during processJavaException Method: " + e) - execution.setVariable("UnexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method") - } - logger.debug("Completed processJavaException Method of " + Prefix) - } + }catch(Exception e){ + logger.debug("Caught Exception during processJavaException Method: " + e) + execution.setVariable("UnexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated + exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method") + } + logger.debug("Completed processJavaException Method of " + Prefix) + } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy deleted file mode 100644 index 36c145b0e0..0000000000 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy +++ /dev/null @@ -1,338 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.infrastructure.scripts; - -import groovy.xml.XmlUtil -import groovy.json.* -import org.onap.so.bpmn.core.UrnPropertiesReader -import org.onap.so.bpmn.core.json.JsonUtils -import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor -import org.onap.so.bpmn.common.scripts.ExceptionUtil -import org.onap.so.bpmn.common.scripts.NetworkUtils -import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils -import org.onap.so.bpmn.common.scripts.VidUtils -import org.onap.so.bpmn.core.WorkflowException - - -import java.util.UUID; - -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.delegate.DelegateExecution -import org.apache.commons.lang3.* -import org.apache.commons.codec.binary.Base64; -import org.springframework.web.util.UriUtils - -import org.slf4j.Logger -import org.slf4j.LoggerFactory - -/** - * This groovy class supports the <class>DoCreateNetworkInstanceRollback.bpmn</class> process. - * - */ -public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcessor { - private static final Logger logger = LoggerFactory.getLogger( DoDeleteNetworkInstanceRollback.class); - - String Prefix="DELNWKIR_" - ExceptionUtil exceptionUtil = new ExceptionUtil() - JsonUtils jsonUtil = new JsonUtils() - VidUtils vidUtils = new VidUtils(this) - NetworkUtils networkUtils = new NetworkUtils() - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - - def className = getClass().getSimpleName() - - /** - * This method is executed during the preProcessRequest task of the <class>DoDeleteNetworkInstanceRollback.bpmn</class> process. - * @param execution - */ - public InitializeProcessVariables(DelegateExecution execution){ - /* Initialize all the process variables in this block */ - - execution.setVariable(Prefix + "WorkflowException", null) - - execution.setVariable(Prefix + "rollbackDeactivateSDNCRequest", null) - execution.setVariable(Prefix + "rollbackDeactivateSDNCResponse", "") - execution.setVariable(Prefix + "rollbackDeactivateSDNCReturnCode", "") - - execution.setVariable(Prefix + "rollbackSDNCRequest", "") - execution.setVariable(Prefix + "rollbackSDNCResponse", "") - execution.setVariable(Prefix + "rollbackSDNCReturnCode", "") - - execution.setVariable(Prefix + "rollbackNetworkRequest", null) - execution.setVariable(Prefix + "rollbackNetworkResponse", "") - execution.setVariable(Prefix + "rollbackNetworkReturnCode", "") - - execution.setVariable(Prefix + "Success", false) - execution.setVariable(Prefix + "fullRollback", false) - - } - - // ************************************************** - // Pre or Prepare Request Section - // ************************************************** - /** - * This method is executed during the preProcessRequest task of the <class>DoDeleteNetworkInstanceRollback.bpmn</class> process. - * @param execution - */ - public void preProcessRequest (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside preProcessRequest() of " + className + ".groovy ") - - try { - // initialize flow variables - InitializeProcessVariables(execution) - - // GET Incoming request/variables - String rollbackDeactivateSDNCRequest = null - String rollbackSDNCRequest = null - String rollbackNetworkRequest = null - - Map<String, String> rollbackData = execution.getVariable("rollbackData") - if (rollbackData != null && rollbackData instanceof Map) { - - if(rollbackData.containsKey("rollbackDeactivateSDNCRequest")) { - rollbackDeactivateSDNCRequest = rollbackData["rollbackDeactivateSDNCRequest"] - } - - if(rollbackData.containsKey("rollbackSDNCRequest")) { - rollbackSDNCRequest = rollbackData["rollbackSDNCRequest"] - } - - if(rollbackData.containsKey("rollbackNetworkRequest")) { - rollbackNetworkRequest = rollbackData["rollbackNetworkRequest"] - } - } - - execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkRequest) - execution.setVariable(Prefix + "rollbackSDNCRequest", rollbackSDNCRequest) - execution.setVariable(Prefix + "rollbackDeactivateSDNCRequest", rollbackDeactivateSDNCRequest) - logger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData")) - - String sdncVersion = execution.getVariable("sdncVersion") - logger.debug("sdncVersion? : " + sdncVersion) - - // PO Authorization Info / headers Authorization= - String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution) - try { - def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey", execution)) - execution.setVariable("BasicAuthHeaderValuePO",encodedString) - execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) - - } catch (IOException ex) { - String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - " - String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage() - logger.debug(dataErrorMessage ) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - if (execution.getVariable("SavedWorkflowException1") != null) { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) - } else { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) - } - logger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException")) - if(execution.getVariable(Prefix + "WorkflowException") != null) { - // called by: DoCreateNetworkInstance, partial rollback - execution.setVariable(Prefix + "fullRollback", false) - - } else { - // called by: Macro - Full Rollback, WorkflowException = null - execution.setVariable(Prefix + "fullRollback", true) - - } - - logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback")) - - } catch (BpmnError e) { - throw e; - - } catch (Exception ex) { - sendSyncError(execution) - // caught exception - String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void validateRollbackResponses (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside validateRollbackResponses() of DoDeleteNetworkInstanceRollback ") - - try { - - // validate SDNC activate response - String rollbackDeactivateSDNCMessages = "" - String rollbackDeactivateSDNCReturnCode = "200" - if (execution.getVariable(Prefix + "rollbackDeactivateSDNCRequest") != null) { - rollbackDeactivateSDNCReturnCode = execution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode") - String rollbackDeactivateSDNCResponse = execution.getVariable(Prefix + "rollbackDeactivateSDNCResponse") - String rollbackDeactivateSDNCReturnInnerCode = "" - rollbackDeactivateSDNCResponse = rollbackDeactivateSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") - if (rollbackDeactivateSDNCReturnCode == "200") { - if (utils.nodeExists(rollbackDeactivateSDNCResponse, "response-code")) { - rollbackDeactivateSDNCReturnInnerCode = utils.getNodeText(rollbackDeactivateSDNCResponse, "response-code") - if (rollbackDeactivateSDNCReturnInnerCode == "200" || rollbackDeactivateSDNCReturnInnerCode == "" || rollbackDeactivateSDNCReturnInnerCode == "0") { - rollbackDeactivateSDNCMessages = " + SNDC deactivate rollback completed." - } else { - rollbackDeactivateSDNCMessages = " + SDNC deactivate rollback failed. " - } - } else { - rollbackDeactivateSDNCMessages = " + SNDC deactivate rollback completed." - } - } else { - rollbackDeactivateSDNCMessages = " + SDNC deactivate rollback failed. " - } - logger.debug(" SDNC deactivate rollback Code - " + rollbackDeactivateSDNCReturnCode) - logger.debug(" SDNC deactivate rollback Response - " + rollbackDeactivateSDNCResponse) - } - - // validate SDNC rollback response - String rollbackSdncErrorMessages = "" - String rollbackSDNCReturnCode = "200" - if (execution.getVariable(Prefix + "rollbackSDNCRequest") != null) { - rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode") - String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse") - String rollbackSDNCReturnInnerCode = "" - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") - if (rollbackSDNCReturnCode == "200") { - if (utils.nodeExists(rollbackSDNCResponse, "response-code")) { - rollbackSDNCReturnInnerCode = utils.getNodeText(rollbackSDNCResponse, "response-code") - if (rollbackSDNCReturnInnerCode == "200" || rollbackSDNCReturnInnerCode == "" || rollbackSDNCReturnInnerCode == "0") { - rollbackSdncErrorMessages = " + SNDC unassign rollback completed." - } else { - rollbackSdncErrorMessages = " + SDNC unassign rollback failed. " - } - } else { - rollbackSdncErrorMessages = " + SNDC unassign rollback completed." - } - } else { - rollbackSdncErrorMessages = " + SDNC unassign rollback failed. " - } - logger.debug(" SDNC assign rollback Code - " + rollbackSDNCReturnCode) - logger.debug(" SDNC assign rollback Response - " + rollbackSDNCResponse) - } - - // validate PO network rollback response - String rollbackNetworkErrorMessages = "" - String rollbackNetworkReturnCode = "200" - if (execution.getVariable(Prefix + "rollbackNetworkRequest") != null) { - rollbackNetworkReturnCode = execution.getVariable(Prefix + "rollbackNetworkReturnCode") - String rollbackNetworkResponse = execution.getVariable(Prefix + "rollbackNetworkResponse") - if (rollbackNetworkReturnCode != "200") { - rollbackNetworkErrorMessages = " + PO Network rollback failed. " - } else { - rollbackNetworkErrorMessages = " + PO Network rollback completed." - } - - logger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode) - logger.debug(" NetworkRollback Response - " + rollbackNetworkResponse) - } - - String statusMessage = "" - int errorCode = 7000 - logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback")) - if (execution.getVariable(Prefix + "fullRollback") == false) { - WorkflowException wfe = execution.getVariable(Prefix + "WorkflowException") // original WorkflowException - if (wfe != null) { - statusMessage = wfe.getErrorMessage() - errorCode = wfe.getErrorCode() - } else { - statusMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception." - errorCode = '7000' - } - - // set if all rolledbacks are successful - if (rollbackDeactivateSDNCReturnCode == "200" && rollbackNetworkReturnCode == "200" && rollbackSDNCReturnCode == "200") { - execution.setVariable("rolledBack", true) - execution.setVariable("wasDeleted", true) - - } else { - execution.setVariable("rolledBack", false) - execution.setVariable("wasDeleted", true) - } - - statusMessage = statusMessage + rollbackDeactivateSDNCMessages + rollbackNetworkErrorMessages + rollbackSdncErrorMessages - logger.debug("Final DoDeleteNetworkInstanceRollback status message: " + statusMessage) - String processKey = getProcessKey(execution); - WorkflowException exception = new WorkflowException(processKey, errorCode, statusMessage); - execution.setVariable("workflowException", exception); - - } else { - // rollback due to failures in Main flow (Macro or a-ala-carte) - Full rollback - if (rollbackDeactivateSDNCReturnCode == "200" && rollbackNetworkReturnCode == "200" && rollbackSDNCReturnCode == "200") { - execution.setVariable("rollbackSuccessful", true) - execution.setVariable("rollbackError", false) - } else { - String exceptionMessage = "Network Delete Rollback was not Successful. " - logger.debug(exceptionMessage) - execution.setVariable("rollbackSuccessful", false) - execution.setVariable("rollbackError", true) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - throw new BpmnError("MSOWorkflowException") - } - } - - } catch (Exception ex) { - String errorMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception." - String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstanceRollback flow. validateRollbackResponses() - " + errorMessage + ": " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - // ******************************* - // Build Error Section - // ******************************* - - - - public void processJavaException(DelegateExecution execution){ - - execution.setVariable("prefix",Prefix) - - try{ - logger.debug("Caught a Java Exception in " + Prefix) - logger.debug("Started processJavaException Method") - logger.debug("Variables List: " + execution.getVariables()) - execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") - - }catch(Exception e){ - logger.debug("Caught Exception during processJavaException Method: " + e) - execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix) - } - logger.debug("Completed processJavaException Method in " + Prefix) - } - -} diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy index 6162780b27..87e56791fc 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy @@ -73,1107 +73,1027 @@ import groovy.xml.XmlUtil public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { private static final Logger logger = LoggerFactory.getLogger( DoUpdateNetworkInstance.class); - String Prefix="UPDNETI_" - ExceptionUtil exceptionUtil = new ExceptionUtil() - JsonUtils jsonUtil = new JsonUtils() - VidUtils vidUtils = new VidUtils(this) - NetworkUtils networkUtils = new NetworkUtils() - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - - /** - * This method is executed during the preProcessRequest task of the <class>DoUpdateNetworkInstance.bpmn</class> process. - * @param execution - */ - public InitializeProcessVariables(DelegateExecution execution){ - /* Initialize all the process variables in this block */ - - execution.setVariable(Prefix + "messageId", "") - execution.setVariable("BasicAuthHeaderValuePO", "") - execution.setVariable("BasicAuthHeaderValueSDNC", "") - execution.setVariable(Prefix + "networkRequest", "") - execution.setVariable(Prefix + "networkInputs", "") - execution.setVariable(Prefix + "networkOutputs", "") - execution.setVariable(Prefix + "requestId", "") - execution.setVariable(Prefix + "source", "") - execution.setVariable(Prefix + "networkId", "") - - execution.setVariable(Prefix + "isPONR", false) // Point-of-no-return, means, rollback is not needed - - // AAI query Cloud Region - execution.setVariable(Prefix + "queryCloudRegionRequest","") - execution.setVariable(Prefix + "queryCloudRegionReturnCode","") - execution.setVariable(Prefix + "queryCloudRegionResponse","") - execution.setVariable(Prefix + "cloudRegionPo","") - execution.setVariable(Prefix + "cloudRegionSdnc","") - execution.setVariable(Prefix + "isCloudRegionGood", false) - - // AAI query Id - execution.setVariable(Prefix + "queryIdAAIRequest","") - execution.setVariable(Prefix + "queryIdAAIResponse", "") - execution.setVariable(Prefix + "aaiIdReturnCode", "") - - // AAI query vpn binding - execution.setVariable(Prefix + "queryVpnBindingAAIRequest","") - execution.setVariable(Prefix + "queryVpnBindingAAIResponse", "") - execution.setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "") - execution.setVariable(Prefix + "vpnBindings", null) - execution.setVariable(Prefix + "vpnCount", 0) - execution.setVariable(Prefix + "routeCollection", "") - - // AAI query network policy - execution.setVariable(Prefix + "queryNetworkPolicyAAIRequest","") - execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", "") - execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "") - execution.setVariable(Prefix + "networkPolicyUriList", null) - execution.setVariable(Prefix + "networkPolicyCount", 0) - execution.setVariable(Prefix + "networkCollection", "") - - // AAI query route table reference - execution.setVariable(Prefix + "queryNetworkTableRefAAIRequest","") - execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", "") - execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "") - execution.setVariable(Prefix + "networkTableRefUriList", null) - execution.setVariable(Prefix + "networkTableRefCount", 0) - execution.setVariable(Prefix + "tableRefCollection", "") - - // AAI requery Id - execution.setVariable(Prefix + "requeryIdAAIRequest","") - execution.setVariable(Prefix + "requeryIdAAIResponse", "") - execution.setVariable(Prefix + "aaiRequeryIdReturnCode", "") - - // AAI update contrail - execution.setVariable(Prefix + "updateContrailAAIUrlRequest","") - execution.setVariable(Prefix + "updateContrailAAIPayloadRequest","") - execution.setVariable(Prefix + "updateContrailAAIResponse", "") - execution.setVariable(Prefix + "aaiUpdateContrailReturnCode", "") - - execution.setVariable(Prefix + "updateNetworkRequest", "") - execution.setVariable(Prefix + "updateNetworkResponse", "") - execution.setVariable(Prefix + "rollbackNetworkRequest", "") - execution.setVariable(Prefix + "networkReturnCode", "") - execution.setVariable(Prefix + "isNetworkRollbackNeeded", false) - - execution.setVariable(Prefix + "changeAssignSDNCRequest", "") - execution.setVariable(Prefix + "changeAssignSDNCResponse", "") - execution.setVariable(Prefix + "rollbackSDNCRequest", "") - execution.setVariable(Prefix + "sdncReturnCode", "") - execution.setVariable(Prefix + "isSdncRollbackNeeded", false) - execution.setVariable(Prefix + "sdncResponseSuccess", false) - - execution.setVariable(Prefix + "isVnfBindingPresent", false) - execution.setVariable(Prefix + "Success", false) - execution.setVariable(Prefix + "serviceInstanceId", "") - - execution.setVariable(Prefix + "isException", false) - - } - - // ************************************************** - // Pre or Prepare Request Section - // ************************************************** - /** - * This method is executed during the preProcessRequest task of the <class>DoUpdateNetworkInstance.bpmn</class> process. - * @param execution - */ - public void preProcessRequest (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside preProcessRequest DoUpdateNetworkInstance Request ") - - try { - // initialize flow variables - InitializeProcessVariables(execution) - - // GET Incoming request & validate 3 kinds of format. - execution.setVariable("action", "UPDATE") - String networkRequest = execution.getVariable("bpmnRequest") - if (networkRequest != null) { - if (networkRequest.contains("requestDetails")) { - // JSON format request is sent, create xml - try { - def prettyJson = JsonOutput.prettyPrint(networkRequest.toString()) - logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson) - networkRequest = vidUtils.createXmlNetworkRequestInfra(execution, networkRequest) - - } catch (Exception ex) { - String dataErrorMessage = " Invalid json format Request - " + ex.getMessage() - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - } else { - // XML format request is sent - - } - } else { - // vIPR format request is sent, create xml from individual variables - networkRequest = vidUtils.createXmlNetworkRequestInstance(execution) - } - - networkRequest = utils.formatXml(networkRequest) - logger.debug(networkRequest) - execution.setVariable(Prefix + "networkRequest", networkRequest) - logger.debug(" network-request - " + '\n' + networkRequest) - - // validate 'disableRollback' (aka, 'suppressRollback') - boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, networkRequest) - execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled) - logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled) - - String networkInputs = utils.getNodeXml(networkRequest, "network-inputs", false).replace("tag0:","").replace(":tag0","") - execution.setVariable(Prefix + "networkInputs", networkInputs) - logger.debug(Prefix + "networkInputs - " + '\n' + networkInputs) - - // prepare messageId - String messageId = execution.getVariable(Prefix + "messageId") // for testing - if (messageId == null || messageId == "") { - messageId = UUID.randomUUID() - logger.debug(" UPDNETI_messageId, random generated: " + messageId) - } else { - logger.debug(" UPDNETI_messageId, pre-assigned: " + messageId) - } - execution.setVariable(Prefix + "messageId", messageId) - - String source = utils.getNodeText(networkRequest, "source") - execution.setVariable(Prefix + "source", source) - logger.debug(Prefix + "source - " + source) - - String networkId = "" - if (utils.nodeExists(networkRequest, "network-id")) { - networkId = utils.getNodeText(networkRequest, "network-id") - if (networkId == 'null' || networkId == "") { - sendSyncError(execution) - // missing value of networkId - String dataErrorMessage = "Variable 'network-id' value/element is missing." - logger.debug(" Invalid Request - " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - - } - } - - String lcpCloudRegion = "" - if (utils.nodeExists(networkRequest, "aic-cloud-region")) { - lcpCloudRegion = utils.getNodeText(networkRequest, "aic-cloud-region") - if ((lcpCloudRegion == 'null') || (lcpCloudRegion == "")) { - sendSyncError(execution) - String dataErrorMessage = "requestDetails has missing 'aic-cloud-region' value/element." - logger.debug(" Invalid Request - " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - } - - String serviceInstanceId = "" - if (utils.nodeExists(networkRequest, "service-instance-id")) { - serviceInstanceId = utils.getNodeText(networkRequest, "service-instance-id") - if ((serviceInstanceId == 'null') || (lcpCloudRegion == "")) { - sendSyncError(execution) - String dataErrorMessage = "Variable 'serviceInstanceId' value/element is missing." - logger.debug(" Invalid Request - " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - } - - // PO Authorization Info / headers Authorization= - String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution) - - - try { - def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey", execution)) - execution.setVariable("BasicAuthHeaderValuePO",encodedString) - execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) - - } catch (IOException ex) { - String exceptionMessage = "Exception Encountered in DoUpdateNetworkInstance, PreProcessRequest() - " - String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage() - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - // Set variables for Generic Get Sub Flow use - execution.setVariable(Prefix + "serviceInstanceId", serviceInstanceId) - logger.debug(Prefix + "serviceInstanceId - " + serviceInstanceId) - - logger.debug(" Url for SDNC adapter: " + UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint",execution)) - - String sdncVersion = execution.getVariable("sdncVersion") - logger.debug("sdncVersion? : " + sdncVersion) - - // build 'networkOutputs' - networkId = utils.getNodeText(networkRequest, "network-id") - if ((networkId == null) || (networkId == "null")) { - networkId = "" - } - String networkName = utils.getNodeText(networkRequest, "network-name") - if ((networkName == null) || (networkName == "null")) { - networkName = "" - } - String networkOutputs = - """<network-outputs> + String Prefix="UPDNETI_" + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + VidUtils vidUtils = new VidUtils(this) + NetworkUtils networkUtils = new NetworkUtils() + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + + /** + * This method is executed during the preProcessRequest task of the <class>DoUpdateNetworkInstance.bpmn</class> process. + * @param execution + */ + public InitializeProcessVariables(DelegateExecution execution){ + /* Initialize all the process variables in this block */ + + execution.setVariable(Prefix + "messageId", "") + execution.setVariable("BasicAuthHeaderValuePO", "") + execution.setVariable("BasicAuthHeaderValueSDNC", "") + execution.setVariable(Prefix + "networkRequest", "") + execution.setVariable(Prefix + "networkInputs", "") + execution.setVariable(Prefix + "networkOutputs", "") + execution.setVariable(Prefix + "requestId", "") + execution.setVariable(Prefix + "source", "") + execution.setVariable(Prefix + "networkId", "") + + execution.setVariable(Prefix + "isPONR", false) // Point-of-no-return, means, rollback is not needed + + // AAI query Cloud Region + execution.setVariable(Prefix + "queryCloudRegionRequest","") + execution.setVariable(Prefix + "queryCloudRegionReturnCode","") + execution.setVariable(Prefix + "queryCloudRegionResponse","") + execution.setVariable(Prefix + "cloudRegionPo","") + execution.setVariable(Prefix + "cloudRegionSdnc","") + execution.setVariable(Prefix + "isCloudRegionGood", false) + + // AAI query Id + execution.setVariable(Prefix + "queryIdAAIRequest","") + execution.setVariable(Prefix + "queryIdAAIResponse", "") + execution.setVariable(Prefix + "aaiIdReturnCode", "") + + // AAI query vpn binding + execution.setVariable(Prefix + "queryVpnBindingAAIRequest","") + execution.setVariable(Prefix + "queryVpnBindingAAIResponse", "") + execution.setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "") + execution.setVariable(Prefix + "vpnBindings", null) + execution.setVariable(Prefix + "vpnCount", 0) + execution.setVariable(Prefix + "routeCollection", "") + + // AAI query network policy + execution.setVariable(Prefix + "queryNetworkPolicyAAIRequest","") + execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", "") + execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "") + execution.setVariable(Prefix + "networkPolicyUriList", null) + execution.setVariable(Prefix + "networkPolicyCount", 0) + execution.setVariable(Prefix + "networkCollection", "") + + // AAI query route table reference + execution.setVariable(Prefix + "queryNetworkTableRefAAIRequest","") + execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", "") + execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "") + execution.setVariable(Prefix + "networkTableRefUriList", null) + execution.setVariable(Prefix + "networkTableRefCount", 0) + execution.setVariable(Prefix + "tableRefCollection", "") + + // AAI requery Id + execution.setVariable(Prefix + "requeryIdAAIRequest","") + execution.setVariable(Prefix + "requeryIdAAIResponse", "") + execution.setVariable(Prefix + "aaiRequeryIdReturnCode", "") + + // AAI update contrail + execution.setVariable(Prefix + "updateContrailAAIUrlRequest","") + execution.setVariable(Prefix + "updateContrailAAIPayloadRequest","") + execution.setVariable(Prefix + "updateContrailAAIResponse", "") + execution.setVariable(Prefix + "aaiUpdateContrailReturnCode", "") + + execution.setVariable(Prefix + "updateNetworkRequest", "") + execution.setVariable(Prefix + "updateNetworkResponse", "") + execution.setVariable(Prefix + "rollbackNetworkRequest", "") + execution.setVariable(Prefix + "networkReturnCode", "") + execution.setVariable(Prefix + "isNetworkRollbackNeeded", false) + + execution.setVariable(Prefix + "changeAssignSDNCRequest", "") + execution.setVariable(Prefix + "changeAssignSDNCResponse", "") + execution.setVariable(Prefix + "rollbackSDNCRequest", "") + execution.setVariable(Prefix + "sdncReturnCode", "") + execution.setVariable(Prefix + "isSdncRollbackNeeded", false) + execution.setVariable(Prefix + "sdncResponseSuccess", false) + + execution.setVariable(Prefix + "isVnfBindingPresent", false) + execution.setVariable(Prefix + "Success", false) + execution.setVariable(Prefix + "serviceInstanceId", "") + + execution.setVariable(Prefix + "isException", false) + + } + + // ************************************************** + // Pre or Prepare Request Section + // ************************************************** + /** + * This method is executed during the preProcessRequest task of the <class>DoUpdateNetworkInstance.bpmn</class> process. + * @param execution + */ + public void preProcessRequest (DelegateExecution execution) { + + execution.setVariable("prefix",Prefix) + + logger.trace("Inside preProcessRequest DoUpdateNetworkInstance Request ") + + try { + // initialize flow variables + InitializeProcessVariables(execution) + + // GET Incoming request & validate 3 kinds of format. + execution.setVariable("action", "UPDATE") + String networkRequest = execution.getVariable("bpmnRequest") + if (networkRequest != null) { + if (networkRequest.contains("requestDetails")) { + // JSON format request is sent, create xml + try { + def prettyJson = JsonOutput.prettyPrint(networkRequest.toString()) + logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson) + networkRequest = vidUtils.createXmlNetworkRequestInfra(execution, networkRequest) + + } catch (Exception ex) { + String dataErrorMessage = " Invalid json format Request - " + ex.getMessage() + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + } else { + // XML format request is sent + + } + } else { + // vIPR format request is sent, create xml from individual variables + networkRequest = vidUtils.createXmlNetworkRequestInstance(execution) + } + + networkRequest = utils.formatXml(networkRequest) + logger.debug(networkRequest) + execution.setVariable(Prefix + "networkRequest", networkRequest) + logger.debug(" network-request - " + '\n' + networkRequest) + + // validate 'disableRollback' (aka, 'suppressRollback') + boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, networkRequest) + execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled) + logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled) + + String networkInputs = utils.getNodeXml(networkRequest, "network-inputs", false).replace("tag0:","").replace(":tag0","") + execution.setVariable(Prefix + "networkInputs", networkInputs) + logger.debug(Prefix + "networkInputs - " + '\n' + networkInputs) + + // prepare messageId + String messageId = execution.getVariable(Prefix + "messageId") // for testing + if (messageId == null || messageId == "") { + messageId = UUID.randomUUID() + logger.debug(" UPDNETI_messageId, random generated: " + messageId) + } else { + logger.debug(" UPDNETI_messageId, pre-assigned: " + messageId) + } + execution.setVariable(Prefix + "messageId", messageId) + + String source = utils.getNodeText(networkRequest, "source") + execution.setVariable(Prefix + "source", source) + logger.debug(Prefix + "source - " + source) + + String networkId = "" + if (utils.nodeExists(networkRequest, "network-id")) { + networkId = utils.getNodeText(networkRequest, "network-id") + if (networkId == 'null' || networkId == "") { + sendSyncError(execution) + // missing value of networkId + String dataErrorMessage = "Variable 'network-id' value/element is missing." + logger.debug(" Invalid Request - " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + + } + } + + String lcpCloudRegion = "" + if (utils.nodeExists(networkRequest, "aic-cloud-region")) { + lcpCloudRegion = utils.getNodeText(networkRequest, "aic-cloud-region") + if ((lcpCloudRegion == 'null') || (lcpCloudRegion == "")) { + sendSyncError(execution) + String dataErrorMessage = "requestDetails has missing 'aic-cloud-region' value/element." + logger.debug(" Invalid Request - " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + } + + String serviceInstanceId = "" + if (utils.nodeExists(networkRequest, "service-instance-id")) { + serviceInstanceId = utils.getNodeText(networkRequest, "service-instance-id") + if ((serviceInstanceId == 'null') || (lcpCloudRegion == "")) { + sendSyncError(execution) + String dataErrorMessage = "Variable 'serviceInstanceId' value/element is missing." + logger.debug(" Invalid Request - " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + } + + // PO Authorization Info / headers Authorization= + String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution) + + + try { + def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey", execution)) + execution.setVariable("BasicAuthHeaderValuePO",encodedString) + execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) + + } catch (IOException ex) { + String exceptionMessage = "Exception Encountered in DoUpdateNetworkInstance, PreProcessRequest() - " + String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage() + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + + // Set variables for Generic Get Sub Flow use + execution.setVariable(Prefix + "serviceInstanceId", serviceInstanceId) + logger.debug(Prefix + "serviceInstanceId - " + serviceInstanceId) + + logger.debug(" Url for SDNC adapter: " + UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint",execution)) + + String sdncVersion = execution.getVariable("sdncVersion") + logger.debug("sdncVersion? : " + sdncVersion) + + // build 'networkOutputs' + networkId = utils.getNodeText(networkRequest, "network-id") + if ((networkId == null) || (networkId == "null")) { + networkId = "" + } + String networkName = utils.getNodeText(networkRequest, "network-name") + if ((networkName == null) || (networkName == "null")) { + networkName = "" + } + String networkOutputs = + """<network-outputs> <network-id>${MsoUtils.xmlEscape(networkId)}</network-id> <network-name>${MsoUtils.xmlEscape(networkName)}</network-name> </network-outputs>""" - execution.setVariable(Prefix + "networkOutputs", networkOutputs) - logger.debug(Prefix + "networkOutputs - " + '\n' + networkOutputs) - execution.setVariable(Prefix + "networkId", networkId) - execution.setVariable(Prefix + "networkName", networkName) + execution.setVariable(Prefix + "networkOutputs", networkOutputs) + logger.debug(Prefix + "networkOutputs - " + '\n' + networkOutputs) + execution.setVariable(Prefix + "networkId", networkId) + execution.setVariable(Prefix + "networkName", networkName) - } catch (BpmnError e) { - throw e; + } catch (BpmnError e) { + throw e; - } catch (Exception ex){ - sendSyncError(execution) - // caught exception - String exceptionMessage = "Exception Encountered in DoUpdateNetworkInstance, PreProcessRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex){ + sendSyncError(execution) + // caught exception + String exceptionMessage = "Exception Encountered in DoUpdateNetworkInstance, PreProcessRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } - } - - /** - * Gets the service instance uri from aai - * - */ - public void getServiceInstance(DelegateExecution execution) { - logger.trace("getServiceInstance ") - try { - String serviceInstanceId = execution.getVariable('serviceInstanceId') - - AAIResourcesClient resourceClient = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId) - - if(!resourceClient.exists(uri)){ - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Service Instance not found in aai") - }else{ - Map<String, String> keys = uri.getURIKeys() - execution.setVariable("serviceType", keys.get("service-type")) - execution.setVariable("subscriberName", keys.get("global-customer-id")) - } - - }catch(BpmnError e) { - throw e; - }catch (Exception ex){ - String msg = "Exception in getServiceInstance. " + ex.getMessage() - logger.debug(msg) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) - } - } + } + } + + /** + * Gets the service instance uri from aai + * + */ + public void getServiceInstance(DelegateExecution execution) { + logger.trace("getServiceInstance ") + try { + String serviceInstanceId = execution.getVariable('serviceInstanceId') + + AAIResourcesClient resourceClient = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId) + + if(!resourceClient.exists(uri)){ + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Service Instance not found in aai") + }else{ + Map<String, String> keys = uri.getURIKeys() + execution.setVariable("serviceType", keys.get("service-type")) + execution.setVariable("subscriberName", keys.get("global-customer-id")) + } + + }catch(BpmnError e) { + throw e; + }catch (Exception ex){ + String msg = "Exception in getServiceInstance. " + ex.getMessage() + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } - public void callRESTQueryAAICloudRegion (DelegateExecution execution) { + public void callRESTQueryAAICloudRegion (DelegateExecution execution) { - execution.setVariable("prefix", Prefix) + execution.setVariable("prefix", Prefix) - logger.debug(" ***** Inside callRESTQueryAAICloudRegion of DoUpdateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTQueryAAICloudRegion of DoUpdateNetworkInstance ***** " ) - try { - String networkInputs = execution.getVariable(Prefix + "networkInputs") - String cloudRegion = utils.getNodeText(networkInputs, "aic-cloud-region") + try { + String networkInputs = execution.getVariable(Prefix + "networkInputs") + String cloudRegion = utils.getNodeText(networkInputs, "aic-cloud-region") - // Prepare AA&I url - String aai_endpoint = UrnPropertiesReader.getVariable("aai.endpoint", execution) - AaiUtil aaiUtil = new AaiUtil(this) + // Prepare AA&I url + String aai_endpoint = UrnPropertiesReader.getVariable("aai.endpoint", execution) + AaiUtil aaiUtil = new AaiUtil(this) - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion) - def queryCloudRegionRequest = aaiUtil.createAaiUri(uri) + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, Defaults.CLOUD_OWNER.toString(), cloudRegion) + def queryCloudRegionRequest = aaiUtil.createAaiUri(uri) - execution.setVariable(Prefix + "queryCloudRegionRequest", queryCloudRegionRequest) + execution.setVariable(Prefix + "queryCloudRegionRequest", queryCloudRegionRequest) - String cloudRegionPo = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion) - String cloudRegionSdnc = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "SDNC", cloudRegion) + String cloudRegionPo = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion) + String cloudRegionSdnc = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "SDNC", cloudRegion) - if ((cloudRegionPo != "ERROR") && (cloudRegionSdnc != "ERROR")) { - execution.setVariable(Prefix + "cloudRegionPo", cloudRegionPo) - execution.setVariable(Prefix + "cloudRegionSdnc", cloudRegionSdnc) - execution.setVariable(Prefix + "isCloudRegionGood", true) + if ((cloudRegionPo != "ERROR") && (cloudRegionSdnc != "ERROR")) { + execution.setVariable(Prefix + "cloudRegionPo", cloudRegionPo) + execution.setVariable(Prefix + "cloudRegionSdnc", cloudRegionSdnc) + execution.setVariable(Prefix + "isCloudRegionGood", true) - } else { - String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode") - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } else { + String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode") + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } + } - logger.debug(" is Cloud Region Good: " + execution.getVariable(Prefix + "isCloudRegionGood")) + logger.debug(" is Cloud Region Good: " + execution.getVariable(Prefix + "isCloudRegionGood")) - } catch (BpmnError e) { - throw e; + } catch (BpmnError e) { + throw e; - } catch (Exception ex) { - // try error - String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow - callRESTQueryAAICloudRegion() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + // try error + String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow - callRESTQueryAAICloudRegion() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void callRESTQueryAAINetworkId(DelegateExecution execution) { + public void callRESTQueryAAINetworkId(DelegateExecution execution) { - execution.setVariable("prefix", Prefix) + execution.setVariable("prefix", Prefix) - logger.debug(" ***** Inside callRESTQueryAAINetworkId of DoUpdateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTQueryAAINetworkId of DoUpdateNetworkInstance ***** " ) - try { - // get variables - String networkRequest = execution.getVariable(Prefix + "networkRequest") - String networkId = utils.getNodeText(networkRequest, "network-id") - execution.setVariable(Prefix + "networkId", networkId) + try { + // get variables + String networkRequest = execution.getVariable(Prefix + "networkRequest") + String networkId = utils.getNodeText(networkRequest, "network-id") + execution.setVariable(Prefix + "networkId", networkId) - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ONE) - AAIResultWrapper network = client.get(uri, NotFoundException.class) + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ONE) + AAIResultWrapper network = client.get(uri, NotFoundException.class) - execution.setVariable(Prefix + "aaiIdReturnCode", "200") + execution.setVariable(Prefix + "aaiIdReturnCode", "200") - execution.setVariable(Prefix + "queryIdAAIResponse", network) + execution.setVariable(Prefix + "queryIdAAIResponse", network) - } catch (NotFoundException e) { - String dataErrorMessage = "Response Error from QueryAAINetworkId is 404 (Not Found)." - logger.debug(" AAI Query Failed. " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkId() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (NotFoundException e) { + String dataErrorMessage = "Response Error from QueryAAINetworkId is 404 (Not Found)." + logger.debug(" AAI Query Failed. " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkId() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } - public void callRESTReQueryAAINetworkId(DelegateExecution execution) { + public void callRESTReQueryAAINetworkId(DelegateExecution execution) { - execution.setVariable("prefix", Prefix) + execution.setVariable("prefix", Prefix) - logger.debug(" ***** Inside callRESTReQueryAAINetworkId of DoUpdateNetworkInstance ***** " ) + logger.debug(" ***** Inside callRESTReQueryAAINetworkId of DoUpdateNetworkInstance ***** " ) - try { - // get variables - String networkRequest = execution.getVariable(Prefix + "networkRequest") - String networkId = utils.getNodeText(networkRequest, "network-id") + try { + // get variables + String networkRequest = execution.getVariable(Prefix + "networkRequest") + String networkId = utils.getNodeText(networkRequest, "network-id") - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ONE) - AAIResultWrapper network = client.get(uri, NotFoundException.class) + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId).depth(Depth.ONE) + AAIResultWrapper network = client.get(uri, NotFoundException.class) - execution.setVariable(Prefix + "aaiRequeryIdReturnCode", "200") - execution.setVariable(Prefix + "requeryIdAAIResponse", network) + execution.setVariable(Prefix + "aaiRequeryIdReturnCode", "200") + execution.setVariable(Prefix + "requeryIdAAIResponse", network) - L3Network net = network.asBean(L3Network.class).get() - String netId = net.getNetworkId() - String netName = net.getNetworkName() - String networkOutputs = - """<network-outputs> + L3Network net = network.asBean(L3Network.class).get() + String netId = net.getNetworkId() + String netName = net.getNetworkName() + String networkOutputs = + """<network-outputs> <network-id>${MsoUtils.xmlEscape(netId)}</network-id> <network-name>${MsoUtils.xmlEscape(netName)}</network-name> </network-outputs>""" - execution.setVariable(Prefix + "networkOutputs", networkOutputs) - logger.debug(" networkOutputs - " + '\n' + networkOutputs) - - } catch (NotFoundException e) { - String dataErrorMessage = "Response Error from ReQueryAAINetworkId is 404 (Not Found)." - logger.debug(" AAI ReQuery Failed. - " + dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTReQueryAAINetworkId() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void callRESTQueryAAINetworkVpnBinding(DelegateExecution execution) { - - execution.setVariable("prefix", Prefix) - - logger.debug(" ***** Inside callRESTQueryAAINetworkVpnBinding of DoUpdateNetworkInstance ***** " ) - - try { - - // get variables - AAIResultWrapper queryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") - if(queryIdAAIResponse.getRelationships().isPresent()){ - List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.VPN_BINDING) - - logger.debug(Prefix + "vpnCount - " + uris.size()) - - if (uris.size() > 0) { - String routeTargets = "" - for(AAIResourceUri u : uris) { - - AAIResourcesClient client = new AAIResourcesClient() - AAIResultWrapper wrapper = client.get(u.depth(Depth.TWO), NotFoundException.class) - Optional<VpnBinding> binding = wrapper.asBean(VpnBinding.class) - - String routeTarget = "" - String routeRole = "" - if(binding.get().getRouteTargets() != null) { - List<RouteTarget> targets = binding.get().getRouteTargets().getRouteTarget() - for(RouteTarget target : targets) { - routeTarget = target.getGlobalRouteTarget() - routeRole = target.getRouteTargetRole() - routeTargets += "<routeTargets>" + '\n' + - " <routeTarget>" + routeTarget + "</routeTarget>" + '\n' + - " <routeTargetRole>" + routeRole + "</routeTargetRole>" + '\n' + - "</routeTargets>" + '\n' - } - } - - } // end loop - - execution.setVariable(Prefix + "routeCollection", routeTargets) - logger.debug(" UPDNETI_routeCollection - " + '\n' + routeTargets) - - } else { - // reset return code to success - execution.setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200") - AaiUtil aaiUriUtil = new AaiUtil(this) - String schemaVersion = aaiUriUtil.getNamespace() - String aaiStubResponse = - """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> - <vpn-binding xmlns="${schemaVersion}"> - <global-route-target/> - </vpn-binding> - </rest:payload>""" - String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) - execution.setVariable(Prefix + "queryVpnBindingAAIResponse", aaiStubResponseAsXml) - execution.setVariable(Prefix + "routeCollection", "<routeTargets/>") - logger.debug(" No vpnBinding, using this stub as response - " + '\n' + aaiStubResponseAsXml) - - } - } + execution.setVariable(Prefix + "networkOutputs", networkOutputs) + logger.debug(" networkOutputs - " + '\n' + networkOutputs) + + } catch (NotFoundException e) { + String dataErrorMessage = "Response Error from ReQueryAAINetworkId is 404 (Not Found)." + logger.debug(" AAI ReQuery Failed. - " + dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTReQueryAAINetworkId() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } catch (NotFoundException e) { - logger.debug("Response Error from AAINetworkVpnBinding is 404 (Not Found).") - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Response Error from AAINetworkVpnBinding is 404 (Not Found).") - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkVpnBinding() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } + } - public void callRESTQueryAAINetworkPolicy(DelegateExecution execution) { + } - execution.setVariable("prefix", Prefix) + public void callRESTQueryAAINetworkVpnBinding(DelegateExecution execution) { - logger.debug(" ***** Inside callRESTQueryAAINetworkPolicy of DoUpdateNetworkInstance ***** " ) + execution.setVariable("prefix", Prefix) - try { - // get variables - AAIResultWrapper queryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") - if(queryIdAAIResponse.getRelationships().isPresent()){ - List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.NETWORK_POLICY) + logger.debug(" ***** Inside callRESTQueryAAINetworkVpnBinding of DoUpdateNetworkInstance ***** " ) - execution.setVariable(Prefix + "networkPolicyCount", uris.size()) - logger.debug(Prefix + "networkPolicyCount - " + uris.size()) + try { - if (uris.size() > 0) { + // get variables + AAIResultWrapper queryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") + if(queryIdAAIResponse.getRelationships().isPresent()){ + List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.VPN_BINDING) - String networkPolicies = "" - // AII loop call using list vpnBindings - for(AAIResourceUri u : uris) { + logger.debug(Prefix + "vpnCount - " + uris.size()) - AAIResourcesClient client = new AAIResourcesClient() - NetworkPolicy p = client.get(u, NotFoundException.class).asBean(NetworkPolicy.class).get() + if (uris.size() > 0) { + String routeTargets = "" + for(AAIResourceUri u : uris) { - execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200") + AAIResourcesClient client = new AAIResourcesClient() + AAIResultWrapper wrapper = client.get(u.depth(Depth.TWO), NotFoundException.class) + Optional<VpnBinding> binding = wrapper.asBean(VpnBinding.class) - String networkPolicy = p.getNetworkPolicyFqdn() - networkPolicies += "<policyFqdns>" + networkPolicy + "</policyFqdns>" + '\n' + String routeTarget = "" + String routeRole = "" + if(binding.get().getRouteTargets() != null) { + List<RouteTarget> targets = binding.get().getRouteTargets().getRouteTarget() + for(RouteTarget target : targets) { + routeTarget = target.getGlobalRouteTarget() + routeRole = target.getRouteTargetRole() + routeTargets += "<routeTargets>" + '\n' + + " <routeTarget>" + routeTarget + "</routeTarget>" + '\n' + + " <routeTargetRole>" + routeRole + "</routeTargetRole>" + '\n' + + "</routeTargets>" + '\n' + } + } - } // end loop + } // end loop - execution.setVariable(Prefix + "networkCollection", networkPolicies) - logger.debug(" UPDNETI_networkCollection - " + '\n' + networkPolicies) + execution.setVariable(Prefix + "routeCollection", routeTargets) + logger.debug(" UPDNETI_routeCollection - " + '\n' + routeTargets) - } else { - // reset return code to success - execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200") - AaiUtil aaiUriUtil = new AaiUtil(this) - String schemaVersion = aaiUriUtil.getNamespace() - String aaiStubResponse = - """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> - <network-policy xmlns="${schemaVersion}"> - <network-policy-fqdn/> - </network-policy> + } else { + // reset return code to success + execution.setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200") + AaiUtil aaiUriUtil = new AaiUtil(this) + String schemaVersion = aaiUriUtil.getNamespace() + String aaiStubResponse = + """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> + <vpn-binding xmlns="${schemaVersion}"> + <global-route-target/> + </vpn-binding> </rest:payload>""" - String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) - execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", aaiStubResponseAsXml) - execution.setVariable(Prefix + "networkCollection", "<policyFqdns/>") - logger.debug(" No net policies, using this stub as response - " + '\n' + aaiStubResponseAsXml) + String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) + execution.setVariable(Prefix + "queryVpnBindingAAIResponse", aaiStubResponseAsXml) + execution.setVariable(Prefix + "routeCollection", "<routeTargets/>") + logger.debug(" No vpnBinding, using this stub as response - " + '\n' + aaiStubResponseAsXml) + + } + } + + } catch (NotFoundException e) { + logger.debug("Response Error from AAINetworkVpnBinding is 404 (Not Found).") + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Response Error from AAINetworkVpnBinding is 404 (Not Found).") + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkVpnBinding() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } - } + } - } catch (NotFoundException e) { - String dataErrorMessage = "Response Error from QueryAAINetworkPolicy is 404 (Not Found)." - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkPolicy() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } - } + public void callRESTQueryAAINetworkPolicy(DelegateExecution execution) { - } + execution.setVariable("prefix", Prefix) - public void callRESTQueryAAINetworkTableRef(DelegateExecution execution) { + logger.debug(" ***** Inside callRESTQueryAAINetworkPolicy of DoUpdateNetworkInstance ***** " ) - execution.setVariable("prefix", Prefix) + try { + // get variables + AAIResultWrapper queryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") + if(queryIdAAIResponse.getRelationships().isPresent()){ + List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.NETWORK_POLICY) - logger.debug(" ***** Inside callRESTQueryAAINetworkTableRef of DoUpdateNetworkInstance ***** " ) + execution.setVariable(Prefix + "networkPolicyCount", uris.size()) + logger.debug(Prefix + "networkPolicyCount - " + uris.size()) - try { - AAIResultWrapper queryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") - if(queryIdAAIResponse.getRelationships().isPresent()){ - List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.ROUTE_TABLE_REFERENCE) + if (uris.size() > 0) { - execution.setVariable(Prefix + "networkTableRefCount", uris.size()) - logger.debug(Prefix + "networkTableRefCount - " + uris.size()) + String networkPolicies = "" + // AII loop call using list vpnBindings + for(AAIResourceUri u : uris) { - logger.debug(" UPDNETI_networkTableRefCount - " + uris.size()) - if (uris.size() > 0) { + AAIResourcesClient client = new AAIResourcesClient() + NetworkPolicy p = client.get(u, NotFoundException.class).asBean(NetworkPolicy.class).get() - execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200") + execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200") - // AII loop call using list vpnBindings - String networkTableRefs = "" - for(AAIResourceUri u : uris) { + String networkPolicy = p.getNetworkPolicyFqdn() + networkPolicies += "<policyFqdns>" + networkPolicy + "</policyFqdns>" + '\n' - AAIResourcesClient client = new AAIResourcesClient() - RouteTableReference rt = client.get(u, NotFoundException.class).asBean(RouteTableReference.class).get() + } // end loop - String networkTableRef = rt.getRouteTableReferenceFqdn() - networkTableRefs += "<routeTableFqdns>" + networkTableRef + "</routeTableFqdns>" + '\n' + execution.setVariable(Prefix + "networkCollection", networkPolicies) + logger.debug(" UPDNETI_networkCollection - " + '\n' + networkPolicies) - } // end loop + } else { + // reset return code to success + execution.setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200") + AaiUtil aaiUriUtil = new AaiUtil(this) + String schemaVersion = aaiUriUtil.getNamespace() + String aaiStubResponse = + """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> + <network-policy xmlns="${schemaVersion}"> + <network-policy-fqdn/> + </network-policy> + </rest:payload>""" + String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) + execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", aaiStubResponseAsXml) + execution.setVariable(Prefix + "networkCollection", "<policyFqdns/>") + logger.debug(" No net policies, using this stub as response - " + '\n' + aaiStubResponseAsXml) + + } + } + + } catch (NotFoundException e) { + String dataErrorMessage = "Response Error from QueryAAINetworkPolicy is 404 (Not Found)." + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkPolicy() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - execution.setVariable(Prefix + "tableRefCollection", networkTableRefs) - logger.debug(" UPDNETI_tableRefCollection - " + '\n' + networkTableRefs) + } - } else { - // reset return code to success - execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200") - AaiUtil aaiUriUtil = new AaiUtil(this) - String schemaVersion = aaiUriUtil.getNamespace() - String aaiStubResponse = - """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> - <route-table-references xmlns="${schemaVersion}"> - <route-table-reference-fqdn/> - </route-table-references> - </rest:payload>""" - String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) - execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", aaiStubResponseAsXml) - execution.setVariable(Prefix + "tableRefCollection", "<routeTableFqdns/>") - logger.debug(" No net table references, using this stub as response - " + '\n' + aaiStubResponseAsXml) - - } - } - - } catch (NotFoundException e) { - String dataErrorMessage = "Response Error from QueryAAINetworkTableRef is 404 (Not Found)." - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkTableRef() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void callRESTUpdateContrailAAINetwork(DelegateExecution execution) { - execution.setVariable("prefix", Prefix) - logger.debug(" ***** Inside callRESTUpdateContrailAAINetwork of DoUpdateNetworkInstance ***** " ) - try { - // get variables - String networkRequest = execution.getVariable(Prefix + "networkRequest") - String networkId = utils.getNodeText(networkRequest, "network-id") - AAIResultWrapper requeryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") - String updateNetworkResponse = execution.getVariable(Prefix + "updateNetworkResponse") - - L3Network oldL3Network = requeryIdAAIResponse.asBean(L3Network.class).get() - L3Network l3Network = new L3Network() - if (oldL3Network.getHeatStackId() != null) { - } else { - if (utils.nodeExists(updateNetworkResponse, 'networkStackId')) { - l3Network.setHeatStackId(utils.getNodeText(updateNetworkResponse, 'networkStackId')) - } - } - if (oldL3Network.getNeutronNetworkId() != null) { - } else { - if (utils.nodeExists(updateNetworkResponse, 'neutronNetworkId')) { - l3Network.setNeutronNetworkId(utils.getNodeText(updateNetworkResponse, 'neutronNetworkId')) - } - } - if (oldL3Network.getContrailNetworkFqdn() != null) { - } else { - if (utils.nodeExists(updateNetworkResponse, 'networkFqdn')) { - l3Network.setContrailNetworkFqdn(utils.getNodeText(updateNetworkResponse, 'networkFqdn')) - } - } - - String status = utils.getNodeText(updateNetworkResponse, 'orchestration-status') - if(status.equals("pending-create") || status.equals("PendingCreate")){ - l3Network.setOrchestrationStatus("Created") - }else{ - l3Network.setOrchestrationStatus("Active") - } - - AAIResourcesClient client = new AAIResourcesClient() - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId) - client.update(uri, l3Network) - - List<Subnet> subnets = oldL3Network.getSubnets().getSubnet() - for(Subnet s:subnets){ - String subnetOrchStatus = s.getOrchestrationStatus() - String subnetId = s.getSubnetId() - - Subnet subnet = new Subnet() - String neutronSubnetId = networkUtils.extractNeutSubId(updateNetworkResponse, subnetId) - subnet.setNeutronSubnetId(neutronSubnetId) - if(subnetOrchStatus.equals("pending-create") || subnetOrchStatus.equals("PendingCreate") ){ - subnet.setOrchestrationStatus("Created") - }else{ - subnet.setOrchestrationStatus("Active") - } - - AAIResourceUri subUri = AAIUriFactory.createResourceUri(AAIObjectType.SUBNET, networkId, subnetId) - client.update(subUri, subnet) - } - - execution.setVariable(Prefix + "isPONR", true) - - } catch (BpmnError e) { - throw e; - } catch (NotFoundException e) { - String dataErrorMessage = " Response Error from UpdateContrailAAINetwork is 404 (Not Found)." - logger.debug(dataErrorMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTUpdateContrailAAINetwork() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void prepareUpdateNetworkRequest (DelegateExecution execution) { - - execution.setVariable("prefix", Prefix) - - logger.trace("Inside prepareUpdateNetworkRequest of DoUpdateNetworkInstance ") - - try { - - // get variables - String requestId = execution.getVariable(Prefix + "requestId") - String messageId = execution.getVariable(Prefix + "messageId") - String source = execution.getVariable(Prefix + "source") - - String requestInput = execution.getVariable(Prefix + "networkRequest") - L3Network queryIdResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionPo") - String backoutOnFailure = execution.getVariable(Prefix + "rollbackEnabled") + } - // Prepare Network request - String routeCollection = execution.getVariable(Prefix + "routeCollection") - String policyCollection = execution.getVariable(Prefix + "networkCollection") - String tableCollection = execution.getVariable(Prefix + "tableRefCollection") - String updateNetworkRequest = networkUtils.UpdateNetworkRequestV2(execution, requestId, messageId, requestInput, queryIdResponse, routeCollection, policyCollection, tableCollection, cloudRegionId, backoutOnFailure, source ) - // Format Response - String buildUpdateNetworkRequestAsString = utils.formatXml(updateNetworkRequest) - buildUpdateNetworkRequestAsString = buildUpdateNetworkRequestAsString.replace(":w1aac13n0", "").replace("w1aac13n0:", "") - logger.debug(buildUpdateNetworkRequestAsString) + public void callRESTQueryAAINetworkTableRef(DelegateExecution execution) { - execution.setVariable(Prefix + "updateNetworkRequest", buildUpdateNetworkRequestAsString) - logger.debug(" UPDNETI_updateNetworkRequest - " + "\n" + buildUpdateNetworkRequestAsString) + execution.setVariable("prefix", Prefix) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareUpdateNetworkRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + logger.debug(" ***** Inside callRESTQueryAAINetworkTableRef of DoUpdateNetworkInstance ***** " ) - } + try { + AAIResultWrapper queryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") + if(queryIdAAIResponse.getRelationships().isPresent()){ + List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.ROUTE_TABLE_REFERENCE) - } + execution.setVariable(Prefix + "networkTableRefCount", uris.size()) + logger.debug(Prefix + "networkTableRefCount - " + uris.size()) - public void prepareSDNCRequest (DelegateExecution execution) { + logger.debug(" UPDNETI_networkTableRefCount - " + uris.size()) + if (uris.size() > 0) { - execution.setVariable("prefix", Prefix) + execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200") - logger.trace("Inside prepareSDNCRequest of DoUpdateNetworkInstance ") + // AII loop call using list vpnBindings + String networkTableRefs = "" + for(AAIResourceUri u : uris) { - try { - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String updateNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + AAIResourcesClient client = new AAIResourcesClient() + RouteTableReference rt = client.get(u, NotFoundException.class).asBean(RouteTableReference.class).get() - String networkId = "" - if (utils.nodeExists(updateNetworkInput, "network-id")) { - networkId = utils.getNodeText(updateNetworkInput, "network-id") - } - if (networkId == null) {networkId = ""} + String networkTableRef = rt.getRouteTableReferenceFqdn() + networkTableRefs += "<routeTableFqdns>" + networkTableRef + "</routeTableFqdns>" + '\n' - String serviceInstanceId = utils.getNodeText(updateNetworkInput, "service-instance-id") + } // end loop - AAIResultWrapper wrapper = execution.getVariable(Prefix + "queryIdAAIResponse") - L3Network queryAAIResponse = wrapper.asBean(L3Network.class).get() + execution.setVariable(Prefix + "tableRefCollection", networkTableRefs) + logger.debug(" UPDNETI_tableRefCollection - " + '\n' + networkTableRefs) - // 1. prepare assign topology via SDNC Adapter SUBFLOW call - String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, updateNetworkInput, serviceInstanceId, sdncCallback, "changeassign", "NetworkActivateRequest", cloudRegionId, networkId, queryAAIResponse, null) + } else { + // reset return code to success + execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200") + AaiUtil aaiUriUtil = new AaiUtil(this) + String schemaVersion = aaiUriUtil.getNamespace() + String aaiStubResponse = + """ <rest:payload contentType="text/xml" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"> + <route-table-references xmlns="${schemaVersion}"> + <route-table-reference-fqdn/> + </route-table-references> + </rest:payload>""" + String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse) + execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", aaiStubResponseAsXml) + execution.setVariable(Prefix + "tableRefCollection", "<routeTableFqdns/>") + logger.debug(" No net table references, using this stub as response - " + '\n' + aaiStubResponseAsXml) - String sndcTopologyUpdateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) - logger.debug(sndcTopologyUpdateRequesAsString) - execution.setVariable(Prefix + "changeAssignSDNCRequest", sndcTopologyUpdateRequesAsString) - logger.debug(" UPDNETI_changeAssignSDNCRequest - " + "\n" + sndcTopologyUpdateRequesAsString) + } + } + } catch (NotFoundException e) { + String dataErrorMessage = "Response Error from QueryAAINetworkTableRef is 404 (Not Found)." + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSDNCRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkTableRef() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } - } + } + + public void callRESTUpdateContrailAAINetwork(DelegateExecution execution) { + execution.setVariable("prefix", Prefix) + logger.debug(" ***** Inside callRESTUpdateContrailAAINetwork of DoUpdateNetworkInstance ***** " ) + try { + // get variables + String networkRequest = execution.getVariable(Prefix + "networkRequest") + String networkId = utils.getNodeText(networkRequest, "network-id") + AAIResultWrapper requeryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") + String updateNetworkResponse = execution.getVariable(Prefix + "updateNetworkResponse") + + L3Network oldL3Network = requeryIdAAIResponse.asBean(L3Network.class).get() + L3Network l3Network = new L3Network() + if (oldL3Network.getHeatStackId() != null) { + } else { + if (utils.nodeExists(updateNetworkResponse, 'networkStackId')) { + l3Network.setHeatStackId(utils.getNodeText(updateNetworkResponse, 'networkStackId')) + } + } + if (oldL3Network.getNeutronNetworkId() != null) { + } else { + if (utils.nodeExists(updateNetworkResponse, 'neutronNetworkId')) { + l3Network.setNeutronNetworkId(utils.getNodeText(updateNetworkResponse, 'neutronNetworkId')) + } + } + if (oldL3Network.getContrailNetworkFqdn() != null) { + } else { + if (utils.nodeExists(updateNetworkResponse, 'networkFqdn')) { + l3Network.setContrailNetworkFqdn(utils.getNodeText(updateNetworkResponse, 'networkFqdn')) + } + } + + String status = utils.getNodeText(updateNetworkResponse, 'orchestration-status') + if(status.equals("pending-create") || status.equals("PendingCreate")){ + l3Network.setOrchestrationStatus("Created") + }else{ + l3Network.setOrchestrationStatus("Active") + } + + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId) + client.update(uri, l3Network) + + List<Subnet> subnets = oldL3Network.getSubnets().getSubnet() + for(Subnet s:subnets){ + String subnetOrchStatus = s.getOrchestrationStatus() + String subnetId = s.getSubnetId() + + Subnet subnet = new Subnet() + String neutronSubnetId = networkUtils.extractNeutSubId(updateNetworkResponse, subnetId) + subnet.setNeutronSubnetId(neutronSubnetId) + if(subnetOrchStatus.equals("pending-create") || subnetOrchStatus.equals("PendingCreate") ){ + subnet.setOrchestrationStatus("Created") + }else{ + subnet.setOrchestrationStatus("Active") + } + + AAIResourceUri subUri = AAIUriFactory.createResourceUri(AAIObjectType.SUBNET, networkId, subnetId) + client.update(subUri, subnet) + } + + execution.setVariable(Prefix + "isPONR", true) + + } catch (BpmnError e) { + throw e; + } catch (NotFoundException e) { + String dataErrorMessage = " Response Error from UpdateContrailAAINetwork is 404 (Not Found)." + logger.debug(dataErrorMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTUpdateContrailAAINetwork() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } + } + public void prepareUpdateNetworkRequest (DelegateExecution execution) { - // ************************************************** - // Post or Validate Response Section - // ************************************************** + execution.setVariable("prefix", Prefix) - public void validateUpdateNetworkResponse (DelegateExecution execution) { + logger.trace("Inside prepareUpdateNetworkRequest of DoUpdateNetworkInstance ") - execution.setVariable("prefix", Prefix) + try { - logger.trace("Inside validateUpdateNetworkResponse of DoUpdateNetworkInstance ") + // get variables + String requestId = execution.getVariable(Prefix + "requestId") + String messageId = execution.getVariable(Prefix + "messageId") + String source = execution.getVariable(Prefix + "source") - try { - String returnCode = execution.getVariable(Prefix + "networkReturnCode") - String networkResponse = execution.getVariable(Prefix + "updateNetworkResponse") - if (networkResponse==null) { - networkResponse="" // reset - } + String requestInput = execution.getVariable(Prefix + "networkRequest") + L3Network queryIdResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionPo") + String backoutOnFailure = execution.getVariable(Prefix + "rollbackEnabled") + + // Prepare Network request + String routeCollection = execution.getVariable(Prefix + "routeCollection") + String policyCollection = execution.getVariable(Prefix + "networkCollection") + String tableCollection = execution.getVariable(Prefix + "tableRefCollection") + String updateNetworkRequest = networkUtils.UpdateNetworkRequestV2(execution, requestId, messageId, requestInput, queryIdResponse, routeCollection, policyCollection, tableCollection, cloudRegionId, backoutOnFailure, source ) + // Format Response + String buildUpdateNetworkRequestAsString = utils.formatXml(updateNetworkRequest) + buildUpdateNetworkRequestAsString = buildUpdateNetworkRequestAsString.replace(":w1aac13n0", "").replace("w1aac13n0:", "") + logger.debug(buildUpdateNetworkRequestAsString) + + execution.setVariable(Prefix + "updateNetworkRequest", buildUpdateNetworkRequestAsString) + logger.debug(" UPDNETI_updateNetworkRequest - " + "\n" + buildUpdateNetworkRequestAsString) + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareUpdateNetworkRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + + } - logger.debug(" Network Adapter update responseCode: " + returnCode) + } - String errorMessage = "" - if (returnCode == "200") { - execution.setVariable(Prefix + "isNetworkRollbackNeeded", true) - logger.debug(networkResponse) - execution.setVariable(Prefix + "updateNetworkResponse", networkResponse) - logger.debug(" Network Adapter update Success Response - " + "\n" + networkResponse) + public void prepareSDNCRequest (DelegateExecution execution) { - // prepare rollback data - String rollbackData = utils.getNodeXml(networkResponse, "rollback", false).replace("tag0:","").replace(":tag0","") - rollbackData = rollbackData.replace("rollback>", "networkRollback>") - String rollbackNetwork = - """<rollbackNetworkRequest> - ${rollbackData} - </rollbackNetworkRequest>""" - String rollbackNetworkXml = utils.formatXml(rollbackNetwork) - execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkXml) - logger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml) + execution.setVariable("prefix", Prefix) - } else { // network error - if (returnCode.toInteger() > 399 && returnCode.toInteger() < 600) { //4xx, 5xx - if (networkResponse.contains("updateNetworkError")) { - networkResponse = networkResponse.replace('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>', '') - errorMessage = utils.getNodeText(networkResponse, "message") - errorMessage = "Received error from Network Adapter: " + errorMessage - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage) + logger.trace("Inside prepareSDNCRequest of DoUpdateNetworkInstance ") - } else { // CatchAll exception - if (returnCode == "500") { - errorMessage = "JBWEB000065: HTTP Status 500." - } else { - errorMessage = "Return code is " + returnCode - } - errorMessage = "Received error from Network Adapter: " + errorMessage - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage) + try { + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String updateNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - } + String networkId = "" + if (utils.nodeExists(updateNetworkInput, "network-id")) { + networkId = utils.getNodeText(updateNetworkInput, "network-id") + } + if (networkId == null) {networkId = ""} - } else { // CatchAll exception - String dataErrorMessage = "Received error from Network Adapter. Return code is: " + returnCode - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + String serviceInstanceId = utils.getNodeText(updateNetworkInput, "service-instance-id") - } + AAIResultWrapper wrapper = execution.getVariable(Prefix + "queryIdAAIResponse") + L3Network queryAAIResponse = wrapper.asBean(L3Network.class).get() - } + // 1. prepare assign topology via SDNC Adapter SUBFLOW call + String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, updateNetworkInput, serviceInstanceId, sdncCallback, "changeassign", "NetworkActivateRequest", cloudRegionId, networkId, queryAAIResponse, null) - } catch (BpmnError e) { - throw e; + String sndcTopologyUpdateRequesAsString = utils.formatXml(sndcTopologyCreateRequest) + logger.debug(sndcTopologyUpdateRequesAsString) + execution.setVariable(Prefix + "changeAssignSDNCRequest", sndcTopologyUpdateRequesAsString) + logger.debug(" UPDNETI_changeAssignSDNCRequest - " + "\n" + sndcTopologyUpdateRequesAsString) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. validateUpdateNetworkResponse() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSDNCRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } - } + } - public void validateSDNCResponse (DelegateExecution execution) { + public void validateSDNCResponse (DelegateExecution execution) { - execution.setVariable("prefix", Prefix) + execution.setVariable("prefix", Prefix) - logger.trace("Inside validateSDNCResponse of DoUpdateNetworkInstance ") + logger.trace("Inside validateSDNCResponse of DoUpdateNetworkInstance ") - String response = execution.getVariable(Prefix + "changeAssignSDNCResponse") - WorkflowException workflowException = null - try { - workflowException = execution.getVariable(Prefix + "WorkflowException") - //execution.setVariable("WorkflowException", workflowException) - } catch (Exception ex) { - logger.debug(" Sdnc 'WorkflowException' object is empty or null. ") - } + String response = execution.getVariable(Prefix + "changeAssignSDNCResponse") + WorkflowException workflowException = null + try { + workflowException = execution.getVariable(Prefix + "WorkflowException") + //execution.setVariable("WorkflowException", workflowException) + } catch (Exception ex) { + logger.debug(" Sdnc 'WorkflowException' object is empty or null. ") + } - boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") + boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) - // reset variable - String changeAssignSDNCResponseDecodeXml = execution.getVariable(Prefix + "changeAssignSDNCResponse") - changeAssignSDNCResponseDecodeXml = changeAssignSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") - execution.setVariable(Prefix + "changeAssignSDNCResponse", changeAssignSDNCResponseDecodeXml) - - if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, prefix+'sdncResponseSuccess' - execution.setVariable(Prefix + "isSdncRollbackNeeded", true) - logger.debug("Successfully Validated SDNC Response") - - } else { - logger.debug("Did NOT Successfully Validated SDNC Response") - throw new BpmnError("MSOWorkflowException") - } - - } - - - public void postProcessResponse (DelegateExecution execution) { - - execution.setVariable("prefix", Prefix) - - logger.trace("Inside postProcessResponse of DoUpdateNetworkInstance ") - - try { - logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException")) - if (execution.getVariable(Prefix + "isException") == false) { - // set rollback data - execution.setVariable("orchestrationStatus", "") - execution.setVariable("networkId", execution.getVariable(Prefix + "networkId")) - execution.setVariable("networkName", execution.getVariable(Prefix + "networkName")) - prepareSuccessRollbackData(execution) // populate rollbackData - execution.setVariable("WorkflowException", null) - execution.setVariable(Prefix + "Success", true) - logger.debug(" ***** postProcessResponse(), GOOD !!!") - } else { - execution.setVariable(Prefix + "Success", false) - execution.setVariable("rollbackData", null) - String exceptionMessage = " Exception encountered in MSO Bpmn. " - if (execution.getVariable("workflowException") != null) { // Output of Rollback flow. - logger.debug(" ***** workflowException: " + execution.getVariable("workflowException")) - WorkflowException wfex = execution.getVariable("workflowException") - exceptionMessage = wfex.getErrorMessage() - } else { - if (execution.getVariable(Prefix + "WorkflowException") != null) { - WorkflowException pwfex = execution.getVariable(Prefix + "WorkflowException") - exceptionMessage = pwfex.getErrorMessage() - } - } - // going to the Main flow: a-la-carte or macro - logger.debug(" ***** postProcessResponse(), BAD !!!") - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - throw new BpmnError("MSOWorkflowException") - } + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) + // reset variable + String changeAssignSDNCResponseDecodeXml = execution.getVariable(Prefix + "changeAssignSDNCResponse") + changeAssignSDNCResponseDecodeXml = changeAssignSDNCResponseDecodeXml.replace('<?xml version="1.0" encoding="UTF-8"?>', "") + execution.setVariable(Prefix + "changeAssignSDNCResponse", changeAssignSDNCResponseDecodeXml) - } catch(BpmnError b){ - logger.debug("Rethrowing MSOWorkflowException") - throw b + if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, prefix+'sdncResponseSuccess' + execution.setVariable(Prefix + "isSdncRollbackNeeded", true) + logger.debug("Successfully Validated SDNC Response") + } else { + logger.debug("Did NOT Successfully Validated SDNC Response") + throw new BpmnError("MSOWorkflowException") + } - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. postProcessResponse() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } + + + public void postProcessResponse (DelegateExecution execution) { + + execution.setVariable("prefix", Prefix) + + logger.trace("Inside postProcessResponse of DoUpdateNetworkInstance ") + + try { + logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException")) + if (execution.getVariable(Prefix + "isException") == false) { + // set rollback data + execution.setVariable("orchestrationStatus", "") + execution.setVariable("networkId", execution.getVariable(Prefix + "networkId")) + execution.setVariable("networkName", execution.getVariable(Prefix + "networkName")) + prepareSuccessRollbackData(execution) // populate rollbackData + execution.setVariable("WorkflowException", null) + execution.setVariable(Prefix + "Success", true) + logger.debug(" ***** postProcessResponse(), GOOD !!!") + } else { + execution.setVariable(Prefix + "Success", false) + execution.setVariable("rollbackData", null) + String exceptionMessage = " Exception encountered in MSO Bpmn. " + if (execution.getVariable("workflowException") != null) { // Output of Rollback flow. + logger.debug(" ***** workflowException: " + execution.getVariable("workflowException")) + WorkflowException wfex = execution.getVariable("workflowException") + exceptionMessage = wfex.getErrorMessage() + } else { + if (execution.getVariable(Prefix + "WorkflowException") != null) { + WorkflowException pwfex = execution.getVariable(Prefix + "WorkflowException") + exceptionMessage = pwfex.getErrorMessage() + } + } + // going to the Main flow: a-la-carte or macro + logger.debug(" ***** postProcessResponse(), BAD !!!") + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + throw new BpmnError("MSOWorkflowException") + } + + } catch(BpmnError b){ + logger.debug("Rethrowing MSOWorkflowException") + throw b + + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. postProcessResponse() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) } - } + } - public void prepareSDNCRollbackRequest (DelegateExecution execution) { + public void prepareSDNCRollbackRequest (DelegateExecution execution) { - execution.setVariable("prefix", Prefix) + execution.setVariable("prefix", Prefix) - logger.trace("Inside prepareSDNCRollbackRequest of DoUpdateNetworkInstance ") + logger.trace("Inside prepareSDNCRollbackRequest of DoUpdateNetworkInstance ") - try { - // for some reason the WorkflowException object is null after the sdnc rollback call task, need to save WorkflowException. - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) - // get variables - String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) - String updateNetworkInput = execution.getVariable(Prefix + "networkRequest") - String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") - String changeAssignSDNCResponse = execution.getVariable(Prefix + "changeAssignSDNCResponse") - String networkId = utils.getNodeText(changeAssignSDNCResponse, "network-id") + try { + // for some reason the WorkflowException object is null after the sdnc rollback call task, need to save WorkflowException. + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) + // get variables + String sdncCallback = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) + String updateNetworkInput = execution.getVariable(Prefix + "networkRequest") + String cloudRegionId = execution.getVariable(Prefix + "cloudRegionSdnc") + String changeAssignSDNCResponse = execution.getVariable(Prefix + "changeAssignSDNCResponse") + String networkId = utils.getNodeText(changeAssignSDNCResponse, "network-id") - String serviceInstanceId = utils.getNodeText(updateNetworkInput, "service-instance-id") + String serviceInstanceId = utils.getNodeText(updateNetworkInput, "service-instance-id") - // 2. prepare rollback topology via SDNC Adapter SUBFLOW call - String sndcTopologyRollbackRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, updateNetworkInput, serviceInstanceId, sdncCallback, "rollback", "NetworkActivateRequest", cloudRegionId, networkId, null, null) - String sndcTopologyRollbackRequestAsString = utils.formatXml(sndcTopologyRollbackRequest) - execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRequestAsString) - logger.debug(" Preparing request for SDNC Topology assign's rollback/compensation . . . - " + "\n" + sndcTopologyRollbackRequestAsString) + // 2. prepare rollback topology via SDNC Adapter SUBFLOW call + String sndcTopologyRollbackRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, updateNetworkInput, serviceInstanceId, sdncCallback, "rollback", "NetworkActivateRequest", cloudRegionId, networkId, null, null) + String sndcTopologyRollbackRequestAsString = utils.formatXml(sndcTopologyRollbackRequest) + execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRequestAsString) + logger.debug(" Preparing request for SDNC Topology assign's rollback/compensation . . . - " + "\n" + sndcTopologyRollbackRequestAsString) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSDNCRollbackRequest() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSDNCRollbackRequest() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } + + } - } + public void prepareRollbackData(DelegateExecution execution) { - public void prepareRollbackData(DelegateExecution execution) { + execution.setVariable("prefix",Prefix) - execution.setVariable("prefix",Prefix) + logger.trace("Inside prepareRollbackData() of DoUpdateNetworkInstance ") - logger.trace("Inside prepareRollbackData() of DoUpdateNetworkInstance ") + try { - try { + Map<String, String> rollbackData = new HashMap<String, String>(); + String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") + if (rollbackSDNCRequest != null) { + if (rollbackSDNCRequest != "") { + rollbackData.put("rollbackSDNCRequest", execution.getVariable(Prefix + "rollbackSDNCRequest")) + } + } + String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") + if (rollbackNetworkRequest != null) { + if (rollbackNetworkRequest != "") { + rollbackData.put("rollbackNetworkRequest", execution.getVariable(Prefix + "rollbackNetworkRequest")) + } + } + execution.setVariable("rollbackData", rollbackData) + logger.debug("** rollbackData : " + rollbackData) - Map<String, String> rollbackData = new HashMap<String, String>(); - String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") - if (rollbackSDNCRequest != null) { - if (rollbackSDNCRequest != "") { - rollbackData.put("rollbackSDNCRequest", execution.getVariable(Prefix + "rollbackSDNCRequest")) - } - } - String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") - if (rollbackNetworkRequest != null) { - if (rollbackNetworkRequest != "") { - rollbackData.put("rollbackNetworkRequest", execution.getVariable(Prefix + "rollbackNetworkRequest")) - } - } - execution.setVariable("rollbackData", rollbackData) - logger.debug("** rollbackData : " + rollbackData) + execution.setVariable("WorkflowException", execution.getVariable(Prefix + "WorkflowException")) + logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException")) - execution.setVariable("WorkflowException", execution.getVariable(Prefix + "WorkflowException")) - logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException")) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareRollbackData() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareRollbackData() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } - } + } - } + public void prepareSuccessRollbackData(DelegateExecution execution) { - public void prepareSuccessRollbackData(DelegateExecution execution) { + execution.setVariable("prefix",Prefix) - execution.setVariable("prefix",Prefix) + logger.trace("Inside prepareSuccessRollbackData() of DoUpdateNetworkInstance ") - logger.trace("Inside prepareSuccessRollbackData() of DoUpdateNetworkInstance ") + try { - try { + if (execution.getVariable("sdncVersion") != '1610') { + // skip: 1702 for 'changeassign' or equivalent not yet defined in SNDC, so no rollback. + } else { + prepareSDNCRollbackRequest(execution) + } - if (execution.getVariable("sdncVersion") != '1610') { - // skip: 1702 for 'changeassign' or equivalent not yet defined in SNDC, so no rollback. - } else { - prepareSDNCRollbackRequest(execution) - } + Map<String, String> rollbackData = new HashMap<String, String>(); + String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") + if (rollbackSDNCRequest != null) { + if (rollbackSDNCRequest != "") { + rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) + } + } + String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") + if (rollbackNetworkRequest != null) { + if (rollbackNetworkRequest != "") { + rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) + } + } + execution.setVariable("rollbackData", rollbackData) - Map<String, String> rollbackData = new HashMap<String, String>(); - String rollbackSDNCRequest = execution.getVariable(Prefix + "rollbackSDNCRequest") - if (rollbackSDNCRequest != null) { - if (rollbackSDNCRequest != "") { - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - } - } - String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest") - if (rollbackNetworkRequest != null) { - if (rollbackNetworkRequest != "") { - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - } - } - execution.setVariable("rollbackData", rollbackData) + logger.debug("** 'rollbackData' for Full Rollback : " + rollbackData) + execution.setVariable("WorkflowException", null) - logger.debug("** 'rollbackData' for Full Rollback : " + rollbackData) - execution.setVariable("WorkflowException", null) + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } catch (Exception ex) { - String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } - } + } - } + public void setExceptionFlag(DelegateExecution execution){ - public void setExceptionFlag(DelegateExecution execution){ + execution.setVariable("prefix",Prefix) - execution.setVariable("prefix",Prefix) + logger.trace("Inside setExceptionFlag() of DoUpdateNetworkInstance ") - logger.trace("Inside setExceptionFlag() of DoUpdateNetworkInstance ") + try { - try { + execution.setVariable(Prefix + "isException", true) - execution.setVariable(Prefix + "isException", true) + if (execution.getVariable("SavedWorkflowException1") != null) { + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) + } else { + execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) + } + logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException")) - if (execution.getVariable("SavedWorkflowException1") != null) { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) - } else { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) - } - logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException")) + } catch(Exception ex){ + String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. setExceptionFlag(): " + ex.getMessage() + logger.debug(exceptionMessage) + exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) + } - } catch(Exception ex){ - String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. setExceptionFlag(): " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - } + } - } + // ******************************* + // Build Error Section + // ******************************* - // ******************************* - // Build Error Section - // ******************************* + public void processJavaException(DelegateExecution execution){ - public void processJavaException(DelegateExecution execution){ - - execution.setVariable("prefix",Prefix) - try{ - logger.debug("Caught a Java Exception") - logger.debug("Started processJavaException Method") - logger.debug("Variables List: " + execution.getVariables()) - execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") + execution.setVariable("prefix",Prefix) + try{ + logger.debug("Caught a Java Exception") + logger.debug("Started processJavaException Method") + logger.debug("Variables List: " + execution.getVariables()) + execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated + exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") - }catch(Exception e){ - logger.debug("Caught Exception during processJavaException Method: " + e) - execution.setVariable("UnexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method") - } - logger.debug("Completed processJavaException Method") - } + }catch(Exception e){ + logger.debug("Caught Exception during processJavaException Method: " + e) + execution.setVariable("UnexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated + exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method") + } + logger.debug("Completed processJavaException Method") + } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy deleted file mode 100644 index 371e54ca75..0000000000 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy +++ /dev/null @@ -1,312 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.infrastructure.scripts; - -import groovy.xml.XmlUtil -import groovy.json.* - -import org.onap.so.bpmn.common.scripts.AaiUtil -import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor -import org.onap.so.bpmn.common.scripts.ExceptionUtil -import org.onap.so.bpmn.common.scripts.NetworkUtils -import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils -import org.onap.so.bpmn.common.scripts.VidUtils -import org.onap.so.bpmn.core.WorkflowException -import org.onap.so.bpmn.core.UrnPropertiesReader -import org.onap.so.bpmn.core.json.JsonUtils - - -import java.util.UUID; - -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.delegate.DelegateExecution -import org.apache.commons.lang3.* -import org.apache.commons.codec.binary.Base64; -import org.springframework.web.util.UriUtils - -import org.slf4j.Logger -import org.slf4j.LoggerFactory - -/** - * This groovy class supports the <class>DoCreateNetworkInstance.bpmn</class> process. - * - */ -public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcessor { - private static final Logger logger = LoggerFactory.getLogger( DoUpdateNetworkInstanceRollback.class); - - String Prefix="UPDNETIR_" - ExceptionUtil exceptionUtil = new ExceptionUtil() - JsonUtils jsonUtil = new JsonUtils() - VidUtils vidUtils = new VidUtils(this) - NetworkUtils networkUtils = new NetworkUtils() - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - - def className = getClass().getSimpleName() - - /** - * This method is executed during the preProcessRequest task of the <class>DoUpdateNetworkInstanceRollback.bpmn</class> process. - * @param execution - */ - public InitializeProcessVariables(DelegateExecution execution){ - /* Initialize all the process variables in this block */ - - execution.setVariable(Prefix + "rollbackNetworkRequest", null) - execution.setVariable(Prefix + "rollbackSDNCRequest", null) - execution.setVariable(Prefix + "WorkflowException", null) - - execution.setVariable(Prefix + "rollbackNetworkRequest", "") - execution.setVariable(Prefix + "rollbackNetworkResponse", "") - execution.setVariable(Prefix + "rollbackNetworkReturnCode", "") - - execution.setVariable(Prefix + "rollbackSDNCRequest", "") - execution.setVariable(Prefix + "rollbackSDNCResponse", "") - execution.setVariable(Prefix + "rollbackSDNCReturnCode", "") - - execution.setVariable(Prefix + "Success", false) - execution.setVariable(Prefix + "fullRollback", false) - - } - - // ************************************************** - // Pre or Prepare Request Section - // ************************************************** - /** - * This method is executed during the preProcessRequest task of the <class>DoUpdateNetworkInstanceRollback.bpmn</class> process. - * @param execution - */ - public void preProcessRequest (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside preProcessRequest() of " + className + ".groovy ") - - try { - // initialize flow variables - InitializeProcessVariables(execution) - - // GET Incoming request/variables - String rollbackNetworkRequest = null - String rollbackSDNCRequest = null - - // Partial Rollback - Map<String, String> rollbackData = execution.getVariable("rollbackData") - if (rollbackData != null && rollbackData instanceof Map) { - - if(rollbackData.containsKey("rollbackNetworkRequest")) { - rollbackNetworkRequest = rollbackData["rollbackNetworkRequest"] - } - - if(rollbackData.containsKey("rollbackSDNCRequest")) { - rollbackSDNCRequest = rollbackData["rollbackSDNCRequest"] - } - } - - execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkRequest) - execution.setVariable(Prefix + "rollbackSDNCRequest", rollbackSDNCRequest) - logger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData")) - - String sdncVersion = execution.getVariable("sdncVersion") - logger.debug("sdncVersion? : " + sdncVersion) - - // PO Authorization Info / headers Authorization= - String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution) - - try { - def encodedString = utils.getBasicAuth(basicAuthValuePO, UrnPropertiesReader.getVariable("mso.msoKey", execution)) - execution.setVariable("BasicAuthHeaderValuePO",encodedString) - execution.setVariable("BasicAuthHeaderValueSDNC", encodedString) - - } catch (IOException ex) { - String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - " - String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage() - logger.debug(dataErrorMessage ) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - if (execution.getVariable("SavedWorkflowException1") != null) { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("SavedWorkflowException1")) - } else { - execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException")) - } - logger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException")) - if(execution.getVariable(Prefix + "WorkflowException") != null) { - // called by: DoCreateNetworkInstance, partial rollback - execution.setVariable(Prefix + "fullRollback", false) - - } else { - // called by: Macro - Full Rollback, WorkflowException = null - execution.setVariable(Prefix + "fullRollback", true) - - } - logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback")) - - - } catch (BpmnError e) { - throw e; - - } catch (Exception ex) { - sendSyncError(execution) - // caught exception - String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - - } - - } - - public void validateRollbackResponses (DelegateExecution execution) { - - execution.setVariable("prefix",Prefix) - - logger.trace("Inside validateRollbackResponses() of DoUpdateNetworkInstanceRollback ") - - try { - // validate PO network rollback response - String rollbackNetworkErrorMessages = "" - String rollbackNetworkReturnCode = "200" - if (execution.getVariable(Prefix + "rollbackNetworkRequest") != null) { - rollbackNetworkReturnCode = execution.getVariable(Prefix + "rollbackNetworkReturnCode") - String rollbackNetworkResponse = execution.getVariable(Prefix + "rollbackNetworkResponse") - logger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode) - logger.debug(" NetworkRollback Response - " + rollbackNetworkResponse) - if (rollbackNetworkReturnCode != "200") { - rollbackNetworkErrorMessages = " + PO Network rollback failed. " - } else { - rollbackNetworkErrorMessages = " + PO Network rollback completed." - } - } - - // validate SDNC rollback response - String rollbackSdncErrorMessages = "" - String rollbackSDNCReturnCode = "200" - if (execution.getVariable(Prefix + "rollbackSDNCRequest") != null) { - rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode") - String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse") - String rollbackSDNCReturnInnerCode = "" - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() - rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") - if (rollbackSDNCReturnCode == "200") { - if (utils.nodeExists(rollbackSDNCResponse, "response-code")) { - rollbackSDNCReturnInnerCode = utils.getNodeText(rollbackSDNCResponse, "response-code") - if (rollbackSDNCReturnInnerCode == "200" || rollbackSDNCReturnInnerCode == "" || rollbackSDNCReturnInnerCode == "0") { - rollbackSdncErrorMessages = " + SNDC changeassign rollback completed." - } else { - rollbackSdncErrorMessages = " + SDNC changeassign rollback failed. " - } - } else { - rollbackSdncErrorMessages = " + SNDC changeassign rollback completed." - } - } else { - rollbackSdncErrorMessages = " + SDNC changeassign rollback failed. " - } - logger.debug(" SDNC changeassign rollback Code - " + rollbackSDNCReturnCode) - logger.debug(" SDNC changeassign rollback Response - " + rollbackSDNCResponse) - } - - String statusMessage = "" - int errorCode = 7000 - logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback")) - if (execution.getVariable(Prefix + "fullRollback") == false) { - // original WorkflowException, - WorkflowException wfe = execution.getVariable(Prefix + "WorkflowException") - if (wfe != null) { - // rollback due to failure in DoCreate - Partial rollback - statusMessage = wfe.getErrorMessage() - errorCode = wfe.getErrorCode() - } else { - statusMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception." - errorCode = '7000' - } - - // set if all rolledbacks are successful - if (rollbackNetworkReturnCode == "200" && rollbackSDNCReturnCode == "200") { - execution.setVariable("rolledBack", true) - - } else { - execution.setVariable("rolledBack", false) - - } - - statusMessage = statusMessage + rollbackNetworkErrorMessages + rollbackSdncErrorMessages - logger.debug("Final DoUpdateNetworkInstanceRollback status message: " + statusMessage) - String processKey = getProcessKey(execution); - WorkflowException exception = new WorkflowException(processKey, errorCode, statusMessage); - execution.setVariable("workflowException", exception); - - } else { - // rollback due to failures in Main flow (Macro) - Full rollback - // WorkflowException = null - if (rollbackNetworkReturnCode == "200" && rollbackSDNCReturnCode == "200") { - execution.setVariable("rollbackSuccessful", true) - execution.setVariable("rollbackError", false) - } else { - String exceptionMessage = "Network Update Rollback was not Successful. " - logger.debug(exceptionMessage) - execution.setVariable("rollbackSuccessful", false) - execution.setVariable("rollbackError", true) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - throw new BpmnError("MSOWorkflowException") - } - - } - - - } catch (Exception ex) { - execution.setVariable("WorkflowException", null) - String errorMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception." - String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstanceRollback flow. validateRollbackResponses() - " + errorMessage + ": " + ex.getMessage() - logger.debug(exceptionMessage) - exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage) - execution.setVariable("WorkflowException", execution.getVariable("WorkflowException")) - - } - - } - - // ******************************* - // Build Error Section - // ******************************* - - - - public void processJavaException(DelegateExecution execution){ - - execution.setVariable("prefix",Prefix) - - try{ - logger.debug("Caught a Java Exception in " + Prefix) - logger.debug("Started processJavaException Method") - logger.debug("Variables List: " + execution.getVariables()) - execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception") - - }catch(Exception e){ - logger.debug("Caught Exception during processJavaException Method: " + e) - execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated - exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix) - } - logger.trace("Completed processJavaException Method in " + Prefix) - } - -} diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/api/ControllerContext.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/api/ControllerContext.java index 0de211bd7d..147b291ed7 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/api/ControllerContext.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/decisionpoint/api/ControllerContext.java @@ -18,7 +18,6 @@ */ package org.onap.so.bpmn.infrastructure.decisionpoint.api; -import java.util.Map; import org.camunda.bpm.engine.delegate.DelegateExecution; /** diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java index dd2601f0d0..c390186fb0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java @@ -18,7 +18,6 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableName import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID; -import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java index c63edc93c7..e7e0951d04 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java @@ -54,6 +54,7 @@ import org.onap.aai.domain.yang.LogicalLinks; import org.onap.aai.domain.yang.PInterface; import org.onap.aai.domain.yang.Pnf; import org.onap.aai.domain.yang.Relationship; +import org.onap.logging.filter.base.ErrorCode; import org.onap.so.bpmn.core.UrnPropertiesReader; import org.onap.so.bpmn.core.domain.Resource; import org.onap.so.bpmn.core.domain.ServiceDecomposition; @@ -66,7 +67,6 @@ import org.onap.so.client.aai.entities.Relationships; import org.onap.so.client.aai.entities.uri.AAIPluralResourceUri; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; -import org.onap.logging.filter.base.ErrorCode; import org.onap.so.logger.MessageEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -93,7 +93,7 @@ public class ServicePluginFactory { private static final String VS_UNMONITORED = "VS_besteffort"; private static final String TS_MONITORED = "TS1"; private static final String TS_UNMONITORED = "TS2"; - private static final String CUSTOM_TP_LIST[] = + private static final String[] CUSTOM_TP_LIST = new String[] {VS_MONITORED, VS_UNMONITORED, TS_MONITORED, TS_UNMONITORED}; static { @@ -108,10 +108,14 @@ public class ServicePluginFactory { logger.error("Failed to load property file, Either property file is missing or empty!"); } } catch (IOException e) { - logger.error("Failed to load property file!"); + logger.error("Failed to load property file!", e); } } + private ServicePluginFactory() { + + } + public static synchronized ServicePluginFactory getInstance() { if (null == instance) { instance = new ServicePluginFactory(); @@ -119,9 +123,6 @@ public class ServicePluginFactory { return instance; } - private ServicePluginFactory() { - - } private String getInventoryOSSEndPoint() { return UrnPropertiesReader.getVariable("mso.service-plugin.inventory-oss-endpoint", @@ -197,7 +198,7 @@ public class ServicePluginFactory { return false; } - Map<String, Object> accessTPInfo = new HashMap<String, Object>(); + Map<String, Object> accessTPInfo = new HashMap<>(); accessTPInfo.put("access-provider-id", tpInfoMap.get("access-provider-id")); accessTPInfo.put("access-client-id", tpInfoMap.get("access-client-id")); accessTPInfo.put("access-topology-id", tpInfoMap.get("access-topology-id")); @@ -254,7 +255,7 @@ public class ServicePluginFactory { } } - Map<String, Object> tpInfoMap = new HashMap<String, Object>(); + Map<String, Object> tpInfoMap = new HashMap<>(); // Site resource has location param and SOTNAttachment resource has clientSignal param if (location == null || clientSignal == null) { @@ -413,8 +414,6 @@ public class ServicePluginFactory { serviceRequestInputs.put("remote-access-node-id", crossTPs.get("remote-access-node-id")); serviceRequestInputs.put("remote-access-ltp-id", crossTPs.get("remote-access-ltp-id")); } - - return; } private LogicalLink selectLogicalLink(List<LogicalLink> logicalLinks, String svcName) { @@ -430,14 +429,14 @@ public class ServicePluginFactory { if (relationship.getRelatedTo().equals("p-interface") && relationship.getRelatedLink().contains("-ltpId-" + localTp) && link.getOperationalStatus().equalsIgnoreCase("up")) { - logger.info("linkname:" + link.getLinkName() + " is matching with allowed list"); + logger.info("linkname:{} is matching with allowed list", link.getLinkName()); return link; } } } } - logger.error("There is no matching logical link for allowed list :" + Arrays.toString(allowedList)); + logger.error("There is no matching logical link for allowed list :{}", Arrays.toString(allowedList)); return null; } else { logger.info("link customization is not required"); @@ -459,7 +458,7 @@ public class ServicePluginFactory { if (link != null) { boolean isRemoteLink = false; - logger.info("processing link :" + link.getLinkName()); + logger.info("processing link :{}", link.getLinkName()); AAIResultWrapper wrapper = new AAIResultWrapper(link); Optional<Relationships> optRelationships = wrapper.getRelationships(); List<AAIResourceUri> pInterfaces = new ArrayList<>(); @@ -484,70 +483,7 @@ public class ServicePluginFactory { remoteTP = pInterfaces.get(1); } - if (localTP != null && remoteTP != null) { - // give local tp - String tpUrl = localTP.build().toString(); - String localNodeId = tpUrl.split("/")[4]; - tpInfo.put("local-access-node-id", localNodeId); - - logger.info("Get info for local TP :" + localNodeId); - Optional<Pnf> optLocalPnf = client.get(Pnf.class, - AAIUriFactory.createResourceUri(AAIObjectType.PNF, localNodeId)); - - if (optLocalPnf.isPresent()) { - Pnf localPnf = optLocalPnf.get(); - - for (Relationship rel : localPnf.getRelationshipList().getRelationship()) { - if (rel.getRelatedTo().equalsIgnoreCase("network-resource")) { - String[] networkRef = rel.getRelatedLink() - .substring(rel.getRelatedLink().lastIndexOf("/") + 1).split("-"); - if (networkRef.length == 6) { - tpInfo.put("local-access-provider-id", networkRef[1]); - tpInfo.put("local-access-client-id", networkRef[3]); - tpInfo.put("local-access-topology-id", networkRef[5]); - } - } - } - } - String ltpIdStr = tpUrl.substring(tpUrl.lastIndexOf("/") + 1); - if (ltpIdStr.contains("-")) { - tpInfo.put("local-access-ltp-id", ltpIdStr.substring(ltpIdStr.lastIndexOf("-") + 1)); - } - - // give remote tp - tpUrl = remoteTP.build().toString(); - PInterface intfRemote = client.get(PInterface.class, remoteTP).get(); - - String remoteNodeId = tpUrl.split("/")[4]; - tpInfo.put("remote-access-node-id", remoteNodeId); - - logger.info("Get info for remote TP:" + remoteNodeId); - - String[] networkRefRemote = intfRemote.getNetworkRef().split("-"); - Optional<Pnf> optRemotePnf = client.get(Pnf.class, - AAIUriFactory.createResourceUri(AAIObjectType.PNF, remoteNodeId)); - - if (optRemotePnf.isPresent()) { - Pnf remotePnf = optRemotePnf.get(); - - for (Relationship rel : remotePnf.getRelationshipList().getRelationship()) { - if (rel.getRelatedTo().equalsIgnoreCase("network-resource")) { - String[] networkRef = rel.getRelatedLink() - .substring(rel.getRelatedLink().lastIndexOf("/") + 1).split("-"); - if (networkRef.length == 6) { - tpInfo.put("remote-access-provider-id", networkRefRemote[1]); - tpInfo.put("remote-access-client-id", networkRefRemote[3]); - tpInfo.put("remote-access-topology-id", networkRefRemote[5]); - } - } - } - } - - String ltpIdStrR = tpUrl.substring(tpUrl.lastIndexOf("/") + 1); - if (ltpIdStrR.contains("-")) { - tpInfo.put("remote-access-ltp-id", ltpIdStrR.substring(ltpIdStr.lastIndexOf("-") + 1)); - } - } + tpInfo = getTPInfo(client, localTP, remoteTP); } } } @@ -555,6 +491,91 @@ public class ServicePluginFactory { return tpInfo; } + private Map<String, Object> getTPInfo(AAIResourcesClient client, AAIResourceUri localTP, AAIResourceUri remoteTP) { + + Map<String, Object> tpInfo = new HashMap<>(); + + if (localTP != null && remoteTP != null) { + // give local tp + String tpUrl = localTP.build().toString(); + String localNodeId = tpUrl.split("/")[4]; + tpInfo.put("local-access-node-id", localNodeId); + + logger.info("Get info for local TP :{}", localNodeId); + Optional<Pnf> optLocalPnf = + client.get(Pnf.class, AAIUriFactory.createResourceUri(AAIObjectType.PNF, localNodeId)); + + + getTpInfoFromLocalTp(tpInfo, optLocalPnf); + + String ltpIdStr = tpUrl.substring(tpUrl.lastIndexOf("/") + 1); + if (ltpIdStr.contains("-")) { + tpInfo.put("local-access-ltp-id", ltpIdStr.substring(ltpIdStr.lastIndexOf("-") + 1)); + } + + // give remote tp + tpUrl = remoteTP.build().toString(); + PInterface intfRemote = client.get(PInterface.class, remoteTP).get(); + + String remoteNodeId = tpUrl.split("/")[4]; + tpInfo.put("remote-access-node-id", remoteNodeId); + + logger.info("Get info for remote TP:{}", remoteNodeId); + + String[] networkRefRemote = intfRemote.getNetworkRef().split("-"); + Optional<Pnf> optRemotePnf = + client.get(Pnf.class, AAIUriFactory.createResourceUri(AAIObjectType.PNF, remoteNodeId)); + + getTpInfoFromRemoteTp(tpInfo, networkRefRemote, optRemotePnf); + + String ltpIdStrR = tpUrl.substring(tpUrl.lastIndexOf("/") + 1); + if (ltpIdStrR.contains("-")) { + tpInfo.put("remote-access-ltp-id", ltpIdStrR.substring(ltpIdStr.lastIndexOf("-") + 1)); + } + } + + return tpInfo; + } + + + private void getTpInfoFromLocalTp(Map<String, Object> tpInfo, Optional<Pnf> optLocalPnf) { + if (optLocalPnf.isPresent()) { + Pnf localPnf = optLocalPnf.get(); + + for (Relationship rel : localPnf.getRelationshipList().getRelationship()) { + if (rel.getRelatedTo().equalsIgnoreCase("network-resource")) { + String[] networkRef = + rel.getRelatedLink().substring(rel.getRelatedLink().lastIndexOf("/") + 1).split("-"); + if (networkRef.length == 6) { + tpInfo.put("local-access-provider-id", networkRef[1]); + tpInfo.put("local-access-client-id", networkRef[3]); + tpInfo.put("local-access-topology-id", networkRef[5]); + } + } + } + } + } + + private void getTpInfoFromRemoteTp(Map<String, Object> tpInfo, String[] networkRefRemote, + Optional<Pnf> optRemotePnf) { + if (optRemotePnf.isPresent()) { + Pnf remotePnf = optRemotePnf.get(); + + for (Relationship rel : remotePnf.getRelationshipList().getRelationship()) { + if (rel.getRelatedTo().equalsIgnoreCase("network-resource")) { + String[] networkRef = + rel.getRelatedLink().substring(rel.getRelatedLink().lastIndexOf("/") + 1).split("-"); + if (networkRef.length == 6) { + tpInfo.put("remote-access-provider-id", networkRefRemote[1]); + tpInfo.put("remote-access-client-id", networkRefRemote[3]); + tpInfo.put("remote-access-topology-id", networkRefRemote[5]); + } + } + } + } + } + + // this method check if pInterface is remote private boolean isRemotePInterface(AAIResourcesClient client, AAIResourceUri uri) { @@ -899,6 +920,7 @@ public class ServicePluginFactory { return responseContent; } catch (Exception e) { + logger.debug("Exception in sendRequest", e); return null; } finally { diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java index de8a35de06..e614ddd28d 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java @@ -109,7 +109,7 @@ public abstract class AbstractSdncOperationTask implements JavaDelegate { objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); postBody = objectMapper.writeValueAsString(inputEntity); } catch (JsonProcessingException e) { - logger.error(Arrays.toString(e.getStackTrace())); + logger.error("JsonProcessingException in getPostbody", e); } return postBody; } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java index 3da5b0de70..d2a5c36096 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,9 +21,13 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client; import java.util.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HeaderUtil { + private static Logger logger = LoggerFactory.getLogger(HeaderUtil.class); + public static final String USER = "admin"; public static final String PASS = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"; public static final String DefaulAuth = getAuthorization(USER, PASS); @@ -38,6 +42,7 @@ public class HeaderUtil { try { base64 = Base64.getEncoder().encodeToString(str.getBytes("utf-8")); } catch (Exception ex) { + logger.error("Exception in base64Encode", ex); } return base64; } diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy deleted file mode 100644 index 5e264c0af4..0000000000 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollbackTest.groovy +++ /dev/null @@ -1,343 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.infrastructure.scripts - - -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.mockito.internal.debugging.MockitoDebuggerImpl -import org.onap.so.bpmn.common.scripts.MsoUtils -import org.onap.so.bpmn.core.WorkflowException -import org.junit.Before -import org.junit.Rule; -import org.junit.Test -import org.junit.Ignore -import org.junit.runner.RunWith - -import static org.junit.Assert.*; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.apache.commons.lang3.* - - -@RunWith(MockitoJUnitRunner.class) -class DoDeleteNetworkInstanceRollbackTest { - - @Rule - public WireMockRule wireMockRule = new WireMockRule(8090); - - def utils = new MsoUtils() - String Prefix="DELNWKIR_" - - - String rollbackNetworkRequest = - """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.onap.so/network"> - <rollback> - <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId> - <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId> - <networkStackId/> - <networkType>CONTRAIL_EXTERNAL</networkType> - <networkCreated>true</networkCreated> - <tenantId>7dd5365547234ee8937416c65507d266</tenantId> - <cloudSiteId>RDM2WAGPLCP</cloudSiteId> - <msoRequest> - <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId> - <serviceInstanceId/> - </msoRequest> - </rollback> -</NetworkAdapter:rollbackNetwork>""" - - String rollbackDeActivateSDNCRequest = - """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" - xmlns:ns5="http://org.onap/so/request/types/v1" - xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>activate</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> - <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> - </sdncadapter:RequestHeader> - <aetgt:SDNCRequestData> - <request-information> - <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id> - <request-action>CreateNetworkInstance</request-action> - <source>VID</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <service-type>MSO-dev-service-type</service-type> - <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id> - <subscriber-name>MSO_1610_dev</subscriber-name> - </service-information> - <network-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <onap-model-information> - <model-invariant-uuid>invariant-uuid</model-invariant-uuid> - <model-customization-uuid>customization-uuid</model-customization-uuid> - <model-uuid>uuid</model-uuid> - <model-version>version</model-version> - <model-name>CONTRAIL_EXTERNAL</model-name> - </onap-model-information> - </network-information> - <network-request-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <tenant>7dd5365547234ee8937416c65507d266</tenant> - <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region> - </network-request-information> - </aetgt:SDNCRequestData> -</aetgt:SDNCAdapterWorkflowRequest>""" - - String rollbackSDNCRequest = - """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" - xmlns:ns5="http://org.onap/so/request/types/v1" - xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> - </sdncadapter:RequestHeader> - <aetgt:SDNCRequestData> - <request-information> - <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id> - <request-action>CreateNetworkInstance</request-action> - <source>VID</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <service-type>MSO-dev-service-type</service-type> - <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id> - <subscriber-name>MSO_1610_dev</subscriber-name> - </service-information> - <network-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <onap-model-information> - <model-invariant-uuid>invariant-uuid</model-invariant-uuid> - <model-customization-uuid>customization-uuid</model-customization-uuid> - <model-uuid>uuid</model-uuid> - <model-version>version</model-version> - <model-name>CONTRAIL_EXTERNAL</model-name> - </onap-model-information> - </network-information> - <network-request-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <tenant>7dd5365547234ee8937416c65507d266</tenant> - <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region> - </network-request-information> - </aetgt:SDNCRequestData> -</aetgt:SDNCAdapterWorkflowRequest>""" - -// - - - - - - - - - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public void initializeVariables (DelegateExecution mockExecution) { - - verify(mockExecution).setVariable(Prefix + "WorkflowException", null) - - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackDeactivateSDNCReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "Success", false) - verify(mockExecution).setVariable(Prefix + "fullRollback", false) - - } - - @Test - //@Ignore - public void preProcessRequest() { - - println "************ preProcessRequest ************* " - - WorkflowException workflowException = new WorkflowException("DoCreateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.") - Map<String, String> rollbackData = new HashMap<String, String>(); - rollbackData.put("rollbackDeactivateSDNCRequest", rollbackDeActivateSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - when(mockExecution.getVariable("sdncVersion")).thenReturn("1702") - - when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B") - when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - - when(mockExecution.getVariable("mso.adapters.sdnc.endpoint")).thenReturn("http://localhost:8090/SDNCAdapter") - when(mockExecution.getVariable("mso.adapters.network.rest.endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter") - when(mockExecution.getVariable("mso.adapters.sdnc.resource.endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc") - - - // preProcessRequest(DelegateExecution execution) - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.preProcessRequest(mockExecution) - - //verify variable initialization - initializeVariables(mockExecution) - -// verify(mockExecution).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", Prefix) - - } - - - @Test - //@Ignore - public void validateRollbackResponses_Good() { - - WorkflowException workflowException = new WorkflowException("DoDeleteNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.") - WorkflowException expectedWorkflowException = new WorkflowException("DoDeleteNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC deactivate rollback completed. + PO Network rollback completed. + SNDC unassign rollback completed.") - - println "************ validateRollbackResponses_Good() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false) - - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rolledBack", true) - verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true) - verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class))) - //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException) - } - - @Test - //@Ignore - public void validateRollbackResponses_FullRollback() { - - Map<String, String> rollbackData = new HashMap<String, String>(); - rollbackData.put("rollbackDeactivateSDNCRequest", rollbackDeActivateSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - - println "************ validateRollbackResponses_FullRollback() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackDeactivateSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(null) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - - DoDeleteNetworkInstanceRollback DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() - DoDeleteNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true) - verify(mockExecution, atLeast(1)).setVariable("rollbackError", false) - - } - - - private ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("DoDeleteNetworkInstanceRollback") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - // Initialize prerequisite variables - - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockExecution.getProcessInstanceId()).thenReturn("DoDeleteNetworkInstanceRollback") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - return mockExecution - } - -} diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy deleted file mode 100644 index 7bc82c1ccc..0000000000 --- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy +++ /dev/null @@ -1,329 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.infrastructure.scripts - -import static org.mockito.Mockito.* - -import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.ProcessEngineServices -import org.camunda.bpm.engine.RepositoryService -import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity -import org.camunda.bpm.engine.repository.ProcessDefinition -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.mockito.MockitoAnnotations -import org.mockito.runners.MockitoJUnitRunner -import org.onap.so.bpmn.common.scripts.MsoUtils -import org.onap.so.bpmn.core.WorkflowException -import org.junit.Before -import org.junit.Rule; -import org.junit.Test -import org.junit.Ignore -import org.junit.runner.RunWith - -import static org.junit.Assert.*; - -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.apache.commons.lang3.* - - -@RunWith(MockitoJUnitRunner.class) -class DoUpdateNetworkInstanceRollbackTest { - - def utils = new MsoUtils() - String Prefix="UPDNETIR_" - - - String rollbackNetworkRequest = - """<NetworkAdapter:rollbackNetwork xmlns:NetworkAdapter="http://org.onap.so/network"> - <rollback> - <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId> - <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId> - <networkStackId/> - <networkType>CONTRAIL_EXTERNAL</networkType> - <networkCreated>true</networkCreated> - <tenantId>7dd5365547234ee8937416c65507d266</tenantId> - <cloudSiteId>RDM2WAGPLCP</cloudSiteId> - <msoRequest> - <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId> - <serviceInstanceId/> - </msoRequest> - </rollback> -</NetworkAdapter:rollbackNetwork>""" - - String rollbackActivateSDNCRequest = - """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" - xmlns:ns5="http://org.onap/so/request/types/v1" - xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> - <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> - </sdncadapter:RequestHeader> - <aetgt:SDNCRequestData> - <request-information> - <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id> - <request-action>CreateNetworkInstance</request-action> - <source>VID</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <service-type>MSO-dev-service-type</service-type> - <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id> - <subscriber-name>MSO_1610_dev</subscriber-name> - </service-information> - <network-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <onap-model-information> - <model-invariant-uuid>invariant-uuid</model-invariant-uuid> - <model-customization-uuid>customization-uuid</model-customization-uuid> - <model-uuid>uuid</model-uuid> - <model-version>version</model-version> - <model-name>CONTRAIL_EXTERNAL</model-name> - </onap-model-information> - </network-information> - <network-request-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <tenant>7dd5365547234ee8937416c65507d266</tenant> - <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region> - </network-request-information> - </aetgt:SDNCRequestData> -</aetgt:SDNCAdapterWorkflowRequest>""" - - String rollbackSDNCRequest = - """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" - xmlns:ns5="http://org.onap/so/request/types/v1" - xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>88f65519-9a38-4c4b-8445-9eb4a5a5af56</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>f70e927b-6087-4974-9ef8-c5e4d5847ca4</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>rollback</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl> - <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> - </sdncadapter:RequestHeader> - <aetgt:SDNCRequestData> - <request-information> - <request-id>88f65519-9a38-4c4b-8445-9eb4a5a5af56</request-id> - <request-action>CreateNetworkInstance</request-action> - <source>VID</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id> - <service-type>MSO-dev-service-type</service-type> - <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id> - <subscriber-name>MSO_1610_dev</subscriber-name> - </service-information> - <network-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <onap-model-information> - <model-invariant-uuid>invariant-uuid</model-invariant-uuid> - <model-customization-uuid>customization-uuid</model-customization-uuid> - <model-uuid>uuid</model-uuid> - <model-version>version</model-version> - <model-name>CONTRAIL_EXTERNAL</model-name> - </onap-model-information> - </network-information> - <network-request-information> - <network-id>8abc633a-810b-4ca5-8b3a-09511d13a2ce</network-id> - <network-type>CONTRAIL_EXTERNAL</network-type> - <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name> - <tenant>7dd5365547234ee8937416c65507d266</tenant> - <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region> - </network-request-information> - </aetgt:SDNCRequestData> -</aetgt:SDNCAdapterWorkflowRequest>""" - -// - - - - - - - - - - - @Before - public void init() - { - MockitoAnnotations.initMocks(this) - } - - public void initializeVariables (DelegateExecution mockExecution) { - - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", null) - verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", null) - verify(mockExecution).setVariable(Prefix + "WorkflowException", null) - - verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackNetworkReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "") - verify(mockExecution).setVariable(Prefix + "rollbackSDNCResponse", "") - verify(mockExecution).setVariable(Prefix + "rollbackSDNCReturnCode", "") - - verify(mockExecution).setVariable(Prefix + "Success", false) - verify(mockExecution).setVariable(Prefix + "fullRollback", false) - - - } - - @Test - //@Ignore - public void preProcessRequest() { - - println "************ preProcessRequest ************* " - - WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.") - Map<String, String> rollbackData = new HashMap<String, String>(); - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - when(mockExecution.getVariable("sdncVersion")).thenReturn("1610") - when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B") - when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") - - when(mockExecution.getVariable("mso.adapters.sdnc.endpoint")).thenReturn("http://localhost:28090/SDNCAdapter") - when(mockExecution.getVariable("mso.adapters.network.rest.endpoint")).thenReturn("http://localhost:28090/networks/NetworkAdapter") - when(mockExecution.getVariable("mso.adapters.sdnc.resource.endpoint")).thenReturn("http://localhost:28090/SDNCAdapterRpc") - - - // preProcessRequest(DelegateExecution execution) - DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.preProcessRequest(mockExecution) - -// verify(mockExecution).getVariable("isDebugLogEnabled") - verify(mockExecution).setVariable("prefix", Prefix) - - //verify variable initialization - initializeVariables(mockExecution) - - } - - - @Test - @Ignore - public void validateRollbackResponses_Good() { - - WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404.") - WorkflowException expectedWorkflowException = new WorkflowException("DoUpdateNetworkInstanceRollback", 2500, "AAI Update Contrail Failed. Error 404. + SNDC activate rollback completed. + PO Network rollback completed. + SNDC assign rollback completed.") - - println "************ validateRollbackResponses_Good() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "") - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(workflowException) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(false) - - DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rolledBack", true) - verify(mockExecution, atLeast(1)).setVariable("wasDeleted", true) - verify(mockExecution).setVariable("WorkflowException", refEq(expectedWorkflowException, any(WorkflowException.class))) - //verify(mockExecution).setVariable("WorkflowException", expectedWorkflowException) - } - - @Test - //@Ignore - public void validateRollbackResponses_FullRollback() { - - Map<String, String> rollbackData = new HashMap<String, String>(); - rollbackData.put("rollbackSDNCRequest", rollbackSDNCRequest) - rollbackData.put("rollbackNetworkRequest", rollbackNetworkRequest) - - println "************ validateRollbackResponses_FullRollback() ************* " - ExecutionEntity mockExecution = setupMock() - // Initialize prerequisite variables - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("prefix")).thenReturn(Prefix) - when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn("Good") - when(mockExecution.getVariable(Prefix + "rollbackNetworkReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackNetworkResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "rollbackSDNCReturnCode")).thenReturn("200") - when(mockExecution.getVariable(Prefix + "rollbackSDNCResponse")).thenReturn("GoodResponse") - when(mockExecution.getVariable(Prefix + "WorkflowException")).thenReturn(null) - when(mockExecution.getVariable(Prefix + "fullRollback")).thenReturn(true) - when(mockExecution.getVariable("rollbackData")).thenReturn(rollbackData) - - DoUpdateNetworkInstanceRollback DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() - DoUpdateNetworkInstanceRollback.validateRollbackResponses(mockExecution) - - // verify set prefix = Prefix + "" - verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix) - verify(mockExecution, atLeast(1)).setVariable("rollbackSuccessful", true) - verify(mockExecution, atLeast(1)).setVariable("rollbackError", false) - - } - - - private ExecutionEntity setupMock() { - - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn("DoUpdateNetworkInstanceRollback") - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - // Initialize prerequisite variables - - when(mockExecution.getId()).thenReturn("100") - when(mockExecution.getProcessDefinitionId()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockExecution.getProcessInstanceId()).thenReturn("DoUpdateNetworkInstanceRollback") - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) - - return mockExecution - } - -} diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteVfModuleVolumeInfraV1.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteVfModuleVolumeInfraV1.bpmn index 2e5d2e30b1..65a11e24be 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteVfModuleVolumeInfraV1.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteVfModuleVolumeInfraV1.bpmn @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DeleteVfModuleVolumeInfraV1" name="DeleteVfModuleVolumeInfraV1" isExecutable="true"> <bpmn2:scriptTask id="preProcessRequest_ScriptTask" name="PreProcess Incoming Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() deleteVfMod.executeMethod('preProcessRequest', execution, isDebugLogEnabled) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_7" name="" sourceRef="preProcessRequest_ScriptTask" targetRef="sendSyncAckResponse_ScriptTask" /> <bpmn2:startEvent id="deleteNetwork_startEvent" name="Start Flow"> @@ -18,24 +18,24 @@ deleteVfMod.executeMethod('preProcessRequest', execution, isDebugLogEnabled) <bpmn2:scriptTask id="sendSyncAckResponse_ScriptTask" name="Send Sync Ack Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() -deleteVfMod.executeMethod('sendSyncResponse', execution, isDebugLogEnabled)]]></bpmn2:script> +deleteVfMod.executeMethod('sendSyncResponse', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_12" name="" sourceRef="sendSyncAckResponse_ScriptTask" targetRef="ScriptTask_callRestCloudRegion" /> <bpmn2:scriptTask id="ScriptTask_callRestCloudRegion" name="Call REST Query Cloud Region " scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def delVfModuleVol = new DeleteVfModuleVolumeInfraV1() -delVfModuleVol.executeMethod('callRESTQueryAAICloudRegion', execution, isDebugLogEnabled)]]></bpmn2:script> +delVfModuleVol.executeMethod('callRESTQueryAAICloudRegion', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="prepareVnfAdapterDelete_ScriptTask_1" name="Prepare Vnf Adapter Delete" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_15</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() -deleteVfMod.executeMethod('prepareVnfAdapterDeleteRequest', execution, isDebugLogEnabled)]]></bpmn2:script> +deleteVfMod.executeMethod('prepareVnfAdapterDeleteRequest', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="prepareVnfAdapterDelete_ScriptTask_1" targetRef="callVnfAdapterDeleteSubflow_CallActivity" /> <bpmn2:endEvent id="EndEvent_5"> @@ -48,12 +48,12 @@ deleteVfMod.executeMethod('prepareVnfAdapterDeleteRequest', execution, isDebugLo <bpmn2:outgoing>SequenceFlow_21</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_15" name="" sourceRef="ExclusiveGateway_3" targetRef="prepareVnfAdapterDelete_ScriptTask_1"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELVfModVol_tenantId") == execution.getVariable("DELVfModVol_volumeGroupTenantId")}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELVfModVol_tenantId") == execution.getVariable("DELVfModVol_volumeGroupTenantId")}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_21" name="" sourceRef="ExclusiveGateway_3" targetRef="ScriptTask_2" /> - <bpmn2:callActivity id="callVnfAdapterDeleteSubflow_CallActivity" name="Call Vnf Adapter Delete subflow" calledElement="vnfAdapterTask"> + <bpmn2:callActivity id="callVnfAdapterDeleteSubflow_CallActivity" name="Call Vnf Adapter Delete subflow" calledElement="openstackAdapterTask"> <bpmn2:extensionElements> - <camunda:in source="DELVfModVol_deleteVnfARequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="DELVfModVol_deleteVnfARequest" target="openstackAdapterTaskRequest" /> <camunda:out source="WorkflowResponse" target="DELVfModVol_deleteVnfAResponse" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> @@ -67,18 +67,18 @@ deleteVfMod.executeMethod('prepareVnfAdapterDeleteRequest', execution, isDebugLo <bpmn2:scriptTask id="callAAIQuery_scriptTask" name="Query AAI for Volume Group Info" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() deleteVfMod.executeMethod('queryAAIForVolumeGroup', execution, isDebugLogEnabled) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_13" name="" sourceRef="callAAIQuery_scriptTask" targetRef="ExclusiveGateway_3" /> <bpmn2:scriptTask id="ScriptTask_2" name="Handle TenantId Mismatch" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_21</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_22</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() -deleteVfMod.executeMethod('handleTenantIdMismatch', execution, isDebugLogEnabled)]]></bpmn2:script> +deleteVfMod.executeMethod('handleTenantIdMismatch', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_22" name="" sourceRef="ScriptTask_2" targetRef="EndEvent_5" /> <bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="ScriptTask_callRestCloudRegion" targetRef="ExclusiveGateway_1" /> @@ -89,7 +89,7 @@ deleteVfMod.executeMethod('handleTenantIdMismatch', execution, isDebugLogEnabled </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_3" /> <bpmn2:sequenceFlow id="SequenceFlow_8" name="" sourceRef="ExclusiveGateway_1" targetRef="callAAIQuery_scriptTask"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELVfModVol_isCloudRegionGood") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELVfModVol_isCloudRegionGood") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:endEvent id="EndEvent_3"> <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming> @@ -109,9 +109,9 @@ deleteVfMod.executeMethod('handleTenantIdMismatch', execution, isDebugLogEnabled <bpmn2:scriptTask id="ScriptTask_4" name="Send Sync Ack Error" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_responseNotSent</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() -deleteVfMod.executeMethod('sendSyncError', execution, isDebugLogEnabled)]]></bpmn2:script> +deleteVfMod.executeMethod('sendSyncError', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_responseNotSent" name="No" sourceRef="ExclusiveGateway_synResponseSent" targetRef="ScriptTask_4" /> <bpmn2:sequenceFlow id="SequenceFlow_responseSent" name="Yes" sourceRef="ExclusiveGateway_synResponseSent" targetRef="prepareFalloutHandler_ScriptTask"> @@ -121,10 +121,10 @@ deleteVfMod.executeMethod('sendSyncError', execution, isDebugLogEnabled)]]></bpm <bpmn2:incoming>SequenceFlow_responseSent</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_25</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() deleteVfMod.executeMethod('prepareFalloutHandler', execution, isDebugLogEnabled) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_25" name="" sourceRef="prepareFalloutHandler_ScriptTask" targetRef="faultHandler_CallActivity" /> <bpmn2:callActivity id="faultHandler_CallActivity" name="Call FalloutHandlerV1" calledElement="FalloutHandler"> @@ -151,27 +151,27 @@ deleteVfMod.executeMethod('prepareFalloutHandler', execution, isDebugLogEnabled) <bpmn2:scriptTask id="prepareDBInfraRequest_ScriptTask" name="Prepare DB Infra Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_35</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_37</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() deleteVfMod.executeMethod('prepareDBRequest', execution, isDebugLogEnabled) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_37" name="" sourceRef="prepareDBInfraRequest_ScriptTask" targetRef="callDBInfra_ServiceTask" /> <bpmn2:scriptTask id="postProcessAndCompletionRequest_ScriptTask" name="Prepare Completion Handler Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_27</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_29</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() deleteVfMod.executeMethod('prepareCompletionHandlerRequest', execution, isDebugLogEnabled) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_29" name="" sourceRef="postProcessAndCompletionRequest_ScriptTask" targetRef="callCompleteMsoProcess_CallActivity" /> <bpmn2:scriptTask id="ScriptTask_3" name="Set Success" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_24</bpmn2:outgoing> - <bpmn2:script><![CDATA[// The following variable is checked by the unit test -execution.setVariable("DELVfModVol_TransactionSuccessIndicator", true)]]></bpmn2:script> + <bpmn2:script>// The following variable is checked by the unit test +execution.setVariable("DELVfModVol_TransactionSuccessIndicator", true)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_24" name="" sourceRef="ScriptTask_3" targetRef="EndEvent_2" /> <bpmn2:callActivity id="callCompleteMsoProcess_CallActivity" name="Call CompleteMsoProcess" calledElement="CompleteMsoProcess"> @@ -197,7 +197,7 @@ execution.setVariable("DELVfModVol_TransactionSuccessIndicator", true)]]></bpmn2 <bpmn2:extensionElements> <camunda:connector> <camunda:inputOutput> - <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)}]]></camunda:inputParameter> + <camunda:inputParameter name="url">${UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)}</camunda:inputParameter> <camunda:inputParameter name="payload">${DELVfModVol_updateInfraRequest}</camunda:inputParameter> <camunda:inputParameter name="headers"> <camunda:map> @@ -219,9 +219,9 @@ execution.setVariable("DELVfModVol_TransactionSuccessIndicator", true)]]></bpmn2 <bpmn2:scriptTask id="callRESTDeleteVolGrpId_ScriptTask" name="Call REST Delete AAI Vol Grp Id" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_vnfAdapterCallOK</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_35</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DeleteVfModuleVolumeInfraV1() -deleteVfMod.executeMethod('deleteVolGrpId', execution, isDebugLogEnabled)]]></bpmn2:script> +deleteVfMod.executeMethod('deleteVolGrpId', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_35" name="" sourceRef="callRESTDeleteVolGrpId_ScriptTask" targetRef="prepareDBInfraRequest_ScriptTask" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_2" name="Is call to VNF Adapter OK?" default="SequenceFlow_vnfAdapterCallNotOK"> @@ -243,321 +243,321 @@ deleteVfMod.executeMethod('deleteVolGrpId', execution, isDebugLogEnabled)]]></bp <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteVfModuleVolumeInfraV1"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="deleteNetwork_startEvent"> - <dc:Bounds x="103" y="94" width="36" height="36" /> + <dc:Bounds x="223" y="94" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="89" y="135" width="65" height="22" /> + <dc:Bounds x="216" y="135" width="51" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_61" bpmnElement="preProcessRequest_ScriptTask"> - <dc:Bounds x="355" y="72" width="100" height="80" /> + <dc:Bounds x="475" y="72" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_47" targetElement="_BPMNShape_ScriptTask_61"> - <di:waypoint xsi:type="dc:Point" x="139" y="112" /> - <di:waypoint xsi:type="dc:Point" x="355" y="112" /> + <di:waypoint x="259" y="112" /> + <di:waypoint x="475" y="112" /> <bpmndi:BPMNLabel> <dc:Bounds x="116" y="12" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_62" bpmnElement="callAAIQuery_scriptTask"> - <dc:Bounds x="864" y="72" width="100" height="80" /> + <dc:Bounds x="984" y="72" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_3" bpmnElement="faultHandler_CallActivity"> - <dc:Bounds x="438" y="360" width="100" height="80" /> + <dc:Bounds x="558" y="360" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_4" bpmnElement="callCompleteMsoProcess_CallActivity"> - <dc:Bounds x="993" y="985" width="100" height="80" /> + <dc:Bounds x="1113" y="985" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_16" bpmnElement="subProcessException_SubProcess" isExpanded="true"> - <dc:Bounds x="37" y="288" width="660" height="337" /> + <dc:Bounds x="157" y="288" width="660" height="337" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_50" bpmnElement="subProcessStart_StartEvent"> - <dc:Bounds x="60" y="383" width="36" height="36" /> + <dc:Bounds x="180" y="383" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="45" y="424" width="67" height="22" /> + <dc:Bounds x="173" y="424" width="52" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_79" bpmnElement="prepareFalloutHandler_ScriptTask"> - <dc:Bounds x="288" y="360" width="100" height="80" /> + <dc:Bounds x="408" y="360" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_80" bpmnElement="postProcessAndCompletionRequest_ScriptTask"> - <dc:Bounds x="993" y="877" width="100" height="80" /> + <dc:Bounds x="1113" y="877" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_83" bpmnElement="prepareDBInfraRequest_ScriptTask"> - <dc:Bounds x="993" y="660" width="100" height="80" /> + <dc:Bounds x="1113" y="660" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_86" bpmnElement="callDBInfra_ServiceTask"> - <dc:Bounds x="993" y="769" width="100" height="80" /> + <dc:Bounds x="1113" y="769" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_7" sourceElement="_BPMNShape_ScriptTask_61" targetElement="_BPMNShape_ScriptTask_127"> - <di:waypoint xsi:type="dc:Point" x="455" y="112" /> - <di:waypoint xsi:type="dc:Point" x="496" y="112" /> + <di:waypoint x="575" y="112" /> + <di:waypoint x="616" y="112" /> <bpmndi:BPMNLabel> <dc:Bounds x="486" y="112" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_127" bpmnElement="sendSyncAckResponse_ScriptTask"> - <dc:Bounds x="496" y="72" width="100" height="80" /> + <dc:Bounds x="616" y="72" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_StartEvent_50" targetElement="_BPMNShape_ExclusiveGateway_255"> - <di:waypoint xsi:type="dc:Point" x="96" y="401" /> - <di:waypoint xsi:type="dc:Point" x="118" y="401" /> - <di:waypoint xsi:type="dc:Point" x="118" y="400" /> - <di:waypoint xsi:type="dc:Point" x="144" y="400" /> + <di:waypoint x="216" y="401" /> + <di:waypoint x="238" y="401" /> + <di:waypoint x="238" y="400" /> + <di:waypoint x="264" y="400" /> <bpmndi:BPMNLabel> <dc:Bounds x="99" y="401" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_38" bpmnElement="SequenceFlow_25" sourceElement="_BPMNShape_ScriptTask_79" targetElement="_BPMNShape_CallActivity_3"> - <di:waypoint xsi:type="dc:Point" x="388" y="400" /> - <di:waypoint xsi:type="dc:Point" x="438" y="400" /> + <di:waypoint x="508" y="400" /> + <di:waypoint x="558" y="400" /> <bpmndi:BPMNLabel> <dc:Bounds x="413" y="400" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_40" bpmnElement="SequenceFlow_27" sourceElement="_BPMNShape_ServiceTask_86" targetElement="_BPMNShape_ScriptTask_80"> - <di:waypoint xsi:type="dc:Point" x="1043" y="849" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="877" /> + <di:waypoint x="1163" y="849" /> + <di:waypoint x="1163" y="877" /> <bpmndi:BPMNLabel> <dc:Bounds x="1258" y="857" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_42" bpmnElement="SequenceFlow_29" sourceElement="_BPMNShape_ScriptTask_80" targetElement="_BPMNShape_CallActivity_4"> - <di:waypoint xsi:type="dc:Point" x="1043" y="957" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="985" /> + <di:waypoint x="1163" y="957" /> + <di:waypoint x="1163" y="985" /> <bpmndi:BPMNLabel> <dc:Bounds x="1289" y="898" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_134" bpmnElement="callRESTDeleteVolGrpId_ScriptTask"> - <dc:Bounds x="993" y="528" width="100" height="80" /> + <dc:Bounds x="1113" y="528" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_54" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_ScriptTask_134" targetElement="_BPMNShape_ScriptTask_83"> - <di:waypoint xsi:type="dc:Point" x="1043" y="608" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="660" /> + <di:waypoint x="1163" y="608" /> + <di:waypoint x="1163" y="660" /> <bpmndi:BPMNLabel> <dc:Bounds x="1291" y="557" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_58" bpmnElement="SequenceFlow_37" sourceElement="_BPMNShape_ScriptTask_83" targetElement="_BPMNShape_ServiceTask_86"> - <di:waypoint xsi:type="dc:Point" x="1043" y="740" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="769" /> + <di:waypoint x="1163" y="740" /> + <di:waypoint x="1163" y="769" /> <bpmndi:BPMNLabel> <dc:Bounds x="1258" y="751" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_22" bpmnElement="callVnfAdapterDeleteSubflow_CallActivity"> - <dc:Bounds x="993" y="300" width="100" height="80" /> + <dc:Bounds x="1113" y="300" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_160" bpmnElement="prepareVnfAdapterDelete_ScriptTask_1"> - <dc:Bounds x="993" y="180" width="100" height="80" /> + <dc:Bounds x="1113" y="180" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_160" targetElement="_BPMNShape_CallActivity_22"> - <di:waypoint xsi:type="dc:Point" x="1043" y="260" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="300" /> + <di:waypoint x="1163" y="260" /> + <di:waypoint x="1163" y="300" /> <bpmndi:BPMNLabel> <dc:Bounds x="1112" y="280" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_CallActivity_22" targetElement="_BPMNShape_ExclusiveGateway_252"> - <di:waypoint xsi:type="dc:Point" x="1043" y="380" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="401" /> - <di:waypoint xsi:type="dc:Point" x="1042" y="401" /> - <di:waypoint xsi:type="dc:Point" x="1042" y="422" /> + <di:waypoint x="1163" y="380" /> + <di:waypoint x="1163" y="401" /> + <di:waypoint x="1162" y="401" /> + <di:waypoint x="1162" y="422" /> <bpmndi:BPMNLabel> <dc:Bounds x="1039" y="415" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_163" bpmnElement="EndEvent_1"> - <dc:Bounds x="588" y="382" width="36" height="36" /> + <dc:Bounds x="708" y="382" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="606" y="423" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_CallActivity_3" targetElement="_BPMNShape_EndEvent_163"> - <di:waypoint xsi:type="dc:Point" x="538" y="400" /> - <di:waypoint xsi:type="dc:Point" x="588" y="400" /> + <di:waypoint x="658" y="400" /> + <di:waypoint x="708" y="400" /> <bpmndi:BPMNLabel> <dc:Bounds x="558" y="400" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_167" bpmnElement="EndEvent_2"> - <dc:Bounds x="1025" y="1201" width="36" height="36" /> + <dc:Bounds x="1145" y="1201" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1029" y="1242" width="29" height="22" /> + <dc:Bounds x="1154" y="1242" width="20" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_CallActivity_4" targetElement="_BPMNShape_ScriptTask_241"> - <di:waypoint xsi:type="dc:Point" x="1043" y="1065" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="1093" /> + <di:waypoint x="1163" y="1065" /> + <di:waypoint x="1163" y="1093" /> <bpmndi:BPMNLabel> <dc:Bounds x="1258" y="1083" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_234" bpmnElement="ScriptTask_4"> - <dc:Bounds x="120" y="492" width="100" height="80" /> + <dc:Bounds x="240" y="492" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_ScriptTask_127" targetElement="_BPMNShape_ScriptTask_251"> - <di:waypoint xsi:type="dc:Point" x="596" y="112" /> - <di:waypoint xsi:type="dc:Point" x="623" y="112" /> - <di:waypoint xsi:type="dc:Point" x="623" y="115" /> - <di:waypoint xsi:type="dc:Point" x="636" y="115" /> + <di:waypoint x="716" y="112" /> + <di:waypoint x="743" y="112" /> + <di:waypoint x="743" y="115" /> + <di:waypoint x="756" y="115" /> <bpmndi:BPMNLabel> <dc:Bounds x="613" y="112" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_ScriptTask_62" targetElement="_BPMNShape_ExclusiveGateway_203"> - <di:waypoint xsi:type="dc:Point" x="964" y="112" /> - <di:waypoint xsi:type="dc:Point" x="1017" y="111" /> + <di:waypoint x="1084" y="112" /> + <di:waypoint x="1137" y="111" /> <bpmndi:BPMNLabel> <dc:Bounds x="1067" y="113" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_203" bpmnElement="ExclusiveGateway_3" isMarkerVisible="true"> - <dc:Bounds x="1017" y="86" width="50" height="50" /> + <dc:Bounds x="1137" y="86" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="984" y="60" width="102" height="22" /> + <dc:Bounds x="1115" y="60" width="81" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_240" bpmnElement="ScriptTask_2"> - <dc:Bounds x="1104" y="72" width="100" height="80" /> + <dc:Bounds x="1224" y="72" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ExclusiveGateway_203" targetElement="_BPMNShape_ScriptTask_160"> - <di:waypoint xsi:type="dc:Point" x="1042" y="136" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="180" /> + <di:waypoint x="1162" y="136" /> + <di:waypoint x="1163" y="180" /> <bpmndi:BPMNLabel> <dc:Bounds x="1040" y="122" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_16" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_ExclusiveGateway_203" targetElement="_BPMNShape_ScriptTask_240"> - <di:waypoint xsi:type="dc:Point" x="1067" y="111" /> - <di:waypoint xsi:type="dc:Point" x="1085" y="111" /> - <di:waypoint xsi:type="dc:Point" x="1085" y="112" /> - <di:waypoint xsi:type="dc:Point" x="1104" y="112" /> + <di:waypoint x="1187" y="111" /> + <di:waypoint x="1205" y="111" /> + <di:waypoint x="1205" y="112" /> + <di:waypoint x="1224" y="112" /> <bpmndi:BPMNLabel> <dc:Bounds x="1216" y="113" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_178" bpmnElement="EndEvent_5"> - <dc:Bounds x="1242" y="95" width="36" height="36" /> + <dc:Bounds x="1362" y="95" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1260" y="136" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_22" sourceElement="_BPMNShape_ScriptTask_240" targetElement="_BPMNShape_EndEvent_178"> - <di:waypoint xsi:type="dc:Point" x="1204" y="112" /> - <di:waypoint xsi:type="dc:Point" x="1222" y="112" /> - <di:waypoint xsi:type="dc:Point" x="1222" y="113" /> - <di:waypoint xsi:type="dc:Point" x="1242" y="113" /> + <di:waypoint x="1324" y="112" /> + <di:waypoint x="1342" y="112" /> + <di:waypoint x="1342" y="113" /> + <di:waypoint x="1362" y="113" /> <bpmndi:BPMNLabel> <dc:Bounds x="1220" y="113" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_241" bpmnElement="ScriptTask_3"> - <dc:Bounds x="993" y="1093" width="100" height="80" /> + <dc:Bounds x="1113" y="1093" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_24" sourceElement="_BPMNShape_ScriptTask_241" targetElement="_BPMNShape_EndEvent_167"> - <di:waypoint xsi:type="dc:Point" x="1043" y="1173" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="1201" /> + <di:waypoint x="1163" y="1173" /> + <di:waypoint x="1163" y="1201" /> <bpmndi:BPMNLabel> <dc:Bounds x="1040" y="1320" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_251" bpmnElement="ScriptTask_callRestCloudRegion"> - <dc:Bounds x="636" y="75" width="100" height="80" /> + <dc:Bounds x="756" y="75" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_223" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true"> - <dc:Bounds x="774" y="89" width="50" height="50" /> + <dc:Bounds x="894" y="89" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="735" y="40" width="125" height="22" /> + <dc:Bounds x="879" y="40" width="78" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_215" bpmnElement="EndEvent_3"> - <dc:Bounds x="781" y="170" width="36" height="36" /> + <dc:Bounds x="901" y="170" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="799" y="211" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ExclusiveGateway_223" targetElement="_BPMNShape_EndEvent_215"> - <di:waypoint xsi:type="dc:Point" x="798" y="139" /> - <di:waypoint xsi:type="dc:Point" x="798" y="153" /> - <di:waypoint xsi:type="dc:Point" x="799" y="153" /> - <di:waypoint xsi:type="dc:Point" x="799" y="170" /> + <di:waypoint x="918" y="139" /> + <di:waypoint x="918" y="153" /> + <di:waypoint x="919" y="153" /> + <di:waypoint x="919" y="170" /> <bpmndi:BPMNLabel> <dc:Bounds x="796" y="166" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ScriptTask_251" targetElement="_BPMNShape_ExclusiveGateway_223"> - <di:waypoint xsi:type="dc:Point" x="736" y="115" /> - <di:waypoint xsi:type="dc:Point" x="754" y="115" /> - <di:waypoint xsi:type="dc:Point" x="754" y="114" /> - <di:waypoint xsi:type="dc:Point" x="774" y="114" /> + <di:waypoint x="856" y="115" /> + <di:waypoint x="874" y="115" /> + <di:waypoint x="874" y="114" /> + <di:waypoint x="894" y="114" /> <bpmndi:BPMNLabel> <dc:Bounds x="752" y="114" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_ExclusiveGateway_223" targetElement="_BPMNShape_ScriptTask_62"> - <di:waypoint xsi:type="dc:Point" x="824" y="114" /> - <di:waypoint xsi:type="dc:Point" x="844" y="114" /> - <di:waypoint xsi:type="dc:Point" x="844" y="112" /> - <di:waypoint xsi:type="dc:Point" x="864" y="112" /> + <di:waypoint x="944" y="114" /> + <di:waypoint x="964" y="114" /> + <di:waypoint x="964" y="112" /> + <di:waypoint x="984" y="112" /> <bpmndi:BPMNLabel> <dc:Bounds x="841" y="113" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_252" bpmnElement="ExclusiveGateway_2" isMarkerVisible="true"> - <dc:Bounds x="1017" y="422" width="50" height="50" /> + <dc:Bounds x="1137" y="422" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="960" y="477" width="164" height="22" /> + <dc:Bounds x="1129" y="477" width="66" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_vnfAdapterCallOK" sourceElement="_BPMNShape_ExclusiveGateway_252" targetElement="_BPMNShape_ScriptTask_134"> - <di:waypoint xsi:type="dc:Point" x="1042" y="472" /> - <di:waypoint xsi:type="dc:Point" x="1043" y="528" /> + <di:waypoint x="1162" y="472" /> + <di:waypoint x="1163" y="528" /> <bpmndi:BPMNLabel> <dc:Bounds x="1040" y="500" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_236" bpmnElement="EndEvent_6"> - <dc:Bounds x="1168" y="430" width="36" height="36" /> + <dc:Bounds x="1288" y="430" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1186" y="471" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_vnfAdapterCallNotOK" sourceElement="_BPMNShape_ExclusiveGateway_252" targetElement="_BPMNShape_EndEvent_236"> - <di:waypoint xsi:type="dc:Point" x="1067" y="447" /> - <di:waypoint xsi:type="dc:Point" x="1117" y="447" /> - <di:waypoint xsi:type="dc:Point" x="1117" y="448" /> - <di:waypoint xsi:type="dc:Point" x="1168" y="448" /> + <di:waypoint x="1187" y="447" /> + <di:waypoint x="1237" y="447" /> + <di:waypoint x="1237" y="448" /> + <di:waypoint x="1288" y="448" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_255" bpmnElement="ExclusiveGateway_synResponseSent" isMarkerVisible="true"> - <dc:Bounds x="144" y="375" width="50" height="50" /> + <dc:Bounds x="264" y="375" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="106" y="439" width="129" height="22" /> + <dc:Bounds x="254" y="439" width="73" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_17" bpmnElement="SequenceFlow_responseNotSent" sourceElement="_BPMNShape_ExclusiveGateway_255" targetElement="_BPMNShape_ScriptTask_234"> - <di:waypoint xsi:type="dc:Point" x="169" y="425" /> - <di:waypoint xsi:type="dc:Point" x="169" y="458" /> - <di:waypoint xsi:type="dc:Point" x="170" y="458" /> - <di:waypoint xsi:type="dc:Point" x="170" y="492" /> + <di:waypoint x="289" y="425" /> + <di:waypoint x="289" y="458" /> + <di:waypoint x="290" y="458" /> + <di:waypoint x="290" y="492" /> <bpmndi:BPMNLabel> - <dc:Bounds x="159" y="458" width="22" height="22" /> + <dc:Bounds x="283" y="458" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20" bpmnElement="SequenceFlow_responseSent" sourceElement="_BPMNShape_ExclusiveGateway_255" targetElement="_BPMNShape_ScriptTask_79"> - <di:waypoint xsi:type="dc:Point" x="194" y="400" /> - <di:waypoint xsi:type="dc:Point" x="288" y="400" /> + <di:waypoint x="314" y="400" /> + <di:waypoint x="408" y="400" /> <bpmndi:BPMNLabel> - <dc:Bounds x="204" y="400" width="29" height="22" /> + <dc:Bounds x="330" y="400" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_22" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_234" targetElement="_BPMNShape_ScriptTask_79"> - <di:waypoint xsi:type="dc:Point" x="220" y="532" /> - <di:waypoint xsi:type="dc:Point" x="254" y="532" /> - <di:waypoint xsi:type="dc:Point" x="336" y="532" /> - <di:waypoint xsi:type="dc:Point" x="336" y="508" /> - <di:waypoint xsi:type="dc:Point" x="336" y="482" /> - <di:waypoint xsi:type="dc:Point" x="337" y="440" /> + <di:waypoint x="340" y="532" /> + <di:waypoint x="374" y="532" /> + <di:waypoint x="456" y="532" /> + <di:waypoint x="456" y="508" /> + <di:waypoint x="456" y="482" /> + <di:waypoint x="457" y="440" /> <bpmndi:BPMNLabel> <dc:Bounds x="317" y="532" width="6" height="6" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/UpdateVfModuleVolumeInfraV1.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/UpdateVfModuleVolumeInfraV1.bpmn index ce346e13b3..4826d88d8a 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/UpdateVfModuleVolumeInfraV1.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/UpdateVfModuleVolumeInfraV1.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_ZBLUcCkQEeaY6ZhIaNLwzg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_ZBLUcCkQEeaY6ZhIaNLwzg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="UpdateVfModuleVolumeInfraV1" name="UpdateVfModuleVolumeInfraV1" isExecutable="true"> <bpmn2:endEvent id="EndEvent_4" name="TheEnd"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> @@ -21,7 +21,7 @@ <bpmn2:extensionElements> <camunda:connector> <camunda:inputOutput> - <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)}]]></camunda:inputParameter> + <camunda:inputParameter name="url">${UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)}</camunda:inputParameter> <camunda:inputParameter name="payload">${UPDVfModVol_updateInfraRequest}</camunda:inputParameter> <camunda:inputParameter name="headers"> <camunda:map> @@ -43,26 +43,26 @@ <bpmn2:scriptTask id="ScriptTask_prepVnfRest" name="Prepare VNF Adapter Rest Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_22</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_21</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('prepVnfAdapterRest', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('prepVnfAdapterRest', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_21" name="" sourceRef="ScriptTask_prepVnfRest" targetRef="CallActivity_callVNFAdapterRest" /> <bpmn2:scriptTask id="ScriptTask_prepCompletionHandlerRequest" name="Prep Completion Handler Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('prepCompletionHandlerRequest', execution, UPDVfModVol_requestId, 'UPDATE', UPDVfModVol_source, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('prepCompletionHandlerRequest', execution, UPDVfModVol_requestId, 'UPDATE', UPDVfModVol_source, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_13" name="" sourceRef="ScriptTask_prepCompletionHandlerRequest" targetRef="CallActivity_completionHandler" /> - <bpmn2:callActivity id="CallActivity_callVNFAdapterRest" name="VNFAdapterRest" calledElement="vnfAdapterTask"> + <bpmn2:callActivity id="CallActivity_callVNFAdapterRest" name="VNFAdapterRest" calledElement="openstackAdapterTask"> <bpmn2:extensionElements> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:out source="WorkflowResponse" target="UPDVfModVol_vnfAdapterRestResponse" /> <camunda:out source="WorkflowException" target="WorkflowException" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> - <camunda:in source="UPDVfModVol_vnfAdapterRestRequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="UPDVfModVol_vnfAdapterRestRequest" target="openstackAdapterTaskRequest" /> </bpmn2:extensionElements> <bpmn2:incoming>SequenceFlow_21</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_19</bpmn2:outgoing> @@ -71,16 +71,16 @@ uvmv.executeMethod('prepCompletionHandlerRequest', execution, UPDVfModVol_reques <bpmn2:scriptTask id="ScriptTask_prepDbInfraRequest" name="Prep DB Infra Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_19</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_11</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('prepDbInfraDbRequest', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('prepDbInfraDbRequest', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_11" name="" sourceRef="ScriptTask_prepDbInfraRequest" targetRef="ServiceTask_callUpdateInfraDb" /> <bpmn2:scriptTask id="ScriptTask_postProcessTemp" name="Set Success" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> - <bpmn2:script><![CDATA[// The following variable is checked by the unit test -execution.setVariable("UpdateVfModuleVolumeSuccessIndicator", true)]]></bpmn2:script> + <bpmn2:script>// The following variable is checked by the unit test +execution.setVariable("UpdateVfModuleVolumeSuccessIndicator", true)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="ScriptTask_postProcessTemp" targetRef="EndEvent_4" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_2"> @@ -101,9 +101,9 @@ execution.setVariable("UpdateVfModuleVolumeSuccessIndicator", true)]]></bpmn2:sc <bpmn2:scriptTask id="ScriptTask_preFalloutHandler" name="Fallout Handler (prep)" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('prepFalloutHandler', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('prepFalloutHandler', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="ScriptTask_preFalloutHandler" targetRef="CallActivity_falloutHandler" /> <bpmn2:callActivity id="CallActivity_falloutHandler" name="Fallout Handler" calledElement="FalloutHandler"> @@ -134,17 +134,17 @@ uvmv.executeMethod('prepFalloutHandler', execution, isDebugLogEnabled)]]></bpmn2 <bpmn2:scriptTask id="ScriptTask_queryAaiForVfModule" name="Query AAI for VF Module" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_YesVfModuleRelation</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('queryAAIForVfModule', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('queryAAIForVfModule', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_8" name="" sourceRef="ScriptTask_queryAaiForVfModule" targetRef="ExclusiveGateway_personaModelIdMatch" /> <bpmn2:scriptTask id="ScriptTask_handlePersonaModelIdMismatch" name="Handle Persona Model ID Mismatch" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_personaModelidMatchNo</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_18</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('handlePersonaModelIdMismatch', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('handlePersonaModelIdMismatch', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_18" name="" sourceRef="ScriptTask_handlePersonaModelIdMismatch" targetRef="EndEvent_personaModelIdMismatch" /> <bpmn2:endEvent id="EndEvent_personaModelIdMismatch"> @@ -154,9 +154,9 @@ uvmv.executeMethod('handlePersonaModelIdMismatch', execution, isDebugLogEnabled) <bpmn2:scriptTask id="ScriptTask_preProcessRequest" name="Pre-process Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('preProcessRequest', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('preProcessRequest', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="ScriptTask_preProcessRequest" targetRef="ScriptTask_sendSynchResponse" /> <bpmn2:startEvent id="StartEvent_1" name="Start"> @@ -166,9 +166,9 @@ uvmv.executeMethod('preProcessRequest', execution, isDebugLogEnabled)]]></bpmn2: <bpmn2:scriptTask id="ScriptTask_sendSynchResponse" name="Send Synch Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_20</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('sendSynchResponse', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('sendSynchResponse', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_20" name="" sourceRef="ScriptTask_sendSynchResponse" targetRef="ScriptTask_queryAaiGenricVnf" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="VF-MODULE relation?" default="SequenceFlow_noVfModuleRelation"> @@ -177,7 +177,7 @@ uvmv.executeMethod('sendSynchResponse', execution, isDebugLogEnabled)]]></bpmn2: <bpmn2:outgoing>SequenceFlow_noVfModuleRelation</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_YesVfModuleRelation" name="Yes" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_queryAaiForVfModule"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{UPDVfModVol_relatedVfModuleLink != ''}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{UPDVfModVol_relatedVfModuleLink != ''}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_noVfModuleRelation" name="No" sourceRef="ExclusiveGateway_1" targetRef="ExclusiveGateway_2" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_isTenantMatch" name="TenantId Match?" default="SequenceFlow_NoTenantMatch"> @@ -192,9 +192,9 @@ uvmv.executeMethod('sendSynchResponse', execution, isDebugLogEnabled)]]></bpmn2: <bpmn2:scriptTask id="ScriptTask_tenantIdMismatch" name="Handle TenantId Mismatch" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_NoTenantMatch</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_17</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('handleTenantIdMismatch', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('handleTenantIdMismatch', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_17" name="" sourceRef="ScriptTask_tenantIdMismatch" targetRef="EndEvent_2" /> <bpmn2:endEvent id="EndEvent_2"> @@ -204,17 +204,17 @@ uvmv.executeMethod('handleTenantIdMismatch', execution, isDebugLogEnabled)]]></b <bpmn2:scriptTask id="ScriptTask_queryAAI" name="Query AAI for Volume Group Info" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_15</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('queryAAIForVolumeGroup', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('queryAAIForVolumeGroup', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_15" name="" sourceRef="ScriptTask_queryAAI" targetRef="ExclusiveGateway_isTenantMatch" /> <bpmn2:scriptTask id="ScriptTask_queryAaiGenricVnf" name="Query AAI for Generic VNF" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_20</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def uvmv = new UpdateVfModuleVolumeInfraV1() -uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bpmn2:script> +uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="ScriptTask_queryAaiGenricVnf" targetRef="ScriptTask_queryAAI" /> </bpmn2:process> @@ -228,10 +228,10 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="_BPMNShape_StartEvent_62" targetElement="_BPMNShape_ScriptTask_231"> - <di:waypoint xsi:type="dc:Point" x="227" y="149" /> - <di:waypoint xsi:type="dc:Point" x="268" y="149" /> - <di:waypoint xsi:type="dc:Point" x="268" y="150" /> - <di:waypoint xsi:type="dc:Point" x="295" y="150" /> + <di:waypoint x="227" y="149" /> + <di:waypoint x="268" y="149" /> + <di:waypoint x="268" y="150" /> + <di:waypoint x="295" y="150" /> <bpmndi:BPMNLabel> <dc:Bounds x="248" y="149" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -249,8 +249,8 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp <dc:Bounds x="454" y="112" width="109" height="76" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_231" targetElement="_BPMNShape_ScriptTask_232"> - <di:waypoint xsi:type="dc:Point" x="403" y="150" /> - <di:waypoint xsi:type="dc:Point" x="454" y="150" /> + <di:waypoint x="403" y="150" /> + <di:waypoint x="454" y="150" /> <bpmndi:BPMNLabel> <dc:Bounds x="418" y="150" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -262,15 +262,15 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp <dc:Bounds x="868" y="420" width="109" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_11" sourceElement="_BPMNShape_ScriptTask_233" targetElement="_BPMNShape_ServiceTask_101"> - <di:waypoint xsi:type="dc:Point" x="838" y="460" /> - <di:waypoint xsi:type="dc:Point" x="868" y="460" /> + <di:waypoint x="838" y="460" /> + <di:waypoint x="868" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="853" y="491" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_ServiceTask_101" targetElement="_BPMNShape_ScriptTask_234"> - <di:waypoint xsi:type="dc:Point" x="976" y="460" /> - <di:waypoint xsi:type="dc:Point" x="1014" y="460" /> + <di:waypoint x="976" y="460" /> + <di:waypoint x="1014" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="959" y="497" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -282,15 +282,15 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp <dc:Bounds x="1162" y="429" width="109" height="61" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_ScriptTask_234" targetElement="_BPMNShape_CallActivity_43"> - <di:waypoint xsi:type="dc:Point" x="1122" y="460" /> - <di:waypoint xsi:type="dc:Point" x="1162" y="459" /> + <di:waypoint x="1122" y="460" /> + <di:waypoint x="1162" y="459" /> <bpmndi:BPMNLabel> <dc:Bounds x="1134" y="477" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_CallActivity_43" targetElement="_BPMNShape_ScriptTask_230"> - <di:waypoint xsi:type="dc:Point" x="1270" y="459" /> - <di:waypoint xsi:type="dc:Point" x="1318" y="460" /> + <di:waypoint x="1270" y="459" /> + <di:waypoint x="1318" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="1216" y="521" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -308,15 +308,15 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp <dc:Bounds x="1064" y="112" width="97" height="75" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ScriptTask_235" targetElement="_BPMNShape_ExclusiveGateway_126"> - <di:waypoint xsi:type="dc:Point" x="850" y="149" /> - <di:waypoint xsi:type="dc:Point" x="931" y="149" /> + <di:waypoint x="850" y="149" /> + <di:waypoint x="931" y="149" /> <bpmndi:BPMNLabel> <dc:Bounds x="877" y="149" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_16" bpmnElement="SequenceFlow_NoTenantMatch" sourceElement="_BPMNShape_ExclusiveGateway_126" targetElement="_BPMNShape_ScriptTask_236"> - <di:waypoint xsi:type="dc:Point" x="965" y="149" /> - <di:waypoint xsi:type="dc:Point" x="1064" y="149" /> + <di:waypoint x="965" y="149" /> + <di:waypoint x="1064" y="149" /> <bpmndi:BPMNLabel> <dc:Bounds x="986" y="149" width="22" height="22" /> </bpmndi:BPMNLabel> @@ -328,31 +328,31 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_17" bpmnElement="SequenceFlow_17" sourceElement="_BPMNShape_ScriptTask_236" targetElement="_BPMNShape_EndEvent_169"> - <di:waypoint xsi:type="dc:Point" x="1160" y="149" /> - <di:waypoint xsi:type="dc:Point" x="1225" y="149" /> + <di:waypoint x="1160" y="149" /> + <di:waypoint x="1225" y="149" /> <bpmndi:BPMNLabel> <dc:Bounds x="1179" y="149" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_tenantIsMatch" sourceElement="_BPMNShape_ExclusiveGateway_126" targetElement="_BPMNShape_ExclusiveGateway_254"> - <di:waypoint xsi:type="dc:Point" x="948" y="166" /> - <di:waypoint xsi:type="dc:Point" x="948" y="244" /> + <di:waypoint x="948" y="166" /> + <di:waypoint x="948" y="244" /> <bpmndi:BPMNLabel> <dc:Bounds x="915" y="173" width="29" height="22" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_CallActivity_42" targetElement="_BPMNShape_ScriptTask_233"> - <di:waypoint xsi:type="dc:Point" x="691" y="460" /> - <di:waypoint xsi:type="dc:Point" x="730" y="460" /> + <di:waypoint x="691" y="460" /> + <di:waypoint x="730" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="712" y="531" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20" bpmnElement="SequenceFlow_20" sourceElement="_BPMNShape_ScriptTask_232" targetElement="_BPMNShape_ScriptTask_318"> - <di:waypoint xsi:type="dc:Point" x="562" y="150" /> - <di:waypoint xsi:type="dc:Point" x="581" y="150" /> - <di:waypoint xsi:type="dc:Point" x="581" y="149" /> - <di:waypoint xsi:type="dc:Point" x="612" y="149" /> + <di:waypoint x="562" y="150" /> + <di:waypoint x="581" y="150" /> + <di:waypoint x="581" y="149" /> + <di:waypoint x="612" y="149" /> <bpmndi:BPMNLabel> <dc:Bounds x="578" y="150" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -361,8 +361,8 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp <dc:Bounds x="454" y="420" width="109" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_21" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_ScriptTask_237" targetElement="_BPMNShape_CallActivity_42"> - <di:waypoint xsi:type="dc:Point" x="562" y="460" /> - <di:waypoint xsi:type="dc:Point" x="591" y="460" /> + <di:waypoint x="562" y="460" /> + <di:waypoint x="591" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="446" y="460" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -383,8 +383,8 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp <dc:Bounds x="639" y="832" width="109" height="61" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ScriptTask_238" targetElement="_BPMNShape_CallActivity_44"> - <di:waypoint xsi:type="dc:Point" x="553" y="862" /> - <di:waypoint xsi:type="dc:Point" x="639" y="862" /> + <di:waypoint x="553" y="862" /> + <di:waypoint x="639" y="862" /> <bpmndi:BPMNLabel> <dc:Bounds x="573" y="946" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -396,8 +396,8 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_CallActivity_44" targetElement="_BPMNShape_EndEvent_170"> - <di:waypoint xsi:type="dc:Point" x="747" y="862" /> - <di:waypoint xsi:type="dc:Point" x="862" y="862" /> + <di:waypoint x="747" y="862" /> + <di:waypoint x="862" y="862" /> <bpmndi:BPMNLabel> <dc:Bounds x="765" y="1030" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -409,15 +409,15 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_ScriptTask_230" targetElement="_BPMNShape_EndEvent_171"> - <di:waypoint xsi:type="dc:Point" x="1426" y="460" /> - <di:waypoint xsi:type="dc:Point" x="1461" y="459" /> + <di:waypoint x="1426" y="460" /> + <di:waypoint x="1461" y="459" /> <bpmndi:BPMNLabel> <dc:Bounds x="1442" y="467" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="_BPMNShape_StartEvent_63" targetElement="_BPMNShape_ScriptTask_238"> - <di:waypoint xsi:type="dc:Point" x="337" y="862" /> - <di:waypoint xsi:type="dc:Point" x="445" y="862" /> + <di:waypoint x="337" y="862" /> + <di:waypoint x="445" y="862" /> <bpmndi:BPMNLabel> <dc:Bounds x="385" y="1030" width="6" height="6" /> </bpmndi:BPMNLabel> @@ -429,10 +429,10 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_YesVfModuleRelation" sourceElement="_BPMNShape_ExclusiveGateway_254" targetElement="_BPMNShape_ScriptTask_313"> - <di:waypoint xsi:type="dc:Point" x="931" y="261" /> - <di:waypoint xsi:type="dc:Point" x="634" y="261" /> - <di:waypoint xsi:type="dc:Point" x="634" y="262" /> - <di:waypoint xsi:type="dc:Point" x="405" y="262" /> + <di:waypoint x="931" y="261" /> + <di:waypoint x="634" y="261" /> + <di:waypoint x="634" y="262" /> + <di:waypoint x="405" y="262" /> <bpmndi:BPMNLabel> <dc:Bounds x="729" y="261" width="29" height="22" /> </bpmndi:BPMNLabel> @@ -447,16 +447,16 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_ScriptTask_313" targetElement="_BPMNShape_ExclusiveGateway_255"> - <di:waypoint xsi:type="dc:Point" x="350" y="302" /> - <di:waypoint xsi:type="dc:Point" x="350" y="329" /> - <di:waypoint xsi:type="dc:Point" x="350" y="346" /> + <di:waypoint x="350" y="302" /> + <di:waypoint x="350" y="329" /> + <di:waypoint x="350" y="346" /> <bpmndi:BPMNLabel> <dc:Bounds x="347" y="318" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_personaModelIdMatchYes" sourceElement="_BPMNShape_ExclusiveGateway_255" targetElement="_BPMNShape_ExclusiveGateway_256"> - <di:waypoint xsi:type="dc:Point" x="367" y="363" /> - <di:waypoint xsi:type="dc:Point" x="491" y="363" /> + <di:waypoint x="367" y="363" /> + <di:waypoint x="491" y="363" /> <bpmndi:BPMNLabel> <dc:Bounds x="398" y="363" width="29" height="22" /> </bpmndi:BPMNLabel> @@ -468,18 +468,18 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_noVfModuleRelation" sourceElement="_BPMNShape_ExclusiveGateway_254" targetElement="_BPMNShape_ExclusiveGateway_256"> - <di:waypoint xsi:type="dc:Point" x="948" y="278" /> - <di:waypoint xsi:type="dc:Point" x="948" y="363" /> - <di:waypoint xsi:type="dc:Point" x="701" y="363" /> - <di:waypoint xsi:type="dc:Point" x="525" y="363" /> + <di:waypoint x="948" y="278" /> + <di:waypoint x="948" y="363" /> + <di:waypoint x="701" y="363" /> + <di:waypoint x="525" y="363" /> <bpmndi:BPMNLabel> <dc:Bounds x="795" y="363" width="22" height="22" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_22" bpmnElement="SequenceFlow_personaModelidMatchNo" sourceElement="_BPMNShape_ExclusiveGateway_255" targetElement="_BPMNShape_ScriptTask_315"> - <di:waypoint xsi:type="dc:Point" x="350" y="380" /> - <di:waypoint xsi:type="dc:Point" x="350" y="401" /> - <di:waypoint xsi:type="dc:Point" x="351" y="460" /> + <di:waypoint x="350" y="380" /> + <di:waypoint x="350" y="401" /> + <di:waypoint x="351" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="350" y="409" width="22" height="22" /> </bpmndi:BPMNLabel> @@ -494,22 +494,22 @@ uvmv.executeMethod('queryAAIForGenericVnf', execution, isDebugLogEnabled)]]></bp </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_24" bpmnElement="SequenceFlow_18" sourceElement="_BPMNShape_ScriptTask_315" targetElement="_BPMNShape_EndEvent_172"> - <di:waypoint xsi:type="dc:Point" x="351" y="540" /> - <di:waypoint xsi:type="dc:Point" x="351" y="600" /> + <di:waypoint x="351" y="540" /> + <di:waypoint x="351" y="600" /> <bpmndi:BPMNLabel> <dc:Bounds x="348" y="560" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_25" bpmnElement="SequenceFlow_22" sourceElement="_BPMNShape_ExclusiveGateway_256" targetElement="_BPMNShape_ScriptTask_237"> - <di:waypoint xsi:type="dc:Point" x="508" y="380" /> - <di:waypoint xsi:type="dc:Point" x="508" y="420" /> + <di:waypoint x="508" y="380" /> + <di:waypoint x="508" y="420" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_318" bpmnElement="ScriptTask_queryAaiGenricVnf"> <dc:Bounds x="612" y="112" width="97" height="75" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_318" targetElement="_BPMNShape_ScriptTask_235"> - <di:waypoint xsi:type="dc:Point" x="708" y="149" /> - <di:waypoint xsi:type="dc:Point" x="742" y="149" /> + <di:waypoint x="708" y="149" /> + <di:waypoint x="742" y="149" /> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstance.bpmn index c049eaafa0..76e6199fa6 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstance.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoCreateNetworkInstance" name="DoCreateNetworkInstance" isExecutable="true"> <bpmn2:startEvent id="createNetwork_startEvent" name="Start Flow"> <bpmn2:outgoing>SequenceFlow_1n61wit</bpmn2:outgoing> @@ -24,8 +24,7 @@ DoCreateNetworkInstance.callRESTQueryAAICloudRegion(execution)</bpmn2:script> <bpmn2:outgoing>SequenceFlow_11</bpmn2:outgoing> <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.prepareSDNCRequest(execution) -</bpmn2:script> +DoCreateNetworkInstance.prepareSDNCRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_11" name="" sourceRef="prepareSDNCTopoRequest_ScriptTask" targetRef="callAssignSDNCAdapter_CallActivity" /> <bpmn2:scriptTask id="validateSDNCResponse_ScriptTask" name="Validate SDNC Assign Response" scriptFormat="groovy"> @@ -78,13 +77,6 @@ DoCreateNetworkInstance.callRESTQueryAAINetworkId(execution)</bpmn2:script> <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing> </bpmn2:callActivity> <bpmn2:sequenceFlow id="SequenceFlow_12" name="" sourceRef="callAssignSDNCAdapter_CallActivity" targetRef="validateSDNCResponse_ScriptTask" /> - <bpmn2:scriptTask id="validateCreatePONetwork_ScriptTask" name="Validate Create PO Network" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_59</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing> - <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* -def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.validateCreateNetworkResponse(execution)</bpmn2:script> - </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="isNetworkActive_ExclusiveGateway" name="Is Network Active?" default="isNetworkActiveNo_SequenceFlow"> <bpmn2:incoming>isAAIQueryNameYes_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>isNetworkActiveYes_SequenceFlow</bpmn2:outgoing> @@ -149,7 +141,7 @@ DoCreateNetworkInstance.prepareSDNCRollbackRequest(execution)</bpmn2:script> <bpmn2:outgoing>isSdncRpc4No_SequenceFlow4</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isSdncRpc4Yes_SequenceFlow4" name="Yes" sourceRef="isSdncRpc4_ExclusiveGateway4" targetRef="Task_0q6pzpn"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'} </bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isSdncRpc4No_SequenceFlow4" name="No" sourceRef="isSdncRpc4_ExclusiveGateway4" targetRef="prepareSDNCRollbackRequest_ScriptTask" /> <bpmn2:scriptTask id="Task_0q6pzpn" name="Prepare RSRC SDNCRollback Request" scriptFormat="groovy"> @@ -163,7 +155,7 @@ DoCreateNetworkInstance.prepareRpcSDNCRollbackRequest(execution)</bpmn2:script> <bpmn2:incoming>SequenceFlow_1qwubew</bpmn2:incoming> </bpmn2:endEvent> <bpmn2:scriptTask id="ScriptTask_0myjg9k" name="Prepare RollbackData" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_15sffxc</bpmn2:incoming> + <bpmn2:incoming>Flow_15l1pk2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_096tad6</bpmn2:outgoing> <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() @@ -223,7 +215,7 @@ DoCreateNetworkInstance.postProcessResponse(execution)</bpmn2:script> <bpmn2:incoming>SequenceFlow_0bwpkkb</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_15sffxc</bpmn2:outgoing> </bpmn2:inclusiveGateway> - <bpmn2:sequenceFlow id="SequenceFlow_15sffxc" sourceRef="ExclusiveGateway_1qb2vwe" targetRef="ScriptTask_0myjg9k" /> + <bpmn2:sequenceFlow id="SequenceFlow_15sffxc" sourceRef="ExclusiveGateway_1qb2vwe" targetRef="validateCreatePONetwork_ScriptTask" /> <bpmn2:inclusiveGateway id="ExclusiveGateway_1bk0tqd"> <bpmn2:incoming>SequenceFlow_0b8j5rw</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_12tlymf</bpmn2:incoming> @@ -241,19 +233,24 @@ DoCreateNetworkInstance.postProcessResponse(execution)</bpmn2:script> <bpmn2:outgoing>SequenceFlow_10ttvwn</bpmn2:outgoing> <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.setExceptionFlag(execution) -</bpmn2:script> +DoCreateNetworkInstance.setExceptionFlag(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_10ttvwn" sourceRef="ScriptTask_0j3058g" targetRef="isRollbackOn_ExclusiveGateway" /> + <bpmn2:scriptTask id="validateCreatePONetwork_ScriptTask" name="Validate Create PO Network" scriptFormat="groovy"> + <bpmn2:incoming>SequenceFlow_15sffxc</bpmn2:incoming> + <bpmn2:outgoing>Flow_15l1pk2</bpmn2:outgoing> + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* +def DoCreateNetworkInstance = new DoCreateNetworkInstance() +DoCreateNetworkInstance.validateCreateNetworkResponse(execution)</bpmn2:script> + </bpmn2:scriptTask> + <bpmn2:sequenceFlow id="Flow_15l1pk2" sourceRef="validateCreatePONetwork_ScriptTask" targetRef="ScriptTask_0myjg9k" /> <bpmn2:textAnnotation id="TextAnnotation_1py1p84"> - <bpmn2:text> -Include ONLY inputs/varrables: + <bpmn2:text>Include ONLY inputs/varrables: rollbackData, as Map -rollbackSDNCRequest -rollbackActivateSDNCRequest -rollbackNetworkRequest -WorkflowException - </bpmn2:text> +WorkflowException</bpmn2:text> </bpmn2:textAnnotation> <bpmn2:association id="Association_0nketgd" sourceRef="CallActivity_1u07hp7" targetRef="TextAnnotation_1py1p84" /> <bpmn2:textAnnotation id="TextAnnotation_0wjpv6r"> @@ -261,31 +258,7 @@ WorkflowException </bpmn2:textAnnotation> <bpmn2:association id="Association_0eolbkz" sourceRef="ExclusiveGateway_1bk0tqd" targetRef="TextAnnotation_0wjpv6r" /> </bpmn2:subProcess> - <bpmn2:serviceTask id="callCreateNetwork_ServiceTask" name="Call Create Network"> - <bpmn2:extensionElements> - <camunda:connector> - <camunda:inputOutput> - <camunda:inputParameter name="payload">${CRENWKI_createNetworkRequest}</camunda:inputParameter> - <camunda:inputParameter name="url">${UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution)} -</camunda:inputParameter> - <camunda:inputParameter name="headers"> - <camunda:map> - <camunda:entry key="Authorization">#{BasicAuthHeaderValuePO}</camunda:entry> - <camunda:entry key="content-type">application/xml</camunda:entry> - </camunda:map> - </camunda:inputParameter> - <camunda:inputParameter name="method">POST</camunda:inputParameter> - <camunda:outputParameter name="CRENWKI_networkReturnCode">${statusCode}</camunda:outputParameter> - <camunda:outputParameter name="CRENWKI_createNetworkResponse">${response}</camunda:outputParameter> - </camunda:inputOutput> - <camunda:connectorId>http-connector</camunda:connectorId> - </camunda:connector> - </bpmn2:extensionElements> - <bpmn2:incoming>SequenceFlow_61</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_59</bpmn2:outgoing> - </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_59" name="" sourceRef="callCreateNetwork_ServiceTask" targetRef="validateCreatePONetwork_ScriptTask" /> - <bpmn2:sequenceFlow id="SequenceFlow_13" name="" sourceRef="validateCreatePONetwork_ScriptTask" targetRef="callRESTReQueryNetworkID_ScriptTask" /> + <bpmn2:sequenceFlow id="SequenceFlow_13" name="" sourceRef="Activity_1yoiuwp" targetRef="callRESTReQueryNetworkID_ScriptTask" /> <bpmn2:scriptTask id="callRESTReQueryNetworkID_ScriptTask" name="Call REST ReQuery Network Id in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_13</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_35</bpmn2:outgoing> @@ -349,10 +322,9 @@ DoCreateNetworkInstance.callRESTQueryAAINetworkPolicy(execution)</bpmn2:script> <bpmn2:outgoing>SequenceFlow_61</bpmn2:outgoing> <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.prepareCreateNetworkRequest(execution) -</bpmn2:script> +DoCreateNetworkInstance.prepareCreateNetworkRequest(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_61" name="" sourceRef="prepareNetworkRequest_ScriptTask" targetRef="callCreateNetwork_ServiceTask" /> + <bpmn2:sequenceFlow id="SequenceFlow_61" name="" sourceRef="prepareNetworkRequest_ScriptTask" targetRef="Activity_1yoiuwp" /> <bpmn2:scriptTask id="callRESTQueryNetworkTableRef_ScriptTask" name="Call REST Query Network TableRef in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_38</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_20</bpmn2:outgoing> @@ -435,7 +407,7 @@ DoCreateNetworkInstance.validateRpcSDNCActivateResponse(execution)</bpmn2:script </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isSdncRpc1No_SequenceFlow1" name="No" sourceRef="isSdncRpc1_ExclusiveGateway1" targetRef="prepareSDNCTopoRequest_ScriptTask" /> <bpmn2:sequenceFlow id="isSdncRpc1Yes_SequenceFlow1" name="Yes" sourceRef="isSdncRpc1_ExclusiveGateway1" targetRef="Task_10lubzj"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'} </bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:callActivity id="Task_0pbtywn" name="Call SDNC RSRC Assign Adapter V1 " calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -458,7 +430,7 @@ DoCreateNetworkInstance.validateRpcSDNCActivateResponse(execution)</bpmn2:script <bpmn2:outgoing>isSdncRpc2No_SequenceFlow2</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isSdncRpc2Yes_SequenceFlow2" name="Yes" sourceRef="isSdncRpc2_ExclusiveGateway2" targetRef="Task_1rd6dg6"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'} </bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isSdncRpc2No_SequenceFlow2" name="No" sourceRef="isSdncRpc2_ExclusiveGateway2" targetRef="Task_0zzobg6" /> <bpmn2:scriptTask id="Task_10lubzj" name="Prepare Assign SDNC RPC Request" scriptFormat="groovy"> @@ -466,8 +438,7 @@ DoCreateNetworkInstance.validateRpcSDNCActivateResponse(execution)</bpmn2:script <bpmn2:outgoing>SequenceFlow_0j8bxnb</bpmn2:outgoing> <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.prepareRpcSDNCRequest(execution) -</bpmn2:script> +DoCreateNetworkInstance.prepareRpcSDNCRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:endEvent id="EndEvent_1te02c4"> <bpmn2:incoming>SequenceFlow_1s8b1m1</bpmn2:incoming> @@ -500,781 +471,773 @@ DoCreateNetworkInstance.postProcessResponse(execution)</bpmn2:script> def DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.getServiceInstance(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:textAnnotation id="TextAnnotation_1orb6o6"> - <bpmn2:text>if '200', Prepare PO Network Rollback</bpmn2:text> - </bpmn2:textAnnotation> - <bpmn2:association id="Association_0c315jr" sourceRef="validateCreatePONetwork_ScriptTask" targetRef="TextAnnotation_1orb6o6" /> + <bpmn2:callActivity id="Activity_1yoiuwp" name="Openstack Adapter" calledElement="openstackAdapterTask"> + <bpmn2:extensionElements> + <camunda:in source="CRENWKI_createNetworkRequest" target="openstackAdapterTaskRequest" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="WorkflowResponse" target="CRENWKI_createNetworkResponse" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + </bpmn2:extensionElements> + <bpmn2:incoming>SequenceFlow_61</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing> + </bpmn2:callActivity> </bpmn2:process> <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateNetworkInstance"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="createNetwork_startEvent"> - <dc:Bounds x="397" y="177" width="36" height="36" /> + <dc:Bounds x="537" y="317" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="390" y="218" width="49" height="13" /> + <dc:Bounds x="529" y="358" width="51" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_62" bpmnElement="callAAIQuery_scriptTask"> - <dc:Bounds x="926" y="-31" width="100" height="80" /> + <dc:Bounds x="1066" y="109" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_62" bpmnElement="isAAIQueryNameOk_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="1098" y="-16" width="50" height="50" /> + <dc:Bounds x="1238" y="124" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1085" y="-56" width="75" height="24" /> + <dc:Bounds x="1226" y="84" width="74" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ScriptTask_62" targetElement="_BPMNShape_ExclusiveGateway_62"> - <di:waypoint x="1026" y="8" /> - <di:waypoint x="1098" y="9" /> + <di:waypoint x="1166" y="148" /> + <di:waypoint x="1238" y="149" /> <bpmndi:BPMNLabel> <dc:Bounds x="1062" y="-6.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_63" bpmnElement="validateCreatePONetwork_ScriptTask"> - <dc:Bounds x="1457" y="1258" width="100" height="80" /> + <dc:Bounds x="828" y="1193" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="isAAIQueryNameNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_62" targetElement="_BPMNShape_InclusiveGateway_4"> - <di:waypoint x="1123" y="34" /> - <di:waypoint x="1123" y="116" /> - <di:waypoint x="1224" y="116" /> + <di:waypoint x="1263" y="174" /> + <di:waypoint x="1263" y="256" /> + <di:waypoint x="1364" y="256" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1131" y="44" width="15" height="14" /> + <dc:Bounds x="1271" y="184" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="isAAIQueryNameYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_62" targetElement="_BPMNShape_ExclusiveGateway_73"> - <di:waypoint x="1148" y="9" /> - <di:waypoint x="1186" y="9" /> - <di:waypoint x="1186" y="9" /> - <di:waypoint x="1224" y="9" /> + <di:waypoint x="1288" y="149" /> + <di:waypoint x="1326" y="149" /> + <di:waypoint x="1326" y="149" /> + <di:waypoint x="1364" y="149" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1151" y="14.164179104477611" width="18" height="12" /> + <dc:Bounds x="1291" y="154" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_83" bpmnElement="callCreateNetwork_ServiceTask"> - <dc:Bounds x="1454" y="1135" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_67" bpmnElement="prepareSDNCTopoRequest_ScriptTask"> - <dc:Bounds x="1590" y="155" width="100" height="80" /> + <dc:Bounds x="1730" y="295" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_16" bpmnElement="subProcessException_SubProcess" isExpanded="true"> - <dc:Bounds x="31" y="608" width="1266" height="686" /> + <dc:Bounds x="171" y="748" width="1266" height="686" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_50" bpmnElement="subProcessStart_StartEvent"> - <dc:Bounds x="107" y="1166" width="36" height="36" /> + <dc:Bounds x="247" y="1306" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="101" y="1207" width="50" height="12" /> + <dc:Bounds x="240" y="1347" width="52" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_67" bpmnElement="isSdncTopoOk_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="1615" y="520" width="50" height="50" /> + <dc:Bounds x="1755" y="660" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1606" y="580" width="67" height="13" /> + <dc:Bounds x="1746" y="720" width="67" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="sdncTopoNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_67" targetElement="_BPMNShape_EndEvent_124"> - <di:waypoint x="1665" y="545" /> - <di:waypoint x="1739" y="545" /> + <di:waypoint x="1805" y="685" /> + <di:waypoint x="1879" y="685" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1670" y="545.8651480742376" width="14" height="13" /> + <dc:Bounds x="1810" y="686" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="sdncTopoYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_67" targetElement="_BPMNShape_ScriptTask_133"> - <di:waypoint x="1615" y="545" /> - <di:waypoint x="1554" y="546" /> + <di:waypoint x="1755" y="685" /> + <di:waypoint x="1694" y="686" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1587" y="549.9992641545633" width="18" height="12" /> + <dc:Bounds x="1727" y="690" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_124" bpmnElement="sndcError_EndEvent"> - <dc:Bounds x="1739" y="527" width="36" height="36" /> + <dc:Bounds x="1879" y="667" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1727" y="576" width="59" height="13" /> + <dc:Bounds x="1866" y="716" width="61" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_19" bpmnElement="callAssignSDNCAdapter_CallActivity"> - <dc:Bounds x="1590" y="276" width="100" height="80" /> + <dc:Bounds x="1730" y="416" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_24" bpmnElement="SequenceFlow_11" sourceElement="_BPMNShape_ScriptTask_67" targetElement="_BPMNShape_CallActivity_19"> - <di:waypoint x="1640" y="235" /> - <di:waypoint x="1640" y="276" /> + <di:waypoint x="1780" y="375" /> + <di:waypoint x="1780" y="416" /> <bpmndi:BPMNLabel> <dc:Bounds x="1655" y="255.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_CallActivity_19" targetElement="_BPMNShape_ScriptTask_131"> - <di:waypoint x="1640" y="356" /> - <di:waypoint x="1640" y="395" /> + <di:waypoint x="1780" y="496" /> + <di:waypoint x="1780" y="535" /> <bpmndi:BPMNLabel> <dc:Bounds x="1655" y="375.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_StartEvent_50"> - <di:waypoint x="143" y="1184" /> - <di:waypoint x="170" y="1184" /> + <di:waypoint x="283" y="1324" /> + <di:waypoint x="310" y="1324" /> <bpmndi:BPMNLabel> <dc:Bounds x="157" y="1169" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_131" bpmnElement="validateSDNCResponse_ScriptTask"> - <dc:Bounds x="1590" y="395" width="100" height="80" /> + <dc:Bounds x="1730" y="535" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_131" targetElement="_BPMNShape_ExclusiveGateway_67"> - <di:waypoint x="1640" y="475" /> - <di:waypoint x="1640" y="498" /> - <di:waypoint x="1640" y="498" /> - <di:waypoint x="1640" y="520" /> + <di:waypoint x="1780" y="615" /> + <di:waypoint x="1780" y="638" /> + <di:waypoint x="1780" y="638" /> + <di:waypoint x="1780" y="660" /> <bpmndi:BPMNLabel> <dc:Bounds x="1655" y="498" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_73" bpmnElement="isNetworkActive_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="1224" y="-16" width="50" height="50" /> + <dc:Bounds x="1364" y="124" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1221" y="-57" width="56" height="24" /> + <dc:Bounds x="1363" y="83" width="53" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_39" bpmnElement="isNetworkActiveYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_73"> - <di:waypoint x="1274" y="9" /> - <di:waypoint x="1335" y="9" /> + <di:waypoint x="1414" y="149" /> + <di:waypoint x="1475" y="149" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1275" y="14.380425096632202" width="18" height="12" /> + <dc:Bounds x="1415" y="154" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_44" bpmnElement="isNetworkActiveNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_73" targetElement="_BPMNShape_InclusiveGateway_4"> - <di:waypoint x="1249" y="34" /> - <di:waypoint x="1249" y="91" /> + <di:waypoint x="1389" y="174" /> + <di:waypoint x="1389" y="231" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1258" y="37.520779498373976" width="14" height="12" /> + <dc:Bounds x="1398" y="178" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_45" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_InclusiveGateway_4" targetElement="_BPMNShape_ScriptTask_245"> - <di:waypoint x="1249" y="141" /> - <di:waypoint x="1249" y="276" /> + <di:waypoint x="1389" y="281" /> + <di:waypoint x="1389" y="416" /> <bpmndi:BPMNLabel> <dc:Bounds x="1264" y="208.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_InclusiveGateway_4" bpmnElement="InclusiveGateway"> - <dc:Bounds x="1224" y="91" width="50" height="50" /> + <dc:Bounds x="1364" y="231" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="1306" y="86" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_133" bpmnElement="callRESTQueryNetworkId_ScriptTask"> - <dc:Bounds x="1454" y="505" width="100" height="80" /> + <dc:Bounds x="1594" y="645" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_134" bpmnElement="callRESTReQueryNetworkID_ScriptTask"> - <dc:Bounds x="1454" y="1392" width="100" height="80" /> + <dc:Bounds x="1594" y="1532" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_135" bpmnElement="callRESTUpdateContrailNetwork_ScriptTask"> - <dc:Bounds x="1454" y="1538" width="100" height="80" /> + <dc:Bounds x="1594" y="1678" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_54" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_ScriptTask_134" targetElement="_BPMNShape_ScriptTask_135"> - <di:waypoint x="1504" y="1472" /> - <di:waypoint x="1504" y="1538" /> + <di:waypoint x="1644" y="1612" /> + <di:waypoint x="1644" y="1678" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="1505" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_156" bpmnElement="callRESTQueryVpnBinding_ScriptTask"> - <dc:Bounds x="1454" y="627" width="100" height="80" /> + <dc:Bounds x="1594" y="767" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ScriptTask_156" targetElement="_BPMNShape_ScriptTask_215"> - <di:waypoint x="1504" y="707" /> - <di:waypoint x="1504" y="727" /> - <di:waypoint x="1504" y="727" /> - <di:waypoint x="1504" y="750" /> + <di:waypoint x="1644" y="847" /> + <di:waypoint x="1644" y="867" /> + <di:waypoint x="1644" y="867" /> + <di:waypoint x="1644" y="890" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="727" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_49" bpmnElement="SequenceFlow_16" sourceElement="_BPMNShape_ScriptTask_133" targetElement="_BPMNShape_ScriptTask_156"> - <di:waypoint x="1504" y="585" /> - <di:waypoint x="1504" y="606" /> - <di:waypoint x="1504" y="606" /> - <di:waypoint x="1504" y="627" /> + <di:waypoint x="1644" y="725" /> + <di:waypoint x="1644" y="746" /> + <di:waypoint x="1644" y="746" /> + <di:waypoint x="1644" y="767" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="606" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_87" bpmnElement="SequenceFlow_59" sourceElement="_BPMNShape_ServiceTask_83" targetElement="_BPMNShape_ScriptTask_63"> - <di:waypoint x="1505" y="1215" /> - <di:waypoint x="1505" y="1237" /> - <di:waypoint x="1505" y="1237" /> - <di:waypoint x="1505" y="1258" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1520" y="1237" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_157" bpmnElement="prepareNetworkRequest_ScriptTask"> - <dc:Bounds x="1454" y="1009" width="100" height="80" /> + <dc:Bounds x="1594" y="1149" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_89" bpmnElement="SequenceFlow_61" sourceElement="_BPMNShape_ScriptTask_157" targetElement="_BPMNShape_ServiceTask_83"> - <di:waypoint x="1504" y="1089" /> - <di:waypoint x="1504" y="1111" /> - <di:waypoint x="1504" y="1111" /> - <di:waypoint x="1504" y="1135" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_89" bpmnElement="SequenceFlow_61" sourceElement="_BPMNShape_ScriptTask_157" targetElement="Activity_18agmdb_di"> + <di:waypoint x="1644" y="1229" /> + <di:waypoint x="1644" y="1275" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="1111" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_215" bpmnElement="callRESTQueryNetworkPolicy_ScriptTask"> - <dc:Bounds x="1454" y="750" width="100" height="80" /> + <dc:Bounds x="1594" y="890" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_60" bpmnElement="SequenceFlow_38" sourceElement="_BPMNShape_ScriptTask_215" targetElement="_BPMNShape_ScriptTask_333"> - <di:waypoint x="1504" y="830" /> - <di:waypoint x="1504" y="879" /> + <di:waypoint x="1644" y="970" /> + <di:waypoint x="1644" y="1019" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="854.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_215" bpmnElement="isPONR_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="304" y="1060" width="50" height="50" /> + <dc:Bounds x="444" y="1200" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="248" y="1078" width="46" height="12" /> + <dc:Bounds x="388" y="1218" width="46" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_77" bpmnElement="isPONR_Yes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_215"> - <di:waypoint x="354" y="1085" /> - <di:waypoint x="457" y="1085" /> - <di:waypoint x="457" y="1159" /> + <di:waypoint x="494" y="1225" /> + <di:waypoint x="597" y="1225" /> + <di:waypoint x="597" y="1299" /> <bpmndi:BPMNLabel> - <dc:Bounds x="351" y="1088" width="18" height="12" /> + <dc:Bounds x="491" y="1228" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_85" bpmnElement="isPONR_No_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_215"> - <di:waypoint x="329" y="1060" /> - <di:waypoint x="329" y="1003" /> + <di:waypoint x="469" y="1200" /> + <di:waypoint x="469" y="1143" /> <bpmndi:BPMNLabel> - <dc:Bounds x="339" y="1051" width="14" height="12" /> + <dc:Bounds x="479" y="1191" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_217" bpmnElement="sdncOk_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="527" y="845" width="50" height="50" /> + <dc:Bounds x="667" y="985" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="585" y="858" width="72" height="24" /> + <dc:Bounds x="726" y="998" width="70" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_92" bpmnElement="sdncOk_Yeso_ExclusiveGateway" sourceElement="_BPMNShape_ExclusiveGateway_217" targetElement="_BPMNShape_ScriptTask_261"> - <di:waypoint x="552" y="845" /> - <di:waypoint x="552" y="776" /> - <di:waypoint x="713" y="776" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_92" bpmnElement="sdncOk_Yeso_ExclusiveGateway" sourceElement="_BPMNShape_ExclusiveGateway_217" targetElement="ExclusiveGateway_00dh41t_di"> + <di:waypoint x="692" y="985" /> + <di:waypoint x="692" y="916" /> + <di:waypoint x="853" y="916" /> <bpmndi:BPMNLabel> - <dc:Bounds x="559" y="829" width="18" height="12" /> + <dc:Bounds x="699" y="969" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_93" bpmnElement="sdncOk_No_ExclusiveGateway" sourceElement="_BPMNShape_ExclusiveGateway_217"> - <di:waypoint x="551" y="894" /> - <di:waypoint x="551" y="978" /> - <di:waypoint x="713" y="978" /> + <di:waypoint x="691" y="1034" /> + <di:waypoint x="691" y="1118" /> + <di:waypoint x="853" y="1118" /> <bpmndi:BPMNLabel> - <dc:Bounds x="559" y="895" width="14" height="12" /> + <dc:Bounds x="699" y="1035" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_245" bpmnElement="callRESTQueryCloudRegion_ScriptTask"> - <dc:Bounds x="1199" y="276" width="100" height="80" /> + <dc:Bounds x="1339" y="416" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_53" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ScriptTask_245" targetElement="_BPMNShape_ScriptTask_67"> - <di:waypoint x="1299" y="316" /> - <di:waypoint x="1337" y="316" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_53" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ScriptTask_245" targetElement="ExclusiveGateway_1ts3ph0_di"> + <di:waypoint x="1439" y="456" /> + <di:waypoint x="1477" y="456" /> <bpmndi:BPMNLabel> <dc:Bounds x="1318" y="301" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_38" bpmnElement="BoundaryEvent_4"> - <dc:Bounds x="1672" y="457" width="36" height="36" /> + <dc:Bounds x="1812" y="597" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1690" y="493" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_69" bpmnElement="SequenceFlow_34" sourceElement="_BPMNShape_BoundaryEvent_38" targetElement="_BPMNShape_EndEvent_124"> - <di:waypoint x="1702" y="488" /> - <di:waypoint x="1745" y="533" /> + <di:waypoint x="1842" y="628" /> + <di:waypoint x="1885" y="673" /> <bpmndi:BPMNLabel> <dc:Bounds x="1724" y="495.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_261" bpmnElement="prepareSDNCRollbackRequest_ScriptTask"> - <dc:Bounds x="886" y="830" width="100" height="79" /> + <dc:Bounds x="1026" y="970" width="100" height="79" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_ScriptTask_63" targetElement="_BPMNShape_ScriptTask_134"> - <di:waypoint x="1507" y="1338" /> - <di:waypoint x="1505" y="1392" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_13" sourceElement="Activity_18agmdb_di" targetElement="_BPMNShape_ScriptTask_134"> + <di:waypoint x="1644" y="1355" /> + <di:waypoint x="1644" y="1532" /> <bpmndi:BPMNLabel> <dc:Bounds x="1506" y="1350" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_28" bpmnElement="unexpectedErrors_SubProcess" isExpanded="true"> - <dc:Bounds x="21" y="381" width="394" height="188" /> + <dc:Bounds x="161" y="521" width="394" height="188" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_71" bpmnElement="StartEvent_1"> - <dc:Bounds x="54" y="458" width="36" height="36" /> + <dc:Bounds x="194" y="598" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="72" y="499" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_270" bpmnElement="ScriptTask_1"> - <dc:Bounds x="169" y="436" width="100" height="80" /> + <dc:Bounds x="309" y="576" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_220" bpmnElement="EndEvent_1"> - <dc:Bounds x="330" y="458" width="36" height="36" /> + <dc:Bounds x="470" y="598" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="348" y="499" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_StartEvent_71" targetElement="_BPMNShape_ScriptTask_270"> - <di:waypoint x="90" y="476" /> - <di:waypoint x="169" y="476" /> + <di:waypoint x="230" y="616" /> + <di:waypoint x="309" y="616" /> <bpmndi:BPMNLabel> <dc:Bounds x="129" y="476" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_270" targetElement="_BPMNShape_EndEvent_220"> - <di:waypoint x="269" y="476" /> - <di:waypoint x="330" y="476" /> + <di:waypoint x="409" y="616" /> + <di:waypoint x="470" y="616" /> <bpmndi:BPMNLabel> <dc:Bounds x="301" y="476" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="ScriptTask_0z2n0hl_di" targetElement="ExclusiveGateway_0lw40k5_di"> - <di:waypoint x="809" y="235" /> - <di:waypoint x="809" y="316" /> - <di:waypoint x="951" y="316" /> + <di:waypoint x="949" y="375" /> + <di:waypoint x="949" y="456" /> + <di:waypoint x="1091" y="456" /> <bpmndi:BPMNLabel> <dc:Bounds x="779" y="275.5" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_333" bpmnElement="callRESTQueryNetworkTableRef_ScriptTask"> - <dc:Bounds x="1454" y="879" width="100" height="80" /> + <dc:Bounds x="1594" y="1019" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_20" sourceElement="_BPMNShape_ScriptTask_333" targetElement="_BPMNShape_ScriptTask_157"> - <di:waypoint x="1504" y="959" /> - <di:waypoint x="1504" y="981" /> - <di:waypoint x="1504" y="981" /> - <di:waypoint x="1504" y="1009" /> + <di:waypoint x="1644" y="1099" /> + <di:waypoint x="1644" y="1121" /> + <di:waypoint x="1644" y="1121" /> + <di:waypoint x="1644" y="1149" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="981" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1n61wit_di" bpmnElement="SequenceFlow_1n61wit"> - <di:waypoint x="433" y="195" /> - <di:waypoint x="492" y="195" /> - <di:waypoint x="492" y="195" /> - <di:waypoint x="546" y="195" /> + <di:waypoint x="573" y="335" /> + <di:waypoint x="632" y="335" /> + <di:waypoint x="632" y="335" /> + <di:waypoint x="686" y="335" /> <bpmndi:BPMNLabel> <dc:Bounds x="507" y="195" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1jay2gg_di" bpmnElement="ScriptTask_preprocess"> - <dc:Bounds x="546" y="155" width="100" height="80" /> + <dc:Bounds x="686" y="295" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0ftylq3_di" bpmnElement="SequenceFlow_0ftylq3"> - <di:waypoint x="646" y="195" /> - <di:waypoint x="706" y="195" /> - <di:waypoint x="706" y="195" /> - <di:waypoint x="759" y="195" /> + <di:waypoint x="786" y="335" /> + <di:waypoint x="846" y="335" /> + <di:waypoint x="846" y="335" /> + <di:waypoint x="899" y="335" /> <bpmndi:BPMNLabel> <dc:Bounds x="676" y="195" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_0lw40k5_di" bpmnElement="isNameSent_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="951" y="291" width="50" height="50" /> + <dc:Bounds x="1091" y="431" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="933" y="349" width="85" height="26" /> + <dc:Bounds x="1074" y="489" width="84" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0635hhm_di" bpmnElement="isNameSentYes_SequenceFlow"> - <di:waypoint x="976" y="291" /> - <di:waypoint x="976" y="170" /> - <di:waypoint x="976" y="170" /> - <di:waypoint x="976" y="49" /> + <di:waypoint x="1116" y="431" /> + <di:waypoint x="1116" y="310" /> + <di:waypoint x="1116" y="310" /> + <di:waypoint x="1116" y="189" /> <bpmndi:BPMNLabel> - <dc:Bounds x="988" y="275" width="18" height="13" /> + <dc:Bounds x="1128" y="415" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1sirjgc_di" bpmnElement="isNameSentNo_SequenceFlow"> - <di:waypoint x="1001" y="316" /> - <di:waypoint x="1199" y="316" /> + <di:waypoint x="1141" y="456" /> + <di:waypoint x="1339" y="456" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1005" y="328" width="14" height="13" /> + <dc:Bounds x="1145" y="468" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1uxa4p9_di" bpmnElement="Task_1ipbwbj"> - <dc:Bounds x="1014" y="1538" width="100" height="80" /> + <dc:Bounds x="1154" y="1678" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0m5hrmn_di" bpmnElement="Task_1rd6dg6"> - <dc:Bounds x="1183" y="1538" width="100" height="80" /> + <dc:Bounds x="1323" y="1678" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_0n0ptg6_di" bpmnElement="ExclusiveGateway_0n0ptg6" isMarkerVisible="true"> - <dc:Bounds x="724" y="1553" width="50" height="50" /> + <dc:Bounds x="864" y="1693" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="644" y="1566" width="68" height="24" /> + <dc:Bounds x="784" y="1706" width="69" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_13deudk_di" bpmnElement="SequenceFlow_13deudk"> - <di:waypoint x="1183" y="1578" /> - <di:waypoint x="1114" y="1578" /> + <di:waypoint x="1323" y="1718" /> + <di:waypoint x="1254" y="1718" /> <bpmndi:BPMNLabel> <dc:Bounds x="1149" y="1563" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_08qibb9_di" bpmnElement="SequenceFlow_08qibb9"> - <di:waypoint x="1014" y="1578" /> - <di:waypoint x="953" y="1578" /> + <di:waypoint x="1154" y="1718" /> + <di:waypoint x="1093" y="1718" /> <bpmndi:BPMNLabel> <dc:Bounds x="984" y="1563" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1t03rs2_di" bpmnElement="SequenceFlow_1t03rs2"> - <di:waypoint x="853" y="1578" /> - <di:waypoint x="774" y="1578" /> + <di:waypoint x="993" y="1718" /> + <di:waypoint x="914" y="1718" /> <bpmndi:BPMNLabel> <dc:Bounds x="814" y="1563" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1jia57e_di" bpmnElement="SequenceFlow_1jia57e"> - <di:waypoint x="749" y="1553" /> - <di:waypoint x="749" y="1484" /> + <di:waypoint x="889" y="1693" /> + <di:waypoint x="889" y="1624" /> <bpmndi:BPMNLabel> - <dc:Bounds x="757" y="1537.7047949008065" width="18" height="12" /> + <dc:Bounds x="897" y="1678" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_18ybfu5_di" bpmnElement="SequenceFlow_18ybfu5"> - <di:waypoint x="749" y="1603" /> - <di:waypoint x="749" y="1669" /> + <di:waypoint x="889" y="1743" /> + <di:waypoint x="889" y="1809" /> <bpmndi:BPMNLabel> - <dc:Bounds x="758" y="1603.7606668519034" width="14" height="12" /> + <dc:Bounds x="898" y="1744" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1v458g5_di" bpmnElement="validateSDNCActivate_Task"> - <dc:Bounds x="853" y="1538" width="100" height="80" /> + <dc:Bounds x="993" y="1678" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="BoundaryEvent_0pg57au_di" bpmnElement="BoundaryEvent_0vb26bm"> - <dc:Bounds x="859" y="1600" width="36" height="36" /> + <dc:Bounds x="999" y="1740" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="877" y="1636" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0s51ns0_di" bpmnElement="SequenceFlow_0s51ns0"> - <di:waypoint x="877" y="1636" /> - <di:waypoint x="877" y="1687" /> - <di:waypoint x="767" y="1687" /> + <di:waypoint x="1017" y="1776" /> + <di:waypoint x="1017" y="1827" /> + <di:waypoint x="907" y="1827" /> <bpmndi:BPMNLabel> <dc:Bounds x="892" y="1661.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0h7h49p_di" bpmnElement="EndEvent_13v46cq"> - <dc:Bounds x="731" y="1669" width="36" height="36" /> + <dc:Bounds x="871" y="1809" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="711" y="1715" width="76" height="24" /> + <dc:Bounds x="852" y="1855" width="74" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_0f9d94i_di" bpmnElement="isSDNCActivate_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="304" y="953" width="50" height="50" /> + <dc:Bounds x="444" y="1093" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="210" y="966" width="84" height="24" /> + <dc:Bounds x="350" y="1106" width="85" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0cly7z2_di" bpmnElement="SequenceFlow_0cly7z2"> - <di:waypoint x="329" y="953" /> - <di:waypoint x="329" y="910" /> + <di:waypoint x="469" y="1093" /> + <di:waypoint x="469" y="1050" /> <bpmndi:BPMNLabel> - <dc:Bounds x="335" y="937" width="18" height="12" /> + <dc:Bounds x="475" y="1077" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_12tlymf_di" bpmnElement="SequenceFlow_12tlymf"> - <di:waypoint x="354" y="978" /> - <di:waypoint x="457" y="978" /> - <di:waypoint x="457" y="895" /> + <di:waypoint x="494" y="1118" /> + <di:waypoint x="597" y="1118" /> + <di:waypoint x="597" y="1035" /> <bpmndi:BPMNLabel> - <dc:Bounds x="350" y="988" width="14" height="12" /> + <dc:Bounds x="490" y="1128" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1ts3ph0_di" bpmnElement="isSdncRpc1_ExclusiveGateway1" isMarkerVisible="true"> - <dc:Bounds x="1337.228" y="291" width="50" height="50" /> + <dc:Bounds x="1477" y="431" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1401" y="304" width="61" height="24" /> + <dc:Bounds x="1542" y="444" width="60" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1r5sja0_di" bpmnElement="isSdncRpc1No_SequenceFlow1"> - <di:waypoint x="1362" y="291" /> - <di:waypoint x="1362" y="195" /> - <di:waypoint x="1590" y="195" /> + <di:waypoint x="1502" y="431" /> + <di:waypoint x="1502" y="335" /> + <di:waypoint x="1730" y="335" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1371" y="273" width="14" height="12" /> + <dc:Bounds x="1511" y="413" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1ow57qy_di" bpmnElement="isSdncRpc1Yes_SequenceFlow1"> - <di:waypoint x="1362" y="341" /> - <di:waypoint x="1362" y="395" /> + <di:waypoint x="1502" y="481" /> + <di:waypoint x="1502" y="535" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1373" y="341" width="18" height="12" /> + <dc:Bounds x="1513" y="481" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_067czgj_di" bpmnElement="Task_0pbtywn"> - <dc:Bounds x="1454" y="395" width="100" height="80" /> + <dc:Bounds x="1594" y="535" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0j8bxnb_di" bpmnElement="SequenceFlow_0j8bxnb"> - <di:waypoint x="1412" y="435" /> - <di:waypoint x="1454" y="435" /> + <di:waypoint x="1552" y="575" /> + <di:waypoint x="1594" y="575" /> <bpmndi:BPMNLabel> <dc:Bounds x="1433" y="420" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0d93bqw_di" bpmnElement="SequenceFlow_0d93bqw"> - <di:waypoint x="1554" y="435" /> - <di:waypoint x="1590" y="435" /> + <di:waypoint x="1694" y="575" /> + <di:waypoint x="1730" y="575" /> <bpmndi:BPMNLabel> <dc:Bounds x="1572" y="420" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_00dh41t_di" bpmnElement="isSdncRpc4_ExclusiveGateway4" isMarkerVisible="true"> - <dc:Bounds x="713" y="751" width="50" height="50" /> + <dc:Bounds x="853" y="891" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="714" y="710" width="61" height="24" /> + <dc:Bounds x="855" y="850" width="60" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0suu90e_di" bpmnElement="isSdncRpc4Yes_SequenceFlow4"> - <di:waypoint x="738" y="801" /> - <di:waypoint x="738" y="830" /> + <di:waypoint x="878" y="941" /> + <di:waypoint x="878" y="970" /> <bpmndi:BPMNLabel> - <dc:Bounds x="743" y="800" width="18" height="12" /> + <dc:Bounds x="883" y="940" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0xnyl6e_di" bpmnElement="isSdncRpc4No_SequenceFlow4"> - <di:waypoint x="763" y="776" /> - <di:waypoint x="936" y="776" /> - <di:waypoint x="936" y="830" /> + <di:waypoint x="903" y="916" /> + <di:waypoint x="1076" y="916" /> + <di:waypoint x="1076" y="970" /> <bpmndi:BPMNLabel> - <dc:Bounds x="772" y="755" width="14" height="12" /> + <dc:Bounds x="912" y="895" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1gghe34_di" bpmnElement="isSdncRpc2_ExclusiveGateway2" isMarkerVisible="true"> - <dc:Bounds x="1360" y="1553" width="50" height="50" /> + <dc:Bounds x="1500" y="1693" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1343" y="1619" width="83" height="36" /> + <dc:Bounds x="1484" y="1759" width="82" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1lphs99_di" bpmnElement="isSdncRpc2Yes_SequenceFlow2"> - <di:waypoint x="1360" y="1578" /> - <di:waypoint x="1283" y="1578" /> + <di:waypoint x="1500" y="1718" /> + <di:waypoint x="1423" y="1718" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1337" y="1580.0388981849903" width="18" height="12" /> + <dc:Bounds x="1477" y="1720" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0lk1uut_di" bpmnElement="isSdncRpc2No_SequenceFlow2"> - <di:waypoint x="1385" y="1553" /> - <di:waypoint x="1385" y="1444" /> - <di:waypoint x="799" y="1444" /> + <di:waypoint x="1525" y="1693" /> + <di:waypoint x="1525" y="1584" /> + <di:waypoint x="939" y="1584" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1362" y="1543.660178848007" width="14" height="12" /> + <dc:Bounds x="1502" y="1684" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1lkq0a3_di" bpmnElement="Task_10lubzj"> - <dc:Bounds x="1312" y="395" width="100" height="80" /> + <dc:Bounds x="1452" y="535" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_19o9l99_di" bpmnElement="Task_0q6pzpn"> - <dc:Bounds x="688" y="830" width="100" height="80" /> + <dc:Bounds x="828" y="970" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1te02c4_di" bpmnElement="EndEvent_1te02c4"> - <dc:Bounds x="467" y="1426" width="36" height="36" /> + <dc:Bounds x="607" y="1566" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="486" y="1462" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1kpt4kc_di" bpmnElement="EndEvent_1kpt4kc"> - <dc:Bounds x="1160" y="1075" width="36" height="36" /> + <dc:Bounds x="1372" y="1215" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1179" y="1111" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0ti2ctu_di" bpmnElement="EndEvent_0ti2ctu"> - <dc:Bounds x="1486" y="-9" width="36" height="36" /> + <dc:Bounds x="1626" y="131" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1468" y="38" width="72" height="12" /> + <dc:Bounds x="1608" y="178" width="73" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1s8b1m1_di" bpmnElement="SequenceFlow_1s8b1m1"> - <di:waypoint x="699" y="1444" /> - <di:waypoint x="597" y="1444" /> - <di:waypoint x="597" y="1444" /> - <di:waypoint x="503" y="1444" /> + <di:waypoint x="839" y="1584" /> + <di:waypoint x="737" y="1584" /> + <di:waypoint x="737" y="1584" /> + <di:waypoint x="643" y="1584" /> <bpmndi:BPMNLabel> <dc:Bounds x="612" y="1444" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1feo4ms_di" bpmnElement="Task_0zzobg6"> - <dc:Bounds x="699" y="1404" width="100" height="80" /> + <dc:Bounds x="839" y="1544" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0myjg9k_di" bpmnElement="ScriptTask_0myjg9k"> - <dc:Bounds x="688" y="1053" width="100" height="80" /> + <dc:Bounds x="960" y="1193" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0b8j5rw_di" bpmnElement="SequenceFlow_0b8j5rw"> - <di:waypoint x="379" y="870" /> - <di:waypoint x="432" y="870" /> + <di:waypoint x="519" y="1010" /> + <di:waypoint x="572" y="1010" /> <bpmndi:BPMNLabel> <dc:Bounds x="406" y="855" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_17adm0m_di" bpmnElement="Task_1imzwi3"> - <dc:Bounds x="279" y="830" width="100" height="80" /> + <dc:Bounds x="419" y="970" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1ipz2ze_di" bpmnElement="SequenceFlow_1ipz2ze"> - <di:waypoint x="1454" y="1578" /> - <di:waypoint x="1432" y="1578" /> - <di:waypoint x="1432" y="1578" /> - <di:waypoint x="1410" y="1578" /> + <di:waypoint x="1594" y="1718" /> + <di:waypoint x="1572" y="1718" /> + <di:waypoint x="1572" y="1718" /> + <di:waypoint x="1550" y="1718" /> <bpmndi:BPMNLabel> <dc:Bounds x="1447" y="1578" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1u07hp7_di" bpmnElement="CallActivity_1u07hp7"> - <dc:Bounds x="841" y="1053" width="100" height="80" /> + <dc:Bounds x="1090" y="1193" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0vzsyrd_di" bpmnElement="SequenceFlow_0vzsyrd"> - <di:waypoint x="941" y="1093" /> - <di:waypoint x="1007" y="1093" /> + <di:waypoint x="1190" y="1233" /> + <di:waypoint x="1220" y="1233" /> <bpmndi:BPMNLabel> <dc:Bounds x="974" y="1078" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0bwpkkb_di" bpmnElement="SequenceFlow_0bwpkkb"> - <di:waypoint x="738" y="910" /> - <di:waypoint x="738" y="953" /> + <di:waypoint x="878" y="1050" /> + <di:waypoint x="878" y="1093" /> <bpmndi:BPMNLabel> <dc:Bounds x="753" y="922" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0lndbvr_di" bpmnElement="SequenceFlow_0lndbvr"> - <di:waypoint x="936" y="909" /> - <di:waypoint x="936" y="978" /> - <di:waypoint x="763" y="978" /> + <di:waypoint x="1076" y="1049" /> + <di:waypoint x="1076" y="1118" /> + <di:waypoint x="903" y="1118" /> <bpmndi:BPMNLabel> <dc:Bounds x="951" y="944" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_096tad6_di" bpmnElement="SequenceFlow_096tad6"> - <di:waypoint x="788" y="1093" /> - <di:waypoint x="841" y="1093" /> + <di:waypoint x="1060" y="1233" /> + <di:waypoint x="1090" y="1233" /> <bpmndi:BPMNLabel> <dc:Bounds x="815" y="1078" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="TextAnnotation_1py1p84_di" bpmnElement="TextAnnotation_1py1p84"> - <dc:Bounds x="1036" y="901" width="252" height="119" /> + <dc:Bounds x="1176" y="1041" width="252" height="119" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Association_0nketgd_di" bpmnElement="Association_0nketgd"> - <di:waypoint x="941" y="1069" /> - <di:waypoint x="1041" y="1020" /> + <di:waypoint x="1187" y="1196" /> + <di:waypoint x="1230" y="1160" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0w2ekuz_di" bpmnElement="ScriptTask_0w2ekuz"> - <dc:Bounds x="1007" y="1053" width="100" height="80" /> + <dc:Bounds x="1220" y="1193" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1qwubew_di" bpmnElement="SequenceFlow_1qwubew"> - <di:waypoint x="1107" y="1093" /> - <di:waypoint x="1160" y="1093" /> + <di:waypoint x="1320" y="1233" /> + <di:waypoint x="1372" y="1233" /> <bpmndi:BPMNLabel> <dc:Bounds x="1134" y="1068" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1r7vhm5_di" bpmnElement="isRollbackOn_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="304" y="1159" width="50" height="50" /> + <dc:Bounds x="444" y="1299" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="290" y="1209" width="78" height="12" /> + <dc:Bounds x="430" y="1349" width="78" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_19kcbiw_di" bpmnElement="isRollbackOn_SequenceFlow_Yes"> - <di:waypoint x="329" y="1159" /> - <di:waypoint x="329" y="1110" /> + <di:waypoint x="469" y="1299" /> + <di:waypoint x="469" y="1250" /> <bpmndi:BPMNLabel> - <dc:Bounds x="337" y="1142" width="18" height="12" /> + <dc:Bounds x="477" y="1282" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0pl3e54_di" bpmnElement="isRollbackOn_SequenceFlow_No"> - <di:waypoint x="354" y="1184" /> - <di:waypoint x="432" y="1184" /> + <di:waypoint x="494" y="1324" /> + <di:waypoint x="572" y="1324" /> <bpmndi:BPMNLabel> - <dc:Bounds x="355" y="1190" width="14" height="12" /> + <dc:Bounds x="495" y="1330" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="InclusiveGateway_0zl5xa8_di" bpmnElement="ExclusiveGateway_1qb2vwe"> - <dc:Bounds x="713" y="953" width="50" height="50" /> + <dc:Bounds x="853" y="1093" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="738" y="1003" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_15sffxc_di" bpmnElement="SequenceFlow_15sffxc"> - <di:waypoint x="738" y="1003" /> - <di:waypoint x="738" y="1053" /> + <di:waypoint x="878" y="1143" /> + <di:waypoint x="878" y="1193" /> <bpmndi:BPMNLabel> <dc:Bounds x="753" y="1028" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="InclusiveGateway_0t3i8it_di" bpmnElement="ExclusiveGateway_1bk0tqd"> - <dc:Bounds x="432" y="845" width="50" height="50" /> + <dc:Bounds x="572" y="985" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="457" y="895" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0k7y7b5_di" bpmnElement="SequenceFlow_0k7y7b5"> - <di:waypoint x="482" y="870" /> - <di:waypoint x="527" y="870" /> + <di:waypoint x="622" y="1010" /> + <di:waypoint x="667" y="1010" /> <bpmndi:BPMNLabel> <dc:Bounds x="505" y="845" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0p3v749_di" bpmnElement="ScriptTask_0p3v749"> - <dc:Bounds x="1335" y="-31" width="100" height="80" /> + <dc:Bounds x="1475" y="109" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_18ylufb_di" bpmnElement="SequenceFlow_18ylufb"> - <di:waypoint x="1435" y="9" /> - <di:waypoint x="1486" y="9" /> + <di:waypoint x="1575" y="149" /> + <di:waypoint x="1626" y="149" /> <bpmndi:BPMNLabel> <dc:Bounds x="1461" y="-6" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="InclusiveGateway_1eochiz_di" bpmnElement="ExclusiveGateway_1umhuft"> - <dc:Bounds x="432" y="1159" width="50" height="50" /> + <dc:Bounds x="572" y="1299" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="457" y="1209" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_17nx822_di" bpmnElement="SequenceFlow_17nx822"> - <di:waypoint x="482" y="1184" /> - <di:waypoint x="1057" y="1184" /> - <di:waypoint x="1057" y="1133" /> + <di:waypoint x="622" y="1324" /> + <di:waypoint x="1270" y="1324" /> + <di:waypoint x="1270" y="1273" /> <bpmndi:BPMNLabel> <dc:Bounds x="770" y="1169" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="TextAnnotation_1orb6o6_di" bpmnElement="TextAnnotation_1orb6o6"> - <dc:Bounds x="1606" y="1241" width="233" height="37" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Association_0c315jr_di" bpmnElement="Association_0c315jr"> - <di:waypoint x="1557" y="1289" /> - <di:waypoint x="1621" y="1278" /> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="TextAnnotation_0wjpv6r_di" bpmnElement="TextAnnotation_0wjpv6r"> - <dc:Bounds x="341" y="735" width="180" height="36" /> + <dc:Bounds x="481" y="875" width="180" height="36" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Association_0eolbkz_di" bpmnElement="Association_0eolbkz"> - <di:waypoint x="452" y="850" /> - <di:waypoint x="435" y="771" /> + <di:waypoint x="592" y="990" /> + <di:waypoint x="575" y="911" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0j3058g_di" bpmnElement="ScriptTask_0j3058g"> - <dc:Bounds x="170" y="1144" width="100" height="80" /> + <dc:Bounds x="310" y="1284" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_10ttvwn_di" bpmnElement="SequenceFlow_10ttvwn"> - <di:waypoint x="270" y="1184" /> - <di:waypoint x="304" y="1184" /> + <di:waypoint x="410" y="1324" /> + <di:waypoint x="444" y="1324" /> <bpmndi:BPMNLabel> <dc:Bounds x="287" y="1159" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0z2n0hl_di" bpmnElement="callGetServiceInstance"> - <dc:Bounds x="759" y="155" width="100" height="80" /> + <dc:Bounds x="899" y="295" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_18agmdb_di" bpmnElement="Activity_1yoiuwp"> + <dc:Bounds x="1594" y="1275" width="100" height="80" /> </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="Flow_15l1pk2_di" bpmnElement="Flow_15l1pk2"> + <di:waypoint x="928" y="1233" /> + <di:waypoint x="960" y="1233" /> + </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn2:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstanceRollback.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstanceRollback.bpmn index 6a4861b9a4..5103fa9d0a 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstanceRollback.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstanceRollback.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0"> <bpmn:process id="DoCreateNetworkInstanceRollback" name="DoCreateNetworkInstanceRollback" isExecutable="true"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_1krl2dg</bpmn:outgoing> @@ -7,9 +7,9 @@ <bpmn:scriptTask id="Task_0whino1" name="PreProcess Incoming Data" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_1krl2dg</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0u41iz2</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback() -DoCreateNetworkInstanceRollback.preProcessRequest(execution)]]></bpmn:script> +DoCreateNetworkInstanceRollback.preProcessRequest(execution)</bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_1krl2dg" sourceRef="StartEvent_1" targetRef="Task_0whino1" /> <bpmn:sequenceFlow id="SequenceFlow_0u41iz2" sourceRef="Task_0whino1" targetRef="ExclusiveGateway_0p5zgdb" /> @@ -72,9 +72,9 @@ DoCreateNetworkInstanceRollback.preProcessRequest(execution)]]></bpmn:script> <bpmn:incoming>SequenceFlow_0qc4v9t</bpmn:incoming> <bpmn:incoming>SequenceFlow_0el8yzs</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0yto4gz</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback() -DoCreateNetworkInstanceRollback.validateRollbackResponses(execution)]]></bpmn:script> +DoCreateNetworkInstanceRollback.validateRollbackResponses(execution)</bpmn:script> </bpmn:scriptTask> <bpmn:exclusiveGateway id="ExclusiveGateway_1n5jck8" name="is SDNC Rollback?" default="SequenceFlow_0qc4v9t"> <bpmn:incoming>SequenceFlow_1lteduj</bpmn:incoming> @@ -84,20 +84,20 @@ DoCreateNetworkInstanceRollback.validateRollbackResponses(execution)]]></bpmn:sc </bpmn:exclusiveGateway> <bpmn:sequenceFlow id="SequenceFlow_1bb7zpp" name="No" sourceRef="ExclusiveGateway_0p5zgdb" targetRef="ExclusiveGateway_0v0en47" /> <bpmn:sequenceFlow id="SequenceFlow_1mxbdps" name="Yes" sourceRef="ExclusiveGateway_0p5zgdb" targetRef="CallActivity_1x88fsq"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKIR_rollbackActivateSDNCRequest") != null}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("CRENWKIR_rollbackActivateSDNCRequest") != null}</bpmn:conditionExpression> </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_0e1uixp" name="Yes" sourceRef="ExclusiveGateway_0v0en47" targetRef="ServiceTask_0bqh5yl"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKIR_rollbackNetworkRequest") != null}]]></bpmn:conditionExpression> + <bpmn:sequenceFlow id="SequenceFlow_0e1uixp" name="Yes" sourceRef="ExclusiveGateway_0v0en47" targetRef="Activity_0620gqx"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("CRENWKIR_rollbackNetworkRequest") != null}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="SequenceFlow_07s5r14" sourceRef="CallActivity_1x88fsq" targetRef="ExclusiveGateway_0v0en47" /> <bpmn:sequenceFlow id="SequenceFlow_1lteduj" name="No" sourceRef="ExclusiveGateway_0v0en47" targetRef="ExclusiveGateway_1n5jck8" /> <bpmn:sequenceFlow id="SequenceFlow_0virkpu" name="Yes" sourceRef="ExclusiveGateway_1n5jck8" targetRef="ExclusiveGateway_17g4q5c"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKIR_rollbackSDNCRequest") != null}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("CRENWKIR_rollbackSDNCRequest") != null}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="SequenceFlow_17o4w67" sourceRef="ServiceTask_0bqh5yl" targetRef="ExclusiveGateway_1n5jck8" /> <bpmn:sequenceFlow id="SequenceFlow_101y57s" name="No" sourceRef="ExclusiveGateway_17g4q5c" targetRef="CallActivity_1xilevb" /> <bpmn:sequenceFlow id="SequenceFlow_0mw0dgd" name="Yes" sourceRef="ExclusiveGateway_17g4q5c" targetRef="CallActivity_0kbwa1x"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion") != '1610'} ]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'} </bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:endEvent id="EndEvent_1fvr7ad"> <bpmn:incoming>SequenceFlow_0yto4gz</bpmn:incoming> @@ -109,9 +109,9 @@ DoCreateNetworkInstanceRollback.validateRollbackResponses(execution)]]></bpmn:sc <bpmn:scriptTask id="ScriptTask_0by1uwk" name="Log / Print Unexpected Error" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_0xktw7v</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0soe5t3</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback() -DoCreateNetworkInstanceRollback.processJavaException(execution)]]></bpmn:script> +DoCreateNetworkInstanceRollback.processJavaException(execution)</bpmn:script> </bpmn:scriptTask> <bpmn:startEvent id="StartEvent_1j0eixl"> <bpmn:outgoing>SequenceFlow_0xktw7v</bpmn:outgoing> @@ -137,9 +137,9 @@ DoCreateNetworkInstanceRollback.processJavaException(execution)]]></bpmn:script> <bpmn:scriptTask id="Task_07i164j" name="Catch Exception" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_0q0te67</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0lomcvn</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* execution.setVariable("workflowException", execution.getVariable("WorkflowException") -]]></bpmn:script> +</bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_0q0te67" sourceRef="StartEvent_1p75ok8" targetRef="Task_07i164j" /> <bpmn:sequenceFlow id="SequenceFlow_0lomcvn" sourceRef="Task_07i164j" targetRef="EndEvent_1aqh7ih" /> @@ -172,29 +172,41 @@ execution.setVariable("workflowException", execution.getVariable("WorkflowExcept </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_1j55a94" sourceRef="BoundaryEvent_1yj6513" targetRef="EndEvent_05tcxw3" /> <bpmn:sequenceFlow id="SequenceFlow_1yn24xq" sourceRef="BoundaryEvent_1y8kgef" targetRef="EndEvent_05tcxw3" /> - <bpmn:scriptTask id="ServiceTask_0bqh5yl" name="Call Rollback Network" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_0e1uixp</bpmn:incoming> + <bpmn:scriptTask id="ServiceTask_0bqh5yl" name="Set Response" scriptFormat="groovy"> + <bpmn:incoming>Flow_0t2n952</bpmn:incoming> <bpmn:outgoing>SequenceFlow_17o4w67</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstanceRollback = new DoCreateNetworkInstanceRollback() -DoCreateNetworkInstanceRollback.callPONetworkAdapter(execution)]]></bpmn:script> +DoCreateNetworkInstanceRollback.setNetworkAdapterResponseCode(execution)</bpmn:script> </bpmn:scriptTask> - <bpmn:textAnnotation id="TextAnnotation_000ap15"> <bpmn:text><![CDATA[Include ONLY inputs/varrables: + <bpmn:callActivity id="Activity_0620gqx" name="openstack Adapter" calledElement="openstackAdapterTask"> + <bpmn:extensionElements> + <camunda:in source="CRENWKIR_rollbackNetworkRequest" target="openstackAdapterTaskRequest" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="WorkflowResponse" target="WorkflowResponse" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_0e1uixp</bpmn:incoming> + <bpmn:outgoing>Flow_0t2n952</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="Flow_0t2n952" sourceRef="Activity_0620gqx" targetRef="ServiceTask_0bqh5yl" /> + <bpmn:textAnnotation id="TextAnnotation_000ap15"> + <bpmn:text>Include ONLY inputs/varrables: rollbackData, as Map -rollbackSDNCRequest -rollbackActivateSDNCRequest -rollbackNetworkRequest WorkflowException -]]></bpmn:text> -</bpmn:textAnnotation> +</bpmn:text> + </bpmn:textAnnotation> <bpmn:association id="Association_0ybkmal" sourceRef="Task_0whino1" targetRef="TextAnnotation_000ap15" /> - <bpmn:textAnnotation id="TextAnnotation_0vwyo82"> <bpmn:text><![CDATA[set value for: + <bpmn:textAnnotation id="TextAnnotation_0vwyo82"> + <bpmn:text>set value for: WorkflowException rolledBack wasDeleted -]]></bpmn:text> -</bpmn:textAnnotation> +</bpmn:text> + </bpmn:textAnnotation> <bpmn:association id="Association_1gx121b" sourceRef="ScriptTask_1ggaxfu" targetRef="TextAnnotation_0vwyo82" /> </bpmn:process> <bpmn:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> @@ -202,316 +214,321 @@ wasDeleted <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateNetworkInstanceRollback"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> - <dc:Bounds x="214" y="240" width="36" height="36" /> + <dc:Bounds x="374" y="100" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="232" y="276" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1dqe09s_di" bpmnElement="Task_0whino1"> - <dc:Bounds x="333" y="218" width="100" height="80" /> + <dc:Bounds x="493" y="78" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1krl2dg_di" bpmnElement="SequenceFlow_1krl2dg"> - <di:waypoint xsi:type="dc:Point" x="250" y="258" /> - <di:waypoint xsi:type="dc:Point" x="333" y="258" /> + <di:waypoint x="410" y="118" /> + <di:waypoint x="493" y="118" /> <bpmndi:BPMNLabel> <dc:Bounds x="292" y="243" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0u41iz2_di" bpmnElement="SequenceFlow_0u41iz2"> - <di:waypoint xsi:type="dc:Point" x="433" y="258" /> - <di:waypoint xsi:type="dc:Point" x="556" y="258" /> - <di:waypoint xsi:type="dc:Point" x="556" y="347" /> + <di:waypoint x="593" y="118" /> + <di:waypoint x="716" y="118" /> + <di:waypoint x="716" y="207" /> <bpmndi:BPMNLabel> <dc:Bounds x="495" y="243" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1x88fsq_di" bpmnElement="CallActivity_1x88fsq"> - <dc:Bounds x="506" y="481" width="100" height="80" /> + <dc:Bounds x="666" y="341" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0kbwa1x_di" bpmnElement="CallActivity_0kbwa1x"> - <dc:Bounds x="972" y="481" width="100" height="80" /> + <dc:Bounds x="1132" y="341" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_0p5zgdb_di" bpmnElement="ExclusiveGateway_0p5zgdb" isMarkerVisible="true"> - <dc:Bounds x="531" y="347" width="50" height="50" /> + <dc:Bounds x="691" y="207" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="439" y="360" width="79" height="24" /> + <dc:Bounds x="600" y="220" width="77" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_0v0en47_di" bpmnElement="ExclusiveGateway_0v0en47" isMarkerVisible="true"> - <dc:Bounds x="697" y="347" width="50" height="50" /> + <dc:Bounds x="857" y="207" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="685" y="312" width="74" height="24" /> + <dc:Bounds x="847" y="172" width="71" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="TextAnnotation_000ap15_di" bpmnElement="TextAnnotation_000ap15"> - <dc:Bounds x="112" y="355" width="277" height="115" /> + <dc:Bounds x="272" y="215" width="277" height="115" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Association_0ybkmal_di" bpmnElement="Association_0ybkmal"> - <di:waypoint xsi:type="dc:Point" x="349" y="298" /> - <di:waypoint xsi:type="dc:Point" x="300" y="355" /> + <di:waypoint x="509" y="158" /> + <di:waypoint x="460" y="215" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1xilevb_di" bpmnElement="CallActivity_1xilevb"> - <dc:Bounds x="972" y="608" width="100" height="80" /> + <dc:Bounds x="1132" y="468" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_17g4q5c_di" bpmnElement="ExclusiveGateway_17g4q5c" isMarkerVisible="true"> - <dc:Bounds x="879" y="496" width="50" height="50" /> + <dc:Bounds x="1039" y="356" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="914" y="460" width="82" height="12" /> + <dc:Bounds x="1074" y="320" width="83" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1ggaxfu_di" bpmnElement="ScriptTask_1ggaxfu"> - <dc:Bounds x="1123" y="332" width="100" height="80" /> + <dc:Bounds x="1283" y="192" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_1n5jck8_di" bpmnElement="ExclusiveGateway_1n5jck8" isMarkerVisible="true"> - <dc:Bounds x="879" y="347" width="50" height="50" /> + <dc:Bounds x="1039" y="207" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="880" y="308" width="48" height="24" /> + <dc:Bounds x="1040" y="168" width="49" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="TextAnnotation_0vwyo82_di" bpmnElement="TextAnnotation_0vwyo82"> - <dc:Bounds x="1287" y="410" width="165" height="60" /> + <dc:Bounds x="1447" y="270" width="165" height="60" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Association_1gx121b_di" bpmnElement="Association_1gx121b"> - <di:waypoint xsi:type="dc:Point" x="1223" y="389" /> - <di:waypoint xsi:type="dc:Point" x="1287" y="412" /> + <di:waypoint x="1383" y="249" /> + <di:waypoint x="1447" y="272" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1bb7zpp_di" bpmnElement="SequenceFlow_1bb7zpp"> - <di:waypoint xsi:type="dc:Point" x="581" y="372" /> - <di:waypoint xsi:type="dc:Point" x="697" y="372" /> + <di:waypoint x="741" y="232" /> + <di:waypoint x="857" y="232" /> <bpmndi:BPMNLabel> - <dc:Bounds x="582" y="349.27450980392155" width="14" height="12" /> + <dc:Bounds x="742" y="209" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1mxbdps_di" bpmnElement="SequenceFlow_1mxbdps"> - <di:waypoint xsi:type="dc:Point" x="556" y="397" /> - <di:waypoint xsi:type="dc:Point" x="556" y="481" /> + <di:waypoint x="716" y="257" /> + <di:waypoint x="716" y="341" /> <bpmndi:BPMNLabel> - <dc:Bounds x="560" y="397.10731155015196" width="18" height="12" /> + <dc:Bounds x="720" y="257" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0e1uixp_di" bpmnElement="SequenceFlow_0e1uixp"> - <di:waypoint xsi:type="dc:Point" x="722" y="397" /> - <di:waypoint xsi:type="dc:Point" x="722" y="439" /> - <di:waypoint xsi:type="dc:Point" x="722" y="439" /> - <di:waypoint xsi:type="dc:Point" x="722" y="481" /> + <di:waypoint x="882" y="257" /> + <di:waypoint x="882" y="290" /> <bpmndi:BPMNLabel> - <dc:Bounds x="730" y="395" width="18" height="12" /> + <dc:Bounds x="890" y="253" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_07s5r14_di" bpmnElement="SequenceFlow_07s5r14"> - <di:waypoint xsi:type="dc:Point" x="606" y="521" /> - <di:waypoint xsi:type="dc:Point" x="647" y="521" /> - <di:waypoint xsi:type="dc:Point" x="647" y="372" /> - <di:waypoint xsi:type="dc:Point" x="697" y="372" /> + <di:waypoint x="766" y="381" /> + <di:waypoint x="807" y="381" /> + <di:waypoint x="807" y="232" /> + <di:waypoint x="857" y="232" /> <bpmndi:BPMNLabel> <dc:Bounds x="662" y="446.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1lteduj_di" bpmnElement="SequenceFlow_1lteduj"> - <di:waypoint xsi:type="dc:Point" x="747" y="372" /> - <di:waypoint xsi:type="dc:Point" x="879" y="372" /> + <di:waypoint x="907" y="232" /> + <di:waypoint x="1039" y="232" /> <bpmndi:BPMNLabel> - <dc:Bounds x="750" y="350.14631933618307" width="14" height="12" /> + <dc:Bounds x="910" y="210" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0virkpu_di" bpmnElement="SequenceFlow_0virkpu"> - <di:waypoint xsi:type="dc:Point" x="904" y="397" /> - <di:waypoint xsi:type="dc:Point" x="904" y="496" /> + <di:waypoint x="1064" y="257" /> + <di:waypoint x="1064" y="356" /> <bpmndi:BPMNLabel> - <dc:Bounds x="914" y="392.7469456247061" width="18" height="12" /> + <dc:Bounds x="1074" y="253" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_17o4w67_di" bpmnElement="SequenceFlow_17o4w67"> - <di:waypoint xsi:type="dc:Point" x="772" y="521" /> - <di:waypoint xsi:type="dc:Point" x="817" y="521" /> - <di:waypoint xsi:type="dc:Point" x="817" y="372" /> - <di:waypoint xsi:type="dc:Point" x="879" y="372" /> + <di:waypoint x="932" y="451" /> + <di:waypoint x="977" y="451" /> + <di:waypoint x="977" y="232" /> + <di:waypoint x="1039" y="232" /> <bpmndi:BPMNLabel> <dc:Bounds x="832" y="446.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_101y57s_di" bpmnElement="SequenceFlow_101y57s"> - <di:waypoint xsi:type="dc:Point" x="904" y="546" /> - <di:waypoint xsi:type="dc:Point" x="904" y="648" /> - <di:waypoint xsi:type="dc:Point" x="972" y="648" /> + <di:waypoint x="1064" y="406" /> + <di:waypoint x="1064" y="508" /> + <di:waypoint x="1132" y="508" /> <bpmndi:BPMNLabel> - <dc:Bounds x="913" y="544" width="14" height="12" /> + <dc:Bounds x="1073" y="404" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0mw0dgd_di" bpmnElement="SequenceFlow_0mw0dgd"> - <di:waypoint xsi:type="dc:Point" x="929" y="521" /> - <di:waypoint xsi:type="dc:Point" x="972" y="521" /> + <di:waypoint x="1089" y="381" /> + <di:waypoint x="1132" y="381" /> <bpmndi:BPMNLabel> - <dc:Bounds x="930" y="498" width="18" height="12" /> + <dc:Bounds x="1090" y="358" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_1fvr7ad_di" bpmnElement="EndEvent_1fvr7ad"> - <dc:Bounds x="1278" y="255" width="36" height="36" /> + <dc:Bounds x="1438" y="115" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1296" y="291" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0qc4v9t_di" bpmnElement="SequenceFlow_0qc4v9t"> - <di:waypoint xsi:type="dc:Point" x="929" y="372" /> - <di:waypoint xsi:type="dc:Point" x="1123" y="372" /> + <di:waypoint x="1089" y="232" /> + <di:waypoint x="1283" y="232" /> <bpmndi:BPMNLabel> - <dc:Bounds x="941" y="351.1191898360114" width="14" height="12" /> + <dc:Bounds x="1101" y="211" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0790olb_di" bpmnElement="SequenceFlow_0790olb"> - <di:waypoint xsi:type="dc:Point" x="1072" y="648" /> - <di:waypoint xsi:type="dc:Point" x="1173" y="648" /> - <di:waypoint xsi:type="dc:Point" x="1173" y="546" /> + <di:waypoint x="1232" y="508" /> + <di:waypoint x="1333" y="508" /> + <di:waypoint x="1333" y="406" /> <bpmndi:BPMNLabel> <dc:Bounds x="1123" y="633" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1rrutp3_di" bpmnElement="SequenceFlow_1rrutp3"> - <di:waypoint xsi:type="dc:Point" x="1072" y="521" /> - <di:waypoint xsi:type="dc:Point" x="1148" y="521" /> + <di:waypoint x="1232" y="381" /> + <di:waypoint x="1308" y="381" /> <bpmndi:BPMNLabel> <dc:Bounds x="1110" y="506" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="SubProcess_1p4663w_di" bpmnElement="SubProcess_1p4663w" isExpanded="true"> - <dc:Bounds x="-6" y="665" width="394" height="188" /> + <dc:Bounds x="154" y="525" width="394" height="188" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0by1uwk_di" bpmnElement="ScriptTask_0by1uwk"> - <dc:Bounds x="142" y="720" width="100" height="80" /> + <dc:Bounds x="302" y="580" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_1j0eixl_di" bpmnElement="StartEvent_1j0eixl"> - <dc:Bounds x="27" y="742" width="36" height="36" /> + <dc:Bounds x="187" y="602" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="45" y="783" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0jxh015_di" bpmnElement="EndEvent_0jxh015"> - <dc:Bounds x="303" y="742" width="36" height="36" /> + <dc:Bounds x="463" y="602" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="321" y="783" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0xktw7v_di" bpmnElement="SequenceFlow_0xktw7v"> - <di:waypoint xsi:type="dc:Point" x="63" y="760" /> - <di:waypoint xsi:type="dc:Point" x="142" y="760" /> + <di:waypoint x="223" y="620" /> + <di:waypoint x="302" y="620" /> <bpmndi:BPMNLabel> <dc:Bounds x="105" y="760" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0soe5t3_di" bpmnElement="SequenceFlow_0soe5t3"> - <di:waypoint xsi:type="dc:Point" x="242" y="760" /> - <di:waypoint xsi:type="dc:Point" x="303" y="760" /> + <di:waypoint x="402" y="620" /> + <di:waypoint x="463" y="620" /> <bpmndi:BPMNLabel> <dc:Bounds x="277" y="760" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="InclusiveGateway_0dot6c9_di" bpmnElement="ExclusiveGateway_0b9kbop"> - <dc:Bounds x="1148" y="496" width="50" height="50" /> + <dc:Bounds x="1308" y="356" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="1173" y="546" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0el8yzs_di" bpmnElement="SequenceFlow_0el8yzs"> - <di:waypoint xsi:type="dc:Point" x="1173" y="496" /> - <di:waypoint xsi:type="dc:Point" x="1173" y="412" /> + <di:waypoint x="1333" y="356" /> + <di:waypoint x="1333" y="272" /> <bpmndi:BPMNLabel> <dc:Bounds x="1188" y="444" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0yto4gz_di" bpmnElement="SequenceFlow_0yto4gz"> - <di:waypoint xsi:type="dc:Point" x="1173" y="332" /> - <di:waypoint xsi:type="dc:Point" x="1173" y="273" /> - <di:waypoint xsi:type="dc:Point" x="1278" y="273" /> + <di:waypoint x="1333" y="192" /> + <di:waypoint x="1333" y="133" /> + <di:waypoint x="1438" y="133" /> <bpmndi:BPMNLabel> <dc:Bounds x="1188" y="302.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="SubProcess_1laq87i_di" bpmnElement="SubProcess_0y6ppiy" isExpanded="true"> - <dc:Bounds x="2" y="886" width="382" height="213" /> + <dc:Bounds x="162" y="746" width="382" height="213" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1aqh7ih_di" bpmnElement="EndEvent_1aqh7ih"> - <dc:Bounds x="305" y="964" width="36" height="36" /> + <dc:Bounds x="465" y="824" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="323" y="1000" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0gg2fk5_di" bpmnElement="Task_07i164j"> - <dc:Bounds x="132" y="942" width="100" height="80" /> + <dc:Bounds x="292" y="802" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0q0te67_di" bpmnElement="SequenceFlow_0q0te67"> - <di:waypoint xsi:type="dc:Point" x="68" y="982" /> - <di:waypoint xsi:type="dc:Point" x="132" y="982" /> + <di:waypoint x="228" y="842" /> + <di:waypoint x="292" y="842" /> <bpmndi:BPMNLabel> <dc:Bounds x="100" y="967" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0lomcvn_di" bpmnElement="SequenceFlow_0lomcvn"> - <di:waypoint xsi:type="dc:Point" x="232" y="982" /> - <di:waypoint xsi:type="dc:Point" x="305" y="982" /> + <di:waypoint x="392" y="842" /> + <di:waypoint x="465" y="842" /> <bpmndi:BPMNLabel> <dc:Bounds x="269" y="957" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="BoundaryEvent_0i4ili6_di" bpmnElement="BoundaryEvent_0dnnott"> - <dc:Bounds x="588" y="543" width="36" height="36" /> + <dc:Bounds x="748" y="403" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="606" y="579" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0ctlrql_di" bpmnElement="SequenceFlow_0ctlrql"> - <di:waypoint xsi:type="dc:Point" x="612" y="577" /> - <di:waypoint xsi:type="dc:Point" x="631" y="622" /> + <di:waypoint x="772" y="437" /> + <di:waypoint x="791" y="482" /> <bpmndi:BPMNLabel> <dc:Bounds x="622" y="584.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_1ra7y1s_di" bpmnElement="EndEvent_0n9y395"> - <dc:Bounds x="621" y="620" width="36" height="36" /> + <dc:Bounds x="781" y="480" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="639" y="656" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_0a7qaw9_di" bpmnElement="StartEvent_1p75ok8"> - <dc:Bounds x="32" y="964" width="36" height="36" /> + <dc:Bounds x="192" y="824" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="50" y="1000" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="BoundaryEvent_13arr8o_di" bpmnElement="BoundaryEvent_1yj6513"> - <dc:Bounds x="1054" y="543" width="36" height="36" /> + <dc:Bounds x="1214" y="403" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1072" y="579" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="BoundaryEvent_0qs2m90_di" bpmnElement="BoundaryEvent_1y8kgef"> - <dc:Bounds x="1054" y="590" width="36" height="36" /> + <dc:Bounds x="1214" y="450" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1072" y="626" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0tnenxe_di" bpmnElement="EndEvent_05tcxw3"> - <dc:Bounds x="1116" y="573" width="36" height="36" /> + <dc:Bounds x="1276" y="433" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1134" y="609" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1j55a94_di" bpmnElement="SequenceFlow_1j55a94"> - <di:waypoint xsi:type="dc:Point" x="1088" y="569" /> - <di:waypoint xsi:type="dc:Point" x="1118" y="584" /> + <di:waypoint x="1248" y="429" /> + <di:waypoint x="1278" y="444" /> <bpmndi:BPMNLabel> <dc:Bounds x="1103" y="561.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1yn24xq_di" bpmnElement="SequenceFlow_1yn24xq"> - <di:waypoint xsi:type="dc:Point" x="1088" y="599" /> - <di:waypoint xsi:type="dc:Point" x="1116" y="591" /> + <di:waypoint x="1248" y="459" /> + <di:waypoint x="1276" y="451" /> <bpmndi:BPMNLabel> <dc:Bounds x="1102" y="580" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0c5jqhn_di" bpmnElement="ServiceTask_0bqh5yl"> - <dc:Bounds x="672" y="481" width="100" height="80" /> + <dc:Bounds x="832" y="411" width="100" height="80" /> </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0txfb5e_di" bpmnElement="Activity_0620gqx"> + <dc:Bounds x="832" y="290" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="Flow_0t2n952_di" bpmnElement="Flow_0t2n952"> + <di:waypoint x="882" y="370" /> + <di:waypoint x="882" y="411" /> + </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> -</bpmn:definitions>
\ No newline at end of file +</bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModule.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModule.bpmn index 0d1b970c62..74e0600f4f 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModule.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModule.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_pNTO8MRhEeWv36YLr7PC3Q" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_pNTO8MRhEeWv36YLr7PC3Q" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoCreateVfModule" name="DoCreateVfModule" isExecutable="true"> <bpmn2:startEvent id="StartEvent_1" name="Start"> <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> @@ -37,7 +37,7 @@ <bpmn2:outgoing>SequenceFlow_21</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_19" name="yes" sourceRef="IsVolumeGroupNameSpecified" targetRef="ConfirmVolumeName"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFM_volumeGroupName") != null && execution.getVariable("DCVFM_volumeGroupName") != "" }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFM_volumeGroupName") != null && execution.getVariable("DCVFM_volumeGroupName") != "" }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_21" name="no" sourceRef="IsVolumeGroupNameSpecified" targetRef="ExclusiveGateway_4" /> <bpmn2:callActivity id="ConfirmVolumeName" name="Confirm Volume Group Name" calledElement="ConfirmVolumeGroupName"> @@ -76,19 +76,19 @@ <bpmn2:scriptTask id="PostProcessSDNCAssignRequest" name="PostProcess SDNC Assign Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_20</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1nh92s8</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* String response = execution.getVariable("DCVFM_assignSDNCAdapterResponse") def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.validateSDNCResponse(execution, response, "assign")]]></bpmn2:script> +doCreateVfModule.validateSDNCResponse(execution, response, "assign")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="PreProcessSDNCAssignRequest" name="PreProcess SDNC Assign Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_18</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessSDNCAssignRequest(execution)]]></bpmn2:script> +doCreateVfModule.preProcessSDNCAssignRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_18" name="" sourceRef="PreProcessSDNCAssignRequest" targetRef="CallSDNCAdapterVDModuleTopologyAssign" /> <bpmn2:sequenceFlow id="SequenceFlow_20" name="" sourceRef="CallSDNCAdapterVDModuleTopologyAssign" targetRef="PostProcessSDNCAssignRequest" /> @@ -96,9 +96,9 @@ doCreateVfModule.preProcessSDNCAssignRequest(execution)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_0p61zug</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_0aegg0r</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_23</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessSDNCGetRequest(execution, "vfmodule")]]></bpmn2:script> +doCreateVfModule.preProcessSDNCGetRequest(execution, "vfmodule")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CallSDNCAdapterVFModuleTopologyGET" name="Call SDNC Adapter: VF Module Topology GET" calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -118,12 +118,12 @@ doCreateVfModule.preProcessSDNCGetRequest(execution, "vfmodule")]]></bpmn2:scrip <bpmn2:scriptTask id="PostProcessSDNCGetRequest" name="PostProcess SDNC GET Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_24</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_31</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* String response = execution.getVariable("DCVFM_getSDNCAdapterResponse") def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.validateSDNCResponse(execution, response, "get")]]></bpmn2:script> +doCreateVfModule.validateSDNCResponse(execution, response, "get")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="UpdateAAIVfModule_1" name="UpdateAAIVfModule" calledElement="UpdateAAIVfModule"> <bpmn2:extensionElements> @@ -138,16 +138,16 @@ doCreateVfModule.validateSDNCResponse(execution, response, "get")]]></bpmn2:scri <bpmn2:scriptTask id="PreProcessUpdateAAIVfModule_1" name="PreProcess Update AAIVfModule" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1avfxsz</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessUpdateAAIVfModuleRequestOrch(execution)]]></bpmn2:script> +doCreateVfModule.preProcessUpdateAAIVfModuleRequestOrch(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="PreProcessSDNCActivateRequest" name="PreProcess SDNC Activate Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessSDNCActivateRequest(execution)]]></bpmn2:script> +doCreateVfModule.preProcessSDNCActivateRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CallSDNCAdapterVFModuleTopologyActivate" name="Call SDNC Adapter: VF Module Topology Activate" calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -165,12 +165,12 @@ doCreateVfModule.preProcessSDNCActivateRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="PostProcessSDNCActivateRequest" name="PostProcess SDNC Activate Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_13</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* String response = execution.getVariable("DCVFM_activateSDNCAdapterResponse") def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.validateSDNCResponse(execution, response, "activate")]]></bpmn2:script> +doCreateVfModule.validateSDNCResponse(execution, response, "activate")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="ExclusiveGateway_5" name="Is volume_group_id specified?" default="SequenceFlow_30"> <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming> @@ -195,9 +195,9 @@ doCreateVfModule.validateSDNCResponse(execution, response, "activate")]]></bpmn2 <bpmn2:scriptTask id="PrepareCreateAAIVfModuleVolumeGroupRequest" name="Prepare CreateAAIVfModuleVolumeGroup Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_28</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.prepareCreateAAIVfModuleVolumeGroupRequest(execution)]]></bpmn2:script> +doCreateVfModule.prepareCreateAAIVfModuleVolumeGroupRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CreateAAIVfModuleVolumeGroup" name="CreateAAIVfModuleVolumeGroup" calledElement="CreateAAIVfModuleVolumeGroup"> <bpmn2:extensionElements> @@ -220,13 +220,13 @@ doCreateVfModule.prepareCreateAAIVfModuleVolumeGroupRequest(execution)]]></bpmn2 <bpmn2:scriptTask id="PreProcessVNFAdapterRequest" name="PreProcess VNF Adapter Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_31</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessVNFAdapterRequest(execution)]]></bpmn2:script> +doCreateVfModule.preProcessVNFAdapterRequest(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:callActivity id="CallVNFAdapterVFModuleCreate" name="Call VNF Adapter to create VF Module" calledElement="vnfAdapterTask"> + <bpmn2:callActivity id="CallVNFAdapterVFModuleCreate" name="Call VNF Adapter to create VF Module" calledElement="openstackAdapterTask"> <bpmn2:extensionElements> - <camunda:in source="DCVFM_createVnfARequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="DCVFM_createVnfARequest" target="openstackAdapterTaskRequest" /> <camunda:out source="WorkflowResponse" target="DCVFM_createVnfAResponse" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> @@ -239,9 +239,9 @@ doCreateVfModule.preProcessVNFAdapterRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="PostProcessVNFAdapterRequest" name="PostProcess VNF Adapter Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_33</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1ushk1d</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.postProcessVNFAdapterRequest(execution)]]></bpmn2:script> +doCreateVfModule.postProcessVNFAdapterRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_2" name="To UpdateAndActivate"> <bpmn2:incoming>SequenceFlow_0xfanpi</bpmn2:incoming> @@ -265,9 +265,9 @@ doCreateVfModule.postProcessVNFAdapterRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="PostProcessCreateAAIVfModule" name="PostProcess CreateAAIVfModule" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_25</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_27</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.postProcessCreateAAIVfModule(execution)]]></bpmn2:script> +doCreateVfModule.postProcessCreateAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_27" name="" sourceRef="PostProcessCreateAAIVfModule" targetRef="IsBaseVfModule" /> <bpmn2:exclusiveGateway id="IsBaseVfModule" name="Is Base VF Module?" default="SequenceFlow_36"> @@ -277,22 +277,22 @@ doCreateVfModule.postProcessCreateAAIVfModule(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_36" name="no" sourceRef="IsBaseVfModule" targetRef="QueryAAIVfModule" /> <bpmn2:sequenceFlow id="SequenceFlow_39" name="yes" sourceRef="IsBaseVfModule" targetRef="ExclusiveGateway_2"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DCVFM_isBaseVfModule") == "true"]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DCVFM_isBaseVfModule") == "true"</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:scriptTask id="QueryAAIVfModule" name="Query AAI Vf Module" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_36</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_37</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.queryAAIVfModule(execution)]]></bpmn2:script> +doCreateVfModule.queryAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_37" name="" sourceRef="QueryAAIVfModule" targetRef="ExclusiveGateway_2" /> <bpmn2:scriptTask id="ScriptTask_setSuccess" name="Set Success Indicator" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_16</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.setSuccessIndicator(execution, true)]]></bpmn2:script> +doCreateVfModule.setSuccessIndicator(execution, true)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_7" name="" sourceRef="ScriptTask_setSuccess" targetRef="EndEvent_1" /> <bpmn2:endEvent id="EndEvent_1"> @@ -302,20 +302,20 @@ doCreateVfModule.setSuccessIndicator(execution, true)]]></bpmn2:script> <bpmn2:scriptTask id="QueryCloudRegion" name="Query Cloud Region" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_40</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_43</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -return doCreateVfModule.queryCloudRegion(execution)]]></bpmn2:script> +return doCreateVfModule.queryCloudRegion(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_40" name="yes" sourceRef="IsVolumeGroupIdSpecified" targetRef="QueryCloudRegion"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFM_volumeGroupId") != null && execution.getVariable("DCVFM_volumeGroupId") != "" }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFM_volumeGroupId") != null && execution.getVariable("DCVFM_volumeGroupId") != "" }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_43" name="" sourceRef="QueryCloudRegion" targetRef="ConfirmVolumeGroupTenant" /> <bpmn2:scriptTask id="PreProcessRequest" name="Pre-Process Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessRequest(execution)]]></bpmn2:script> +doCreateVfModule.preProcessRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="PreProcessRequest" targetRef="ExclusiveGateway_19933zh" /> <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_1" name="To DoCreateVfModule"> @@ -352,16 +352,16 @@ doCreateVfModule.preProcessRequest(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_1ushk1d" sourceRef="PostProcessVNFAdapterRequest" targetRef="ExclusiveGateway_183x8vk" /> <bpmn2:sequenceFlow id="SequenceFlow_0ery1pk" name="yes" sourceRef="ExclusiveGateway_183x8vk" targetRef="CreateNetworkPoliciesInAAI"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DCVFM_contrailNetworkPolicyFqdnList") != null && !execution.getVariable("DCVFM_contrailNetworkPolicyFqdnList").isEmpty()]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DCVFM_contrailNetworkPolicyFqdnList") != null && !execution.getVariable("DCVFM_contrailNetworkPolicyFqdnList").isEmpty()</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_0xfanpi" name="no" sourceRef="ExclusiveGateway_183x8vk" targetRef="IntermediateThrowEvent_2" /> <bpmn2:sequenceFlow id="SequenceFlow_0abffyj" sourceRef="CreateNetworkPoliciesInAAI" targetRef="IntermediateThrowEvent_2" /> <bpmn2:scriptTask id="CreateNetworkPoliciesInAAI" name="Create Network Policies In AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0ery1pk</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0abffyj</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.createNetworkPoliciesInAAI(execution)]]></bpmn2:script> +doCreateVfModule.createNetworkPoliciesInAAI(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="ExclusiveGateway_0f54imv" name="need to update VNF in AAI?" default="SequenceFlow_1k5uku2"> <bpmn2:incoming>SequenceFlow_0363dz7</bpmn2:incoming> @@ -374,7 +374,7 @@ doCreateVfModule.createNetworkPoliciesInAAI(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_1avfxsz</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0bi38s7" name="yes" sourceRef="ExclusiveGateway_0f54imv" targetRef="PreProcessUpdateAAIGenericVnf"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[!execution.getVariable("DCVFM_oamManagementV4Address").isEmpty() || !execution.getVariable("DCVFM_oamManagementV6Address").isEmpty()]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">!execution.getVariable("DCVFM_oamManagementV4Address").isEmpty() || !execution.getVariable("DCVFM_oamManagementV6Address").isEmpty()</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_1qm81ym" sourceRef="PreProcessUpdateAAIGenericVnf" targetRef="UpdateAAIGenericVNFTask" /> <bpmn2:sequenceFlow id="SequenceFlow_112los9" sourceRef="UpdateAAIGenericVNFTask" targetRef="ExclusiveGateway_1edqxlf" /> @@ -384,9 +384,9 @@ doCreateVfModule.createNetworkPoliciesInAAI(execution)]]></bpmn2:script> <bpmn2:scriptTask id="PreProcessUpdateAAIGenericVnf" name="PreProcess Update AAI Generic VNF" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0bi38s7</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1qm81ym</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.prepUpdateAAIGenericVnf(execution)]]></bpmn2:script> +doCreateVfModule.prepUpdateAAIGenericVnf(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="UpdateAAIGenericVNFTask" name="Update AAI Generic VNF" calledElement="UpdateAAIGenericVnf"> <bpmn2:extensionElements> @@ -401,16 +401,16 @@ doCreateVfModule.prepUpdateAAIGenericVnf(execution)]]></bpmn2:script> </bpmn2:callActivity> <bpmn2:sequenceFlow id="SequenceFlow_0zcfn2x" name="no" sourceRef="ExclusiveGateway_2" targetRef="IntermediateThrowEvent_3" /> <bpmn2:sequenceFlow id="SequenceFlow_0m382su" name="yes" sourceRef="ExclusiveGateway_2" targetRef="PreProcessSDNCVnfGetRequest"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFM_sdncVersion" ) == '1707'}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFM_sdncVersion" ) == '1707'}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_0g270u0" sourceRef="PreProcessSDNCVnfGetRequest" targetRef="CallSDNCAdapterVNFTopologyGET" /> <bpmn2:sequenceFlow id="SequenceFlow_1yrlvgb" sourceRef="CallSDNCAdapterVNFTopologyGET" targetRef="PostProcessSDNCVnfGetRequest" /> <bpmn2:scriptTask id="PreProcessSDNCVnfGetRequest" name="PreProcess SDNC VNF Topology GET Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0m382su</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0g270u0</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessSDNCGetRequest(execution, 'vnf')]]></bpmn2:script> +doCreateVfModule.preProcessSDNCGetRequest(execution, 'vnf')</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CallSDNCAdapterVNFTopologyGET" name="Call SDNC Adapter: VNF Topology GET" calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -428,12 +428,12 @@ doCreateVfModule.preProcessSDNCGetRequest(execution, 'vnf')]]></bpmn2:script> <bpmn2:scriptTask id="PostProcessSDNCVnfGetRequest" name="PostProcess SDNC VNF Toplogy GET request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1yrlvgb</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_170kw7h</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* String response = execution.getVariable("DCVFM_getVnfSDNCAdapterResponse") def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.validateSDNCResponse(execution, response, "get")]]></bpmn2:script> +doCreateVfModule.validateSDNCResponse(execution, response, "get")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_170kw7h" sourceRef="PostProcessSDNCVnfGetRequest" targetRef="IntermediateThrowEvent_3" /> <bpmn2:sequenceFlow id="SequenceFlow_1f53tby" sourceRef="Task_0kuj2a1" targetRef="IntermediateThrowEvent_1" /> @@ -445,7 +445,7 @@ doCreateVfModule.validateSDNCResponse(execution, response, "get")]]></bpmn2:scri </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0270n5c" name="yes" sourceRef="ExclusiveGateway_0ffvqla" targetRef="IntermediateThrowEvent_1" /> <bpmn2:sequenceFlow id="SequenceFlow_05og7iw" name="no" sourceRef="ExclusiveGateway_0ffvqla" targetRef="Task_0kuj2a1"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFM_vfModuleName") == null}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFM_vfModuleName") == null}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:callActivity id="Task_0kuj2a1" name="Generate VF Module Name" calledElement="GenerateVfModuleName"> <bpmn2:extensionElements> @@ -486,16 +486,16 @@ doCreateVfModule.validateSDNCResponse(execution, response, "get")]]></bpmn2:scri <bpmn2:scriptTask id="PreProcessRollback" name="Pre Process Rollback" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_04bd5in</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1i1q78e</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessRollback(execution)]]></bpmn2:script> +doCreateVfModule.preProcessRollback(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="PostProcessRollback" name="Post Process Rollback" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0112l2c</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0z2rczk</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.postProcessRollback(execution)]]></bpmn2:script> +doCreateVfModule.postProcessRollback(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_02lc25j" sourceRef="StartEvent_18lzc5m" targetRef="ExclusiveGateway_039bib8" /> <bpmn2:sequenceFlow id="SequenceFlow_0z2rczk" sourceRef="PostProcessRollback" targetRef="EndEvent_0wsdptv" /> @@ -508,14 +508,14 @@ doCreateVfModule.postProcessRollback(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_04bd5in" name="no" sourceRef="ExclusiveGateway_039bib8" targetRef="PreProcessRollback" /> <bpmn2:sequenceFlow id="SequenceFlow_1nh7m8d" name="yes" sourceRef="ExclusiveGateway_039bib8" targetRef="Task_1fm09pi"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("disableRollback" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("disableRollback" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:scriptTask id="Task_1fm09pi" name="Process Error" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1nh7m8d</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1pgo10r</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.processBPMNException(execution)]]></bpmn2:script> +doCreateVfModule.processBPMNException(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1pgo10r" sourceRef="Task_1fm09pi" targetRef="EndEvent_0wsdptv" /> </bpmn2:subProcess> @@ -525,7 +525,7 @@ doCreateVfModule.processBPMNException(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_006rnym</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_28" name="yes" sourceRef="ExclusiveGateway_5" targetRef="PrepareCreateAAIVfModuleVolumeGroupRequest"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFM_volumeGroupId") != null && execution.getVariable("DCVFM_volumeGroupId") != "" }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFM_volumeGroupId") != null && execution.getVariable("DCVFM_volumeGroupId") != "" }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:exclusiveGateway id="ExclusiveGateway_19933zh" name="Is aLaCarte?" default="SequenceFlow_1y1ttqe"> <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming> @@ -540,18 +540,18 @@ doCreateVfModule.processBPMNException(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0lilmm3" name="no" sourceRef="ExclusiveGateway_02fd6gx" targetRef="ExclusiveGateway_0ffvqla" /> <bpmn2:sequenceFlow id="SequenceFlow_1y8q87e" name="yes" sourceRef="ExclusiveGateway_19933zh" targetRef="Task_14n44kb"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DCVFM_aLaCarte") == true]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DCVFM_aLaCarte") == true</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_1sf1091" sourceRef="Task_14n44kb" targetRef="ExclusiveGateway_02fd6gx" /> <bpmn2:sequenceFlow id="SequenceFlow_17cp3tn" name="yes" sourceRef="ExclusiveGateway_0jw7ymg" targetRef="Task_0kqh1of"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DCVFM_twoPhaseDesign") == true]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DCVFM_twoPhaseDesign") == true</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:endEvent id="EndEvent_0pd6bbj"> <bpmn2:incoming>SequenceFlow_00bh7m7</bpmn2:incoming> <bpmn2:terminateEventDefinition /> </bpmn2:endEvent> <bpmn2:sequenceFlow id="SequenceFlow_15i583d" name="yes" sourceRef="ExclusiveGateway_02fd6gx" targetRef="ExclusiveGateway_1f6x9ii"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DCVFM_orchestrationStatus") == "PendingActivation" || execution.getVariable("DCVFM_orchestrationStatus") == "Assigned"]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DCVFM_orchestrationStatus") == "PendingActivation" || execution.getVariable("DCVFM_orchestrationStatus") == "Assigned"</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:exclusiveGateway id="ExclusiveGateway_0gsliyw" name="Is aLaCarte?" default="SequenceFlow_1iyt5i4"> <bpmn2:incoming>SequenceFlow_1nh92s8</bpmn2:incoming> @@ -559,7 +559,7 @@ doCreateVfModule.processBPMNException(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_1iyt5i4</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_16mgvsd" name="yes" sourceRef="ExclusiveGateway_0gsliyw" targetRef="Task_08tnqe1"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DCVFM_aLaCarte") == true]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DCVFM_aLaCarte") == true</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_1nh92s8" sourceRef="PostProcessSDNCAssignRequest" targetRef="ExclusiveGateway_0gsliyw" /> <bpmn2:sequenceFlow id="SequenceFlow_0cc17yk" sourceRef="Task_08tnqe1" targetRef="ExclusiveGateway_0jw7ymg" /> @@ -581,30 +581,30 @@ doCreateVfModule.processBPMNException(execution)]]></bpmn2:script> <bpmn2:scriptTask id="Task_0kqh1of" name="PrepareUpdateAAIVfModulePendingActivation" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_17cp3tn</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0ynd0iy</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessUpdateAAIVfModuleRequestStatus(execution, 'PendingActivation')]]></bpmn2:script> +doCreateVfModule.preProcessUpdateAAIVfModuleRequestStatus(execution, 'PendingActivation')</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="Task_08tnqe1" name="Query Catalog DB" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_16mgvsd</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0cc17yk</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.queryCatalogDB(execution)]]></bpmn2:script> +doCreateVfModule.queryCatalogDB(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="Task_14n44kb" name="Query AAI for Orchestration Status" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1y8q87e</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1sf1091</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.queryAAIVfModuleForStatus(execution)]]></bpmn2:script> +doCreateVfModule.queryAAIVfModuleForStatus(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="Task_16p51r4" name="Set Success Indicator 1st Phase" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1mnipp8</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_00bh7m7</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.setSuccessIndicator(execution, true)]]></bpmn2:script> +doCreateVfModule.setSuccessIndicator(execution, true)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="ExclusiveGateway_1f6x9ii" name="Is volume_group_id specified for stage 2?" default="SequenceFlow_0tfrcnc"> <bpmn2:incoming>SequenceFlow_15i583d</bpmn2:incoming> @@ -613,7 +613,7 @@ doCreateVfModule.setSuccessIndicator(execution, true)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0tfrcnc" name="no" sourceRef="ExclusiveGateway_1f6x9ii" targetRef="ExclusiveGateway_09r5rvt" /> <bpmn2:sequenceFlow id="SequenceFlow_0oadvvx" name="yes" sourceRef="ExclusiveGateway_1f6x9ii" targetRef="Task_0dx8gpp"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFM_volumeGroupId") != null && execution.getVariable("DCVFM_volumeGroupId") != "" }]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFM_volumeGroupId") != null && execution.getVariable("DCVFM_volumeGroupId") != "" }</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:exclusiveGateway id="ExclusiveGateway_09r5rvt"> <bpmn2:incoming>SequenceFlow_0tfrcnc</bpmn2:incoming> @@ -629,7 +629,7 @@ doCreateVfModule.setSuccessIndicator(execution, true)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_0p3cspl</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0xed5sn" name="yes" sourceRef="ExclusiveGateway_04msdir" targetRef="ExclusiveGateway_1biy4yg"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DCVFM_isBaseVfModule") == "true"]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DCVFM_isBaseVfModule") == "true"</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_0p3cspl" name="no" sourceRef="ExclusiveGateway_04msdir" targetRef="Task_0cdjxcd" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_1biy4yg"> @@ -642,9 +642,9 @@ doCreateVfModule.setSuccessIndicator(execution, true)]]></bpmn2:script> <bpmn2:scriptTask id="Task_0dx8gpp" name="Query Cloud Region For Stage 2" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0oadvvx</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_03batve</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -return doCreateVfModule.queryCloudRegion(execution)]]></bpmn2:script> +return doCreateVfModule.queryCloudRegion(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="Task_0e8s9xm" name="Confirm Volume Group Tenant" calledElement="ConfirmVolumeGroupTenant"> <bpmn2:extensionElements> @@ -663,17 +663,17 @@ return doCreateVfModule.queryCloudRegion(execution)]]></bpmn2:script> <bpmn2:scriptTask id="Task_0cdjxcd" name="Query AAI Vf Module for Stage 2" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0p3cspl</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1k7xbcu</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.queryAAIVfModule(execution)]]></bpmn2:script> +doCreateVfModule.queryAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="Task_19zw1li" name="PrepareUpdateAAIVfModuleAssign" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_006rnym</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_1iyt5i4</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0thm33s</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModule = new DoCreateVfModule() -doCreateVfModule.preProcessUpdateAAIVfModuleRequestStatus(execution, 'Assigned')]]></bpmn2:script> +doCreateVfModule.preProcessUpdateAAIVfModuleRequestStatus(execution, 'Assigned')</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="Task_01b1fio" name="Update AAI VF Module Assigned" calledElement="UpdateAAIVfModule"> <bpmn2:extensionElements> @@ -693,983 +693,983 @@ doCreateVfModule.preProcessUpdateAAIVfModuleRequestStatus(execution, 'Assigned') <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateVfModule"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_50" bpmnElement="StartEvent_1"> - <dc:Bounds x="38" y="153" width="36" height="36" /> + <dc:Bounds x="258" y="403" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="44" y="189" width="23" height="12" /> + <dc:Bounds x="263" y="439" width="25" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_50" targetElement="_BPMNShape_ScriptTask_124"> - <di:waypoint xsi:type="dc:Point" x="74" y="171" /> - <di:waypoint xsi:type="dc:Point" x="147" y="171" /> + <di:waypoint x="294" y="421" /> + <di:waypoint x="367" y="421" /> <bpmndi:BPMNLabel> <dc:Bounds x="99" y="171" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_124" bpmnElement="PreProcessRequest"> - <dc:Bounds x="147" y="131" width="100" height="80" /> + <dc:Bounds x="367" y="381" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_IntermediateCatchEvent_24" bpmnElement="IntermediateCatchEvent_1"> - <dc:Bounds x="36" y="376" width="36" height="36" /> + <dc:Bounds x="256" y="626" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="0" y="417" width="114" height="22" /> + <dc:Bounds x="235" y="667" width="85" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_IntermediateThrowEvent_22" bpmnElement="IntermediateThrowEvent_1"> - <dc:Bounds x="828" y="153" width="36" height="36" /> + <dc:Bounds x="1048" y="403" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="869" y="173" width="86" height="36" /> + <dc:Bounds x="1090" y="423" width="85" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_157" bpmnElement="CallSDNCAdapterVDModuleTopologyAssign"> - <dc:Bounds x="266" y="672" width="121" height="94" /> + <dc:Bounds x="486" y="922" width="121" height="94" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_158" bpmnElement="CallSDNCAdapterVFModuleTopologyGET"> - <dc:Bounds x="254" y="1029" width="133" height="97" /> + <dc:Bounds x="474" y="1279" width="133" height="97" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_90" bpmnElement="IsVolumeGroupIdSpecified" isMarkerVisible="true"> - <dc:Bounds x="144" y="368" width="50" height="50" /> + <dc:Bounds x="364" y="618" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="89" y="347" width="178" height="22" /> + <dc:Bounds x="356" y="597" width="84" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_172" bpmnElement="ConfirmVolumeGroupTenant"> - <dc:Bounds x="209" y="528" width="118" height="89" /> + <dc:Bounds x="429" y="778" width="118" height="89" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_91" bpmnElement="ExclusiveGateway_4" isMarkerVisible="true"> - <dc:Bounds x="559" y="368" width="50" height="50" /> + <dc:Bounds x="779" y="618" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="584" y="423" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_11" sourceElement="_BPMNShape_ExclusiveGateway_90" targetElement="_BPMNShape_ExclusiveGateway_91"> - <di:waypoint xsi:type="dc:Point" x="194" y="393" /> - <di:waypoint xsi:type="dc:Point" x="559" y="393" /> + <di:waypoint x="414" y="643" /> + <di:waypoint x="779" y="643" /> <bpmndi:BPMNLabel> - <dc:Bounds x="209" y="393" width="20" height="22" /> + <dc:Bounds x="433" y="643" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_173" bpmnElement="CallVNFAdapterVFModuleCreate"> - <dc:Bounds x="746" y="1031" width="121" height="97" /> + <dc:Bounds x="966" y="1281" width="121" height="97" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_174" bpmnElement="UpdateAAIVfModule_1"> - <dc:Bounds x="717" y="1211" width="117" height="97" /> + <dc:Bounds x="937" y="1461" width="117" height="97" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_175" bpmnElement="CallSDNCAdapterVFModuleTopologyActivate"> - <dc:Bounds x="1039" y="1209" width="119" height="99" /> + <dc:Bounds x="1259" y="1459" width="119" height="99" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_92" bpmnElement="ExclusiveGateway_5" isMarkerVisible="true"> - <dc:Bounds x="1384" y="1234" width="50" height="50" /> + <dc:Bounds x="1604" y="1484" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1381" y="1206" width="86" height="36" /> + <dc:Bounds x="1602" y="1456" width="84" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_176" bpmnElement="CreateAAIVfModuleVolumeGroup"> - <dc:Bounds x="1688" y="1204" width="121" height="112" /> + <dc:Bounds x="1908" y="1454" width="121" height="112" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_93" bpmnElement="ExclusiveGateway_6" isMarkerVisible="true"> - <dc:Bounds x="1813" y="1072" width="50" height="50" /> + <dc:Bounds x="2033" y="1322" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="1838" y="1127" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_29" sourceElement="_BPMNShape_ScriptTask_176" targetElement="_BPMNShape_ExclusiveGateway_93"> - <di:waypoint xsi:type="dc:Point" x="1808" y="1260" /> - <di:waypoint xsi:type="dc:Point" x="1838" y="1260" /> - <di:waypoint xsi:type="dc:Point" x="1838" y="1162" /> - <di:waypoint xsi:type="dc:Point" x="1838" y="1122" /> + <di:waypoint x="2028" y="1510" /> + <di:waypoint x="2058" y="1510" /> + <di:waypoint x="2058" y="1412" /> + <di:waypoint x="2058" y="1372" /> <bpmndi:BPMNLabel> <dc:Bounds x="1834" y="1260" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_30" bpmnElement="SequenceFlow_30" sourceElement="_BPMNShape_ExclusiveGateway_92" targetElement="_BPMNShape_ExclusiveGateway_93"> - <di:waypoint xsi:type="dc:Point" x="1409" y="1234" /> - <di:waypoint xsi:type="dc:Point" x="1409" y="1097" /> - <di:waypoint xsi:type="dc:Point" x="1813" y="1097" /> + <di:waypoint x="1629" y="1484" /> + <di:waypoint x="1629" y="1347" /> + <di:waypoint x="2033" y="1347" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1419" y="1143.6746987951808" width="12" height="12" /> + <dc:Bounds x="1639" y="1394" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_IntermediateCatchEvent_24" targetElement="_BPMNShape_ExclusiveGateway_90"> - <di:waypoint xsi:type="dc:Point" x="72" y="394" /> - <di:waypoint xsi:type="dc:Point" x="120" y="394" /> - <di:waypoint xsi:type="dc:Point" x="120" y="393" /> - <di:waypoint xsi:type="dc:Point" x="144" y="393" /> + <di:waypoint x="292" y="644" /> + <di:waypoint x="340" y="644" /> + <di:waypoint x="340" y="643" /> + <di:waypoint x="364" y="643" /> <bpmndi:BPMNLabel> <dc:Bounds x="117" y="394" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_101" bpmnElement="IsVolumeGroupNameSpecified" isMarkerVisible="true"> - <dc:Bounds x="360" y="547" width="50" height="50" /> + <dc:Bounds x="580" y="797" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="309" y="496" width="200" height="22" /> + <dc:Bounds x="585" y="746" width="88" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_17" bpmnElement="SequenceFlow_17" sourceElement="_BPMNShape_ScriptTask_172" targetElement="_BPMNShape_ExclusiveGateway_101"> - <di:waypoint xsi:type="dc:Point" x="327" y="572" /> - <di:waypoint xsi:type="dc:Point" x="360" y="572" /> + <di:waypoint x="547" y="822" /> + <di:waypoint x="580" y="822" /> <bpmndi:BPMNLabel> <dc:Bounds x="338" y="572" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_Task_3" bpmnElement="ConfirmVolumeName"> - <dc:Bounds x="453" y="528" width="109" height="89" /> + <dc:Bounds x="673" y="778" width="109" height="89" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_ExclusiveGateway_101" targetElement="_BPMNShape_Task_3"> - <di:waypoint xsi:type="dc:Point" x="410" y="572" /> - <di:waypoint xsi:type="dc:Point" x="453" y="572" /> + <di:waypoint x="630" y="822" /> + <di:waypoint x="673" y="822" /> <bpmndi:BPMNLabel> - <dc:Bounds x="410" y="576" width="27" height="22" /> + <dc:Bounds x="635" y="826" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_21" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_ExclusiveGateway_101" targetElement="_BPMNShape_ExclusiveGateway_91"> - <di:waypoint xsi:type="dc:Point" x="385" y="547" /> - <di:waypoint xsi:type="dc:Point" x="385" y="393" /> - <di:waypoint xsi:type="dc:Point" x="559" y="393" /> + <di:waypoint x="605" y="797" /> + <di:waypoint x="605" y="643" /> + <di:waypoint x="779" y="643" /> <bpmndi:BPMNLabel> - <dc:Bounds x="392" y="450" width="20" height="22" /> + <dc:Bounds x="616" y="700" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_Task_3" targetElement="_BPMNShape_ExclusiveGateway_91"> - <di:waypoint xsi:type="dc:Point" x="561" y="572" /> - <di:waypoint xsi:type="dc:Point" x="584" y="572" /> - <di:waypoint xsi:type="dc:Point" x="584" y="418" /> + <di:waypoint x="781" y="822" /> + <di:waypoint x="804" y="822" /> + <di:waypoint x="804" y="668" /> <bpmndi:BPMNLabel> <dc:Bounds x="581" y="492" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ScriptTask_124" targetElement="_BPMNShape_IntermediateThrowEvent_22"> - <di:waypoint xsi:type="dc:Point" x="247" y="171" /> - <di:waypoint xsi:type="dc:Point" x="302" y="171" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ScriptTask_124" targetElement="ExclusiveGateway_19933zh_di"> + <di:waypoint x="467" y="421" /> + <di:waypoint x="522" y="421" /> <bpmndi:BPMNLabel> <dc:Bounds x="275" y="156" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ExclusiveGateway_91" targetElement="_BPMNShape_ScriptTask_156"> - <di:waypoint xsi:type="dc:Point" x="609" y="393" /> - <di:waypoint xsi:type="dc:Point" x="628" y="393" /> - <di:waypoint xsi:type="dc:Point" x="628" y="394" /> - <di:waypoint xsi:type="dc:Point" x="696" y="394" /> + <di:waypoint x="829" y="643" /> + <di:waypoint x="848" y="643" /> + <di:waypoint x="848" y="644" /> + <di:waypoint x="916" y="644" /> <bpmndi:BPMNLabel> <dc:Bounds x="636" y="394" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_178" bpmnElement="PreProcessSDNCAssignRequest"> - <dc:Bounds x="109" y="674" width="121" height="94" /> + <dc:Bounds x="329" y="924" width="121" height="94" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_179" bpmnElement="PostProcessSDNCAssignRequest"> - <dc:Bounds x="435" y="674" width="121" height="94" /> + <dc:Bounds x="655" y="924" width="121" height="94" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_IntermediateThrowEvent_44" bpmnElement="IntermediateThrowEvent_3"> - <dc:Bounds x="2193" y="376" width="36" height="36" /> + <dc:Bounds x="2413" y="626" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="2181" y="417" width="60" height="12" /> + <dc:Bounds x="2402" y="667" width="59" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_IntermediateCatchEvent_29" bpmnElement="IntermediateCatchEvent_2"> - <dc:Bounds x="24" y="706" width="36" height="36" /> + <dc:Bounds x="244" y="956" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="13" y="747" width="58" height="22" /> + <dc:Bounds x="239" y="997" width="46" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_IntermediateCatchEvent_29" targetElement="_BPMNShape_ScriptTask_178"> - <di:waypoint xsi:type="dc:Point" x="60" y="724" /> - <di:waypoint xsi:type="dc:Point" x="81" y="724" /> - <di:waypoint xsi:type="dc:Point" x="81" y="721" /> - <di:waypoint xsi:type="dc:Point" x="109" y="721" /> + <di:waypoint x="280" y="974" /> + <di:waypoint x="301" y="974" /> + <di:waypoint x="301" y="971" /> + <di:waypoint x="329" y="971" /> <bpmndi:BPMNLabel> <dc:Bounds x="78" y="722" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_18" sourceElement="_BPMNShape_ScriptTask_178" targetElement="_BPMNShape_ScriptTask_157"> - <di:waypoint xsi:type="dc:Point" x="229" y="721" /> - <di:waypoint xsi:type="dc:Point" x="248" y="721" /> - <di:waypoint xsi:type="dc:Point" x="248" y="719" /> - <di:waypoint xsi:type="dc:Point" x="266" y="719" /> + <di:waypoint x="449" y="971" /> + <di:waypoint x="468" y="971" /> + <di:waypoint x="468" y="969" /> + <di:waypoint x="486" y="969" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20" bpmnElement="SequenceFlow_20" sourceElement="_BPMNShape_ScriptTask_157" targetElement="_BPMNShape_ScriptTask_179"> - <di:waypoint xsi:type="dc:Point" x="386" y="719" /> - <di:waypoint xsi:type="dc:Point" x="411" y="719" /> - <di:waypoint xsi:type="dc:Point" x="411" y="721" /> - <di:waypoint xsi:type="dc:Point" x="435" y="721" /> + <di:waypoint x="606" y="969" /> + <di:waypoint x="631" y="969" /> + <di:waypoint x="631" y="971" /> + <di:waypoint x="655" y="971" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_213" bpmnElement="PreProcessSDNCGetRequest"> - <dc:Bounds x="98" y="1031" width="121" height="94" /> + <dc:Bounds x="318" y="1281" width="121" height="94" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_214" bpmnElement="PostProcessSDNCGetRequest"> - <dc:Bounds x="434" y="1031" width="121" height="94" /> + <dc:Bounds x="654" y="1281" width="121" height="94" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_ScriptTask_213" targetElement="_BPMNShape_ScriptTask_158"> - <di:waypoint xsi:type="dc:Point" x="218" y="1078" /> - <di:waypoint xsi:type="dc:Point" x="236" y="1078" /> - <di:waypoint xsi:type="dc:Point" x="236" y="1077" /> - <di:waypoint xsi:type="dc:Point" x="254" y="1077" /> + <di:waypoint x="438" y="1328" /> + <di:waypoint x="456" y="1328" /> + <di:waypoint x="456" y="1327" /> + <di:waypoint x="474" y="1327" /> <bpmndi:BPMNLabel> <dc:Bounds x="251" y="1068" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_24" bpmnElement="SequenceFlow_24" sourceElement="_BPMNShape_ScriptTask_158" targetElement="_BPMNShape_ScriptTask_214"> - <di:waypoint xsi:type="dc:Point" x="386" y="1077" /> - <di:waypoint xsi:type="dc:Point" x="409" y="1077" /> - <di:waypoint xsi:type="dc:Point" x="409" y="1078" /> - <di:waypoint xsi:type="dc:Point" x="434" y="1078" /> + <di:waypoint x="606" y="1327" /> + <di:waypoint x="629" y="1327" /> + <di:waypoint x="629" y="1328" /> + <di:waypoint x="654" y="1328" /> <bpmndi:BPMNLabel> <dc:Bounds x="410" y="1078" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_Task_2" bpmnElement="PreProcessUpdateAAIVfModule_1"> - <dc:Bounds x="558" y="1211" width="118" height="97" /> + <dc:Bounds x="778" y="1461" width="118" height="97" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_Task_33" bpmnElement="PreProcessSDNCActivateRequest"> - <dc:Bounds x="884" y="1210" width="118" height="98" /> + <dc:Bounds x="1104" y="1460" width="118" height="98" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_Task_4" bpmnElement="PostProcessSDNCActivateRequest"> - <dc:Bounds x="1201" y="1211" width="121" height="95" /> + <dc:Bounds x="1421" y="1461" width="121" height="95" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_Task_2" targetElement="_BPMNShape_ScriptTask_174"> - <di:waypoint xsi:type="dc:Point" x="676" y="1259" /> - <di:waypoint xsi:type="dc:Point" x="717" y="1259" /> + <di:waypoint x="896" y="1509" /> + <di:waypoint x="937" y="1509" /> <bpmndi:BPMNLabel> <dc:Bounds x="697" y="1234" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_ScriptTask_174" targetElement="_BPMNShape_Task_33"> - <di:waypoint xsi:type="dc:Point" x="833" y="1259" /> - <di:waypoint xsi:type="dc:Point" x="884" y="1259" /> + <di:waypoint x="1053" y="1509" /> + <di:waypoint x="1104" y="1509" /> <bpmndi:BPMNLabel> <dc:Bounds x="859" y="1234" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_Task_33" targetElement="_BPMNShape_ScriptTask_175"> - <di:waypoint xsi:type="dc:Point" x="1002" y="1259" /> - <di:waypoint xsi:type="dc:Point" x="1020" y="1259" /> - <di:waypoint xsi:type="dc:Point" x="1020" y="1258" /> - <di:waypoint xsi:type="dc:Point" x="1039" y="1258" /> + <di:waypoint x="1222" y="1509" /> + <di:waypoint x="1240" y="1509" /> + <di:waypoint x="1240" y="1508" /> + <di:waypoint x="1259" y="1508" /> <bpmndi:BPMNLabel> <dc:Bounds x="1035" y="1249" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_ScriptTask_175" targetElement="_BPMNShape_Task_4"> - <di:waypoint xsi:type="dc:Point" x="1157" y="1258" /> - <di:waypoint xsi:type="dc:Point" x="1201" y="1258" /> + <di:waypoint x="1377" y="1508" /> + <di:waypoint x="1421" y="1508" /> <bpmndi:BPMNLabel> <dc:Bounds x="1179" y="1233" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_Task_4" targetElement="_BPMNShape_ExclusiveGateway_92"> - <di:waypoint xsi:type="dc:Point" x="1321" y="1258" /> - <di:waypoint xsi:type="dc:Point" x="1353" y="1258" /> - <di:waypoint xsi:type="dc:Point" x="1353" y="1259" /> - <di:waypoint xsi:type="dc:Point" x="1384" y="1259" /> + <di:waypoint x="1541" y="1508" /> + <di:waypoint x="1573" y="1508" /> + <di:waypoint x="1573" y="1509" /> + <di:waypoint x="1604" y="1509" /> <bpmndi:BPMNLabel> <dc:Bounds x="1368" y="1249" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_175" bpmnElement="EndEvent_1"> - <dc:Bounds x="2107" y="1079" width="36" height="36" /> + <dc:Bounds x="2327" y="1329" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="2125" y="1120" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_16" bpmnElement="SequenceFlow_16" sourceElement="_BPMNShape_ExclusiveGateway_93" targetElement="_BPMNShape_ScriptTask_218"> - <di:waypoint xsi:type="dc:Point" x="1863" y="1097" /> - <di:waypoint xsi:type="dc:Point" x="1929" y="1096" /> + <di:waypoint x="2083" y="1347" /> + <di:waypoint x="2149" y="1346" /> <bpmndi:BPMNLabel> <dc:Bounds x="1896" y="1082" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_IntermediateThrowEvent_45" bpmnElement="IntermediateThrowEvent_2"> - <dc:Bounds x="1281" y="1060" width="36" height="36" /> + <dc:Bounds x="1501" y="1310" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1257" y="1101" width="84" height="36" /> + <dc:Bounds x="1477" y="1351" width="85" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_IntermediateCatchEvent_30" bpmnElement="IntermediateCatchEvent_3"> - <dc:Bounds x="-27" y="1241" width="36" height="36" /> + <dc:Bounds x="193" y="1491" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="-35" y="1282" width="84" height="24" /> + <dc:Bounds x="185" y="1532" width="85" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_Task_7" bpmnElement="PrepareCreateAAIVfModuleVolumeGroupRequest"> - <dc:Bounds x="1502" y="1204" width="121" height="112" /> + <dc:Bounds x="1722" y="1454" width="121" height="112" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="_BPMNShape_Task_7" targetElement="_BPMNShape_ScriptTask_176"> - <di:waypoint xsi:type="dc:Point" x="1623" y="1260" /> - <di:waypoint xsi:type="dc:Point" x="1688" y="1260" /> + <di:waypoint x="1843" y="1510" /> + <di:waypoint x="1908" y="1510" /> <bpmndi:BPMNLabel> <dc:Bounds x="1656" y="1245" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_Task_25" bpmnElement="PreProcessVNFAdapterRequest"> - <dc:Bounds x="583" y="1031" width="121" height="96" /> + <dc:Bounds x="803" y="1281" width="121" height="96" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_Task_35" bpmnElement="PostProcessVNFAdapterRequest"> - <dc:Bounds x="907" y="1033" width="116" height="92" /> + <dc:Bounds x="1127" y="1283" width="116" height="92" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_31" bpmnElement="SequenceFlow_31" sourceElement="_BPMNShape_ScriptTask_214" targetElement="_BPMNShape_Task_25"> - <di:waypoint xsi:type="dc:Point" x="554" y="1078" /> - <di:waypoint xsi:type="dc:Point" x="569" y="1078" /> - <di:waypoint xsi:type="dc:Point" x="569" y="1079" /> - <di:waypoint xsi:type="dc:Point" x="583" y="1079" /> + <di:waypoint x="774" y="1328" /> + <di:waypoint x="789" y="1328" /> + <di:waypoint x="789" y="1329" /> + <di:waypoint x="803" y="1329" /> <bpmndi:BPMNLabel> <dc:Bounds x="584" y="1069" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_32" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_Task_25" targetElement="_BPMNShape_ScriptTask_173"> - <di:waypoint xsi:type="dc:Point" x="703" y="1079" /> - <di:waypoint xsi:type="dc:Point" x="746" y="1079" /> + <di:waypoint x="923" y="1329" /> + <di:waypoint x="966" y="1329" /> <bpmndi:BPMNLabel> <dc:Bounds x="725" y="1054" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_33" bpmnElement="SequenceFlow_33" sourceElement="_BPMNShape_ScriptTask_173" targetElement="_BPMNShape_Task_35"> - <di:waypoint xsi:type="dc:Point" x="866" y="1079" /> - <di:waypoint xsi:type="dc:Point" x="907" y="1079" /> + <di:waypoint x="1086" y="1329" /> + <di:waypoint x="1127" y="1329" /> <bpmndi:BPMNLabel> <dc:Bounds x="887" y="1054" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_215" bpmnElement="QueryAAIVfModule"> - <dc:Bounds x="1224" y="516" width="125" height="92" /> + <dc:Bounds x="1444" y="766" width="125" height="92" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_211" bpmnElement="IsBaseVfModule" isMarkerVisible="true"> - <dc:Bounds x="1128" y="368" width="50" height="50" /> + <dc:Bounds x="1348" y="618" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1092" y="336" width="124" height="22" /> + <dc:Bounds x="1347" y="586" width="55" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_212" bpmnElement="ExclusiveGateway_2" isMarkerVisible="true"> - <dc:Bounds x="1408" y="368" width="50" height="50" /> + <dc:Bounds x="1628" y="618" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1395" y="329" width="75" height="36" /> + <dc:Bounds x="1616" y="579" width="73" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_36" bpmnElement="SequenceFlow_36" sourceElement="_BPMNShape_ExclusiveGateway_211" targetElement="_BPMNShape_ScriptTask_215"> - <di:waypoint xsi:type="dc:Point" x="1153" y="418" /> - <di:waypoint xsi:type="dc:Point" x="1153" y="562" /> - <di:waypoint xsi:type="dc:Point" x="1224" y="562" /> + <di:waypoint x="1373" y="668" /> + <di:waypoint x="1373" y="812" /> + <di:waypoint x="1444" y="812" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1122" y="450" width="20" height="22" /> + <dc:Bounds x="1346" y="700" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_39" bpmnElement="SequenceFlow_39" sourceElement="_BPMNShape_ExclusiveGateway_211" targetElement="_BPMNShape_ExclusiveGateway_212"> - <di:waypoint xsi:type="dc:Point" x="1178" y="393" /> - <di:waypoint xsi:type="dc:Point" x="1408" y="393" /> + <di:waypoint x="1398" y="643" /> + <di:waypoint x="1628" y="643" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1285" y="393" width="27" height="22" /> + <dc:Bounds x="1510" y="643" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_216" bpmnElement="PostProcessCreateAAIVfModule"> - <dc:Bounds x="897" y="348" width="125" height="92" /> + <dc:Bounds x="1117" y="598" width="125" height="92" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_27" bpmnElement="SequenceFlow_27" sourceElement="_BPMNShape_ScriptTask_216" targetElement="_BPMNShape_ExclusiveGateway_211"> - <di:waypoint xsi:type="dc:Point" x="1021" y="394" /> - <di:waypoint xsi:type="dc:Point" x="1075" y="394" /> - <di:waypoint xsi:type="dc:Point" x="1075" y="393" /> - <di:waypoint xsi:type="dc:Point" x="1128" y="393" /> + <di:waypoint x="1241" y="644" /> + <di:waypoint x="1295" y="644" /> + <di:waypoint x="1295" y="643" /> + <di:waypoint x="1348" y="643" /> <bpmndi:BPMNLabel> <dc:Bounds x="1072" y="394" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_37" bpmnElement="SequenceFlow_37" sourceElement="_BPMNShape_ScriptTask_215" targetElement="_BPMNShape_ExclusiveGateway_212"> - <di:waypoint xsi:type="dc:Point" x="1348" y="562" /> - <di:waypoint xsi:type="dc:Point" x="1378" y="562" /> - <di:waypoint xsi:type="dc:Point" x="1378" y="393" /> - <di:waypoint xsi:type="dc:Point" x="1408" y="393" /> + <di:waypoint x="1568" y="812" /> + <di:waypoint x="1598" y="812" /> + <di:waypoint x="1598" y="643" /> + <di:waypoint x="1628" y="643" /> <bpmndi:BPMNLabel> <dc:Bounds x="1393" y="468" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_218" bpmnElement="ScriptTask_setSuccess"> - <dc:Bounds x="1929" y="1049" width="128" height="95" /> + <dc:Bounds x="2149" y="1299" width="128" height="95" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="_BPMNShape_ScriptTask_218" targetElement="_BPMNShape_EndEvent_175"> - <di:waypoint xsi:type="dc:Point" x="2057" y="1097" /> - <di:waypoint xsi:type="dc:Point" x="2107" y="1096" /> + <di:waypoint x="2277" y="1347" /> + <di:waypoint x="2327" y="1346" /> <bpmndi:BPMNLabel> <dc:Bounds x="2082" y="1082" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_254" bpmnElement="QueryCloudRegion"> - <dc:Bounds x="101" y="440" width="134" height="81" /> + <dc:Bounds x="321" y="690" width="134" height="81" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_40" bpmnElement="SequenceFlow_40" sourceElement="_BPMNShape_ExclusiveGateway_90" targetElement="_BPMNShape_ScriptTask_254"> - <di:waypoint xsi:type="dc:Point" x="169" y="418" /> - <di:waypoint xsi:type="dc:Point" x="169" y="429" /> - <di:waypoint xsi:type="dc:Point" x="168" y="429" /> - <di:waypoint xsi:type="dc:Point" x="168" y="440" /> + <di:waypoint x="389" y="668" /> + <di:waypoint x="389" y="679" /> + <di:waypoint x="388" y="679" /> + <di:waypoint x="388" y="690" /> <bpmndi:BPMNLabel> - <dc:Bounds x="180" y="417" width="27" height="22" /> + <dc:Bounds x="405" y="667" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_43" bpmnElement="SequenceFlow_43" sourceElement="_BPMNShape_ScriptTask_254" targetElement="_BPMNShape_ScriptTask_172"> - <di:waypoint xsi:type="dc:Point" x="168" y="520" /> - <di:waypoint xsi:type="dc:Point" x="168" y="524" /> - <di:waypoint xsi:type="dc:Point" x="168" y="581" /> - <di:waypoint xsi:type="dc:Point" x="208" y="581" /> - <di:waypoint xsi:type="dc:Point" x="209" y="581" /> + <di:waypoint x="388" y="770" /> + <di:waypoint x="388" y="774" /> + <di:waypoint x="388" y="831" /> + <di:waypoint x="428" y="831" /> + <di:waypoint x="429" y="831" /> <bpmndi:BPMNLabel> <dc:Bounds x="165" y="574" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_156" bpmnElement="CreateAAIVfModule"> - <dc:Bounds x="696" y="348" width="121" height="92" /> + <dc:Bounds x="916" y="598" width="121" height="92" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_25" bpmnElement="SequenceFlow_25" sourceElement="_BPMNShape_ScriptTask_156" targetElement="_BPMNShape_ScriptTask_216"> - <di:waypoint xsi:type="dc:Point" x="816" y="394" /> - <di:waypoint xsi:type="dc:Point" x="897" y="394" /> + <di:waypoint x="1036" y="644" /> + <di:waypoint x="1117" y="644" /> <bpmndi:BPMNLabel> <dc:Bounds x="857" y="369" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_183x8vk_di" bpmnElement="ExclusiveGateway_183x8vk" isMarkerVisible="true"> - <dc:Bounds x="1076" y="1055" width="50" height="50" /> + <dc:Bounds x="1296" y="1305" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1056" y="1105" width="89" height="36" /> + <dc:Bounds x="1281" y="1355" width="79" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1ushk1d_di" bpmnElement="SequenceFlow_1ushk1d"> - <di:waypoint xsi:type="dc:Point" x="1023" y="1079" /> - <di:waypoint xsi:type="dc:Point" x="1076" y="1080" /> + <di:waypoint x="1243" y="1329" /> + <di:waypoint x="1296" y="1330" /> <bpmndi:BPMNLabel> <dc:Bounds x="1050" y="1065" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0ery1pk_di" bpmnElement="SequenceFlow_0ery1pk"> - <di:waypoint xsi:type="dc:Point" x="1101" y="1055" /> - <di:waypoint xsi:type="dc:Point" x="1101" y="979" /> - <di:waypoint xsi:type="dc:Point" x="1147" y="979" /> + <di:waypoint x="1321" y="1305" /> + <di:waypoint x="1321" y="1229" /> + <di:waypoint x="1367" y="1229" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1054" y="1267" width="18" height="12" /> + <dc:Bounds x="1275" y="1517" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0xfanpi_di" bpmnElement="SequenceFlow_0xfanpi"> - <di:waypoint xsi:type="dc:Point" x="1126" y="1080" /> - <di:waypoint xsi:type="dc:Point" x="1281" y="1078" /> + <di:waypoint x="1346" y="1330" /> + <di:waypoint x="1501" y="1328" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1198" y="1054" width="12" height="12" /> + <dc:Bounds x="1418" y="1304" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0abffyj_di" bpmnElement="SequenceFlow_0abffyj"> - <di:waypoint xsi:type="dc:Point" x="1247" y="979" /> - <di:waypoint xsi:type="dc:Point" x="1299" y="979" /> - <di:waypoint xsi:type="dc:Point" x="1299" y="1060" /> + <di:waypoint x="1467" y="1229" /> + <di:waypoint x="1519" y="1229" /> + <di:waypoint x="1519" y="1310" /> <bpmndi:BPMNLabel> <dc:Bounds x="1273" y="964" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1dv7amn_di" bpmnElement="CreateNetworkPoliciesInAAI"> - <dc:Bounds x="1147" y="939" width="100" height="80" /> + <dc:Bounds x="1367" y="1189" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_0f54imv_di" bpmnElement="ExclusiveGateway_0f54imv" isMarkerVisible="true"> - <dc:Bounds x="64" y="1235" width="50" height="50" /> + <dc:Bounds x="284" y="1485" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="51" y="1200" width="75" height="24" /> + <dc:Bounds x="272" y="1450" width="74" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_1edqxlf_di" bpmnElement="ExclusiveGateway_1edqxlf" isMarkerVisible="true"> - <dc:Bounds x="432" y="1235" width="50" height="50" /> + <dc:Bounds x="652" y="1485" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="457" y="1285" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0bi38s7_di" bpmnElement="SequenceFlow_0bi38s7"> - <di:waypoint xsi:type="dc:Point" x="89" y="1285" /> - <di:waypoint xsi:type="dc:Point" x="89" y="1438" /> - <di:waypoint xsi:type="dc:Point" x="142" y="1438" /> + <di:waypoint x="309" y="1535" /> + <di:waypoint x="309" y="1688" /> + <di:waypoint x="362" y="1688" /> <bpmndi:BPMNLabel> - <dc:Bounds x="95" y="1362" width="18" height="12" /> + <dc:Bounds x="316" y="1612" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1qm81ym_di" bpmnElement="SequenceFlow_1qm81ym"> - <di:waypoint xsi:type="dc:Point" x="242" y="1438" /> - <di:waypoint xsi:type="dc:Point" x="278" y="1438" /> - <di:waypoint xsi:type="dc:Point" x="278" y="1438" /> - <di:waypoint xsi:type="dc:Point" x="314" y="1438" /> + <di:waypoint x="462" y="1688" /> + <di:waypoint x="498" y="1688" /> + <di:waypoint x="498" y="1688" /> + <di:waypoint x="534" y="1688" /> <bpmndi:BPMNLabel> <dc:Bounds x="293" y="1438" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_112los9_di" bpmnElement="SequenceFlow_112los9"> - <di:waypoint xsi:type="dc:Point" x="414" y="1438" /> - <di:waypoint xsi:type="dc:Point" x="457" y="1438" /> - <di:waypoint xsi:type="dc:Point" x="457" y="1285" /> + <di:waypoint x="634" y="1688" /> + <di:waypoint x="677" y="1688" /> + <di:waypoint x="677" y="1535" /> <bpmndi:BPMNLabel> <dc:Bounds x="436" y="1423" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1k5uku2_di" bpmnElement="SequenceFlow_1k5uku2"> - <di:waypoint xsi:type="dc:Point" x="114" y="1260" /> - <di:waypoint xsi:type="dc:Point" x="432" y="1260" /> + <di:waypoint x="334" y="1510" /> + <di:waypoint x="652" y="1510" /> <bpmndi:BPMNLabel> - <dc:Bounds x="267" y="1245" width="12" height="12" /> + <dc:Bounds x="487" y="1495" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1avfxsz_di" bpmnElement="SequenceFlow_1avfxsz"> - <di:waypoint xsi:type="dc:Point" x="482" y="1260" /> - <di:waypoint xsi:type="dc:Point" x="520" y="1260" /> - <di:waypoint xsi:type="dc:Point" x="520" y="1260" /> - <di:waypoint xsi:type="dc:Point" x="558" y="1260" /> + <di:waypoint x="702" y="1510" /> + <di:waypoint x="740" y="1510" /> + <di:waypoint x="740" y="1510" /> + <di:waypoint x="778" y="1510" /> <bpmndi:BPMNLabel> <dc:Bounds x="535" y="1260" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0363dz7_di" bpmnElement="SequenceFlow_0363dz7"> - <di:waypoint xsi:type="dc:Point" x="9" y="1259" /> - <di:waypoint xsi:type="dc:Point" x="64" y="1260" /> + <di:waypoint x="229" y="1509" /> + <di:waypoint x="284" y="1510" /> <bpmndi:BPMNLabel> <dc:Bounds x="37" y="1235" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0o3bcyq_di" bpmnElement="PreProcessUpdateAAIGenericVnf"> - <dc:Bounds x="142" y="1399" width="100" height="80" /> + <dc:Bounds x="362" y="1649" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0j45ic9_di" bpmnElement="UpdateAAIGenericVNFTask"> - <dc:Bounds x="314" y="1398" width="100" height="80" /> + <dc:Bounds x="534" y="1648" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0zcfn2x_di" bpmnElement="SequenceFlow_0zcfn2x"> - <di:waypoint xsi:type="dc:Point" x="1458" y="393" /> - <di:waypoint xsi:type="dc:Point" x="2193" y="394" /> + <di:waypoint x="1678" y="643" /> + <di:waypoint x="2413" y="644" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1822" y="368.5010168687388" width="12" height="12" /> + <dc:Bounds x="2042" y="619" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0m382su_di" bpmnElement="SequenceFlow_0m382su"> - <di:waypoint xsi:type="dc:Point" x="1433" y="418" /> - <di:waypoint xsi:type="dc:Point" x="1433" y="521" /> - <di:waypoint xsi:type="dc:Point" x="1666" y="521" /> + <di:waypoint x="1653" y="668" /> + <di:waypoint x="1653" y="771" /> + <di:waypoint x="1886" y="771" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1363.5900806639468" y="422.98801391242307" width="19" height="12" /> + <dc:Bounds x="1585" y="673" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0g270u0_di" bpmnElement="SequenceFlow_0g270u0"> - <di:waypoint xsi:type="dc:Point" x="1766" y="521" /> - <di:waypoint xsi:type="dc:Point" x="1816" y="521" /> + <di:waypoint x="1986" y="771" /> + <di:waypoint x="2036" y="771" /> <bpmndi:BPMNLabel> <dc:Bounds x="1791" y="506" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1yrlvgb_di" bpmnElement="SequenceFlow_1yrlvgb"> - <di:waypoint xsi:type="dc:Point" x="1916" y="521" /> - <di:waypoint xsi:type="dc:Point" x="1969" y="521" /> + <di:waypoint x="2136" y="771" /> + <di:waypoint x="2189" y="771" /> <bpmndi:BPMNLabel> <dc:Bounds x="1943" y="506" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1j22oyj_di" bpmnElement="PreProcessSDNCVnfGetRequest"> - <dc:Bounds x="1666" y="481" width="100" height="80" /> + <dc:Bounds x="1886" y="731" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_10t4tix_di" bpmnElement="CallSDNCAdapterVNFTopologyGET"> - <dc:Bounds x="1816" y="481" width="100" height="80" /> + <dc:Bounds x="2036" y="731" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_09wgk9p_di" bpmnElement="PostProcessSDNCVnfGetRequest"> - <dc:Bounds x="1969" y="481" width="100" height="80" /> + <dc:Bounds x="2189" y="731" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_170kw7h_di" bpmnElement="SequenceFlow_170kw7h"> - <di:waypoint xsi:type="dc:Point" x="2069" y="521" /> - <di:waypoint xsi:type="dc:Point" x="2131" y="521" /> - <di:waypoint xsi:type="dc:Point" x="2131" y="394" /> - <di:waypoint xsi:type="dc:Point" x="2193" y="394" /> + <di:waypoint x="2289" y="771" /> + <di:waypoint x="2351" y="771" /> + <di:waypoint x="2351" y="644" /> + <di:waypoint x="2413" y="644" /> <bpmndi:BPMNLabel> <dc:Bounds x="2146" y="447.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1f53tby_di" bpmnElement="SequenceFlow_1f53tby"> - <di:waypoint xsi:type="dc:Point" x="776" y="282" /> - <di:waypoint xsi:type="dc:Point" x="846" y="282" /> - <di:waypoint xsi:type="dc:Point" x="846" y="189" /> + <di:waypoint x="996" y="532" /> + <di:waypoint x="1066" y="532" /> + <di:waypoint x="1066" y="439" /> <bpmndi:BPMNLabel> <dc:Bounds x="811" y="267" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_0ffvqla_di" bpmnElement="ExclusiveGateway_0ffvqla" isMarkerVisible="true"> - <dc:Bounds x="592" y="146" width="50" height="50" /> + <dc:Bounds x="812" y="396" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="574" y="98" width="86" height="36" /> + <dc:Bounds x="795" y="348" width="84" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0270n5c_di" bpmnElement="SequenceFlow_0270n5c"> - <di:waypoint xsi:type="dc:Point" x="642" y="171" /> - <di:waypoint xsi:type="dc:Point" x="828" y="171" /> + <di:waypoint x="862" y="421" /> + <di:waypoint x="1048" y="421" /> <bpmndi:BPMNLabel> - <dc:Bounds x="699" y="145" width="18" height="12" /> + <dc:Bounds x="920" y="395" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_05og7iw_di" bpmnElement="SequenceFlow_05og7iw"> - <di:waypoint xsi:type="dc:Point" x="617" y="196" /> - <di:waypoint xsi:type="dc:Point" x="617" y="282" /> - <di:waypoint xsi:type="dc:Point" x="676" y="282" /> + <di:waypoint x="837" y="446" /> + <di:waypoint x="837" y="532" /> + <di:waypoint x="896" y="532" /> <bpmndi:BPMNLabel> - <dc:Bounds x="626" y="239" width="12" height="12" /> + <dc:Bounds x="846" y="489" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_14nvmgk_di" bpmnElement="Task_0kuj2a1"> - <dc:Bounds x="676" y="242" width="100" height="80" /> + <dc:Bounds x="896" y="492" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SubProcess_0ltzufk_di" bpmnElement="SubProcess_0ltzufk" isExpanded="true"> - <dc:Bounds x="-52" y="1578" width="1047" height="338" /> + <dc:Bounds x="168" y="1828" width="1047" height="338" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_18lzc5m_di" bpmnElement="StartEvent_18lzc5m"> - <dc:Bounds x="91" y="1682" width="36" height="36" /> + <dc:Bounds x="311" y="1932" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="109" y="1723" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0wsdptv_di" bpmnElement="EndEvent_0wsdptv"> - <dc:Bounds x="859" y="1682" width="36" height="36" /> + <dc:Bounds x="1079" y="1932" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="877" y="1723" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_1ehr5kq_di" bpmnElement="CallDoCreateVfModuleRollback"> - <dc:Bounds x="507" y="1660" width="100" height="80" /> + <dc:Bounds x="727" y="1910" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0upatdd_di" bpmnElement="PreProcessRollback"> - <dc:Bounds x="327" y="1660" width="100" height="80" /> + <dc:Bounds x="547" y="1910" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0o1zc29_di" bpmnElement="PostProcessRollback"> - <dc:Bounds x="692" y="1660" width="100" height="80" /> + <dc:Bounds x="912" y="1910" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_02lc25j_di" bpmnElement="SequenceFlow_02lc25j"> - <di:waypoint xsi:type="dc:Point" x="127" y="1700" /> - <di:waypoint xsi:type="dc:Point" x="194" y="1700" /> + <di:waypoint x="347" y="1950" /> + <di:waypoint x="414" y="1950" /> <bpmndi:BPMNLabel> <dc:Bounds x="161" y="1685" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0z2rczk_di" bpmnElement="SequenceFlow_0z2rczk"> - <di:waypoint xsi:type="dc:Point" x="792" y="1700" /> - <di:waypoint xsi:type="dc:Point" x="824" y="1700" /> - <di:waypoint xsi:type="dc:Point" x="824" y="1700" /> - <di:waypoint xsi:type="dc:Point" x="859" y="1700" /> + <di:waypoint x="1012" y="1950" /> + <di:waypoint x="1044" y="1950" /> + <di:waypoint x="1044" y="1950" /> + <di:waypoint x="1079" y="1950" /> <bpmndi:BPMNLabel> <dc:Bounds x="839" y="1700" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1i1q78e_di" bpmnElement="SequenceFlow_1i1q78e"> - <di:waypoint xsi:type="dc:Point" x="427" y="1700" /> - <di:waypoint xsi:type="dc:Point" x="507" y="1700" /> + <di:waypoint x="647" y="1950" /> + <di:waypoint x="727" y="1950" /> <bpmndi:BPMNLabel> <dc:Bounds x="467" y="1685" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0112l2c_di" bpmnElement="SequenceFlow_0112l2c"> - <di:waypoint xsi:type="dc:Point" x="607" y="1700" /> - <di:waypoint xsi:type="dc:Point" x="692" y="1700" /> + <di:waypoint x="827" y="1950" /> + <di:waypoint x="912" y="1950" /> <bpmndi:BPMNLabel> <dc:Bounds x="650" y="1685" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_039bib8_di" bpmnElement="ExclusiveGateway_039bib8" isMarkerVisible="true"> - <dc:Bounds x="194" y="1675" width="50" height="50" /> + <dc:Bounds x="414" y="1925" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="175" y="1647" width="87" height="12" /> + <dc:Bounds x="394" y="1897" width="89" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_04bd5in_di" bpmnElement="SequenceFlow_04bd5in"> - <di:waypoint xsi:type="dc:Point" x="244" y="1700" /> - <di:waypoint xsi:type="dc:Point" x="327" y="1700" /> + <di:waypoint x="464" y="1950" /> + <di:waypoint x="547" y="1950" /> <bpmndi:BPMNLabel> - <dc:Bounds x="280" y="1685" width="12" height="12" /> + <dc:Bounds x="500" y="1935" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1nh7m8d_di" bpmnElement="SequenceFlow_1nh7m8d"> - <di:waypoint xsi:type="dc:Point" x="219" y="1725" /> - <di:waypoint xsi:type="dc:Point" x="219" y="1824" /> - <di:waypoint xsi:type="dc:Point" x="507" y="1824" /> + <di:waypoint x="439" y="1975" /> + <di:waypoint x="439" y="2074" /> + <di:waypoint x="727" y="2074" /> <bpmndi:BPMNLabel> - <dc:Bounds x="225" y="1775" width="18" height="12" /> + <dc:Bounds x="446" y="2025" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_05v20n0_di" bpmnElement="Task_1fm09pi"> - <dc:Bounds x="507" y="1784" width="100" height="80" /> + <dc:Bounds x="727" y="2034" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1pgo10r_di" bpmnElement="SequenceFlow_1pgo10r"> - <di:waypoint xsi:type="dc:Point" x="607" y="1824" /> - <di:waypoint xsi:type="dc:Point" x="877" y="1824" /> - <di:waypoint xsi:type="dc:Point" x="877" y="1718" /> + <di:waypoint x="827" y="2074" /> + <di:waypoint x="1097" y="2074" /> + <di:waypoint x="1097" y="1968" /> <bpmndi:BPMNLabel> <dc:Bounds x="742" y="1809" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_0jw7ymg_di" bpmnElement="ExclusiveGateway_0jw7ymg" isMarkerVisible="true"> - <dc:Bounds x="803" y="696" width="50" height="50" /> + <dc:Bounds x="1023" y="946" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="797" y="653" width="61" height="24" /> + <dc:Bounds x="1018" y="903" width="59" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_28" sourceElement="_BPMNShape_ExclusiveGateway_92" targetElement="_BPMNShape_Task_7"> - <di:waypoint xsi:type="dc:Point" x="1434" y="1259" /> - <di:waypoint xsi:type="dc:Point" x="1502" y="1260" /> + <di:waypoint x="1654" y="1509" /> + <di:waypoint x="1722" y="1510" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1454" y="1264.6906474820144" width="18" height="12" /> + <dc:Bounds x="1675" y="1515" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_19933zh_di" bpmnElement="ExclusiveGateway_19933zh" isMarkerVisible="true"> - <dc:Bounds x="302" y="146" width="50" height="50" /> + <dc:Bounds x="522" y="396" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="295" y="196" width="63" height="12" /> + <dc:Bounds x="515" y="446" width="63" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1y1ttqe_di" bpmnElement="SequenceFlow_1y1ttqe"> - <di:waypoint xsi:type="dc:Point" x="352" y="171" /> - <di:waypoint xsi:type="dc:Point" x="592" y="171" /> + <di:waypoint x="572" y="421" /> + <di:waypoint x="812" y="421" /> <bpmndi:BPMNLabel> - <dc:Bounds x="379" y="147" width="12" height="12" /> + <dc:Bounds x="599" y="397" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_02fd6gx_di" bpmnElement="ExclusiveGateway_02fd6gx" isMarkerVisible="true"> - <dc:Bounds x="447" y="-1" width="50" height="50" /> + <dc:Bounds x="667" y="249" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="427" y="-48" width="89" height="36" /> + <dc:Bounds x="647" y="202" width="89" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0lilmm3_di" bpmnElement="SequenceFlow_0lilmm3"> - <di:waypoint xsi:type="dc:Point" x="472" y="49" /> - <di:waypoint xsi:type="dc:Point" x="472" y="171" /> - <di:waypoint xsi:type="dc:Point" x="592" y="171" /> + <di:waypoint x="692" y="299" /> + <di:waypoint x="692" y="421" /> + <di:waypoint x="812" y="421" /> <bpmndi:BPMNLabel> - <dc:Bounds x="482" y="100" width="12" height="12" /> + <dc:Bounds x="702" y="350" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1y8q87e_di" bpmnElement="SequenceFlow_1y8q87e"> - <di:waypoint xsi:type="dc:Point" x="327" y="146" /> - <di:waypoint xsi:type="dc:Point" x="327" y="64" /> + <di:waypoint x="547" y="396" /> + <di:waypoint x="547" y="314" /> <bpmndi:BPMNLabel> - <dc:Bounds x="333" y="95" width="18" height="12" /> + <dc:Bounds x="554" y="345" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1sf1091_di" bpmnElement="SequenceFlow_1sf1091"> - <di:waypoint xsi:type="dc:Point" x="377" y="24" /> - <di:waypoint xsi:type="dc:Point" x="447" y="24" /> + <di:waypoint x="597" y="274" /> + <di:waypoint x="667" y="274" /> <bpmndi:BPMNLabel> <dc:Bounds x="412" y="9" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_17cp3tn_di" bpmnElement="SequenceFlow_17cp3tn"> - <di:waypoint xsi:type="dc:Point" x="853" y="721" /> - <di:waypoint xsi:type="dc:Point" x="901" y="720" /> + <di:waypoint x="1073" y="971" /> + <di:waypoint x="1121" y="970" /> <bpmndi:BPMNLabel> - <dc:Bounds x="866" y="694.5" width="18" height="12" /> + <dc:Bounds x="1087" y="945" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0b33fd2_di" bpmnElement="EndEvent_0pd6bbj"> - <dc:Bounds x="1367" y="701" width="36" height="36" /> + <dc:Bounds x="1587" y="951" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1385" y="737" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_15i583d_di" bpmnElement="SequenceFlow_15i583d"> - <di:waypoint xsi:type="dc:Point" x="497" y="24" /> - <di:waypoint xsi:type="dc:Point" x="559" y="24" /> + <di:waypoint x="717" y="274" /> + <di:waypoint x="779" y="274" /> <bpmndi:BPMNLabel> - <dc:Bounds x="513" y="3.588067006526856" width="18" height="12" /> + <dc:Bounds x="734" y="254" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_0gsliyw_di" bpmnElement="ExclusiveGateway_0gsliyw" isMarkerVisible="true"> - <dc:Bounds x="592" y="694" width="50" height="50" /> + <dc:Bounds x="812" y="944" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="585" y="656" width="63" height="12" /> + <dc:Bounds x="805" y="906" width="63" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_16mgvsd_di" bpmnElement="SequenceFlow_16mgvsd"> - <di:waypoint xsi:type="dc:Point" x="642" y="719" /> - <di:waypoint xsi:type="dc:Point" x="668" y="719" /> + <di:waypoint x="862" y="969" /> + <di:waypoint x="888" y="969" /> <bpmndi:BPMNLabel> - <dc:Bounds x="641" y="696" width="18" height="12" /> + <dc:Bounds x="862" y="946" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1nh92s8_di" bpmnElement="SequenceFlow_1nh92s8"> - <di:waypoint xsi:type="dc:Point" x="556" y="720" /> - <di:waypoint xsi:type="dc:Point" x="592" y="719" /> + <di:waypoint x="776" y="970" /> + <di:waypoint x="812" y="969" /> <bpmndi:BPMNLabel> <dc:Bounds x="574" y="694.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0cc17yk_di" bpmnElement="SequenceFlow_0cc17yk"> - <di:waypoint xsi:type="dc:Point" x="768" y="720" /> - <di:waypoint xsi:type="dc:Point" x="803" y="721" /> + <di:waypoint x="988" y="970" /> + <di:waypoint x="1023" y="971" /> <bpmndi:BPMNLabel> <dc:Bounds x="786" y="705.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1iyt5i4_di" bpmnElement="SequenceFlow_1iyt5i4"> - <di:waypoint xsi:type="dc:Point" x="617" y="744" /> - <di:waypoint xsi:type="dc:Point" x="617" y="799" /> - <di:waypoint xsi:type="dc:Point" x="98" y="799" /> - <di:waypoint xsi:type="dc:Point" x="98" y="881" /> - <di:waypoint xsi:type="dc:Point" x="119" y="881" /> + <di:waypoint x="837" y="994" /> + <di:waypoint x="837" y="1049" /> + <di:waypoint x="318" y="1049" /> + <di:waypoint x="318" y="1131" /> + <di:waypoint x="339" y="1131" /> <bpmndi:BPMNLabel> - <dc:Bounds x="466" y="776.3184256922661" width="12" height="12" /> + <dc:Bounds x="686" y="1026" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_006rnym_di" bpmnElement="SequenceFlow_006rnym"> - <di:waypoint xsi:type="dc:Point" x="828" y="746" /> - <di:waypoint xsi:type="dc:Point" x="828" y="815" /> - <di:waypoint xsi:type="dc:Point" x="169" y="815" /> - <di:waypoint xsi:type="dc:Point" x="169" y="841" /> + <di:waypoint x="1048" y="996" /> + <di:waypoint x="1048" y="1065" /> + <di:waypoint x="389" y="1065" /> + <di:waypoint x="389" y="1091" /> <bpmndi:BPMNLabel> - <dc:Bounds x="807" y="762.4025974025974" width="12" height="12" /> + <dc:Bounds x="1027" y="1012" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0ynd0iy_di" bpmnElement="SequenceFlow_0ynd0iy"> - <di:waypoint xsi:type="dc:Point" x="1001" y="719" /> - <di:waypoint xsi:type="dc:Point" x="1057" y="719" /> + <di:waypoint x="1221" y="969" /> + <di:waypoint x="1277" y="969" /> <bpmndi:BPMNLabel> <dc:Bounds x="1029" y="704" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_00bh7m7_di" bpmnElement="SequenceFlow_00bh7m7"> - <di:waypoint xsi:type="dc:Point" x="1312" y="719" /> - <di:waypoint xsi:type="dc:Point" x="1367" y="719" /> + <di:waypoint x="1532" y="969" /> + <di:waypoint x="1587" y="969" /> <bpmndi:BPMNLabel> <dc:Bounds x="1340" y="704" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1mnipp8_di" bpmnElement="SequenceFlow_1mnipp8"> - <di:waypoint xsi:type="dc:Point" x="1157" y="719" /> - <di:waypoint xsi:type="dc:Point" x="1212" y="719" /> + <di:waypoint x="1377" y="969" /> + <di:waypoint x="1432" y="969" /> <bpmndi:BPMNLabel> <dc:Bounds x="1185" y="704" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1bvhxkk_di" bpmnElement="Task_08z2aai"> - <dc:Bounds x="1057" y="679" width="100" height="80" /> + <dc:Bounds x="1277" y="929" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_05mwaoo_di" bpmnElement="Task_0kqh1of"> - <dc:Bounds x="901" y="679" width="100" height="80" /> + <dc:Bounds x="1121" y="929" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_059xue9_di" bpmnElement="Task_08tnqe1"> - <dc:Bounds x="668" y="679" width="100" height="80" /> + <dc:Bounds x="888" y="929" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1k3dub4_di" bpmnElement="Task_14n44kb"> - <dc:Bounds x="277" y="-16" width="100" height="80" /> + <dc:Bounds x="497" y="234" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0okxyur_di" bpmnElement="Task_16p51r4"> - <dc:Bounds x="1212" y="679" width="100" height="80" /> + <dc:Bounds x="1432" y="929" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_1f6x9ii_di" bpmnElement="ExclusiveGateway_1f6x9ii" isMarkerVisible="true"> - <dc:Bounds x="559" y="-1" width="50" height="50" /> + <dc:Bounds x="779" y="249" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="539" y="49" width="89" height="48" /> + <dc:Bounds x="762" y="299" width="84" height="53" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0tfrcnc_di" bpmnElement="SequenceFlow_0tfrcnc"> - <di:waypoint xsi:type="dc:Point" x="609" y="24" /> - <di:waypoint xsi:type="dc:Point" x="946" y="24" /> + <di:waypoint x="829" y="274" /> + <di:waypoint x="1166" y="274" /> <bpmndi:BPMNLabel> - <dc:Bounds x="772" y="9" width="12" height="12" /> + <dc:Bounds x="992" y="259" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0oadvvx_di" bpmnElement="SequenceFlow_0oadvvx"> - <di:waypoint xsi:type="dc:Point" x="584" y="-1" /> - <di:waypoint xsi:type="dc:Point" x="584" y="-63" /> - <di:waypoint xsi:type="dc:Point" x="616" y="-63" /> + <di:waypoint x="804" y="249" /> + <di:waypoint x="804" y="187" /> + <di:waypoint x="836" y="187" /> <bpmndi:BPMNLabel> - <dc:Bounds x="590" y="-42" width="18" height="12" /> + <dc:Bounds x="811" y="208" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_09r5rvt_di" bpmnElement="ExclusiveGateway_09r5rvt" isMarkerVisible="true"> - <dc:Bounds x="946" y="-1" width="50" height="50" /> + <dc:Bounds x="1166" y="249" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="971" y="49" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1qzw172_di" bpmnElement="SequenceFlow_1qzw172"> - <di:waypoint xsi:type="dc:Point" x="996" y="24" /> - <di:waypoint xsi:type="dc:Point" x="1074" y="24" /> + <di:waypoint x="1216" y="274" /> + <di:waypoint x="1294" y="274" /> <bpmndi:BPMNLabel> <dc:Bounds x="1035" y="9" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_03batve_di" bpmnElement="SequenceFlow_03batve"> - <di:waypoint xsi:type="dc:Point" x="716" y="-63" /> - <di:waypoint xsi:type="dc:Point" x="796" y="-63" /> + <di:waypoint x="936" y="187" /> + <di:waypoint x="1016" y="187" /> <bpmndi:BPMNLabel> <dc:Bounds x="756" y="-78" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0c6p4aa_di" bpmnElement="SequenceFlow_0c6p4aa"> - <di:waypoint xsi:type="dc:Point" x="896" y="-63" /> - <di:waypoint xsi:type="dc:Point" x="971" y="-63" /> - <di:waypoint xsi:type="dc:Point" x="971" y="-1" /> + <di:waypoint x="1116" y="187" /> + <di:waypoint x="1191" y="187" /> + <di:waypoint x="1191" y="249" /> <bpmndi:BPMNLabel> <dc:Bounds x="934" y="-78" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_04msdir_di" bpmnElement="ExclusiveGateway_04msdir" isMarkerVisible="true"> - <dc:Bounds x="1074" y="-1" width="50" height="50" /> + <dc:Bounds x="1294" y="249" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1057" y="49" width="84" height="36" /> + <dc:Bounds x="1278" y="299" width="82" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0xed5sn_di" bpmnElement="SequenceFlow_0xed5sn"> - <di:waypoint xsi:type="dc:Point" x="1124" y="24" /> - <di:waypoint xsi:type="dc:Point" x="1338" y="24" /> + <di:waypoint x="1344" y="274" /> + <di:waypoint x="1558" y="274" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1222" y="9" width="18" height="12" /> + <dc:Bounds x="1443" y="259" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0p3cspl_di" bpmnElement="SequenceFlow_0p3cspl"> - <di:waypoint xsi:type="dc:Point" x="1099" y="-1" /> - <di:waypoint xsi:type="dc:Point" x="1099" y="-63" /> - <di:waypoint xsi:type="dc:Point" x="1190" y="-63" /> + <di:waypoint x="1319" y="249" /> + <di:waypoint x="1319" y="187" /> + <di:waypoint x="1410" y="187" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1108" y="-41.26315789473686" width="12" height="12" /> + <dc:Bounds x="1328" y="209" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1biy4yg_di" bpmnElement="ExclusiveGateway_1biy4yg" isMarkerVisible="true"> - <dc:Bounds x="1338" y="-1" width="50" height="50" /> + <dc:Bounds x="1558" y="249" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="1363" y="49" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0p61zug_di" bpmnElement="SequenceFlow_0p61zug"> - <di:waypoint xsi:type="dc:Point" x="1388" y="24" /> - <di:waypoint xsi:type="dc:Point" x="1436" y="24" /> - <di:waypoint xsi:type="dc:Point" x="1436" y="-170" /> - <di:waypoint xsi:type="dc:Point" x="-60" y="-170" /> - <di:waypoint xsi:type="dc:Point" x="-60" y="1078" /> - <di:waypoint xsi:type="dc:Point" x="98" y="1078" /> + <di:waypoint x="1608" y="274" /> + <di:waypoint x="1656" y="274" /> + <di:waypoint x="1656" y="80" /> + <di:waypoint x="160" y="80" /> + <di:waypoint x="160" y="1328" /> + <di:waypoint x="318" y="1328" /> <bpmndi:BPMNLabel> <dc:Bounds x="688" y="-185" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1k7xbcu_di" bpmnElement="SequenceFlow_1k7xbcu"> - <di:waypoint xsi:type="dc:Point" x="1290" y="-63" /> - <di:waypoint xsi:type="dc:Point" x="1363" y="-63" /> - <di:waypoint xsi:type="dc:Point" x="1363" y="-1" /> + <di:waypoint x="1510" y="187" /> + <di:waypoint x="1583" y="187" /> + <di:waypoint x="1583" y="249" /> <bpmndi:BPMNLabel> <dc:Bounds x="1327" y="-78" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0ti2a86_di" bpmnElement="Task_0dx8gpp"> - <dc:Bounds x="616" y="-103" width="100" height="80" /> + <dc:Bounds x="836" y="147" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_1r5f381_di" bpmnElement="Task_0e8s9xm"> - <dc:Bounds x="796" y="-103" width="100" height="80" /> + <dc:Bounds x="1016" y="147" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0fajmo7_di" bpmnElement="Task_0cdjxcd"> - <dc:Bounds x="1190" y="-103" width="100" height="80" /> + <dc:Bounds x="1410" y="147" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_065935d_di" bpmnElement="Task_19zw1li"> - <dc:Bounds x="119" y="841" width="100" height="80" /> + <dc:Bounds x="339" y="1091" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_11w102e_di" bpmnElement="Task_01b1fio"> - <dc:Bounds x="285" y="841" width="100" height="80" /> + <dc:Bounds x="505" y="1091" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0thm33s_di" bpmnElement="SequenceFlow_0thm33s"> - <di:waypoint xsi:type="dc:Point" x="219" y="881" /> - <di:waypoint xsi:type="dc:Point" x="285" y="881" /> + <di:waypoint x="439" y="1131" /> + <di:waypoint x="505" y="1131" /> <bpmndi:BPMNLabel> <dc:Bounds x="252" y="856" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0aegg0r_di" bpmnElement="SequenceFlow_0aegg0r"> - <di:waypoint xsi:type="dc:Point" x="385" y="881" /> - <di:waypoint xsi:type="dc:Point" x="438" y="881" /> - <di:waypoint xsi:type="dc:Point" x="438" y="953" /> - <di:waypoint xsi:type="dc:Point" x="159" y="953" /> - <di:waypoint xsi:type="dc:Point" x="159" y="1031" /> + <di:waypoint x="605" y="1131" /> + <di:waypoint x="658" y="1131" /> + <di:waypoint x="658" y="1203" /> + <di:waypoint x="379" y="1203" /> + <di:waypoint x="379" y="1281" /> <bpmndi:BPMNLabel> <dc:Bounds x="453" y="917" width="0" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleRollback.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleRollback.bpmn index e9675b89f8..699ee5bcd1 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleRollback.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleRollback.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoCreateVfModuleRollback" name="DoCreateVfModuleRollback" isExecutable="true"> <bpmn2:startEvent id="StartEvent_1"> <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> @@ -21,7 +21,7 @@ <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing> </bpmn2:callActivity> <bpmn2:sequenceFlow id="SequenceFlow_6" name="yes" sourceRef="ExclusiveGateway_1" targetRef="InvokePrepareUpdateAAIVfModule"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DCVFMR_rollbackPrepareUpdateVfModule") == "true" && !(execution.getVariable('aLaCarte') == true && execution.getVariable("DCVFMR_rollbackSDNCRequestAssign") == "true")]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DCVFMR_rollbackPrepareUpdateVfModule") == "true" && !(execution.getVariable('aLaCarte') == true && execution.getVariable("DCVFMR_rollbackSDNCRequestAssign") == "true")</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_8" name="" sourceRef="InvokePrepareUpdateAAIVfModule" targetRef="ExclusiveGateway_2" /> <bpmn2:sequenceFlow id="SequenceFlow_9" name="no" sourceRef="ExclusiveGateway_1" targetRef="ExclusiveGateway_2" /> @@ -34,15 +34,15 @@ <bpmn2:scriptTask id="VNFAdapterPrep" name="VNFAdapter Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1p0v6yk</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_16</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.prepVNFAdapterRequest(execution)]]></bpmn2:script> +dcvfmr.prepVNFAdapterRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_16" name="" sourceRef="VNFAdapterPrep" targetRef="InvokeVNFAdapter" /> - <bpmn2:callActivity id="InvokeVNFAdapter" name="Invoke VNFAdapterTask" calledElement="vnfAdapterTask"> + <bpmn2:callActivity id="InvokeVNFAdapter" name="Invoke VNFAdapterTask" calledElement="openstackAdapterTask"> <bpmn2:extensionElements> <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:in source="vnfAdapterTaskRequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="vnfAdapterTaskRequest" target="openstackAdapterTaskRequest" /> <camunda:out source="WorkflowResponse" target="DoDVfMod_DoCreateVfModuleRollbackResponse" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> @@ -51,15 +51,15 @@ dcvfmr.prepVNFAdapterRequest(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_08aruzz</bpmn2:outgoing> </bpmn2:callActivity> <bpmn2:sequenceFlow id="SequenceFlow_10" name="yes" sourceRef="ExclusiveGateway_2" targetRef="PrepareSDNCDeactivateRequest"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMR_rollbackSDNCRequestActivate") == "true" && execution.getVariable("sdncVersion") == "1707"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFMR_rollbackSDNCRequestActivate") == "true" && execution.getVariable("sdncVersion") == "1707"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_15" name="no" sourceRef="ExclusiveGateway_2" targetRef="ExclusiveGateway_1938vz9" /> <bpmn2:scriptTask id="UpdateAAIVfModulePrep" name="UpdateAAIVfModule Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_13</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.prepUpdateAAIVfModule(execution)]]></bpmn2:script> +dcvfmr.prepUpdateAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_14" name="" sourceRef="UpdateAAIVfModulePrep" targetRef="InvokeUpdateAAIVfModule" /> <bpmn2:callActivity id="InvokeUpdateAAIVfModule" name="Invoke UpdateAAIVfModule" calledElement="UpdateAAIVfModule"> @@ -78,7 +78,7 @@ dcvfmr.prepUpdateAAIVfModule(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_17</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_13" name="yes" sourceRef="ExclusiveGateway_3" targetRef="UpdateAAIVfModulePrep"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMR_rollbackUpdateAAIVfModule") == "true"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFMR_rollbackUpdateAAIVfModule") == "true"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_17" name="no" sourceRef="ExclusiveGateway_3" targetRef="ExclusiveGateway_4" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_4" name="Rollback SDNC Request?" default="SequenceFlow_20"> @@ -88,15 +88,15 @@ dcvfmr.prepUpdateAAIVfModule(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_20</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_19" name="yes" sourceRef="ExclusiveGateway_4" targetRef="ExclusiveGateway_1h87hhh"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMR_rollbackSDNCRequestAssign") == "true" || execution.getVariable("DCVFMR_rollbackSDNCRequestActivate") == "true"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFMR_rollbackSDNCRequestAssign") == "true" || execution.getVariable("DCVFMR_rollbackSDNCRequestActivate") == "true"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_20" name="no" sourceRef="ExclusiveGateway_4" targetRef="ExclusiveGateway_5" /> <bpmn2:scriptTask id="SDNCAdapterPrep2" name="SDNCAdapter Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1rpg6ac</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.prepSDNCAdapterRequest(execution)]]></bpmn2:script> +dcvfmr.prepSDNCAdapterRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_32" name="" sourceRef="SDNCAdapterPrep2" targetRef="InvokeSDNCAdapterV1_2" /> <bpmn2:callActivity id="InvokeSDNCAdapterV1_2" name="Invoke SDNCAdapterV1" calledElement="sdncAdapter"> @@ -121,7 +121,7 @@ dcvfmr.prepSDNCAdapterRequest(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_21" name="no" sourceRef="ExclusiveGateway_5" targetRef="SetSuccessfulRollbackStatus" /> <bpmn2:sequenceFlow id="SequenceFlow_24" name="yes" sourceRef="ExclusiveGateway_5" targetRef="DeleteAAIVfModulePrep"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMR_rollbackCreateAAIVfModule") == "true"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFMR_rollbackCreateAAIVfModule") == "true"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:callActivity id="InvokeDeleteAAIVfModule" name="Invoke DeleteAAIVfModule" calledElement="DeleteAAIVfModule"> <bpmn2:extensionElements> @@ -141,18 +141,18 @@ dcvfmr.prepSDNCAdapterRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="DeleteAAIVfModulePrep" name="DeleteAAIVfModule Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_24</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_34</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.prepDeleteAAIVfModule(execution)]]></bpmn2:script> +dcvfmr.prepDeleteAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_34" name="" sourceRef="DeleteAAIVfModulePrep" targetRef="InvokeDeleteAAIVfModule" /> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="InvokeSDNCAdapterV1_2" targetRef="ScriptTask_1" /> <bpmn2:scriptTask id="ScriptTask_1" name="Validate SDNC Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.sdncValidateResponse(execution, DCVFMR_DoCreateVfModuleRollbackResponse)]]></bpmn2:script> +dcvfmr.sdncValidateResponse(execution, DCVFMR_DoCreateVfModuleRollbackResponse)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="ScriptTask_1" targetRef="ExclusiveGateway_5" /> <bpmn2:subProcess id="SubProcess_1" name="Rollback Error Handling" triggeredByEvent="true"> @@ -168,18 +168,18 @@ dcvfmr.sdncValidateResponse(execution, DCVFMR_DoCreateVfModuleRollbackResponse)] <bpmn2:scriptTask id="LogSaveWorkflowException" name="Log and Save Workflow Exception" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_02fx6z6</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_22</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() dcvfmr.logWorkflowException(execution, 'DoCreateVfModuleRollback caught an event') -dcvfmr.saveWorkflowException(execution, 'DCVFMR_CaughtWorkflowException1')]]></bpmn2:script> +dcvfmr.saveWorkflowException(execution, 'DCVFMR_CaughtWorkflowException1')</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_02fx6z6" sourceRef="SetFailedRollbackStatus" targetRef="LogSaveWorkflowException" /> <bpmn2:scriptTask id="SetFailedRollbackStatus" name="Set Failed Rollback Status" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_02fx6z6</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.setFailedRollbackStatus(execution)]]></bpmn2:script> +dcvfmr.setFailedRollbackStatus(execution)</bpmn2:script> </bpmn2:scriptTask> </bpmn2:subProcess> <bpmn2:boundaryEvent id="BoundaryEvent_1" name="" attachedToRef="SubProcess_1"> @@ -193,9 +193,9 @@ dcvfmr.setFailedRollbackStatus(execution)]]></bpmn2:script> <bpmn2:scriptTask id="InitializeVariables" name="Initialize Variables" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.preProcessRequest(execution)]]></bpmn2:script> +dcvfmr.preProcessRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="InitializeVariables" targetRef="ExclusiveGateway_1yozzae" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_0a0hroy" name="Rollback Update AAI Generic VNF?" default="SequenceFlow_185bo77"> @@ -207,16 +207,16 @@ dcvfmr.preProcessRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="Task_08csf14" name="Delete Network Policies from AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0unumxv</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0djpj3r</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.deleteNetworkPoliciesFromAAI(execution)]]></bpmn2:script> +dcvfmr.deleteNetworkPoliciesFromAAI(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="Task_18r7u02" name="PreProcess Update AAI Generic VNF" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_111l1he</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0ca4brn</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.preProcessUpdateAAIGenericVnf(execution)]]></bpmn2:script> +dcvfmr.preProcessUpdateAAIGenericVnf(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="Task_01ajtiy" name="Update AAI Generic VNF" calledElement="UpdateAAIGenericVnf"> <bpmn2:extensionElements> @@ -238,12 +238,12 @@ dcvfmr.preProcessUpdateAAIGenericVnf(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_185bo77" name="no" sourceRef="ExclusiveGateway_0a0hroy" targetRef="ExclusiveGateway_0uvarlv" /> <bpmn2:sequenceFlow id="SequenceFlow_111l1he" name="yes" sourceRef="ExclusiveGateway_0a0hroy" targetRef="Task_18r7u02"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMR_rollbackUpdateVnfAAI") == "true"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFMR_rollbackUpdateVnfAAI") == "true"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_0ca4brn" sourceRef="Task_18r7u02" targetRef="Task_01ajtiy" /> <bpmn2:sequenceFlow id="SequenceFlow_19r2uus" sourceRef="Task_01ajtiy" targetRef="ExclusiveGateway_0uvarlv" /> <bpmn2:sequenceFlow id="SequenceFlow_1p0v6yk" name="yes " sourceRef="ExclusiveGateway_0uvarlv" targetRef="VNFAdapterPrep"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMR_rollbackVnfAdapterCreate") == "true"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFMR_rollbackVnfAdapterCreate") == "true"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_03i4czf" name="no" sourceRef="ExclusiveGateway_0uvarlv" targetRef="ExclusiveGateway_0ahc44p" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_1yozzae" name="Skip Rollback?" default="SequenceFlow_11er1t8"> @@ -253,7 +253,7 @@ dcvfmr.preProcessUpdateAAIGenericVnf(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_11er1t8" name="no" sourceRef="ExclusiveGateway_1yozzae" targetRef="ExclusiveGateway_1" /> <bpmn2:sequenceFlow id="SequenceFlow_0ggp8wz" name="yes" sourceRef="ExclusiveGateway_1yozzae" targetRef="EndEvent_9"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("skipRollback" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("skipRollback" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:exclusiveGateway id="ExclusiveGateway_1938vz9" name="Rollback Network Policies Creation?" default="SequenceFlow_0n58kg1"> <bpmn2:incoming>SequenceFlow_06rm0hg</bpmn2:incoming> @@ -264,9 +264,9 @@ dcvfmr.preProcessUpdateAAIGenericVnf(execution)]]></bpmn2:script> <bpmn2:scriptTask id="PrepareSDNCDeactivateRequest" name="Prepare SDNC Deactivate Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0ugalf8</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.preProcessSDNCDeactivateRequest(execution)]]></bpmn2:script> +dcvfmr.preProcessSDNCDeactivateRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CallSDNCDeactivate" name="Call SDNC Adapter Deactivate" calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -284,26 +284,26 @@ dcvfmr.preProcessSDNCDeactivateRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="PostProcessSDNCDeactivateRequest" name="PostProcess SDNC Deactivate Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0n78x37</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_06rm0hg</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() String response = execution.getVariable("DCVFMR_deactivateSDNCAdapterResponse") -dcvfmr.sdncValidateResponse(execution, response)]]></bpmn2:script> +dcvfmr.sdncValidateResponse(execution, response)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_0ugalf8" sourceRef="PrepareSDNCDeactivateRequest" targetRef="CallSDNCDeactivate" /> <bpmn2:sequenceFlow id="SequenceFlow_0n78x37" sourceRef="CallSDNCDeactivate" targetRef="PostProcessSDNCDeactivateRequest" /> <bpmn2:sequenceFlow id="SequenceFlow_06rm0hg" sourceRef="PostProcessSDNCDeactivateRequest" targetRef="ExclusiveGateway_1938vz9" /> <bpmn2:sequenceFlow id="SequenceFlow_0n58kg1" name="no" sourceRef="ExclusiveGateway_1938vz9" targetRef="ExclusiveGateway_0a0hroy" /> <bpmn2:sequenceFlow id="SequenceFlow_0unumxv" name="yes" sourceRef="ExclusiveGateway_1938vz9" targetRef="Task_08csf14"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMR_rollbackCreateNetworkPoliciesAAI") == "true"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFMR_rollbackCreateNetworkPoliciesAAI") == "true"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_1iufuuu" sourceRef="PrepareSDNCUnassignRequest" targetRef="CallSDNCAdapterUnassign" /> <bpmn2:sequenceFlow id="SequenceFlow_1l4n37b" sourceRef="CallSDNCAdapterUnassign" targetRef="PostProcessSDNCUnassignRequest" /> <bpmn2:scriptTask id="PrepareSDNCUnassignRequest" name="Prepare SDNC Unassign Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_16ghmax</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1iufuuu</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.preProcessSDNCUnassignRequest(execution)]]></bpmn2:script> +dcvfmr.preProcessSDNCUnassignRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CallSDNCAdapterUnassign" name="Call SDNC Adapter Unassign" calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -321,10 +321,10 @@ dcvfmr.preProcessSDNCUnassignRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="PostProcessSDNCUnassignRequest" name="PostProcess SDNC Unassign Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1l4n37b</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_12otwa4</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() String response = execution.getVariable("DCVFMR_unassignSDNCAdapterResponse") -dcvfmr.sdncValidateResponse(execution, response)]]></bpmn2:script> +dcvfmr.sdncValidateResponse(execution, response)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="ExclusiveGateway_1h87hhh" name="Rollback 1707 SDNC Activate?" default="SequenceFlow_1rpg6ac"> <bpmn2:incoming>SequenceFlow_19</bpmn2:incoming> @@ -333,7 +333,7 @@ dcvfmr.sdncValidateResponse(execution, response)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_1rpg6ac" name="no" sourceRef="ExclusiveGateway_1h87hhh" targetRef="SDNCAdapterPrep2" /> <bpmn2:sequenceFlow id="SequenceFlow_16ghmax" name="yes" sourceRef="ExclusiveGateway_1h87hhh" targetRef="PrepareSDNCUnassignRequest"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMR_rollbackSDNCRequestAssign") == "true" && execution.getVariable("sdncVersion") == "1707"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DCVFMR_rollbackSDNCRequestAssign") == "true" && execution.getVariable("sdncVersion") == "1707"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_12otwa4" sourceRef="PostProcessSDNCUnassignRequest" targetRef="ExclusiveGateway_5" /> <bpmn2:sequenceFlow id="SequenceFlow_1h8ve60" sourceRef="SetSuccessfulRollbackStatus" targetRef="EndEvent_9" /> @@ -342,9 +342,9 @@ dcvfmr.sdncValidateResponse(execution, response)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_35</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_17it51d</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1h8ve60</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.setSuccessfulRollbackStatus(execution)]]></bpmn2:script> +dcvfmr.setSuccessfulRollbackStatus(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="ExclusiveGateway_0ahc44p" name="Set AAI Status to Assigned?" default="SequenceFlow_1gcfdej"> <bpmn2:incoming>SequenceFlow_03i4czf</bpmn2:incoming> @@ -354,7 +354,7 @@ dcvfmr.setSuccessfulRollbackStatus(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_1gcfdej" name="no" sourceRef="ExclusiveGateway_0ahc44p" targetRef="ExclusiveGateway_3" /> <bpmn2:sequenceFlow id="SequenceFlow_17ne2iz" name="yes" sourceRef="ExclusiveGateway_0ahc44p" targetRef="Task_1sqxedz"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable('aLaCarte') == true && execution.getVariable("DCVFMR_rollbackSDNCRequestAssign") == "true"]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable('aLaCarte') == true && execution.getVariable("DCVFMR_rollbackSDNCRequestAssign") == "true"</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_17it51d" sourceRef="Task_0k9gnp2" targetRef="SetSuccessfulRollbackStatus" /> <bpmn2:sequenceFlow id="SequenceFlow_0fvuowt" sourceRef="Task_1sqxedz" targetRef="Task_0k9gnp2" /> @@ -370,9 +370,9 @@ dcvfmr.setSuccessfulRollbackStatus(execution)]]></bpmn2:script> <bpmn2:scriptTask id="Task_1sqxedz" name="UpdateAAIVfModule To Assigned Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_17ne2iz</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0fvuowt</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcvfmr = new DoCreateVfModuleRollback() -dcvfmr.prepUpdateAAIVfModuleToAssigned(execution)]]></bpmn2:script> +dcvfmr.prepUpdateAAIVfModuleToAssigned(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_08aruzz" sourceRef="InvokeVNFAdapter" targetRef="ExclusiveGateway_0ahc44p" /> </bpmn2:process> @@ -381,593 +381,593 @@ dcvfmr.prepUpdateAAIVfModuleToAssigned(execution)]]></bpmn2:script> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateVfModuleRollback"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_37" bpmnElement="StartEvent_1"> - <dc:Bounds x="13" y="100" width="36" height="36" /> + <dc:Bounds x="203" y="210" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="31" y="141" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_22" bpmnElement="InitializeVariables"> - <dc:Bounds x="115" y="78" width="100" height="80" /> + <dc:Bounds x="305" y="188" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_37" targetElement="_BPMNShape_ScriptTask_22"> - <di:waypoint xsi:type="dc:Point" x="49" y="118" /> - <di:waypoint xsi:type="dc:Point" x="115" y="118" /> + <di:waypoint x="239" y="228" /> + <di:waypoint x="305" y="228" /> <bpmndi:BPMNLabel> <dc:Bounds x="82" y="103" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_160" bpmnElement="InvokePrepareUpdateAAIVfModule"> - <dc:Bounds x="725" y="23" width="100" height="80" /> + <dc:Bounds x="915" y="133" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_170" bpmnElement="VNFAdapterPrep"> - <dc:Bounds x="104" y="763" width="100" height="80" /> + <dc:Bounds x="294" y="873" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_13" bpmnElement="InvokeVNFAdapter"> - <dc:Bounds x="262" y="763" width="100" height="80" /> + <dc:Bounds x="452" y="873" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_16" bpmnElement="SequenceFlow_16" sourceElement="_BPMNShape_ScriptTask_170" targetElement="_BPMNShape_CallActivity_13"> - <di:waypoint xsi:type="dc:Point" x="204" y="803" /> - <di:waypoint xsi:type="dc:Point" x="262" y="803" /> + <di:waypoint x="394" y="913" /> + <di:waypoint x="452" y="913" /> <bpmndi:BPMNLabel> <dc:Bounds x="225" y="803" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_171" bpmnElement="UpdateAAIVfModulePrep"> - <dc:Bounds x="732" y="758" width="100" height="80" /> + <dc:Bounds x="922" y="868" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_14" bpmnElement="InvokeUpdateAAIVfModule"> - <dc:Bounds x="912" y="758" width="100" height="80" /> + <dc:Bounds x="1102" y="868" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_172" bpmnElement="SDNCAdapterPrep2"> - <dc:Bounds x="187" y="995" width="100" height="80" /> + <dc:Bounds x="377" y="1105" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_15" bpmnElement="InvokeSDNCAdapterV1_2"> - <dc:Bounds x="327" y="995" width="100" height="80" /> + <dc:Bounds x="517" y="1105" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_173" bpmnElement="DeleteAAIVfModulePrep"> - <dc:Bounds x="704" y="998" width="100" height="80" /> + <dc:Bounds x="894" y="1108" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_16" bpmnElement="InvokeDeleteAAIVfModule"> - <dc:Bounds x="860" y="998" width="100" height="80" /> + <dc:Bounds x="1050" y="1108" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_32" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ScriptTask_172" targetElement="_BPMNShape_CallActivity_15"> - <di:waypoint xsi:type="dc:Point" x="287" y="1035" /> - <di:waypoint xsi:type="dc:Point" x="327" y="1035" /> + <di:waypoint x="477" y="1145" /> + <di:waypoint x="517" y="1145" /> <bpmndi:BPMNLabel> <dc:Bounds x="307" y="1035" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_34" bpmnElement="SequenceFlow_34" sourceElement="_BPMNShape_ScriptTask_173" targetElement="_BPMNShape_CallActivity_16"> - <di:waypoint xsi:type="dc:Point" x="804" y="1038" /> - <di:waypoint xsi:type="dc:Point" x="860" y="1038" /> + <di:waypoint x="994" y="1148" /> + <di:waypoint x="1050" y="1148" /> <bpmndi:BPMNLabel> <dc:Bounds x="820" y="1038" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_169" bpmnElement="EndEvent_9"> - <dc:Bounds x="1159" y="1105" width="36" height="36" /> + <dc:Bounds x="1349" y="1215" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1177" y="1146" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_CallActivity_16" targetElement="_BPMNShape_EndEvent_169"> - <di:waypoint xsi:type="dc:Point" x="960" y="1038" /> - <di:waypoint xsi:type="dc:Point" x="1078" y="1038" /> - <di:waypoint xsi:type="dc:Point" x="1078" y="1083" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_CallActivity_16" targetElement="ScriptTask_0lrbhgj_di"> + <di:waypoint x="1150" y="1148" /> + <di:waypoint x="1268" y="1148" /> + <di:waypoint x="1268" y="1193" /> <bpmndi:BPMNLabel> <dc:Bounds x="1019" y="1023" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_223" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true"> - <dc:Bounds x="538" y="93" width="50" height="50" /> + <dc:Bounds x="728" y="203" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="519" y="152" width="88" height="36" /> + <dc:Bounds x="708" y="262" width="90" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_22" targetElement="_BPMNShape_ExclusiveGateway_223"> - <di:waypoint xsi:type="dc:Point" x="215" y="118" /> - <di:waypoint xsi:type="dc:Point" x="278" y="118" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_22" targetElement="ExclusiveGateway_1yozzae_di"> + <di:waypoint x="405" y="228" /> + <di:waypoint x="468" y="228" /> <bpmndi:BPMNLabel> <dc:Bounds x="247" y="103" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_224" bpmnElement="ExclusiveGateway_2" isMarkerVisible="true"> - <dc:Bounds x="912" y="92" width="50" height="50" /> + <dc:Bounds x="1102" y="202" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="897" y="152" width="79" height="24" /> + <dc:Bounds x="1087" y="262" width="80" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ExclusiveGateway_223"> - <di:waypoint xsi:type="dc:Point" x="563" y="93" /> - <di:waypoint xsi:type="dc:Point" x="563" y="63" /> - <di:waypoint xsi:type="dc:Point" x="725" y="63" /> + <di:waypoint x="753" y="203" /> + <di:waypoint x="753" y="173" /> + <di:waypoint x="915" y="173" /> <bpmndi:BPMNLabel> - <dc:Bounds x="573" y="39.419820324530114" width="18" height="12" /> + <dc:Bounds x="764" y="149" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_ScriptTask_160" targetElement="_BPMNShape_ExclusiveGateway_224"> - <di:waypoint xsi:type="dc:Point" x="825" y="63" /> - <di:waypoint xsi:type="dc:Point" x="862" y="63" /> - <di:waypoint xsi:type="dc:Point" x="937" y="63" /> - <di:waypoint xsi:type="dc:Point" x="937" y="92" /> + <di:waypoint x="1015" y="173" /> + <di:waypoint x="1052" y="173" /> + <di:waypoint x="1127" y="173" /> + <di:waypoint x="1127" y="202" /> <bpmndi:BPMNLabel> <dc:Bounds x="888" y="63" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_ExclusiveGateway_223" targetElement="_BPMNShape_ExclusiveGateway_224"> - <di:waypoint xsi:type="dc:Point" x="588" y="118" /> - <di:waypoint xsi:type="dc:Point" x="912" y="117" /> + <di:waypoint x="778" y="228" /> + <di:waypoint x="1102" y="227" /> <bpmndi:BPMNLabel> - <dc:Bounds x="743" y="117.50867542935495" width="12" height="12" /> + <dc:Bounds x="933" y="228" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_ExclusiveGateway_224" targetElement="_BPMNShape_ScriptTask_170"> - <di:waypoint xsi:type="dc:Point" x="937" y="142" /> - <di:waypoint xsi:type="dc:Point" x="937" y="229" /> - <di:waypoint xsi:type="dc:Point" x="29" y="229" /> - <di:waypoint xsi:type="dc:Point" x="29" y="321" /> - <di:waypoint xsi:type="dc:Point" x="203" y="321" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_ExclusiveGateway_224" targetElement="ScriptTask_17dmaj7_di"> + <di:waypoint x="1127" y="252" /> + <di:waypoint x="1127" y="339" /> + <di:waypoint x="219" y="339" /> + <di:waypoint x="219" y="431" /> + <di:waypoint x="393" y="431" /> <bpmndi:BPMNLabel> - <dc:Bounds x="501" y="235" width="18" height="12" /> + <dc:Bounds x="692" y="345" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_225" bpmnElement="ExclusiveGateway_3" isMarkerVisible="true"> - <dc:Bounds x="594" y="837" width="50" height="50" /> + <dc:Bounds x="784" y="947" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="578" y="892" width="83" height="24" /> + <dc:Bounds x="769" y="1002" width="81" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_ExclusiveGateway_225" targetElement="_BPMNShape_ScriptTask_171"> - <di:waypoint xsi:type="dc:Point" x="644" y="862" /> - <di:waypoint xsi:type="dc:Point" x="665" y="862" /> - <di:waypoint xsi:type="dc:Point" x="665" y="798" /> - <di:waypoint xsi:type="dc:Point" x="732" y="798" /> + <di:waypoint x="834" y="972" /> + <di:waypoint x="855" y="972" /> + <di:waypoint x="855" y="908" /> + <di:waypoint x="922" y="908" /> <bpmndi:BPMNLabel> - <dc:Bounds x="687" y="803" width="18" height="12" /> + <dc:Bounds x="878" y="913" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_171" targetElement="_BPMNShape_CallActivity_14"> - <di:waypoint xsi:type="dc:Point" x="832" y="798" /> - <di:waypoint xsi:type="dc:Point" x="912" y="798" /> + <di:waypoint x="1022" y="908" /> + <di:waypoint x="1102" y="908" /> <bpmndi:BPMNLabel> <dc:Bounds x="843" y="798" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_226" bpmnElement="ExclusiveGateway_4" isMarkerVisible="true"> - <dc:Bounds x="1092" y="837" width="50" height="50" /> + <dc:Bounds x="1282" y="947" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1078" y="892" width="79" height="24" /> + <dc:Bounds x="1269" y="1002" width="77" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ExclusiveGateway_224" targetElement="_BPMNShape_ExclusiveGateway_225"> - <di:waypoint xsi:type="dc:Point" x="962" y="117" /> - <di:waypoint xsi:type="dc:Point" x="1025" y="117" /> - <di:waypoint xsi:type="dc:Point" x="1025" y="212" /> - <di:waypoint xsi:type="dc:Point" x="19" y="212" /> - <di:waypoint xsi:type="dc:Point" x="19" y="382" /> - <di:waypoint xsi:type="dc:Point" x="922" y="382" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ExclusiveGateway_224" targetElement="ExclusiveGateway_1938vz9_di"> + <di:waypoint x="1152" y="227" /> + <di:waypoint x="1215" y="227" /> + <di:waypoint x="1215" y="322" /> + <di:waypoint x="209" y="322" /> + <di:waypoint x="209" y="492" /> + <di:waypoint x="1112" y="492" /> <bpmndi:BPMNLabel> - <dc:Bounds x="501" y="187" width="12" height="12" /> + <dc:Bounds x="691" y="297" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_17" bpmnElement="SequenceFlow_17" sourceElement="_BPMNShape_ExclusiveGateway_225" targetElement="_BPMNShape_ExclusiveGateway_226"> - <di:waypoint xsi:type="dc:Point" x="644" y="862" /> - <di:waypoint xsi:type="dc:Point" x="1092" y="862" /> + <di:waypoint x="834" y="972" /> + <di:waypoint x="1282" y="972" /> <bpmndi:BPMNLabel> - <dc:Bounds x="855" y="862" width="12" height="12" /> + <dc:Bounds x="1045" y="972" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_18" sourceElement="_BPMNShape_CallActivity_14" targetElement="_BPMNShape_ExclusiveGateway_226"> - <di:waypoint xsi:type="dc:Point" x="1012" y="798" /> - <di:waypoint xsi:type="dc:Point" x="1117" y="798" /> - <di:waypoint xsi:type="dc:Point" x="1117" y="837" /> + <di:waypoint x="1202" y="908" /> + <di:waypoint x="1307" y="908" /> + <di:waypoint x="1307" y="947" /> <bpmndi:BPMNLabel> <dc:Bounds x="1090" y="798" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_ExclusiveGateway_226" targetElement="_BPMNShape_ScriptTask_172"> - <di:waypoint xsi:type="dc:Point" x="1117" y="887" /> - <di:waypoint xsi:type="dc:Point" x="1117" y="958" /> - <di:waypoint xsi:type="dc:Point" x="34" y="958" /> - <di:waypoint xsi:type="dc:Point" x="34" y="1103" /> - <di:waypoint xsi:type="dc:Point" x="56" y="1103" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_ExclusiveGateway_226" targetElement="ExclusiveGateway_1h87hhh_di"> + <di:waypoint x="1307" y="997" /> + <di:waypoint x="1307" y="1068" /> + <di:waypoint x="224" y="1068" /> + <di:waypoint x="224" y="1213" /> + <di:waypoint x="246" y="1213" /> <bpmndi:BPMNLabel> - <dc:Bounds x="262" y="958" width="18" height="12" /> + <dc:Bounds x="453" y="1068" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_227" bpmnElement="ExclusiveGateway_5" isMarkerVisible="true"> - <dc:Bounds x="589" y="1098" width="50" height="50" /> + <dc:Bounds x="779" y="1208" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="578" y="1153" width="71" height="24" /> + <dc:Bounds x="769" y="1263" width="70" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20" bpmnElement="SequenceFlow_20" sourceElement="_BPMNShape_ExclusiveGateway_226" targetElement="_BPMNShape_ExclusiveGateway_227"> - <di:waypoint xsi:type="dc:Point" x="1092" y="862" /> - <di:waypoint xsi:type="dc:Point" x="1029" y="862" /> - <di:waypoint xsi:type="dc:Point" x="1029" y="942" /> - <di:waypoint xsi:type="dc:Point" x="25" y="942" /> - <di:waypoint xsi:type="dc:Point" x="25" y="1246" /> - <di:waypoint xsi:type="dc:Point" x="614" y="1246" /> - <di:waypoint xsi:type="dc:Point" x="614" y="1148" /> + <di:waypoint x="1282" y="972" /> + <di:waypoint x="1219" y="972" /> + <di:waypoint x="1219" y="1052" /> + <di:waypoint x="215" y="1052" /> + <di:waypoint x="215" y="1356" /> + <di:waypoint x="804" y="1356" /> + <di:waypoint x="804" y="1258" /> <bpmndi:BPMNLabel> - <dc:Bounds x="976" y="912" width="12" height="12" /> + <dc:Bounds x="1166" y="1022" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_21" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_ExclusiveGateway_227" targetElement="_BPMNShape_EndEvent_169"> - <di:waypoint xsi:type="dc:Point" x="639" y="1123" /> - <di:waypoint xsi:type="dc:Point" x="1028" y="1123" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_21" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_ExclusiveGateway_227" targetElement="ScriptTask_0lrbhgj_di"> + <di:waypoint x="829" y="1233" /> + <di:waypoint x="1218" y="1233" /> <bpmndi:BPMNLabel> - <dc:Bounds x="811" y="1123" width="12" height="12" /> + <dc:Bounds x="1001" y="1233" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_24" bpmnElement="SequenceFlow_24" sourceElement="_BPMNShape_ExclusiveGateway_227" targetElement="_BPMNShape_ScriptTask_173"> - <di:waypoint xsi:type="dc:Point" x="639" y="1123" /> - <di:waypoint xsi:type="dc:Point" x="664" y="1123" /> - <di:waypoint xsi:type="dc:Point" x="664" y="1067" /> - <di:waypoint xsi:type="dc:Point" x="664" y="1038" /> - <di:waypoint xsi:type="dc:Point" x="704" y="1038" /> + <di:waypoint x="829" y="1233" /> + <di:waypoint x="854" y="1233" /> + <di:waypoint x="854" y="1177" /> + <di:waypoint x="854" y="1148" /> + <di:waypoint x="894" y="1148" /> <bpmndi:BPMNLabel> - <dc:Bounds x="679" y="1044" width="18" height="12" /> + <dc:Bounds x="870" y="1154" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_255" bpmnElement="ScriptTask_1"> - <dc:Bounds x="461" y="995" width="100" height="80" /> + <dc:Bounds x="651" y="1105" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_CallActivity_15" targetElement="_BPMNShape_ScriptTask_255"> - <di:waypoint xsi:type="dc:Point" x="427" y="1035" /> - <di:waypoint xsi:type="dc:Point" x="461" y="1035" /> + <di:waypoint x="617" y="1145" /> + <di:waypoint x="651" y="1145" /> <bpmndi:BPMNLabel> <dc:Bounds x="446" y="1035" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ScriptTask_255" targetElement="_BPMNShape_ExclusiveGateway_227"> - <di:waypoint xsi:type="dc:Point" x="561" y="1035" /> - <di:waypoint xsi:type="dc:Point" x="614" y="1035" /> - <di:waypoint xsi:type="dc:Point" x="614" y="1098" /> + <di:waypoint x="751" y="1145" /> + <di:waypoint x="804" y="1145" /> + <di:waypoint x="804" y="1208" /> <bpmndi:BPMNLabel> <dc:Bounds x="614" y="1040" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_22" bpmnElement="SubProcess_1" isExpanded="true"> - <dc:Bounds x="27" y="1464" width="699" height="159" /> + <dc:Bounds x="217" y="1574" width="699" height="159" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_59" bpmnElement="CatchExceptions"> - <dc:Bounds x="47" y="1515" width="36" height="36" /> + <dc:Bounds x="237" y="1625" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="53" y="1560" width="86" height="12" /> + <dc:Bounds x="243" y="1670" width="87" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_281" bpmnElement="LogSaveWorkflowException"> - <dc:Bounds x="391" y="1493" width="100" height="80" /> + <dc:Bounds x="581" y="1603" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_188" bpmnElement="EndEvent_1"> - <dc:Bounds x="565" y="1515" width="36" height="36" /> + <dc:Bounds x="755" y="1625" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="583" y="1551" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_55" bpmnElement="BoundaryEvent_1"> - <dc:Bounds x="708" y="1514" width="36" height="36" /> + <dc:Bounds x="898" y="1624" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="726" y="1550" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_189" bpmnElement="EndEvent_2"> - <dc:Bounds x="880" y="1514" width="36" height="36" /> + <dc:Bounds x="1070" y="1624" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="898" y="1555" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_BoundaryEvent_55" targetElement="_BPMNShape_EndEvent_189"> - <di:waypoint xsi:type="dc:Point" x="744" y="1532" /> - <di:waypoint xsi:type="dc:Point" x="818" y="1532" /> - <di:waypoint xsi:type="dc:Point" x="818" y="1532" /> - <di:waypoint xsi:type="dc:Point" x="880" y="1532" /> + <di:waypoint x="934" y="1642" /> + <di:waypoint x="1008" y="1642" /> + <di:waypoint x="1008" y="1642" /> + <di:waypoint x="1070" y="1642" /> <bpmndi:BPMNLabel> <dc:Bounds x="833" y="1532" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_0a0hroy_di" bpmnElement="ExclusiveGateway_0a0hroy" isMarkerVisible="true"> - <dc:Bounds x="413" y="588" width="50" height="50" /> + <dc:Bounds x="603" y="698" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="397" y="638" width="84" height="38" /> + <dc:Bounds x="584" y="748" width="90" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0mnb4d7_di" bpmnElement="Task_08csf14"> - <dc:Bounds x="212" y="507" width="100" height="80" /> + <dc:Bounds x="402" y="617" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1shi2a6_di" bpmnElement="Task_18r7u02"> - <dc:Bounds x="552" y="507" width="100" height="80" /> + <dc:Bounds x="742" y="617" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0zvct4i_di" bpmnElement="Task_01ajtiy"> - <dc:Bounds x="747" y="507" width="100" height="80" /> + <dc:Bounds x="937" y="617" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0djpj3r_di" bpmnElement="SequenceFlow_0djpj3r"> - <di:waypoint xsi:type="dc:Point" x="312" y="547" /> - <di:waypoint xsi:type="dc:Point" x="438" y="547" /> - <di:waypoint xsi:type="dc:Point" x="438" y="589" /> + <di:waypoint x="502" y="657" /> + <di:waypoint x="628" y="657" /> + <di:waypoint x="628" y="699" /> <bpmndi:BPMNLabel> <dc:Bounds x="375" y="532" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_0uvarlv_di" bpmnElement="ExclusiveGateway_0uvarlv" isMarkerVisible="true"> - <dc:Bounds x="921" y="588" width="50" height="50" /> + <dc:Bounds x="1111" y="698" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="907" y="638" width="78" height="26" /> + <dc:Bounds x="1096" y="748" width="80" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_185bo77_di" bpmnElement="SequenceFlow_185bo77"> - <di:waypoint xsi:type="dc:Point" x="463" y="613" /> - <di:waypoint xsi:type="dc:Point" x="692" y="613" /> - <di:waypoint xsi:type="dc:Point" x="692" y="613" /> - <di:waypoint xsi:type="dc:Point" x="921" y="613" /> + <di:waypoint x="653" y="723" /> + <di:waypoint x="882" y="723" /> + <di:waypoint x="882" y="723" /> + <di:waypoint x="1111" y="723" /> <bpmndi:BPMNLabel> - <dc:Bounds x="701" y="613" width="12" height="14" /> + <dc:Bounds x="891" y="723" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_111l1he_di" bpmnElement="SequenceFlow_111l1he"> - <di:waypoint xsi:type="dc:Point" x="463" y="613" /> - <di:waypoint xsi:type="dc:Point" x="493" y="613" /> - <di:waypoint xsi:type="dc:Point" x="493" y="547" /> - <di:waypoint xsi:type="dc:Point" x="552" y="547" /> + <di:waypoint x="653" y="723" /> + <di:waypoint x="683" y="723" /> + <di:waypoint x="683" y="657" /> + <di:waypoint x="742" y="657" /> <bpmndi:BPMNLabel> - <dc:Bounds x="508" y="553" width="18" height="14" /> + <dc:Bounds x="699" y="663" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0ca4brn_di" bpmnElement="SequenceFlow_0ca4brn"> - <di:waypoint xsi:type="dc:Point" x="652" y="547" /> - <di:waypoint xsi:type="dc:Point" x="693" y="547" /> - <di:waypoint xsi:type="dc:Point" x="693" y="547" /> - <di:waypoint xsi:type="dc:Point" x="747" y="547" /> + <di:waypoint x="842" y="657" /> + <di:waypoint x="883" y="657" /> + <di:waypoint x="883" y="657" /> + <di:waypoint x="937" y="657" /> <bpmndi:BPMNLabel> <dc:Bounds x="708" y="547" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_19r2uus_di" bpmnElement="SequenceFlow_19r2uus"> - <di:waypoint xsi:type="dc:Point" x="847" y="547" /> - <di:waypoint xsi:type="dc:Point" x="946" y="547" /> - <di:waypoint xsi:type="dc:Point" x="946" y="588" /> + <di:waypoint x="1037" y="657" /> + <di:waypoint x="1136" y="657" /> + <di:waypoint x="1136" y="698" /> <bpmndi:BPMNLabel> <dc:Bounds x="897" y="532" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1p0v6yk_di" bpmnElement="SequenceFlow_1p0v6yk"> - <di:waypoint xsi:type="dc:Point" x="946" y="638" /> - <di:waypoint xsi:type="dc:Point" x="946" y="724" /> - <di:waypoint xsi:type="dc:Point" x="47" y="724" /> - <di:waypoint xsi:type="dc:Point" x="47" y="803" /> - <di:waypoint xsi:type="dc:Point" x="104" y="803" /> + <di:waypoint x="1136" y="748" /> + <di:waypoint x="1136" y="834" /> + <di:waypoint x="237" y="834" /> + <di:waypoint x="237" y="913" /> + <di:waypoint x="294" y="913" /> <bpmndi:BPMNLabel> - <dc:Bounds x="507" y="732" width="18" height="14" /> + <dc:Bounds x="698" y="842" width="17" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_03i4czf_di" bpmnElement="SequenceFlow_03i4czf"> - <di:waypoint xsi:type="dc:Point" x="971" y="613" /> - <di:waypoint xsi:type="dc:Point" x="1036" y="613" /> - <di:waypoint xsi:type="dc:Point" x="1036" y="709" /> - <di:waypoint xsi:type="dc:Point" x="30" y="709" /> - <di:waypoint xsi:type="dc:Point" x="30" y="862" /> - <di:waypoint xsi:type="dc:Point" x="466" y="862" /> + <di:waypoint x="1161" y="723" /> + <di:waypoint x="1226" y="723" /> + <di:waypoint x="1226" y="819" /> + <di:waypoint x="220" y="819" /> + <di:waypoint x="220" y="972" /> + <di:waypoint x="656" y="972" /> <bpmndi:BPMNLabel> - <dc:Bounds x="508" y="683" width="12" height="12" /> + <dc:Bounds x="698" y="793" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1yozzae_di" bpmnElement="ExclusiveGateway_1yozzae" isMarkerVisible="true"> - <dc:Bounds x="278" y="93" width="50" height="50" /> + <dc:Bounds x="468" y="203" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="267" y="143" width="72" height="12" /> + <dc:Bounds x="457" y="253" width="73" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_11er1t8_di" bpmnElement="SequenceFlow_11er1t8"> - <di:waypoint xsi:type="dc:Point" x="328" y="118" /> - <di:waypoint xsi:type="dc:Point" x="538" y="118" /> + <di:waypoint x="518" y="228" /> + <di:waypoint x="728" y="228" /> <bpmndi:BPMNLabel> - <dc:Bounds x="357" y="91.50148837900852" width="12" height="12" /> + <dc:Bounds x="547" y="202" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0ggp8wz_di" bpmnElement="SequenceFlow_0ggp8wz"> - <di:waypoint xsi:type="dc:Point" x="303" y="93" /> - <di:waypoint xsi:type="dc:Point" x="303" y="-11" /> - <di:waypoint xsi:type="dc:Point" x="1158" y="-11" /> - <di:waypoint xsi:type="dc:Point" x="1177" y="1105" /> + <di:waypoint x="493" y="203" /> + <di:waypoint x="493" y="99" /> + <di:waypoint x="1348" y="99" /> + <di:waypoint x="1367" y="1215" /> <bpmndi:BPMNLabel> - <dc:Bounds x="723" y="-26" width="18" height="14" /> + <dc:Bounds x="914" y="84" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_22" bpmnElement="SequenceFlow_22" sourceElement="_BPMNShape_ScriptTask_281" targetElement="_BPMNShape_EndEvent_188"> - <di:waypoint xsi:type="dc:Point" x="491" y="1533" /> - <di:waypoint xsi:type="dc:Point" x="565" y="1533" /> + <di:waypoint x="681" y="1643" /> + <di:waypoint x="755" y="1643" /> <bpmndi:BPMNLabel> <dc:Bounds x="528" y="1518" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_StartEvent_59" targetElement="_BPMNShape_ScriptTask_281"> - <di:waypoint xsi:type="dc:Point" x="83" y="1533" /> - <di:waypoint xsi:type="dc:Point" x="198" y="1533" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_StartEvent_59" targetElement="ScriptTask_0cd144f_di"> + <di:waypoint x="273" y="1643" /> + <di:waypoint x="388" y="1643" /> <bpmndi:BPMNLabel> <dc:Bounds x="141" y="1518" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1938vz9_di" bpmnElement="ExclusiveGateway_1938vz9" isMarkerVisible="true"> - <dc:Bounds x="921.561377245509" y="357" width="50" height="50" /> + <dc:Bounds x="1112" y="467" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="902" y="407" width="90" height="24" /> + <dc:Bounds x="1093" y="517" width="89" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_17dmaj7_di" bpmnElement="PrepareSDNCDeactivateRequest"> - <dc:Bounds x="204" y="281" width="100" height="80" /> + <dc:Bounds x="394" y="391" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0ouj5y6_di" bpmnElement="CallSDNCDeactivate"> - <dc:Bounds x="401" y="280" width="100" height="80" /> + <dc:Bounds x="591" y="390" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1fmh02z_di" bpmnElement="PostProcessSDNCDeactivateRequest"> - <dc:Bounds x="613" y="280" width="100" height="80" /> + <dc:Bounds x="803" y="390" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0ugalf8_di" bpmnElement="SequenceFlow_0ugalf8"> - <di:waypoint xsi:type="dc:Point" x="304" y="321" /> - <di:waypoint xsi:type="dc:Point" x="401" y="320" /> + <di:waypoint x="494" y="431" /> + <di:waypoint x="591" y="430" /> <bpmndi:BPMNLabel> <dc:Bounds x="353" y="295.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0n78x37_di" bpmnElement="SequenceFlow_0n78x37"> - <di:waypoint xsi:type="dc:Point" x="501" y="320" /> - <di:waypoint xsi:type="dc:Point" x="613" y="320" /> + <di:waypoint x="691" y="430" /> + <di:waypoint x="803" y="430" /> <bpmndi:BPMNLabel> <dc:Bounds x="557" y="295" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_06rm0hg_di" bpmnElement="SequenceFlow_06rm0hg"> - <di:waypoint xsi:type="dc:Point" x="713" y="320" /> - <di:waypoint xsi:type="dc:Point" x="947" y="320" /> - <di:waypoint xsi:type="dc:Point" x="947" y="357" /> + <di:waypoint x="903" y="430" /> + <di:waypoint x="1137" y="430" /> + <di:waypoint x="1137" y="467" /> <bpmndi:BPMNLabel> <dc:Bounds x="830" y="305" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0n58kg1_di" bpmnElement="SequenceFlow_0n58kg1"> - <di:waypoint xsi:type="dc:Point" x="972" y="382" /> - <di:waypoint xsi:type="dc:Point" x="1033" y="382" /> - <di:waypoint xsi:type="dc:Point" x="1033" y="466" /> - <di:waypoint xsi:type="dc:Point" x="14" y="466" /> - <di:waypoint xsi:type="dc:Point" x="14" y="613" /> - <di:waypoint xsi:type="dc:Point" x="413" y="613" /> + <di:waypoint x="1162" y="492" /> + <di:waypoint x="1223" y="492" /> + <di:waypoint x="1223" y="576" /> + <di:waypoint x="204" y="576" /> + <di:waypoint x="204" y="723" /> + <di:waypoint x="603" y="723" /> <bpmndi:BPMNLabel> - <dc:Bounds x="508" y="444" width="12" height="12" /> + <dc:Bounds x="698" y="554" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0unumxv_di" bpmnElement="SequenceFlow_0unumxv"> - <di:waypoint xsi:type="dc:Point" x="947" y="407" /> - <di:waypoint xsi:type="dc:Point" x="947" y="482" /> - <di:waypoint xsi:type="dc:Point" x="32" y="482" /> - <di:waypoint xsi:type="dc:Point" x="32" y="547" /> - <di:waypoint xsi:type="dc:Point" x="211" y="547" /> + <di:waypoint x="1137" y="517" /> + <di:waypoint x="1137" y="592" /> + <di:waypoint x="222" y="592" /> + <di:waypoint x="222" y="657" /> + <di:waypoint x="401" y="657" /> <bpmndi:BPMNLabel> - <dc:Bounds x="506" y="493" width="18" height="12" /> + <dc:Bounds x="697" y="603" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1iufuuu_di" bpmnElement="SequenceFlow_1iufuuu"> - <di:waypoint xsi:type="dc:Point" x="287" y="1177" /> - <di:waypoint xsi:type="dc:Point" x="328" y="1177" /> + <di:waypoint x="477" y="1287" /> + <di:waypoint x="518" y="1287" /> <bpmndi:BPMNLabel> <dc:Bounds x="308" y="1162" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1l4n37b_di" bpmnElement="SequenceFlow_1l4n37b"> - <di:waypoint xsi:type="dc:Point" x="428" y="1177" /> - <di:waypoint xsi:type="dc:Point" x="469" y="1176" /> + <di:waypoint x="618" y="1287" /> + <di:waypoint x="659" y="1286" /> <bpmndi:BPMNLabel> <dc:Bounds x="449" y="1161.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0qvylv2_di" bpmnElement="PrepareSDNCUnassignRequest"> - <dc:Bounds x="187" y="1138" width="100" height="80" /> + <dc:Bounds x="377" y="1248" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_1stidyk_di" bpmnElement="CallSDNCAdapterUnassign"> - <dc:Bounds x="328" y="1137" width="100" height="80" /> + <dc:Bounds x="518" y="1247" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1ub9z2k_di" bpmnElement="PostProcessSDNCUnassignRequest"> - <dc:Bounds x="469" y="1136" width="100" height="80" /> + <dc:Bounds x="659" y="1246" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_1h87hhh_di" bpmnElement="ExclusiveGateway_1h87hhh" isMarkerVisible="true"> - <dc:Bounds x="55.989141164856846" y="1077.9259624876604" width="50" height="50" /> + <dc:Bounds x="246" y="1188" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="41" y="1127.9259624876604" width="79" height="24" /> + <dc:Bounds x="231" y="1238" width="80" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1rpg6ac_di" bpmnElement="SequenceFlow_1rpg6ac"> - <di:waypoint xsi:type="dc:Point" x="81" y="1078" /> - <di:waypoint xsi:type="dc:Point" x="81" y="1035" /> - <di:waypoint xsi:type="dc:Point" x="187" y="1035" /> + <di:waypoint x="271" y="1188" /> + <di:waypoint x="271" y="1145" /> + <di:waypoint x="377" y="1145" /> <bpmndi:BPMNLabel> - <dc:Bounds x="100" y="1010.5" width="12" height="12" /> + <dc:Bounds x="290" y="1121" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_16ghmax_di" bpmnElement="SequenceFlow_16ghmax"> - <di:waypoint xsi:type="dc:Point" x="81" y="1128" /> - <di:waypoint xsi:type="dc:Point" x="81" y="1178" /> - <di:waypoint xsi:type="dc:Point" x="187" y="1178" /> + <di:waypoint x="271" y="1238" /> + <di:waypoint x="271" y="1288" /> + <di:waypoint x="377" y="1288" /> <bpmndi:BPMNLabel> - <dc:Bounds x="92" y="1182" width="18" height="12" /> + <dc:Bounds x="283" y="1292" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_12otwa4_di" bpmnElement="SequenceFlow_12otwa4"> - <di:waypoint xsi:type="dc:Point" x="569" y="1176" /> - <di:waypoint xsi:type="dc:Point" x="579" y="1176" /> - <di:waypoint xsi:type="dc:Point" x="579" y="1123" /> - <di:waypoint xsi:type="dc:Point" x="589" y="1123" /> + <di:waypoint x="759" y="1286" /> + <di:waypoint x="769" y="1286" /> + <di:waypoint x="769" y="1233" /> + <di:waypoint x="779" y="1233" /> <bpmndi:BPMNLabel> <dc:Bounds x="594" y="1139.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1h8ve60_di" bpmnElement="SequenceFlow_1h8ve60"> - <di:waypoint xsi:type="dc:Point" x="1128" y="1123" /> - <di:waypoint xsi:type="dc:Point" x="1159" y="1123" /> + <di:waypoint x="1318" y="1233" /> + <di:waypoint x="1349" y="1233" /> <bpmndi:BPMNLabel> <dc:Bounds x="1144" y="1108" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0lrbhgj_di" bpmnElement="SetSuccessfulRollbackStatus"> - <dc:Bounds x="1028" y="1083" width="100" height="80" /> + <dc:Bounds x="1218" y="1193" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_02fx6z6_di" bpmnElement="SequenceFlow_02fx6z6"> - <di:waypoint xsi:type="dc:Point" x="298" y="1533" /> - <di:waypoint xsi:type="dc:Point" x="391" y="1533" /> + <di:waypoint x="488" y="1643" /> + <di:waypoint x="581" y="1643" /> <bpmndi:BPMNLabel> <dc:Bounds x="345" y="1518" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0cd144f_di" bpmnElement="SetFailedRollbackStatus"> - <dc:Bounds x="198" y="1493" width="100" height="80" /> + <dc:Bounds x="388" y="1603" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_0ahc44p_di" bpmnElement="ExclusiveGateway_0ahc44p" isMarkerVisible="true"> - <dc:Bounds x="465.5588822355289" y="837" width="50" height="50" /> + <dc:Bounds x="656" y="947" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="500" y="805" width="82" height="24" /> + <dc:Bounds x="689" y="915" width="84" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1gcfdej_di" bpmnElement="SequenceFlow_1gcfdej"> - <di:waypoint xsi:type="dc:Point" x="516" y="862" /> - <di:waypoint xsi:type="dc:Point" x="594" y="862" /> + <di:waypoint x="706" y="972" /> + <di:waypoint x="784" y="972" /> <bpmndi:BPMNLabel> - <dc:Bounds x="551" y="837.0195010054398" width="12" height="12" /> + <dc:Bounds x="741" y="947" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_17ne2iz_di" bpmnElement="SequenceFlow_17ne2iz"> - <di:waypoint xsi:type="dc:Point" x="491" y="887" /> - <di:waypoint xsi:type="dc:Point" x="491" y="931" /> - <di:waypoint xsi:type="dc:Point" x="-38" y="931" /> - <di:waypoint xsi:type="dc:Point" x="-38" y="1347" /> - <di:waypoint xsi:type="dc:Point" x="104" y="1347" /> + <di:waypoint x="681" y="997" /> + <di:waypoint x="681" y="1041" /> + <di:waypoint x="152" y="1041" /> + <di:waypoint x="152" y="1457" /> + <di:waypoint x="294" y="1457" /> <bpmndi:BPMNLabel> - <dc:Bounds x="459" y="884.8446601941747" width="18" height="12" /> + <dc:Bounds x="650" y="995" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_17it51d_di" bpmnElement="SequenceFlow_17it51d"> - <di:waypoint xsi:type="dc:Point" x="362" y="1347" /> - <di:waypoint xsi:type="dc:Point" x="1078" y="1347" /> - <di:waypoint xsi:type="dc:Point" x="1078" y="1163" /> + <di:waypoint x="552" y="1457" /> + <di:waypoint x="1268" y="1457" /> + <di:waypoint x="1268" y="1273" /> <bpmndi:BPMNLabel> <dc:Bounds x="720" y="1332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0fvuowt_di" bpmnElement="SequenceFlow_0fvuowt"> - <di:waypoint xsi:type="dc:Point" x="204" y="1347" /> - <di:waypoint xsi:type="dc:Point" x="262" y="1347" /> + <di:waypoint x="394" y="1457" /> + <di:waypoint x="452" y="1457" /> <bpmndi:BPMNLabel> <dc:Bounds x="233" y="1332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_0i5a02m_di" bpmnElement="Task_0k9gnp2"> - <dc:Bounds x="262" y="1307" width="100" height="80" /> + <dc:Bounds x="452" y="1417" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_008e45v_di" bpmnElement="Task_1sqxedz"> - <dc:Bounds x="104" y="1308" width="100" height="80" /> + <dc:Bounds x="294" y="1418" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_08aruzz_di" bpmnElement="SequenceFlow_08aruzz"> - <di:waypoint xsi:type="dc:Point" x="362" y="803" /> - <di:waypoint xsi:type="dc:Point" x="491" y="803" /> - <di:waypoint xsi:type="dc:Point" x="491" y="837" /> + <di:waypoint x="552" y="913" /> + <di:waypoint x="681" y="913" /> + <di:waypoint x="681" y="947" /> <bpmndi:BPMNLabel> <dc:Bounds x="427" y="778" width="0" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleVolumeRollback.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleVolumeRollback.bpmn index 6f3dceda84..b5cb1bf255 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleVolumeRollback.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleVolumeRollback.bpmn @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0"> <bpmn:process id="DoCreateVfModuleVolumeRollback" name="DoCreateVfModuleVolumeRollback" isExecutable="true"> <bpmn:subProcess id="SubProcess_1p4663w" name="Sub-process for UnexpectedErrors" triggeredByEvent="true"> <bpmn:scriptTask id="ScriptTask_0by1uwk" name="Log / Print Unexpected Error" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_0xktw7v</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0soe5t3</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeRollback = new DoCreateVfModuleVolumeRollback() -doCreateVfModuleVolumeRollback.processJavaException(execution)]]></bpmn:script> +doCreateVfModuleVolumeRollback.processJavaException(execution)</bpmn:script> </bpmn:scriptTask> <bpmn:startEvent id="StartEvent_1j0eixl"> <bpmn:outgoing>SequenceFlow_0xktw7v</bpmn:outgoing> @@ -33,9 +33,9 @@ doCreateVfModuleVolumeRollback.processJavaException(execution)]]></bpmn:script> <bpmn:outgoing>SequenceFlow_0h7k68j</bpmn:outgoing> <bpmn:outgoing>SequenceFlow_10dawse</bpmn:outgoing> </bpmn:exclusiveGateway> - <bpmn:callActivity id="CallActivity_03pmk7v" name="Call VNF Adapter Rollback" calledElement="vnfAdapterTask"> + <bpmn:callActivity id="CallActivity_03pmk7v" name="Call VNF Adapter Rollback" calledElement="openstackAdapterTask"> <bpmn:extensionElements> - <camunda:in source="DCVFMODVOLRBK_rollbackVnfARequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="DCVFMODVOLRBK_rollbackVnfARequest" target="openstackAdapterTaskRequest" /> <camunda:out source="workflowException" target="workflowException" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> @@ -44,15 +44,15 @@ doCreateVfModuleVolumeRollback.processJavaException(execution)]]></bpmn:script> <bpmn:outgoing>SequenceFlow_0bv04qn</bpmn:outgoing> </bpmn:callActivity> <bpmn:sequenceFlow id="SequenceFlow_0h7k68j" sourceRef="ExclusiveGateway_03qps8q" targetRef="CallActivity_03pmk7v"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMODVOLRBK_isCreateVnfRollbackNeeded") == "true"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("DCVFMODVOLRBK_isCreateVnfRollbackNeeded") == "true"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:scriptTask id="ScriptTask_1numqm0" name="Delete Volume Group" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_0bv04qn</bpmn:incoming> <bpmn:incoming>SequenceFlow_17k6oyz</bpmn:incoming> <bpmn:outgoing>SequenceFlow_13nb3n0</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeRollback = new DoCreateVfModuleVolumeRollback() -doCreateVfModuleVolumeRollback.executeMethod('callRESTDeleteAAIVolumeGroup', execution, isDebugLogEnabled)]]></bpmn:script> +doCreateVfModuleVolumeRollback.executeMethod('callRESTDeleteAAIVolumeGroup', execution, isDebugLogEnabled)</bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_0bv04qn" sourceRef="CallActivity_03pmk7v" targetRef="ScriptTask_1numqm0" /> <bpmn:sequenceFlow id="SequenceFlow_10dawse" sourceRef="ExclusiveGateway_03qps8q" targetRef="ExclusiveGateway_1dzejtx" /> @@ -63,7 +63,7 @@ doCreateVfModuleVolumeRollback.executeMethod('callRESTDeleteAAIVolumeGroup', exe <bpmn:outgoing>SequenceFlow_1do0853</bpmn:outgoing> </bpmn:exclusiveGateway> <bpmn:sequenceFlow id="SequenceFlow_17k6oyz" sourceRef="ExclusiveGateway_1dzejtx" targetRef="ScriptTask_1numqm0"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMODVOLRBK_isAAIRollbackNeeded" ) == "true"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("DCVFMODVOLRBK_isAAIRollbackNeeded" ) == "true"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="SequenceFlow_1do0853" sourceRef="ExclusiveGateway_1dzejtx" targetRef="EndEvent_1ddbl39" /> <bpmn:endEvent id="EndEvent_1ddbl39"> @@ -74,14 +74,14 @@ doCreateVfModuleVolumeRollback.executeMethod('callRESTDeleteAAIVolumeGroup', exe <bpmn:incoming>SequenceFlow_13nb3n0</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_11y7faf" sourceRef="ExclusiveGateway_128ycfs" targetRef="ExclusiveGateway_03qps8q"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("DCVFMODVOLRBK_backoutOnFailure") != "false"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("DCVFMODVOLRBK_backoutOnFailure") != "false"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:scriptTask id="ScriptTask_0uhy9lc" name="Pre process" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_0qreiaa</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1xah9es</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeRollback = new DoCreateVfModuleVolumeRollback() -doCreateVfModuleVolumeRollback.preProcessRequest(execution)]]></bpmn:script> +doCreateVfModuleVolumeRollback.preProcessRequest(execution)</bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_1wberw3" sourceRef="ExclusiveGateway_128ycfs" targetRef="EndEvent_1ddbl39" /> <bpmn:sequenceFlow id="SequenceFlow_0qreiaa" sourceRef="StartEvent_0128tti" targetRef="ScriptTask_0uhy9lc" /> @@ -90,153 +90,153 @@ doCreateVfModuleVolumeRollback.preProcessRequest(execution)]]></bpmn:script> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateVfModuleVolumeRollback"> <bpmndi:BPMNShape id="SubProcess_1p4663w_di" bpmnElement="SubProcess_1p4663w" isExpanded="true"> - <dc:Bounds x="293" y="165" width="394" height="188" /> + <dc:Bounds x="293" y="365" width="394" height="188" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0by1uwk_di" bpmnElement="ScriptTask_0by1uwk"> - <dc:Bounds x="441" y="220" width="100" height="80" /> + <dc:Bounds x="441" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_1j0eixl_di" bpmnElement="StartEvent_1j0eixl"> - <dc:Bounds x="326" y="242" width="36" height="36" /> + <dc:Bounds x="326" y="442" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="344" y="283" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0jxh015_di" bpmnElement="EndEvent_0jxh015"> - <dc:Bounds x="602" y="242" width="36" height="36" /> + <dc:Bounds x="602" y="442" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="620" y="283" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0xktw7v_di" bpmnElement="SequenceFlow_0xktw7v"> - <di:waypoint xsi:type="dc:Point" x="362" y="260" /> - <di:waypoint xsi:type="dc:Point" x="441" y="260" /> + <di:waypoint x="362" y="460" /> + <di:waypoint x="441" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="404" y="260" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0soe5t3_di" bpmnElement="SequenceFlow_0soe5t3"> - <di:waypoint xsi:type="dc:Point" x="541" y="260" /> - <di:waypoint xsi:type="dc:Point" x="602" y="260" /> + <di:waypoint x="541" y="460" /> + <di:waypoint x="602" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="576" y="260" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="StartEvent_0128tti_di" bpmnElement="StartEvent_0128tti"> - <dc:Bounds x="173" y="-93" width="36" height="36" /> + <dc:Bounds x="173" y="107" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="167" y="-52" width="50" height="12" /> + <dc:Bounds x="166" y="148" width="52" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_128ycfs_di" bpmnElement="ExclusiveGateway_128ycfs" isMarkerVisible="true"> - <dc:Bounds x="465" y="-100" width="50" height="50" /> + <dc:Bounds x="465" y="100" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="450" y="-50" width="79" height="12" /> + <dc:Bounds x="450" y="150" width="79" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_03qps8q_di" bpmnElement="ExclusiveGateway_03qps8q" isMarkerVisible="true"> - <dc:Bounds x="607" y="-100" width="50" height="50" /> + <dc:Bounds x="607" y="100" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="606" y="-50" width="52" height="12" /> + <dc:Bounds x="606" y="150" width="52" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_03pmk7v_di" bpmnElement="CallActivity_03pmk7v"> - <dc:Bounds x="786" y="-115" width="100" height="80" /> + <dc:Bounds x="786" y="85" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0h7k68j_di" bpmnElement="SequenceFlow_0h7k68j"> - <di:waypoint xsi:type="dc:Point" x="657" y="-75" /> - <di:waypoint xsi:type="dc:Point" x="786" y="-75" /> + <di:waypoint x="657" y="125" /> + <di:waypoint x="786" y="125" /> <bpmndi:BPMNLabel> <dc:Bounds x="722" y="-90" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1numqm0_di" bpmnElement="ScriptTask_1numqm0"> - <dc:Bounds x="998" y="-115" width="100" height="80" /> + <dc:Bounds x="998" y="85" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0bv04qn_di" bpmnElement="SequenceFlow_0bv04qn"> - <di:waypoint xsi:type="dc:Point" x="886" y="-75" /> - <di:waypoint xsi:type="dc:Point" x="937" y="-75" /> - <di:waypoint xsi:type="dc:Point" x="937" y="-75" /> - <di:waypoint xsi:type="dc:Point" x="998" y="-75" /> + <di:waypoint x="886" y="125" /> + <di:waypoint x="937" y="125" /> + <di:waypoint x="937" y="125" /> + <di:waypoint x="998" y="125" /> <bpmndi:BPMNLabel> <dc:Bounds x="952" y="-75" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_10dawse_di" bpmnElement="SequenceFlow_10dawse"> - <di:waypoint xsi:type="dc:Point" x="632" y="-50" /> - <di:waypoint xsi:type="dc:Point" x="632" y="40" /> - <di:waypoint xsi:type="dc:Point" x="811" y="40" /> + <di:waypoint x="632" y="150" /> + <di:waypoint x="632" y="240" /> + <di:waypoint x="811" y="240" /> <bpmndi:BPMNLabel> <dc:Bounds x="648" y="-5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_13nb3n0_di" bpmnElement="SequenceFlow_13nb3n0"> - <di:waypoint xsi:type="dc:Point" x="1098" y="-75" /> - <di:waypoint xsi:type="dc:Point" x="1151" y="-75" /> + <di:waypoint x="1098" y="125" /> + <di:waypoint x="1151" y="125" /> <bpmndi:BPMNLabel> <dc:Bounds x="1125" y="-90" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1dzejtx_di" bpmnElement="ExclusiveGateway_1dzejtx" isMarkerVisible="true"> - <dc:Bounds x="811" y="15" width="50" height="50" /> + <dc:Bounds x="811" y="215" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="809" y="65" width="53" height="12" /> + <dc:Bounds x="809" y="265" width="53" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_17k6oyz_di" bpmnElement="SequenceFlow_17k6oyz"> - <di:waypoint xsi:type="dc:Point" x="861" y="40" /> - <di:waypoint xsi:type="dc:Point" x="1048" y="40" /> - <di:waypoint xsi:type="dc:Point" x="1048" y="-35" /> + <di:waypoint x="861" y="240" /> + <di:waypoint x="1048" y="240" /> + <di:waypoint x="1048" y="165" /> <bpmndi:BPMNLabel> <dc:Bounds x="955" y="25" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1do0853_di" bpmnElement="SequenceFlow_1do0853"> - <di:waypoint xsi:type="dc:Point" x="836" y="65" /> - <di:waypoint xsi:type="dc:Point" x="836" y="99" /> + <di:waypoint x="836" y="265" /> + <di:waypoint x="836" y="299" /> <bpmndi:BPMNLabel> <dc:Bounds x="851" y="82" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0le8wga_di" bpmnElement="EndEvent_1ddbl39"> - <dc:Bounds x="818" y="99" width="36" height="36" /> + <dc:Bounds x="818" y="299" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="836" y="135" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1iibjyo_di" bpmnElement="EndEvent_11duf9p"> - <dc:Bounds x="1151" y="-93" width="36" height="36" /> + <dc:Bounds x="1151" y="107" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1169" y="-57" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_11y7faf_di" bpmnElement="SequenceFlow_11y7faf"> - <di:waypoint xsi:type="dc:Point" x="515" y="-75" /> - <di:waypoint xsi:type="dc:Point" x="607" y="-75" /> + <di:waypoint x="515" y="125" /> + <di:waypoint x="607" y="125" /> <bpmndi:BPMNLabel> <dc:Bounds x="561" y="-90" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0uhy9lc_di" bpmnElement="ScriptTask_0uhy9lc"> - <dc:Bounds x="288" y="-115" width="100" height="80" /> + <dc:Bounds x="288" y="85" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1wberw3_di" bpmnElement="SequenceFlow_1wberw3"> - <di:waypoint xsi:type="dc:Point" x="490" y="-50" /> - <di:waypoint xsi:type="dc:Point" x="490" y="117" /> - <di:waypoint xsi:type="dc:Point" x="818" y="117" /> + <di:waypoint x="490" y="150" /> + <di:waypoint x="490" y="317" /> + <di:waypoint x="818" y="317" /> <bpmndi:BPMNLabel> <dc:Bounds x="505" y="23.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0qreiaa_di" bpmnElement="SequenceFlow_0qreiaa"> - <di:waypoint xsi:type="dc:Point" x="209" y="-75" /> - <di:waypoint xsi:type="dc:Point" x="288" y="-75" /> + <di:waypoint x="209" y="125" /> + <di:waypoint x="288" y="125" /> <bpmndi:BPMNLabel> <dc:Bounds x="249" y="-100" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1xah9es_di" bpmnElement="SequenceFlow_1xah9es"> - <di:waypoint xsi:type="dc:Point" x="388" y="-75" /> - <di:waypoint xsi:type="dc:Point" x="465" y="-75" /> + <di:waypoint x="388" y="125" /> + <di:waypoint x="465" y="125" /> <bpmndi:BPMNLabel> <dc:Bounds x="427" y="-100" width="0" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleVolumeV2.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleVolumeV2.bpmn index 58ea0c4951..5dc9878561 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleVolumeV2.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVfModuleVolumeV2.bpmn @@ -1,27 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_FhrCQG2BEeaNdqnn65BT4A" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_FhrCQG2BEeaNdqnn65BT4A" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoCreateVfModuleVolumeV2" name="DoCreateVfModuleVolumeV2" isExecutable="true"> <bpmn2:scriptTask id="ScriptTask_preProcessRequest" name="Preprocess Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1wi1cf9</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('preProcessRequest', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('preProcessRequest', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="ScriptTask_callRestAaiCloudRegion" name="Call REST AAI Cloud Region" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1dpt7ul</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_23</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAICloudRegion', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAICloudRegion', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_23" name="" sourceRef="ScriptTask_callRestAaiCloudRegion" targetRef="ScriptTask_callRestAaiQueryGenericVnf" /> <bpmn2:scriptTask id="ScriptTask_createVolGrpExistsException" name="Build Workflow Exception" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_volGrpName404No</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('buildWorkflowException', execution, 2500, "Volume group name already exists in the system.", isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('buildWorkflowException', execution, 2500, "Volume group name already exists in the system.", isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_7" name="" sourceRef="ScriptTask_createVolGrpExistsException" targetRef="EndEvent_6" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_aaiReturnCode404" name="AAI Return Code is 404?" default="SequenceFlow_volGrpName404No"> @@ -31,15 +31,15 @@ doCreateVfModuleVolumeV2.executeMethod('buildWorkflowException', execution, 2500 <bpmn2:outgoing>SequenceFlow_volGrpName404No</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_volGrpName404Yes" name="Yes" sourceRef="ExclusiveGateway_aaiReturnCode404" targetRef="ScriptTask_callRestAaiCreateVolumeGrp"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{DCVFMODVOLV2_AaiReturnCode == '404'}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{DCVFMODVOLV2_AaiReturnCode == '404'}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_volGrpName404No" name="No" sourceRef="ExclusiveGateway_aaiReturnCode404" targetRef="ScriptTask_createVolGrpExistsException" /> <bpmn2:scriptTask id="ScriptTask_callRestAaiQueryGenericVnf" name="Call REST AAI Query Generic VNF" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIGenericVnf', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIGenericVnf', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_14" name="" sourceRef="ScriptTask_callRestAaiQueryGenericVnf" targetRef="ScriptTask_callRestAaiQueryVolGrpName" /> <bpmn2:boundaryEvent id="BoundaryEvent_catchAaiError" name="" attachedToRef="ScriptTask_callRestAaiQueryVolGrpName"> @@ -50,22 +50,22 @@ doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIGenericVnf', execution, <bpmn2:scriptTask id="ScriptTask_callRestAaiQueryVolGrpName" name="Call REST AAI Query Volume Grp Name" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_14</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIVolGrpName', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIVolGrpName', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="ScriptTask_callRestAaiQueryVolGrpName" targetRef="ExclusiveGateway_aaiReturnCode404" /> <bpmn2:scriptTask id="ScriptTask_callRestAaiCreateVolumeGrp" name="Call REST AAI Create Volume Group" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_volGrpName404Yes</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('callRESTCreateAAIVolGrpName', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('callRESTCreateAAIVolGrpName', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_9" name="" sourceRef="ScriptTask_callRestAaiCreateVolumeGrp" targetRef="ScriptTask_prepareVnfAdapterCreate" /> - <bpmn2:callActivity id="CallActivity_callVnfAdapterCreate" name="Call VNF Adapter Create" calledElement="vnfAdapterTask"> + <bpmn2:callActivity id="CallActivity_callVnfAdapterCreate" name="Call VNF Adapter Create" calledElement="openstackAdapterTask"> <bpmn2:extensionElements> - <camunda:in source="DCVFMODVOLV2_createVnfARequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="DCVFMODVOLV2_createVnfARequest" target="openstackAdapterTaskRequest" /> <camunda:in source="msoRequestId" target="mso-request-id" /> <camunda:in source="serviceInstanceId" target="mso-service-instance-id" /> <camunda:out source="WorkflowResponse" target="DCVFMODVOLV2_createVnfAResponse" /> @@ -79,25 +79,25 @@ doCreateVfModuleVolumeV2.executeMethod('callRESTCreateAAIVolGrpName', execution, <bpmn2:scriptTask id="ScriptTask_callRestAaiRequeryVolGrpNm" name="Call REST AAI Requery Volume Group Name" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1gbt2n5</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_28</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIVolGrpName', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('callRESTQueryAAIVolGrpName', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_28" name="" sourceRef="ScriptTask_callRestAaiRequeryVolGrpNm" targetRef="ScriptTask_callRestAaiVolumeGrp" /> <bpmn2:scriptTask id="ScriptTask_prepareDbInfraRequest" name="Set Success Indicator" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('setSuccessIndicator', execution, true)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('setSuccessIndicator', execution, true)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_8" name="" sourceRef="ScriptTask_prepareDbInfraRequest" targetRef="EndEvent_1" /> <bpmn2:scriptTask id="ScriptTask_callRestAaiVolumeGrp" name="Call REST AAI Update Volume Group" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_28</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('callRESTUpdateCreatedVolGrpName', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('callRESTUpdateCreatedVolGrpName', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="ScriptTask_callRestAaiVolumeGrp" targetRef="ScriptTask_prepareDbInfraRequest" /> <bpmn2:endEvent id="EndEvent_1" name="End"> @@ -106,9 +106,9 @@ doCreateVfModuleVolumeV2.executeMethod('callRESTUpdateCreatedVolGrpName', execut <bpmn2:scriptTask id="ScriptTask_prepareVnfAdapterCreate" name="Prepare VNF Adapter Create Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('prepareVnfAdapterCreateRequest', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('prepareVnfAdapterCreateRequest', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_10" name="" sourceRef="ScriptTask_prepareVnfAdapterCreate" targetRef="CallActivity_callVnfAdapterCreate" /> <bpmn2:startEvent id="StartEvent_doCreateVfModuleVolume" name="Start"> @@ -121,18 +121,18 @@ doCreateVfModuleVolumeV2.executeMethod('prepareVnfAdapterCreateRequest', executi <bpmn2:scriptTask id="Task_07psich" name="Validate VNF Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1qwurc5</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1gbt2n5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('validateVnfResponse', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('validateVnfResponse', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1qwurc5" sourceRef="CallActivity_callVnfAdapterCreate" targetRef="Task_07psich" /> <bpmn2:sequenceFlow id="SequenceFlow_1gbt2n5" sourceRef="Task_07psich" targetRef="ScriptTask_callRestAaiRequeryVolGrpNm" /> <bpmn2:scriptTask id="Task_0qbm5cz" name=" AAI Query (svc instance) " scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1wi1cf9</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1dpt7ul</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doCreateVfModuleVolumeV2 = new DoCreateVfModuleVolumeV2() -doCreateVfModuleVolumeV2.executeMethod('getServiceInstance', execution, isDebugLogEnabled)]]></bpmn2:script> +doCreateVfModuleVolumeV2.executeMethod('getServiceInstance', execution, isDebugLogEnabled)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1wi1cf9" sourceRef="ScriptTask_preProcessRequest" targetRef="Task_0qbm5cz" /> <bpmn2:sequenceFlow id="SequenceFlow_1dpt7ul" sourceRef="Task_0qbm5cz" targetRef="ScriptTask_callRestAaiCloudRegion" /> @@ -142,194 +142,194 @@ doCreateVfModuleVolumeV2.executeMethod('getServiceInstance', execution, isDebugL <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateVfModuleVolumeV2"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_65" bpmnElement="StartEvent_doCreateVfModuleVolume"> - <dc:Bounds x="270" y="128" width="36" height="36" /> + <dc:Bounds x="170" y="128" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="276" y="169" width="23" height="12" /> + <dc:Bounds x="175" y="169" width="25" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_285" bpmnElement="ScriptTask_preProcessRequest"> - <dc:Bounds x="369" y="106" width="100" height="80" /> + <dc:Bounds x="269" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_287" bpmnElement="ScriptTask_callRestAaiCloudRegion"> - <dc:Bounds x="768" y="106" width="100" height="80" /> + <dc:Bounds x="668" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_288" bpmnElement="ScriptTask_callRestAaiQueryVolGrpName"> - <dc:Bounds x="1045" y="106" width="100" height="80" /> + <dc:Bounds x="945" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_247" bpmnElement="ExclusiveGateway_aaiReturnCode404" isMarkerVisible="true"> - <dc:Bounds x="1242" y="121" width="50" height="50" /> + <dc:Bounds x="1142" y="121" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1224" y="176" width="85" height="24" /> + <dc:Bounds x="1125" y="176" width="83" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_289" bpmnElement="ScriptTask_callRestAaiCreateVolumeGrp"> - <dc:Bounds x="256" y="307" width="100" height="80" /> + <dc:Bounds x="156" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_290" bpmnElement="ScriptTask_prepareVnfAdapterCreate"> - <dc:Bounds x="420" y="307" width="100" height="80" /> + <dc:Bounds x="320" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_32" bpmnElement="CallActivity_callVnfAdapterCreate"> - <dc:Bounds x="576" y="307" width="100" height="80" /> + <dc:Bounds x="476" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_292" bpmnElement="ScriptTask_callRestAaiRequeryVolGrpNm"> - <dc:Bounds x="857" y="307" width="100" height="80" /> + <dc:Bounds x="757" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_293" bpmnElement="ScriptTask_callRestAaiVolumeGrp"> - <dc:Bounds x="995" y="307" width="100" height="80" /> + <dc:Bounds x="895" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_294" bpmnElement="ScriptTask_prepareDbInfraRequest"> - <dc:Bounds x="1142" y="307" width="100" height="80" /> + <dc:Bounds x="1042" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_226" bpmnElement="EndEvent_1"> - <dc:Bounds x="1283" y="328" width="36" height="36" /> + <dc:Bounds x="1183" y="328" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1292" y="369" width="19" height="12" /> + <dc:Bounds x="1192" y="369" width="20" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_65" targetElement="_BPMNShape_ScriptTask_285"> - <di:waypoint xsi:type="dc:Point" x="306" y="146" /> - <di:waypoint xsi:type="dc:Point" x="369" y="146" /> + <di:waypoint x="206" y="146" /> + <di:waypoint x="269" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="338" y="131" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_volGrpName404Yes" sourceElement="_BPMNShape_ExclusiveGateway_247" targetElement="_BPMNShape_ScriptTask_289"> - <di:waypoint xsi:type="dc:Point" x="1267" y="171" /> - <di:waypoint xsi:type="dc:Point" x="1267" y="232" /> - <di:waypoint xsi:type="dc:Point" x="811" y="232" /> - <di:waypoint xsi:type="dc:Point" x="306" y="232" /> - <di:waypoint xsi:type="dc:Point" x="306" y="307" /> + <di:waypoint x="1167" y="171" /> + <di:waypoint x="1167" y="232" /> + <di:waypoint x="711" y="232" /> + <di:waypoint x="206" y="232" /> + <di:waypoint x="206" y="307" /> <bpmndi:BPMNLabel> - <dc:Bounds x="582" y="232" width="18" height="12" /> + <dc:Bounds x="482" y="232" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_ScriptTask_289" targetElement="_BPMNShape_ScriptTask_290"> - <di:waypoint xsi:type="dc:Point" x="356" y="347" /> - <di:waypoint xsi:type="dc:Point" x="420" y="347" /> + <di:waypoint x="256" y="347" /> + <di:waypoint x="320" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="388" y="332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_ScriptTask_290" targetElement="_BPMNShape_CallActivity_32"> - <di:waypoint xsi:type="dc:Point" x="520" y="347" /> - <di:waypoint xsi:type="dc:Point" x="576" y="347" /> + <di:waypoint x="420" y="347" /> + <di:waypoint x="476" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="548" y="455" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_ScriptTask_287" targetElement="_BPMNShape_ScriptTask_311"> - <di:waypoint xsi:type="dc:Point" x="868" y="146" /> - <di:waypoint xsi:type="dc:Point" x="911" y="147" /> + <di:waypoint x="768" y="146" /> + <di:waypoint x="811" y="147" /> <bpmndi:BPMNLabel> <dc:Bounds x="890" y="132" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_296" bpmnElement="ScriptTask_createVolGrpExistsException"> - <dc:Bounds x="1355" y="106" width="100" height="80" /> + <dc:Bounds x="1255" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="_BPMNShape_ScriptTask_296" targetElement="_BPMNShape_EndEvent_241"> - <di:waypoint xsi:type="dc:Point" x="1455" y="146" /> - <di:waypoint xsi:type="dc:Point" x="1493" y="146" /> + <di:waypoint x="1355" y="146" /> + <di:waypoint x="1393" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="1474" y="131" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_BoundaryEvent_62" targetElement="_BPMNShape_ExclusiveGateway_247"> - <di:waypoint xsi:type="dc:Point" x="1145" y="88" /> - <di:waypoint xsi:type="dc:Point" x="1145" y="59" /> - <di:waypoint xsi:type="dc:Point" x="1267" y="59" /> - <di:waypoint xsi:type="dc:Point" x="1267" y="121" /> + <di:waypoint x="1045" y="88" /> + <di:waypoint x="1045" y="59" /> + <di:waypoint x="1167" y="59" /> + <di:waypoint x="1167" y="121" /> <bpmndi:BPMNLabel> <dc:Bounds x="1206" y="44" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_21" bpmnElement="SequenceFlow_volGrpName404No" sourceElement="_BPMNShape_ExclusiveGateway_247" targetElement="_BPMNShape_ScriptTask_296"> - <di:waypoint xsi:type="dc:Point" x="1292" y="146" /> - <di:waypoint xsi:type="dc:Point" x="1355" y="146" /> + <di:waypoint x="1192" y="146" /> + <di:waypoint x="1255" y="146" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1320" y="146" width="14" height="12" /> + <dc:Bounds x="1220" y="146" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_28" sourceElement="_BPMNShape_ScriptTask_292" targetElement="_BPMNShape_ScriptTask_293"> - <di:waypoint xsi:type="dc:Point" x="957" y="347" /> - <di:waypoint xsi:type="dc:Point" x="995" y="347" /> + <di:waypoint x="857" y="347" /> + <di:waypoint x="895" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="976" y="332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_293" targetElement="_BPMNShape_ScriptTask_294"> - <di:waypoint xsi:type="dc:Point" x="1095" y="347" /> - <di:waypoint xsi:type="dc:Point" x="1142" y="347" /> + <di:waypoint x="995" y="347" /> + <di:waypoint x="1042" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="1119" y="332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_ScriptTask_294" targetElement="_BPMNShape_EndEvent_226"> - <di:waypoint xsi:type="dc:Point" x="1242" y="347" /> - <di:waypoint xsi:type="dc:Point" x="1283" y="346" /> + <di:waypoint x="1142" y="347" /> + <di:waypoint x="1183" y="346" /> <bpmndi:BPMNLabel> <dc:Bounds x="1263" y="332" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_311" bpmnElement="ScriptTask_callRestAaiQueryGenericVnf"> - <dc:Bounds x="911" y="106" width="100" height="80" /> + <dc:Bounds x="811" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_311" targetElement="_BPMNShape_ScriptTask_288"> - <di:waypoint xsi:type="dc:Point" x="1011" y="146" /> - <di:waypoint xsi:type="dc:Point" x="1045" y="146" /> + <di:waypoint x="911" y="146" /> + <di:waypoint x="945" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="1028" y="131" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_62" bpmnElement="BoundaryEvent_catchAaiError"> - <dc:Bounds x="1127" y="88" width="36" height="36" /> + <dc:Bounds x="1027" y="88" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1145" y="129" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ScriptTask_288" targetElement="_BPMNShape_ExclusiveGateway_247"> - <di:waypoint xsi:type="dc:Point" x="1145" y="146" /> - <di:waypoint xsi:type="dc:Point" x="1242" y="146" /> + <di:waypoint x="1045" y="146" /> + <di:waypoint x="1142" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="1194" y="131" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_241" bpmnElement="EndEvent_6"> - <dc:Bounds x="1493" y="128" width="36" height="36" /> + <dc:Bounds x="1393" y="128" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1502" y="169" width="19" height="12" /> + <dc:Bounds x="1402" y="169" width="20" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_00lua86_di" bpmnElement="Task_07psich"> - <dc:Bounds x="716" y="307" width="100" height="80" /> + <dc:Bounds x="616" y="307" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1qwurc5_di" bpmnElement="SequenceFlow_1qwurc5"> - <di:waypoint xsi:type="dc:Point" x="676" y="347" /> - <di:waypoint xsi:type="dc:Point" x="716" y="347" /> + <di:waypoint x="576" y="347" /> + <di:waypoint x="616" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="696" y="322" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1gbt2n5_di" bpmnElement="SequenceFlow_1gbt2n5"> - <di:waypoint xsi:type="dc:Point" x="816" y="347" /> - <di:waypoint xsi:type="dc:Point" x="857" y="347" /> + <di:waypoint x="716" y="347" /> + <di:waypoint x="757" y="347" /> <bpmndi:BPMNLabel> <dc:Bounds x="837" y="322" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1n9cmka_di" bpmnElement="Task_0qbm5cz"> - <dc:Bounds x="576" y="106" width="100" height="80" /> + <dc:Bounds x="476" y="106" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1wi1cf9_di" bpmnElement="SequenceFlow_1wi1cf9"> - <di:waypoint xsi:type="dc:Point" x="469" y="146" /> - <di:waypoint xsi:type="dc:Point" x="576" y="146" /> + <di:waypoint x="369" y="146" /> + <di:waypoint x="476" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="477.5" y="131" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1dpt7ul_di" bpmnElement="SequenceFlow_1dpt7ul"> - <di:waypoint xsi:type="dc:Point" x="676" y="146" /> - <di:waypoint xsi:type="dc:Point" x="768" y="146" /> + <di:waypoint x="576" y="146" /> + <di:waypoint x="668" y="146" /> <bpmndi:BPMNLabel> <dc:Bounds x="677" y="131" width="90" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteNetworkInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteNetworkInstance.bpmn index d6069d714e..5edbf3cd55 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteNetworkInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteNetworkInstance.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoDeleteNetworkInstance" name="DoDeleteNetworkInstance" isExecutable="true"> <bpmn2:startEvent id="deleteNetwork_startEvent" name="Start Flow"> <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> @@ -8,9 +8,9 @@ <bpmn2:scriptTask id="callAAIQuery_scriptTask" name="Call REST Query In AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0msqfwu</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def callRESTDeleteAAI = new DoDeleteNetworkInstance() -callRESTDeleteAAI.callRESTQueryAAI(execution)]]></bpmn2:script> +callRESTDeleteAAI.callRESTQueryAAI(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="callAAIQuery_scriptTask" targetRef="isRelationshipExists_ExclusiveGateway" /> <bpmn2:callActivity id="callDeleteSDNCAdapter_CallActivity" name="Call SDNC Unassign Adapter V1 Sub-process" calledElement="sdncAdapter"> @@ -31,10 +31,9 @@ callRESTDeleteAAI.callRESTQueryAAI(execution)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_1jnva78</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def validateSDNCResponse = new DoDeleteNetworkInstance() -validateSDNCResponse.validateSDNCResponse(execution) -]]></bpmn2:script> +validateSDNCResponse.validateSDNCResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="validateSDNCResponse_ScriptTask" targetRef="isSdncTopoDeleteOk_ExclusiveGateway" /> <bpmn2:boundaryEvent id="BoundaryEvent_1" name="" attachedToRef="validateSDNCResponse_ScriptTask"> @@ -54,7 +53,7 @@ validateSDNCResponse.validateSDNCResponse(execution) </bpmn2:endEvent> <bpmn2:sequenceFlow id="sdncTopoDeleteNo_SequenceFlow" name="No" sourceRef="isSdncTopoDeleteOk_ExclusiveGateway" targetRef="sndcError_EndEvent" /> <bpmn2:sequenceFlow id="sdncTopoDeleteYes_SequenceFlow" name="Yes" sourceRef="isSdncTopoDeleteOk_ExclusiveGateway" targetRef="ScriptTask_01xjfhu"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKI_sdncResponseSuccess" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELNWKI_sdncResponseSuccess" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:subProcess id="subProcessException_SubProcess" name="Subprocess For Exception" triggeredByEvent="true"> <bpmn2:startEvent id="subProcessStart_StartEvent" name="Fault Start"> @@ -67,18 +66,17 @@ validateSDNCResponse.validateSDNCResponse(execution) <bpmn2:scriptTask id="ScriptTask_00lgy9f" name="PostProcess Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1nl99y6</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1yvnovn</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.postProcessResponse(execution) -]]></bpmn2:script> +DoDeleteNetworkInstance.postProcessResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1a51h25" sourceRef="subProcessStart_StartEvent" targetRef="Task_0026x4v" /> <bpmn2:sequenceFlow id="SequenceFlow_1yvnovn" sourceRef="ScriptTask_00lgy9f" targetRef="EndEvent_2" /> <bpmn2:scriptTask id="ScriptTask_0n4do0p" name="Prepare SDNC RPC Rollback Deactivate" scriptFormat="groovy"> <bpmn2:outgoing>SequenceFlow_1wif0e5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.prepareRpcSDNCDeactivateRollback(execution)]]></bpmn2:script> +DoDeleteNetworkInstance.prepareRpcSDNCDeactivateRollback(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="ExclusiveGateway_1gix2o6" name="Is Rollback On?"> <bpmn2:incoming>SequenceFlow_021b0sz</bpmn2:incoming> @@ -86,33 +84,16 @@ DoDeleteNetworkInstance.prepareRpcSDNCDeactivateRollback(execution)]]></bpmn2:sc <bpmn2:outgoing>SequenceFlow_1suj1nc</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0tiz0kk" name="Yes" sourceRef="ExclusiveGateway_1gix2o6" targetRef="ExclusiveGateway_1x7o5bo"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKI_rollbackEnabled") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELNWKI_rollbackEnabled") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_1suj1nc" name="No" sourceRef="ExclusiveGateway_1gix2o6" targetRef="ExclusiveGateway_01xin16" /> - <bpmn2:callActivity id="CallActivity_0lku52d" name="DoDelete NetworkInstanceRollback " calledElement="DoDeleteNetworkInstanceRollback"> - <bpmn2:extensionElements> - <camunda:in source="msoRequestId" target="msoRequestId" /> - <camunda:out source="rolledBack" target="rolledBack" /> - <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> - <camunda:in source="serviceInstanceId" target="serviceInstanceId" /> - <camunda:in source="rollbackData" target="rollbackData" /> - <camunda:in source="mso-request-id" target="mso-request-id" /> - <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> - <camunda:in source="WorkflowException" target="WorkflowException" /> - <camunda:in source="sdncVersion" target="sdncVersion" /> - <camunda:out source="workflowException" target="workflowException" /> - <camunda:in source="SavedWorkflowException1" target="SavedWorkflowException1" /> - <camunda:out source="wasDeleted" target="wasDeleted" /> - </bpmn2:extensionElements> - <bpmn2:incoming>SequenceFlow_147vc14</bpmn2:incoming> - </bpmn2:callActivity> <bpmn2:exclusiveGateway id="ExclusiveGateway_1x7o5bo" name="is SDNC Rollback Needed? " default="SequenceFlow_1raa09h"> <bpmn2:incoming>SequenceFlow_0tiz0kk</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0jb7rws</bpmn2:outgoing> <bpmn2:outgoing>SequenceFlow_1raa09h</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0jb7rws" name="Yes" sourceRef="ExclusiveGateway_1x7o5bo" targetRef="ExclusiveGateway_01xin16"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKI_isSdncDeactivateRollbackNeeded") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELNWKI_isSdncDeactivateRollbackNeeded") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:inclusiveGateway id="ExclusiveGateway_01xin16"> <bpmn2:incoming>SequenceFlow_1suj1nc</bpmn2:incoming> @@ -124,24 +105,19 @@ DoDeleteNetworkInstance.prepareRpcSDNCDeactivateRollback(execution)]]></bpmn2:sc <bpmn2:sequenceFlow id="SequenceFlow_1nl99y6" sourceRef="ExclusiveGateway_01xin16" targetRef="ScriptTask_00lgy9f" /> <bpmn2:scriptTask id="ScriptTask_0n4ya47" name="Prepare RollbackData" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1wif0e5</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_147vc14</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.prepareRollbackData(execution)]]></bpmn2:script> +DoDeleteNetworkInstance.prepareRollbackData(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1wif0e5" sourceRef="ScriptTask_0n4do0p" targetRef="ScriptTask_0n4ya47" /> - <bpmn2:sequenceFlow id="SequenceFlow_147vc14" sourceRef="ScriptTask_0n4ya47" targetRef="CallActivity_0lku52d" /> <bpmn2:sequenceFlow id="SequenceFlow_021b0sz" sourceRef="Task_0026x4v" targetRef="ExclusiveGateway_1gix2o6" /> <bpmn2:scriptTask id="Task_0026x4v" name="Set Exception Flag" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1a51h25</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_021b0sz</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.setExceptionFlag(execution)]]></bpmn2:script> +DoDeleteNetworkInstance.setExceptionFlag(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:textAnnotation id="TextAnnotation_0i06ryl"> <bpmn2:text>Rollback Not Needed for Delete.</bpmn2:text> -</bpmn2:textAnnotation> - <bpmn2:association id="Association_0gzsxad" sourceRef="CallActivity_0lku52d" targetRef="TextAnnotation_0i06ryl" /> </bpmn2:subProcess> <bpmn2:exclusiveGateway id="isAAIQueryOk_ExclusiveGateway_2" name="Is AAI Query Ok?" default="querySuccessNo_SequenceFlow"> <bpmn2:incoming>isRelationshipExistNo_SequenceFlow</bpmn2:incoming> @@ -149,7 +125,7 @@ DoDeleteNetworkInstance.setExceptionFlag(execution)]]></bpmn2:script> <bpmn2:outgoing>querySuccessNo_SequenceFlow</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="querySuccessYes_SequenceFlow" name="Yes" sourceRef="isAAIQueryOk_ExclusiveGateway_2" targetRef="isResponseEmpty_ExclusiveGateway_2"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKI_isAAIGood") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELNWKI_isAAIGood") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="querySuccessNo_SequenceFlow" name="No" sourceRef="isAAIQueryOk_ExclusiveGateway_2" targetRef="isReturnCode404_ExclusiveGateway" /> <bpmn2:exclusiveGateway id="isReturnCode404_ExclusiveGateway" name="Is Return Code 404?" default="isReturnCode404_No_SequenceFlow"> @@ -159,7 +135,7 @@ DoDeleteNetworkInstance.setExceptionFlag(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isReturnCode404_No_SequenceFlow" name="No" sourceRef="isReturnCode404_ExclusiveGateway" targetRef="aai_Error_EndEvent" /> <bpmn2:sequenceFlow id="isReturnCode404_Yes_SequenceFlow" name="Yes" sourceRef="isReturnCode404_ExclusiveGateway" targetRef="silentSucces_InclusiveGateway"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKI_aaiReturnCode" ) == "404"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELNWKI_aaiReturnCode" ) == "404"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:endEvent id="aai_Error_EndEvent" name="AAI Error"> <bpmn2:incoming>isReturnCode404_No_SequenceFlow</bpmn2:incoming> @@ -172,7 +148,7 @@ DoDeleteNetworkInstance.setExceptionFlag(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isResponseEmptyNo_SequenceFlow" name="No" sourceRef="isResponseEmpty_ExclusiveGateway_2" targetRef="callRESTQueryCloudRegion_ScriptTask" /> <bpmn2:sequenceFlow id="isResponseEmptyYes_SequenceFlow" name="Yes" sourceRef="isResponseEmpty_ExclusiveGateway_2" targetRef="silentSucces_InclusiveGateway"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKI_isSilentSuccess") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELNWKI_isSilentSuccess") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:inclusiveGateway id="silentSucces_InclusiveGateway" name="Joint"> <bpmn2:incoming>isReturnCode404_Yes_SequenceFlow</bpmn2:incoming> @@ -186,9 +162,9 @@ DoDeleteNetworkInstance.setExceptionFlag(execution)]]></bpmn2:script> <bpmn2:scriptTask id="callRESTQueryCloudRegion_ScriptTask" name="Call REST Query Cloud Region " scriptFormat="groovy"> <bpmn2:incoming>isResponseEmptyNo_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_30</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteNetMod = new DoDeleteNetworkInstance() -deleteNetMod.callRESTQueryAAICloudRegion(execution)]]></bpmn2:script> +deleteNetMod.callRESTQueryAAICloudRegion(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_30" name="" sourceRef="callRESTQueryCloudRegion_ScriptTask" targetRef="prepareNetworkRequest_ScriptTask" /> <bpmn2:exclusiveGateway id="isRelationshipExists_ExclusiveGateway" name="Is Relationship Exists?" default="isRelationshipExistNo_SequenceFlow"> @@ -198,7 +174,7 @@ deleteNetMod.callRESTQueryAAICloudRegion(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isRelationshipExistNo_SequenceFlow" name="No" sourceRef="isRelationshipExists_ExclusiveGateway" targetRef="isAAIQueryOk_ExclusiveGateway_2" /> <bpmn2:sequenceFlow id="isRelationshipExistYes_SequenceFlow" name="Yes" sourceRef="isRelationshipExists_ExclusiveGateway" targetRef="relationshipError_EndEvent"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKI_isVfRelationshipExist") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELNWKI_isVfRelationshipExist") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:endEvent id="relationshipError_EndEvent" name="Relationship Error"> <bpmn2:incoming>isRelationshipExistYes_SequenceFlow</bpmn2:incoming> @@ -210,36 +186,18 @@ deleteNetMod.callRESTQueryAAICloudRegion(execution)]]></bpmn2:script> <bpmn2:scriptTask id="prepareSDNCTopoRequest_ScriptTask" name="Prepare SDNC Topology Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0r3pvf8</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1pdp4d2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def prepareSDNCRequest = new DoDeleteNetworkInstance() -prepareSDNCRequest.prepareSDNCRequest(execution) -]]></bpmn2:script> +prepareSDNCRequest.prepareSDNCRequest(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:scriptTask id="validateDeletePONetwork_ScriptTask" name="Validate Delete PO Network" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_20</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def validateNetworkResponse = new DoDeleteNetworkInstance() -validateNetworkResponse.validateNetworkResponse(execution)]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_20" name="" sourceRef="validateDeletePONetwork_ScriptTask" targetRef="ExclusiveGateway_02t94x3" /> <bpmn2:scriptTask id="prepareNetworkRequest_ScriptTask" name="Prepare Network Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_30</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_15</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def prepareNetworkRequest = new DoDeleteNetworkInstance() -prepareNetworkRequest.prepareNetworkRequest(execution) -]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_15" name="" sourceRef="prepareNetworkRequest_ScriptTask" targetRef="sendRequestToNewworkAdapater_ScriptTask" /> - <bpmn2:scriptTask id="sendRequestToNewworkAdapater_ScriptTask" name="Send Request to Network Adapter" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_15</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def prepareNetworkRequest = new DoDeleteNetworkInstance() -prepareNetworkRequest.sendRequestToVnfAdapter(execution)]]></bpmn2:script> +prepareNetworkRequest.prepareNetworkRequest(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="sendRequestToNewworkAdapater_ScriptTask" targetRef="validateDeletePONetwork_ScriptTask" /> + <bpmn2:sequenceFlow id="SequenceFlow_15" name="" sourceRef="prepareNetworkRequest_ScriptTask" targetRef="Activity_1bwwwba" /> <bpmn2:subProcess id="SubProcess_1" name="Sub-process for UnexpectedErrors" triggeredByEvent="true"> <bpmn2:startEvent id="StartEvent_1"> <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing> @@ -251,9 +209,9 @@ prepareNetworkRequest.sendRequestToVnfAdapter(execution)]]></bpmn2:script> <bpmn2:scriptTask id="unexpectedError_DeleteNetworkInfra_ScriptTask_1" name="Log / Print Unexpected Error" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_13</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_17</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteNetMod = new DoDeleteNetworkInstance() -deleteNetMod.processJavaException(execution)]]></bpmn2:script> +deleteNetMod.processJavaException(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_13" name="" sourceRef="StartEvent_1" targetRef="unexpectedError_DeleteNetworkInfra_ScriptTask_1" /> <bpmn2:sequenceFlow id="SequenceFlow_17" name="" sourceRef="unexpectedError_DeleteNetworkInfra_ScriptTask_1" targetRef="EndEvent_4" /> @@ -261,15 +219,14 @@ deleteNetMod.processJavaException(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_01xjfhu" name="PostProcess Response" scriptFormat="groovy"> <bpmn2:incoming>sdncTopoDeleteYes_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1pbgnr2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.postProcessResponse(execution) -]]></bpmn2:script> +DoDeleteNetworkInstance.postProcessResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1pbgnr2" sourceRef="ScriptTask_01xjfhu" targetRef="EndEvent_3" /> <bpmn2:sequenceFlow id="SequenceFlow_1pdp4d2" sourceRef="prepareSDNCTopoRequest_ScriptTask" targetRef="callDeleteSDNCAdapter_CallActivity" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_02t94x3" name="is not '1610' SNDC Call?" default="SequenceFlow_0r3pvf8"> - <bpmn2:incoming>SequenceFlow_20</bpmn2:incoming> + <bpmn2:incoming>Flow_10caop8</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0r3pvf8</bpmn2:outgoing> <bpmn2:outgoing>SequenceFlow_0kqnddy</bpmn2:outgoing> </bpmn2:exclusiveGateway> @@ -277,10 +234,9 @@ DoDeleteNetworkInstance.postProcessResponse(execution) <bpmn2:scriptTask id="ScriptTask_0iqzbz6" name="Prepare RSRC SDNC Unassign Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0f13b17</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0zlbzad</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def prepareSDNCRequest = new DoDeleteNetworkInstance() -prepareSDNCRequest.prepareRpcSDNCRequest(execution) -]]></bpmn2:script> +prepareSDNCRequest.prepareRpcSDNCRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CallActivity_03wzdas" name="Call RSRC SDNC Unassign Adapter V1 " calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -298,23 +254,22 @@ prepareSDNCRequest.prepareRpcSDNCRequest(execution) <bpmn2:sequenceFlow id="SequenceFlow_1jnva78" sourceRef="CallActivity_03wzdas" targetRef="validateSDNCResponse_ScriptTask" /> <bpmn2:sequenceFlow id="SequenceFlow_0zlbzad" sourceRef="ScriptTask_0iqzbz6" targetRef="CallActivity_03wzdas" /> <bpmn2:sequenceFlow id="SequenceFlow_0kqnddy" name="Yes" sourceRef="ExclusiveGateway_02t94x3" targetRef="ScriptTask_1wf192s"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion") != '1610'} ]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:scriptTask id="ScriptTask_01w2cd9" name="PreProcess Incoming Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0msqfwu</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.preProcessRequest(execution)]]></bpmn2:script> +DoDeleteNetworkInstance.preProcessRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_0msqfwu" sourceRef="ScriptTask_01w2cd9" targetRef="callAAIQuery_scriptTask" /> <bpmn2:scriptTask id="ScriptTask_0dtzzht" name="PostProcess Response" scriptFormat="groovy"> <bpmn2:incoming>silentSuccess_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0f25bme</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.postProcessResponse(execution) -]]></bpmn2:script> +DoDeleteNetworkInstance.postProcessResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_0f25bme" sourceRef="ScriptTask_0dtzzht" targetRef="EndEvent_1" /> <bpmn2:callActivity id="CallActivity_0wyu1mx" name="Call RSRC SDNC Deactivate Adapter" calledElement="sdncAdapter"> @@ -333,9 +288,9 @@ DoDeleteNetworkInstance.postProcessResponse(execution) <bpmn2:scriptTask id="ScriptTask_1wf192s" name="Prepare SDNC RSRC Deactivate Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0kqnddy</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1o088sy</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.prepareRpcSDNCDeactivate(execution)]]></bpmn2:script> +DoDeleteNetworkInstance.prepareRpcSDNCDeactivate(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1o088sy" sourceRef="ScriptTask_1wf192s" targetRef="CallActivity_0wyu1mx" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_024qvqd" default="SequenceFlow_1qyo7ot"> @@ -346,9 +301,9 @@ DoDeleteNetworkInstance.prepareRpcSDNCDeactivate(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_00vwf2h" name="Validate Deactivate SDNC Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1i3193l</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0n8sf23</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoDeleteNetworkInstance = new DoDeleteNetworkInstance() -DoDeleteNetworkInstance.validateRpcSDNCDeactivateResponse(execution)]]></bpmn2:script> +DoDeleteNetworkInstance.validateRpcSDNCDeactivateResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:boundaryEvent id="BoundaryEvent_0un9yyu" name="" attachedToRef="ScriptTask_00vwf2h"> <bpmn2:outgoing>SequenceFlow_08hus4u</bpmn2:outgoing> @@ -359,575 +314,555 @@ DoDeleteNetworkInstance.validateRpcSDNCDeactivateResponse(execution)]]></bpmn2:s <bpmn2:sequenceFlow id="SequenceFlow_08hus4u" sourceRef="BoundaryEvent_0un9yyu" targetRef="EndEvent_1l210ae" /> <bpmn2:sequenceFlow id="SequenceFlow_1qyo7ot" name="No" sourceRef="ExclusiveGateway_024qvqd" targetRef="EndEvent_1l210ae" /> <bpmn2:sequenceFlow id="SequenceFlow_0f13b17" name="Yes" sourceRef="ExclusiveGateway_024qvqd" targetRef="ScriptTask_0iqzbz6"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKI_sdncResponseSuccess" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("DELNWKI_sdncResponseSuccess" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:endEvent id="EndEvent_1l210ae"> <bpmn2:incoming>SequenceFlow_08hus4u</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_1qyo7ot</bpmn2:incoming> <bpmn2:errorEventDefinition errorRef="Error_3" /> </bpmn2:endEvent> + <bpmn2:callActivity id="Activity_1bwwwba" name="openstack Adapter" calledElement="openstackAdapterTask"> + <bpmn2:extensionElements> + <camunda:in source="DELNWKI_deleteNetworkRequest" target="openstackAdapterTaskRequest" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="WorkflowResponse" target="DELNWKI_deleteNetworkResponse" /> + </bpmn2:extensionElements> + <bpmn2:incoming>SequenceFlow_15</bpmn2:incoming> + <bpmn2:outgoing>Flow_10caop8</bpmn2:outgoing> + </bpmn2:callActivity> + <bpmn2:sequenceFlow id="Flow_10caop8" sourceRef="Activity_1bwwwba" targetRef="ExclusiveGateway_02t94x3" /> </bpmn2:process> <bpmn2:error id="Error_3" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeleteNetworkInstance"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="deleteNetwork_startEvent"> - <dc:Bounds x="444" y="185" width="36" height="36" /> + <dc:Bounds x="604" y="185" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="437" y="226" width="49" height="12" /> + <dc:Bounds x="596" y="226" width="51" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_47"> - <di:waypoint xsi:type="dc:Point" x="480" y="203" /> - <di:waypoint xsi:type="dc:Point" x="597" y="204" /> + <di:waypoint x="640" y="203" /> + <di:waypoint x="757" y="204" /> <bpmndi:BPMNLabel> <dc:Bounds x="539" y="188.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_62" bpmnElement="callAAIQuery_scriptTask"> - <dc:Bounds x="816" y="163" width="100" height="80" /> + <dc:Bounds x="976" y="163" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_62" bpmnElement="isAAIQueryOk_ExclusiveGateway_2" isMarkerVisible="true"> - <dc:Bounds x="984" y="72" width="50" height="50" /> + <dc:Bounds x="1144" y="72" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="966" y="44" width="87" height="12" /> + <dc:Bounds x="1127" y="44" width="86" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ScriptTask_62" targetElement="_BPMNShape_ExclusiveGateway_224"> - <di:waypoint xsi:type="dc:Point" x="866" y="163" /> - <di:waypoint xsi:type="dc:Point" x="865" y="122" /> + <di:waypoint x="1026" y="163" /> + <di:waypoint x="1025" y="122" /> <bpmndi:BPMNLabel> <dc:Bounds x="862" y="135" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_63" bpmnElement="validateDeletePONetwork_ScriptTask"> - <dc:Bounds x="1131" y="509" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="querySuccessYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_62" targetElement="_BPMNShape_ExclusiveGateway_65"> - <di:waypoint xsi:type="dc:Point" x="1009" y="122" /> - <di:waypoint xsi:type="dc:Point" x="1009" y="177" /> + <di:waypoint x="1169" y="122" /> + <di:waypoint x="1169" y="177" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1008" y="120" width="29" height="22" /> + <dc:Bounds x="1174" y="120" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="querySuccessNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_62" targetElement="_BPMNShape_ExclusiveGateway_64"> - <di:waypoint xsi:type="dc:Point" x="1034" y="97" /> - <di:waypoint xsi:type="dc:Point" x="1126" y="97" /> + <di:waypoint x="1194" y="97" /> + <di:waypoint x="1286" y="97" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1036" y="97" width="22" height="22" /> + <dc:Bounds x="1200" y="97" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_64" bpmnElement="isReturnCode404_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="1126" y="72" width="50" height="50" /> + <dc:Bounds x="1286" y="72" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1115" y="41" width="77" height="24" /> + <dc:Bounds x="1277" y="41" width="74" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="isReturnCode404_No_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_64" targetElement="_BPMNShape_EndEvent_118"> - <di:waypoint xsi:type="dc:Point" x="1176" y="97" /> - <di:waypoint xsi:type="dc:Point" x="1212" y="97" /> - <di:waypoint xsi:type="dc:Point" x="1212" y="98" /> - <di:waypoint xsi:type="dc:Point" x="1281" y="98" /> + <di:waypoint x="1336" y="97" /> + <di:waypoint x="1372" y="97" /> + <di:waypoint x="1372" y="98" /> + <di:waypoint x="1441" y="98" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1176" y="97" width="22" height="22" /> + <dc:Bounds x="1340" y="97" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="isReturnCode404_Yes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_64" targetElement="_BPMNShape_InclusiveGateway_2"> - <di:waypoint xsi:type="dc:Point" x="1151" y="122" /> - <di:waypoint xsi:type="dc:Point" x="1151" y="177" /> + <di:waypoint x="1311" y="122" /> + <di:waypoint x="1311" y="177" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1152" y="120" width="29" height="22" /> + <dc:Bounds x="1318" y="120" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_65" bpmnElement="isResponseEmpty_ExclusiveGateway_2" isMarkerVisible="true"> - <dc:Bounds x="984" y="177" width="50" height="50" /> + <dc:Bounds x="1144" y="177" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1016" y="163" width="95" height="22" /> + <dc:Bounds x="1185" y="163" width="78" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="isResponseEmptyNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_65" targetElement="_BPMNShape_ScriptTask_250"> - <di:waypoint xsi:type="dc:Point" x="1009" y="227" /> - <di:waypoint xsi:type="dc:Point" x="1010" y="269" /> + <di:waypoint x="1169" y="227" /> + <di:waypoint x="1170" y="269" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1016" y="227" width="22" height="22" /> + <dc:Bounds x="1180" y="227" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="isResponseEmptyYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_65" targetElement="_BPMNShape_InclusiveGateway_2"> - <di:waypoint xsi:type="dc:Point" x="1034" y="202" /> - <di:waypoint xsi:type="dc:Point" x="1126" y="202" /> + <di:waypoint x="1194" y="202" /> + <di:waypoint x="1286" y="202" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1034" y="202" width="29" height="22" /> + <dc:Bounds x="1200" y="202" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_118" bpmnElement="aai_Error_EndEvent"> - <dc:Bounds x="1281" y="80" width="36" height="36" /> + <dc:Bounds x="1441" y="80" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1270" y="121" width="59" height="22" /> + <dc:Bounds x="1437" y="121" width="46" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_66" bpmnElement="prepareNetworkRequest_ScriptTask"> - <dc:Bounds x="1131" y="269" width="100" height="80" /> + <dc:Bounds x="1291" y="269" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ScriptTask_66" targetElement="_BPMNShape_ScriptTask_242"> - <di:waypoint xsi:type="dc:Point" x="1181" y="349" /> - <di:waypoint xsi:type="dc:Point" x="1181" y="387" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ScriptTask_66" targetElement="Activity_16tuuqq_di"> + <di:waypoint x="1341" y="349" /> + <di:waypoint x="1341" y="400" /> <bpmndi:BPMNLabel> <dc:Bounds x="1196" y="368" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_67" bpmnElement="prepareSDNCTopoRequest_ScriptTask"> - <dc:Bounds x="981" y="718" width="100" height="80" /> + <dc:Bounds x="1141" y="718" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_20" sourceElement="_BPMNShape_ScriptTask_63" targetElement="_BPMNShape_ScriptTask_67"> - <di:waypoint xsi:type="dc:Point" x="1180" y="589" /> - <di:waypoint xsi:type="dc:Point" x="1181" y="648" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1181" y="603.5" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_16" bpmnElement="subProcessException_SubProcess" isExpanded="true"> - <dc:Bounds x="-1" y="576" width="902" height="448" /> + <dc:Bounds x="159" y="576" width="902" height="448" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_50" bpmnElement="subProcessStart_StartEvent"> - <dc:Bounds x="49" y="896" width="36" height="36" /> + <dc:Bounds x="209" y="896" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="43" y="938" width="50" height="12" /> + <dc:Bounds x="202" y="938" width="52" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_67" bpmnElement="isSdncTopoDeleteOk_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="1156" y="997" width="50" height="50" /> + <dc:Bounds x="1316" y="997" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1070" y="1010" width="70" height="24" /> + <dc:Bounds x="1230" y="1010" width="70" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="sdncTopoDeleteNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_67" targetElement="_BPMNShape_EndEvent_124"> - <di:waypoint xsi:type="dc:Point" x="1206" y="1022" /> - <di:waypoint xsi:type="dc:Point" x="1244" y="1022" /> - <di:waypoint xsi:type="dc:Point" x="1244" y="1022" /> - <di:waypoint xsi:type="dc:Point" x="1278" y="1022" /> + <di:waypoint x="1366" y="1022" /> + <di:waypoint x="1404" y="1022" /> + <di:waypoint x="1404" y="1022" /> + <di:waypoint x="1438" y="1022" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1206" y="1029.0213702128942" width="14" height="12" /> + <dc:Bounds x="1366" y="1029" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="sdncTopoDeleteYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_67"> - <di:waypoint xsi:type="dc:Point" x="1181" y="1047" /> - <di:waypoint xsi:type="dc:Point" x="1181" y="1097" /> + <di:waypoint x="1341" y="1047" /> + <di:waypoint x="1341" y="1097" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1187" y="1053.3920491579422" width="18" height="12" /> + <dc:Bounds x="1347" y="1053" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_124" bpmnElement="sndcError_EndEvent"> - <dc:Bounds x="1278" y="1004" width="36" height="36" /> + <dc:Bounds x="1438" y="1004" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1289" y="1047" width="59" height="12" /> + <dc:Bounds x="1448" y="1047" width="61" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_19" bpmnElement="callDeleteSDNCAdapter_CallActivity"> - <dc:Bounds x="981" y="851" width="100" height="80" /> + <dc:Bounds x="1141" y="851" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_CallActivity_19" targetElement="_BPMNShape_ScriptTask_131"> - <di:waypoint xsi:type="dc:Point" x="1081" y="891" /> - <di:waypoint xsi:type="dc:Point" x="1131" y="891" /> + <di:waypoint x="1241" y="891" /> + <di:waypoint x="1291" y="891" /> <bpmndi:BPMNLabel> <dc:Bounds x="1106" y="876" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_242" targetElement="_BPMNShape_ScriptTask_63"> - <di:waypoint xsi:type="dc:Point" x="1181" y="467" /> - <di:waypoint xsi:type="dc:Point" x="1181" y="509" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1196" y="488" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_InclusiveGateway_2" bpmnElement="silentSucces_InclusiveGateway"> - <dc:Bounds x="1126" y="177" width="50" height="50" /> + <dc:Bounds x="1286" y="177" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1136" y="227" width="33" height="22" /> + <dc:Bounds x="1300" y="227" width="25" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_36" bpmnElement="silentSuccess_SequenceFlow" sourceElement="_BPMNShape_InclusiveGateway_2"> - <di:waypoint xsi:type="dc:Point" x="1176" y="202" /> - <di:waypoint xsi:type="dc:Point" x="1305" y="203" /> + <di:waypoint x="1336" y="202" /> + <di:waypoint x="1465" y="203" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1195" y="180.7648701031734" width="72" height="12" /> + <dc:Bounds x="1355" y="181" width="73" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_131" bpmnElement="validateSDNCResponse_ScriptTask"> - <dc:Bounds x="1131" y="851" width="100" height="80" /> + <dc:Bounds x="1291" y="851" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_131" targetElement="_BPMNShape_ExclusiveGateway_67"> - <di:waypoint xsi:type="dc:Point" x="1180" y="931" /> - <di:waypoint xsi:type="dc:Point" x="1181" y="997" /> + <di:waypoint x="1340" y="931" /> + <di:waypoint x="1341" y="997" /> <bpmndi:BPMNLabel> <dc:Bounds x="1181" y="949" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_242" bpmnElement="sendRequestToNewworkAdapater_ScriptTask"> - <dc:Bounds x="1131" y="387" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_179" bpmnElement="EndEvent_1"> - <dc:Bounds x="1458" y="185" width="36" height="36" /> + <dc:Bounds x="1618" y="185" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1476" y="226" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_180" bpmnElement="EndEvent_2"> - <dc:Bounds x="817" y="687" width="36" height="36" /> + <dc:Bounds x="977" y="687" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="835" y="728" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_182" bpmnElement="EndEvent_3"> - <dc:Bounds x="1163" y="1228" width="36" height="36" /> + <dc:Bounds x="1323" y="1228" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1181" y="1269" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_250" bpmnElement="callRESTQueryCloudRegion_ScriptTask"> - <dc:Bounds x="960" y="269" width="100" height="80" /> + <dc:Bounds x="1120" y="269" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_52" bpmnElement="SequenceFlow_30" sourceElement="_BPMNShape_ScriptTask_250" targetElement="_BPMNShape_ScriptTask_66"> - <di:waypoint xsi:type="dc:Point" x="1060" y="309" /> - <di:waypoint xsi:type="dc:Point" x="1096" y="309" /> - <di:waypoint xsi:type="dc:Point" x="1096" y="309" /> - <di:waypoint xsi:type="dc:Point" x="1131" y="309" /> + <di:waypoint x="1220" y="309" /> + <di:waypoint x="1256" y="309" /> + <di:waypoint x="1256" y="309" /> + <di:waypoint x="1291" y="309" /> <bpmndi:BPMNLabel> <dc:Bounds x="1111" y="309" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_41" bpmnElement="BoundaryEvent_1"> - <dc:Bounds x="1213" y="913" width="36" height="36" /> + <dc:Bounds x="1373" y="913" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1231" y="949" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_41" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_BoundaryEvent_41" targetElement="_BPMNShape_EndEvent_124"> - <di:waypoint xsi:type="dc:Point" x="1241" y="945" /> - <di:waypoint xsi:type="dc:Point" x="1286" y="1007" /> + <di:waypoint x="1401" y="945" /> + <di:waypoint x="1446" y="1007" /> <bpmndi:BPMNLabel> <dc:Bounds x="1264" y="961" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_224" bpmnElement="isRelationshipExists_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="840" y="72" width="50" height="50" /> + <dc:Bounds x="1000" y="72" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="829" y="41" width="74" height="24" /> + <dc:Bounds x="989" y="41" width="74" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_60" bpmnElement="isRelationshipExistNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_224" targetElement="_BPMNShape_ExclusiveGateway_62"> - <di:waypoint xsi:type="dc:Point" x="890" y="97" /> - <di:waypoint xsi:type="dc:Point" x="984" y="97" /> + <di:waypoint x="1050" y="97" /> + <di:waypoint x="1144" y="97" /> <bpmndi:BPMNLabel> - <dc:Bounds x="890" y="97" width="22" height="22" /> + <dc:Bounds x="1054" y="97" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_216" bpmnElement="relationshipError_EndEvent"> - <dc:Bounds x="730" y="80" width="36" height="36" /> + <dc:Bounds x="890" y="80" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="701" y="117" width="109" height="22" /> + <dc:Bounds x="871" y="117" width="90" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_61" bpmnElement="isRelationshipExistYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_224" targetElement="_BPMNShape_EndEvent_216"> - <di:waypoint xsi:type="dc:Point" x="840" y="97" /> - <di:waypoint xsi:type="dc:Point" x="800" y="97" /> - <di:waypoint xsi:type="dc:Point" x="800" y="98" /> - <di:waypoint xsi:type="dc:Point" x="766" y="98" /> + <di:waypoint x="1000" y="97" /> + <di:waypoint x="960" y="97" /> + <di:waypoint x="960" y="98" /> + <di:waypoint x="926" y="98" /> <bpmndi:BPMNLabel> - <dc:Bounds x="816" y="97" width="29" height="22" /> + <dc:Bounds x="982" y="97" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_29" bpmnElement="SubProcess_1" isExpanded="true"> - <dc:Bounds x="0" y="369" width="326" height="175" /> + <dc:Bounds x="160" y="369" width="326" height="175" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_73" bpmnElement="StartEvent_1"> - <dc:Bounds x="36" y="432" width="36" height="36" /> + <dc:Bounds x="196" y="432" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="54" y="473" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_222" bpmnElement="EndEvent_4"> - <dc:Bounds x="240" y="432" width="36" height="36" /> + <dc:Bounds x="400" y="432" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="258" y="473" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_272" bpmnElement="unexpectedError_DeleteNetworkInfra_ScriptTask_1"> - <dc:Bounds x="108" y="410" width="100" height="80" /> + <dc:Bounds x="268" y="410" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_StartEvent_73" targetElement="_BPMNShape_ScriptTask_272"> - <di:waypoint xsi:type="dc:Point" x="72" y="450" /> - <di:waypoint xsi:type="dc:Point" x="108" y="450" /> + <di:waypoint x="232" y="450" /> + <di:waypoint x="268" y="450" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_17" sourceElement="_BPMNShape_ScriptTask_272" targetElement="_BPMNShape_EndEvent_222"> - <di:waypoint xsi:type="dc:Point" x="208" y="450" /> - <di:waypoint xsi:type="dc:Point" x="240" y="450" /> + <di:waypoint x="368" y="450" /> + <di:waypoint x="400" y="450" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_00lgy9f_di" bpmnElement="ScriptTask_00lgy9f"> - <dc:Bounds x="688" y="665" width="100" height="80" /> + <dc:Bounds x="848" y="665" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1a51h25_di" bpmnElement="SequenceFlow_1a51h25"> - <di:waypoint xsi:type="dc:Point" x="85" y="914" /> - <di:waypoint xsi:type="dc:Point" x="124" y="914" /> + <di:waypoint x="245" y="914" /> + <di:waypoint x="284" y="914" /> <bpmndi:BPMNLabel> <dc:Bounds x="105" y="899" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1yvnovn_di" bpmnElement="SequenceFlow_1yvnovn"> - <di:waypoint xsi:type="dc:Point" x="788" y="705" /> - <di:waypoint xsi:type="dc:Point" x="817" y="705" /> + <di:waypoint x="948" y="705" /> + <di:waypoint x="977" y="705" /> <bpmndi:BPMNLabel> <dc:Bounds x="803" y="690" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_01xjfhu_di" bpmnElement="ScriptTask_01xjfhu"> - <dc:Bounds x="1131" y="1097" width="100" height="80" /> + <dc:Bounds x="1291" y="1097" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1pbgnr2_di" bpmnElement="SequenceFlow_1pbgnr2"> - <di:waypoint xsi:type="dc:Point" x="1181" y="1177" /> - <di:waypoint xsi:type="dc:Point" x="1181" y="1228" /> + <di:waypoint x="1341" y="1177" /> + <di:waypoint x="1341" y="1228" /> <bpmndi:BPMNLabel> <dc:Bounds x="1196" y="1202.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1pdp4d2_di" bpmnElement="SequenceFlow_1pdp4d2"> - <di:waypoint xsi:type="dc:Point" x="1031" y="798" /> - <di:waypoint xsi:type="dc:Point" x="1031" y="851" /> + <di:waypoint x="1191" y="798" /> + <di:waypoint x="1191" y="851" /> <bpmndi:BPMNLabel> <dc:Bounds x="1046" y="824.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_02t94x3_di" bpmnElement="ExclusiveGateway_02t94x3" isMarkerVisible="true"> - <dc:Bounds x="1156" y="648" width="50" height="50" /> + <dc:Bounds x="1316" y="648" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1150" y="707" width="61" height="24" /> + <dc:Bounds x="1311" y="707" width="60" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0r3pvf8_di" bpmnElement="SequenceFlow_0r3pvf8"> - <di:waypoint xsi:type="dc:Point" x="1156" y="673" /> - <di:waypoint xsi:type="dc:Point" x="1031" y="673" /> - <di:waypoint xsi:type="dc:Point" x="1031" y="718" /> + <di:waypoint x="1316" y="673" /> + <di:waypoint x="1191" y="673" /> + <di:waypoint x="1191" y="718" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1134" y="681" width="14" height="12" /> + <dc:Bounds x="1294" y="681" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0iqzbz6_di" bpmnElement="ScriptTask_0iqzbz6"> - <dc:Bounds x="1426" y="851" width="100" height="80" /> + <dc:Bounds x="1586" y="851" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_03wzdas_di" bpmnElement="CallActivity_03wzdas"> - <dc:Bounds x="1279" y="851" width="100" height="80" /> + <dc:Bounds x="1439" y="851" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1jnva78_di" bpmnElement="SequenceFlow_1jnva78"> - <di:waypoint xsi:type="dc:Point" x="1279" y="891" /> - <di:waypoint xsi:type="dc:Point" x="1231" y="891" /> + <di:waypoint x="1439" y="891" /> + <di:waypoint x="1391" y="891" /> <bpmndi:BPMNLabel> <dc:Bounds x="1255" y="876" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0zlbzad_di" bpmnElement="SequenceFlow_0zlbzad"> - <di:waypoint xsi:type="dc:Point" x="1426" y="891" /> - <di:waypoint xsi:type="dc:Point" x="1379" y="891" /> + <di:waypoint x="1586" y="891" /> + <di:waypoint x="1539" y="891" /> <bpmndi:BPMNLabel> <dc:Bounds x="1403" y="876" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0kqnddy_di" bpmnElement="SequenceFlow_0kqnddy"> - <di:waypoint xsi:type="dc:Point" x="1206" y="673" /> - <di:waypoint xsi:type="dc:Point" x="1279" y="673" /> + <di:waypoint x="1366" y="673" /> + <di:waypoint x="1439" y="673" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1217" y="677.9562629793824" width="18" height="12" /> + <dc:Bounds x="1377" y="678" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_01w2cd9_di" bpmnElement="ScriptTask_01w2cd9"> - <dc:Bounds x="597" y="163" width="100" height="80" /> + <dc:Bounds x="757" y="163" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0msqfwu_di" bpmnElement="SequenceFlow_0msqfwu"> - <di:waypoint xsi:type="dc:Point" x="697" y="203" /> - <di:waypoint xsi:type="dc:Point" x="816" y="203" /> + <di:waypoint x="857" y="203" /> + <di:waypoint x="976" y="203" /> <bpmndi:BPMNLabel> <dc:Bounds x="757" y="188" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0dtzzht_di" bpmnElement="ScriptTask_0dtzzht"> - <dc:Bounds x="1305" y="163" width="100" height="80" /> + <dc:Bounds x="1465" y="163" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0f25bme_di" bpmnElement="SequenceFlow_0f25bme"> - <di:waypoint xsi:type="dc:Point" x="1405" y="203" /> - <di:waypoint xsi:type="dc:Point" x="1458" y="203" /> + <di:waypoint x="1565" y="203" /> + <di:waypoint x="1618" y="203" /> <bpmndi:BPMNLabel> <dc:Bounds x="1432" y="178" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_0wyu1mx_di" bpmnElement="CallActivity_0wyu1mx"> - <dc:Bounds x="1426" y="633" width="100" height="80" /> + <dc:Bounds x="1586" y="633" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1wf192s_di" bpmnElement="ScriptTask_1wf192s"> - <dc:Bounds x="1279" y="633" width="100" height="80" /> + <dc:Bounds x="1439" y="633" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1o088sy_di" bpmnElement="SequenceFlow_1o088sy"> - <di:waypoint xsi:type="dc:Point" x="1379" y="673" /> - <di:waypoint xsi:type="dc:Point" x="1403" y="673" /> - <di:waypoint xsi:type="dc:Point" x="1403" y="673" /> - <di:waypoint xsi:type="dc:Point" x="1426" y="673" /> + <di:waypoint x="1539" y="673" /> + <di:waypoint x="1563" y="673" /> + <di:waypoint x="1563" y="673" /> + <di:waypoint x="1586" y="673" /> <bpmndi:BPMNLabel> <dc:Bounds x="1418" y="673" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_024qvqd_di" bpmnElement="ExclusiveGateway_024qvqd" isMarkerVisible="true"> - <dc:Bounds x="1597" y="775" width="50" height="50" /> + <dc:Bounds x="1757" y="775" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="1622" y="825" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_00vwf2h_di" bpmnElement="ScriptTask_00vwf2h"> - <dc:Bounds x="1572" y="633" width="100" height="80" /> + <dc:Bounds x="1732" y="633" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="BoundaryEvent_0un9yyu_di" bpmnElement="BoundaryEvent_0un9yyu"> - <dc:Bounds x="1654" y="695" width="36" height="36" /> + <dc:Bounds x="1814" y="695" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1672" y="731" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1i3193l_di" bpmnElement="SequenceFlow_1i3193l"> - <di:waypoint xsi:type="dc:Point" x="1526" y="673" /> - <di:waypoint xsi:type="dc:Point" x="1572" y="673" /> + <di:waypoint x="1686" y="673" /> + <di:waypoint x="1732" y="673" /> <bpmndi:BPMNLabel> <dc:Bounds x="1549" y="648" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0n8sf23_di" bpmnElement="SequenceFlow_0n8sf23"> - <di:waypoint xsi:type="dc:Point" x="1622" y="713" /> - <di:waypoint xsi:type="dc:Point" x="1622" y="775" /> + <di:waypoint x="1782" y="713" /> + <di:waypoint x="1782" y="775" /> <bpmndi:BPMNLabel> <dc:Bounds x="1637" y="734" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_08hus4u_di" bpmnElement="SequenceFlow_08hus4u"> - <di:waypoint xsi:type="dc:Point" x="1680" y="729" /> - <di:waypoint xsi:type="dc:Point" x="1710" y="784" /> + <di:waypoint x="1840" y="729" /> + <di:waypoint x="1870" y="784" /> <bpmndi:BPMNLabel> <dc:Bounds x="1695" y="741.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1qyo7ot_di" bpmnElement="SequenceFlow_1qyo7ot"> - <di:waypoint xsi:type="dc:Point" x="1647" y="800" /> - <di:waypoint xsi:type="dc:Point" x="1700" y="800" /> + <di:waypoint x="1807" y="800" /> + <di:waypoint x="1860" y="800" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1651" y="808" width="14" height="12" /> + <dc:Bounds x="1811" y="808" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0f13b17_di" bpmnElement="SequenceFlow_0f13b17"> - <di:waypoint xsi:type="dc:Point" x="1622" y="825" /> - <di:waypoint xsi:type="dc:Point" x="1622" y="891" /> - <di:waypoint xsi:type="dc:Point" x="1526" y="891" /> + <di:waypoint x="1782" y="825" /> + <di:waypoint x="1782" y="891" /> + <di:waypoint x="1686" y="891" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1629" y="824" width="18" height="12" /> + <dc:Bounds x="1789" y="824" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0p7ad9r_di" bpmnElement="EndEvent_1l210ae"> - <dc:Bounds x="1700" y="782" width="36" height="36" /> + <dc:Bounds x="1860" y="782" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1718" y="818" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0n4do0p_di" bpmnElement="ScriptTask_0n4do0p"> - <dc:Bounds x="245" y="665" width="100" height="80" /> + <dc:Bounds x="405" y="665" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_1gix2o6_di" bpmnElement="ExclusiveGateway_1gix2o6" isMarkerVisible="true"> - <dc:Bounds x="270" y="889" width="50" height="50" /> + <dc:Bounds x="430" y="889" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="256" y="939" width="77" height="13" /> + <dc:Bounds x="416" y="939" width="78" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0tiz0kk_di" bpmnElement="SequenceFlow_0tiz0kk"> - <di:waypoint xsi:type="dc:Point" x="295" y="889" /> - <di:waypoint xsi:type="dc:Point" x="295" y="869" /> - <di:waypoint xsi:type="dc:Point" x="295" y="869" /> - <di:waypoint xsi:type="dc:Point" x="295" y="849" /> + <di:waypoint x="455" y="889" /> + <di:waypoint x="455" y="869" /> + <di:waypoint x="455" y="869" /> + <di:waypoint x="455" y="849" /> <bpmndi:BPMNLabel> - <dc:Bounds x="299" y="858.4545454545455" width="19" height="13" /> + <dc:Bounds x="460" y="858" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1suj1nc_di" bpmnElement="SequenceFlow_1suj1nc"> - <di:waypoint xsi:type="dc:Point" x="320" y="914" /> - <di:waypoint xsi:type="dc:Point" x="437" y="914" /> - <di:waypoint xsi:type="dc:Point" x="437" y="849" /> + <di:waypoint x="480" y="914" /> + <di:waypoint x="597" y="914" /> + <di:waypoint x="597" y="849" /> <bpmndi:BPMNLabel> - <dc:Bounds x="333" y="897" width="14" height="13" /> + <dc:Bounds x="493" y="897" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="CallActivity_0lku52d_di" bpmnElement="CallActivity_0lku52d"> - <dc:Bounds x="523" y="665" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_1x7o5bo_di" bpmnElement="ExclusiveGateway_1x7o5bo" isMarkerVisible="true"> - <dc:Bounds x="270" y="799" width="50" height="50" /> + <dc:Bounds x="430" y="799" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="173" y="812" width="87" height="25" /> + <dc:Bounds x="333" y="812" width="88" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0jb7rws_di" bpmnElement="SequenceFlow_0jb7rws"> - <di:waypoint xsi:type="dc:Point" x="295" y="799" /> - <di:waypoint xsi:type="dc:Point" x="295" y="772" /> - <di:waypoint xsi:type="dc:Point" x="437" y="772" /> - <di:waypoint xsi:type="dc:Point" x="437" y="799" /> + <di:waypoint x="455" y="799" /> + <di:waypoint x="455" y="772" /> + <di:waypoint x="597" y="772" /> + <di:waypoint x="597" y="799" /> <bpmndi:BPMNLabel> - <dc:Bounds x="312" y="776.0384854424079" width="18" height="12" /> + <dc:Bounds x="472" y="776" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="InclusiveGateway_17qke2s_di" bpmnElement="ExclusiveGateway_01xin16"> - <dc:Bounds x="412" y="799" width="50" height="50" /> + <dc:Bounds x="572" y="799" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="437" y="849" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1raa09h_di" bpmnElement="SequenceFlow_1raa09h"> - <di:waypoint xsi:type="dc:Point" x="320" y="824" /> - <di:waypoint xsi:type="dc:Point" x="412" y="824" /> + <di:waypoint x="480" y="824" /> + <di:waypoint x="572" y="824" /> <bpmndi:BPMNLabel> <dc:Bounds x="366" y="809" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1nl99y6_di" bpmnElement="SequenceFlow_1nl99y6"> - <di:waypoint xsi:type="dc:Point" x="462" y="824" /> - <di:waypoint xsi:type="dc:Point" x="738" y="824" /> - <di:waypoint xsi:type="dc:Point" x="738" y="745" /> + <di:waypoint x="622" y="824" /> + <di:waypoint x="898" y="824" /> + <di:waypoint x="898" y="745" /> <bpmndi:BPMNLabel> <dc:Bounds x="600" y="809" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0n4ya47_di" bpmnElement="ScriptTask_0n4ya47"> - <dc:Bounds x="387" y="665" width="100" height="80" /> + <dc:Bounds x="547" y="665" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1wif0e5_di" bpmnElement="SequenceFlow_1wif0e5"> - <di:waypoint xsi:type="dc:Point" x="345" y="705" /> - <di:waypoint xsi:type="dc:Point" x="387" y="705" /> + <di:waypoint x="505" y="705" /> + <di:waypoint x="547" y="705" /> <bpmndi:BPMNLabel> <dc:Bounds x="366" y="690" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_147vc14_di" bpmnElement="SequenceFlow_147vc14"> - <di:waypoint xsi:type="dc:Point" x="487" y="705" /> - <di:waypoint xsi:type="dc:Point" x="523" y="705" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="505" y="690" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_021b0sz_di" bpmnElement="SequenceFlow_021b0sz"> - <di:waypoint xsi:type="dc:Point" x="224" y="914" /> - <di:waypoint xsi:type="dc:Point" x="270" y="914" /> + <di:waypoint x="384" y="914" /> + <di:waypoint x="430" y="914" /> <bpmndi:BPMNLabel> <dc:Bounds x="247" y="899" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1gtl61j_di" bpmnElement="Task_0026x4v"> - <dc:Bounds x="124" y="874" width="100" height="80" /> + <dc:Bounds x="284" y="874" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="TextAnnotation_0i06ryl_di" bpmnElement="TextAnnotation_0i06ryl"> - <dc:Bounds x="592" y="596" width="106" height="45" /> + <bpmndi:BPMNShape id="Activity_16tuuqq_di" bpmnElement="Activity_1bwwwba"> + <dc:Bounds x="1291" y="400" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Association_0gzsxad_di" bpmnElement="Association_0gzsxad"> - <di:waypoint xsi:type="dc:Point" x="606" y="665" /> - <di:waypoint xsi:type="dc:Point" x="627" y="641" /> + <bpmndi:BPMNEdge id="Flow_10caop8_di" bpmnElement="Flow_10caop8"> + <di:waypoint x="1341" y="480" /> + <di:waypoint x="1341" y="648" /> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> -</bpmn2:definitions>
\ No newline at end of file +</bpmn2:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteNetworkInstanceRollback.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteNetworkInstanceRollback.bpmn deleted file mode 100644 index 7ec02addfa..0000000000 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteNetworkInstanceRollback.bpmn +++ /dev/null @@ -1,547 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0"> - <bpmn:process id="DoDeleteNetworkInstanceRollback" name="DoDeleteNetworkInstanceRollback" isExecutable="true"> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_1krl2dg</bpmn:outgoing> - </bpmn:startEvent> - <bpmn:scriptTask id="Task_0whino1" name="PreProcess Incoming Data" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_1krl2dg</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0u41iz2</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() -DoDeleteNetworkInstanceRollback.preProcessRequest(execution)]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:sequenceFlow id="SequenceFlow_1krl2dg" sourceRef="StartEvent_1" targetRef="Task_0whino1" /> - <bpmn:sequenceFlow id="SequenceFlow_0u41iz2" sourceRef="Task_0whino1" targetRef="ExclusiveGateway_0p5zgdb" /> - <bpmn:callActivity id="CallActivity_1x88fsq" name="Call RSRC SDNC Activate Adapter" calledElement="sdncAdapter"> - <bpmn:extensionElements> - <camunda:in source="DELNWKIR_rollbackDeactivateSDNCRequest" target="sdncAdapterWorkflowRequest" /> - <camunda:in source="mso-request-id" target="mso-request-id" /> - <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> - <camunda:out source="SDNCA_ResponseCode" target="DELNWKIR_rollbackDeactivateSDNCReturnCode" /> - <camunda:out source="sdncAdapterResponse" target="DELNWKIR_rollbackDeactivateSDNCResponse" /> - <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_1mxbdps</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_07s5r14</bpmn:outgoing> - </bpmn:callActivity> - <bpmn:exclusiveGateway id="ExclusiveGateway_0p5zgdb" name="is RSRC Deactivate Rollback?" default="SequenceFlow_1bb7zpp"> - <bpmn:incoming>SequenceFlow_0u41iz2</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1bb7zpp</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_1mxbdps</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:scriptTask id="ScriptTask_1ggaxfu" name="Validate Rollback Responses" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_1xokvq6</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1xs882r</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1ucaagl</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() -DoDeleteNetworkInstanceRollback.validateRollbackResponses(execution)]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:sequenceFlow id="SequenceFlow_1bb7zpp" name="No" sourceRef="ExclusiveGateway_0p5zgdb" targetRef="ExclusiveGateway_03d5sol" /> - <bpmn:sequenceFlow id="SequenceFlow_1mxbdps" name="Yes" sourceRef="ExclusiveGateway_0p5zgdb" targetRef="CallActivity_1x88fsq"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKIR_rollbackDeactivateSDNCRequest") != null}]]></bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_07s5r14" sourceRef="CallActivity_1x88fsq" targetRef="ExclusiveGateway_03d5sol" /> - <bpmn:endEvent id="EndEvent_1fvr7ad"> - <bpmn:incoming>SequenceFlow_1ucaagl</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_1eyt8z2" sourceRef="ServiceTask_1vx8ti9" targetRef="ExclusiveGateway_03fn5ks" /> - <bpmn:subProcess id="SubProcess_1p4663w" name="Sub-process for UnexpectedErrors" triggeredByEvent="true"> - <bpmn:scriptTask id="ScriptTask_0by1uwk" name="Log / Print Unexpected Error" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_0xktw7v</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0soe5t3</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def DoDeleteNetworkInstanceRollback = new DoDeleteNetworkInstanceRollback() -DoDeleteNetworkInstanceRollback.processJavaException(execution)]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:startEvent id="StartEvent_1j0eixl"> - <bpmn:outgoing>SequenceFlow_0xktw7v</bpmn:outgoing> - <bpmn:errorEventDefinition errorRef="Error_1" /> - </bpmn:startEvent> - <bpmn:endEvent id="EndEvent_0jxh015"> - <bpmn:incoming>SequenceFlow_0soe5t3</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0xktw7v" name="" sourceRef="StartEvent_1j0eixl" targetRef="ScriptTask_0by1uwk" /> - <bpmn:sequenceFlow id="SequenceFlow_0soe5t3" name="" sourceRef="ScriptTask_0by1uwk" targetRef="EndEvent_0jxh015" /> - </bpmn:subProcess> - <bpmn:inclusiveGateway id="ExclusiveGateway_0798yby"> - <bpmn:incoming>SequenceFlow_1hcmrh9</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1pi168e</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1xs882r</bpmn:outgoing> - </bpmn:inclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_1xs882r" sourceRef="ExclusiveGateway_0798yby" targetRef="ScriptTask_1ggaxfu" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_03d5sol" name="is PO Network Rollback?" default="SequenceFlow_1yj3542"> - <bpmn:incoming>SequenceFlow_1bb7zpp</bpmn:incoming> - <bpmn:incoming>SequenceFlow_07s5r14</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1yj3542</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_18e00sw</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_1yj3542" name="No" sourceRef="ExclusiveGateway_03d5sol" targetRef="ExclusiveGateway_03fn5ks" /> - <bpmn:serviceTask id="ServiceTask_1vx8ti9" name="Call Rollback Network"> - <bpmn:extensionElements> - <camunda:connector> - <camunda:inputOutput> - <camunda:inputParameter name="payload">${DELNWKIR_rollbackNetworkRequest}</camunda:inputParameter> - <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution)} -]]></camunda:inputParameter> - <camunda:inputParameter name="headers"> - <camunda:map> - <camunda:entry key="Authorization">#{BasicAuthHeaderValuePO}</camunda:entry> - <camunda:entry key="content-type">application/xml</camunda:entry> - </camunda:map> - </camunda:inputParameter> - <camunda:inputParameter name="method">POST</camunda:inputParameter> - <camunda:outputParameter name="DELNWKIR_rollbackNetworkResponse">${response}</camunda:outputParameter> - <camunda:outputParameter name="DELNWKIR_rollbackNetworkReturnCode">${statusCode}</camunda:outputParameter> - </camunda:inputOutput> - <camunda:connectorId>http-connector</camunda:connectorId> - </camunda:connector> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_18e00sw</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1eyt8z2</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_18e00sw" name="Yes" sourceRef="ExclusiveGateway_03d5sol" targetRef="ServiceTask_1vx8ti9"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKIR_rollbackNetworkRequest") != null}]]></bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:exclusiveGateway id="ExclusiveGateway_03fn5ks" name="is SDNC Rollback?" default="SequenceFlow_1xokvq6"> - <bpmn:incoming>SequenceFlow_1yj3542</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1eyt8z2</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1xokvq6</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_172safw</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:exclusiveGateway id="ExclusiveGateway_1ga27si" name="is RSRC SDNC?" default="SequenceFlow_1wy1aba"> - <bpmn:incoming>SequenceFlow_172safw</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1wy1aba</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_1yltkyg</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_1xokvq6" name="No" sourceRef="ExclusiveGateway_03fn5ks" targetRef="ScriptTask_1ggaxfu" /> - <bpmn:sequenceFlow id="SequenceFlow_172safw" name="Yes" sourceRef="ExclusiveGateway_03fn5ks" targetRef="ExclusiveGateway_1ga27si"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("DELNWKIR_rollbackSDNCRequest") != null}]]></bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_1wy1aba" name="No" sourceRef="ExclusiveGateway_1ga27si" targetRef="Task_00chyig" /> - <bpmn:sequenceFlow id="SequenceFlow_1yltkyg" name="Yes" sourceRef="ExclusiveGateway_1ga27si" targetRef="Task_1iuumxi"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion") != '1610'} ]]></bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_1hcmrh9" sourceRef="Task_1iuumxi" targetRef="ExclusiveGateway_0798yby" /> - <bpmn:sequenceFlow id="SequenceFlow_1pi168e" sourceRef="Task_00chyig" targetRef="ExclusiveGateway_0798yby" /> - <bpmn:callActivity id="Task_1iuumxi" name="Call Assign RSRC SDNC Adapter" calledElement="sdncAdapter"> - <bpmn:extensionElements> - <camunda:in source="DELNWKIR_rollbackSDNCRequest" target="sdncAdapterWorkflowRequest" /> - <camunda:in source="mso-request-id" target="mso-request-id" /> - <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> - <camunda:out source="SDNCA_ResponseCode" target="DELNWKIR_rollbackSDNCReturnCode" /> - <camunda:out source="sdncAdapterResponse" target="DELNWKIR_rollbackSDNCResponse" /> - <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_1yltkyg</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1hcmrh9</bpmn:outgoing> - </bpmn:callActivity> - <bpmn:callActivity id="Task_00chyig" name="Call Rollback SDNC Adapter" calledElement="sdncAdapter"> - <bpmn:extensionElements> - <camunda:in source="DELNWKIR_rollbackSDNCRequest" target="sdncAdapterWorkflowRequest" /> - <camunda:in source="mso-request-id" target="mso-request-id" /> - <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> - <camunda:out source="SDNCA_ResponseCode" target="DELNWKIR_rollbackSDNCReturnCode" /> - <camunda:out source="sdncAdapterResponse" target="DELNWKIR_rollbackSDNCResponse" /> - <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_1wy1aba</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1pi168e</bpmn:outgoing> - </bpmn:callActivity> - <bpmn:sequenceFlow id="SequenceFlow_1ucaagl" sourceRef="ScriptTask_1ggaxfu" targetRef="EndEvent_1fvr7ad" /> - <bpmn:subProcess id="SubProcess_02vfqr7" triggeredByEvent="true"> - <bpmn:endEvent id="EndEvent_0m7hpuj"> - <bpmn:incoming>SequenceFlow_1s5yjuu</bpmn:incoming> - </bpmn:endEvent> - <bpmn:scriptTask id="ScriptTask_0yr3vca" name="Catch Exception" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_01hh1wq</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1s5yjuu</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -execution.setVariable("workflowException", execution.getVariable("WorkflowException")]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:startEvent id="StartEvent_001ol7f"> - <bpmn:outgoing>SequenceFlow_01hh1wq</bpmn:outgoing> - <bpmn:errorEventDefinition errorRef="Error_2" /> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_1s5yjuu" sourceRef="ScriptTask_0yr3vca" targetRef="EndEvent_0m7hpuj" /> - <bpmn:sequenceFlow id="SequenceFlow_01hh1wq" sourceRef="StartEvent_001ol7f" targetRef="ScriptTask_0yr3vca" /> - </bpmn:subProcess> - <bpmn:boundaryEvent id="BoundaryEvent_1mrkh9x" attachedToRef="CallActivity_1x88fsq"> - <bpmn:outgoing>SequenceFlow_0b0m3o7</bpmn:outgoing> - <bpmn:errorEventDefinition errorRef="Error_2" /> - </bpmn:boundaryEvent> - <bpmn:boundaryEvent id="BoundaryEvent_16cracu" attachedToRef="ServiceTask_1vx8ti9"> - <bpmn:outgoing>SequenceFlow_141226w</bpmn:outgoing> - <bpmn:errorEventDefinition errorRef="Error_2" /> - </bpmn:boundaryEvent> - <bpmn:sequenceFlow id="SequenceFlow_141226w" sourceRef="BoundaryEvent_16cracu" targetRef="EndEvent_00y9o8y" /> - <bpmn:sequenceFlow id="SequenceFlow_0b0m3o7" sourceRef="BoundaryEvent_1mrkh9x" targetRef="EndEvent_00y9o8y" /> - <bpmn:endEvent id="EndEvent_00y9o8y"> - <bpmn:incoming>SequenceFlow_141226w</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0b0m3o7</bpmn:incoming> - <bpmn:errorEventDefinition errorRef="Error_2" /> - </bpmn:endEvent> - <bpmn:boundaryEvent id="BoundaryEvent_1gk4tem" attachedToRef="Task_1iuumxi"> - <bpmn:outgoing>SequenceFlow_1lr1613</bpmn:outgoing> - <bpmn:errorEventDefinition errorRef="Error_2" /> - </bpmn:boundaryEvent> - <bpmn:boundaryEvent id="BoundaryEvent_1qaz277" attachedToRef="Task_00chyig"> - <bpmn:outgoing>SequenceFlow_0np0b8p</bpmn:outgoing> - <bpmn:errorEventDefinition errorRef="Error_2" /> - </bpmn:boundaryEvent> - <bpmn:endEvent id="EndEvent_1qfbudr"> - <bpmn:incoming>SequenceFlow_1lr1613</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0np0b8p</bpmn:incoming> - <bpmn:errorEventDefinition errorRef="Error_2" /> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_1lr1613" sourceRef="BoundaryEvent_1gk4tem" targetRef="EndEvent_1qfbudr" /> - <bpmn:sequenceFlow id="SequenceFlow_0np0b8p" sourceRef="BoundaryEvent_1qaz277" targetRef="EndEvent_1qfbudr" /> - <bpmn:textAnnotation id="TextAnnotation_000ap15"> <bpmn:text><![CDATA[Include ONLY inputs/varrables: -rollbackData, as Map --rollbackDeactivateSDNCRequest --rollbackNetworkRequest -WorkflowException -]]></bpmn:text> -</bpmn:textAnnotation> - <bpmn:association id="Association_0ybkmal" sourceRef="Task_0whino1" targetRef="TextAnnotation_000ap15" /> - <bpmn:textAnnotation id="TextAnnotation_0vwyo82"> <bpmn:text><![CDATA[set value for: -WorkflowException -rolledBack -wasDeleted -]]></bpmn:text> -</bpmn:textAnnotation> - <bpmn:association id="Association_1gx121b" sourceRef="ScriptTask_1ggaxfu" targetRef="TextAnnotation_0vwyo82" /> - </bpmn:process> - <bpmn:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> - <bpmn:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeleteNetworkInstanceRollback"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> - <dc:Bounds x="214" y="240" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="232" y="276" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_1dqe09s_di" bpmnElement="Task_0whino1"> - <dc:Bounds x="333" y="218" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1krl2dg_di" bpmnElement="SequenceFlow_1krl2dg"> - <di:waypoint xsi:type="dc:Point" x="250" y="258" /> - <di:waypoint xsi:type="dc:Point" x="333" y="258" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="292" y="243" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0u41iz2_di" bpmnElement="SequenceFlow_0u41iz2"> - <di:waypoint xsi:type="dc:Point" x="433" y="258" /> - <di:waypoint xsi:type="dc:Point" x="556" y="258" /> - <di:waypoint xsi:type="dc:Point" x="556" y="347" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="495" y="243" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="CallActivity_1x88fsq_di" bpmnElement="CallActivity_1x88fsq"> - <dc:Bounds x="506" y="481" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0p5zgdb_di" bpmnElement="ExclusiveGateway_0p5zgdb" isMarkerVisible="true"> - <dc:Bounds x="531" y="347" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="451" y="360" width="55" height="36" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="TextAnnotation_000ap15_di" bpmnElement="TextAnnotation_000ap15"> - <dc:Bounds x="112" y="355" width="277" height="115" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Association_0ybkmal_di" bpmnElement="Association_0ybkmal"> - <di:waypoint xsi:type="dc:Point" x="349" y="298" /> - <di:waypoint xsi:type="dc:Point" x="300" y="355" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ScriptTask_1ggaxfu_di" bpmnElement="ScriptTask_1ggaxfu"> - <dc:Bounds x="1097" y="332" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="TextAnnotation_0vwyo82_di" bpmnElement="TextAnnotation_0vwyo82"> - <dc:Bounds x="1230" y="448" width="165" height="60" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Association_1gx121b_di" bpmnElement="Association_1gx121b"> - <di:waypoint xsi:type="dc:Point" x="1195" y="404" /> - <di:waypoint xsi:type="dc:Point" x="1264" y="448" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1bb7zpp_di" bpmnElement="SequenceFlow_1bb7zpp"> - <di:waypoint xsi:type="dc:Point" x="581" y="372" /> - <di:waypoint xsi:type="dc:Point" x="711" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="589" y="350.17259171746633" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1mxbdps_di" bpmnElement="SequenceFlow_1mxbdps"> - <di:waypoint xsi:type="dc:Point" x="556" y="397" /> - <di:waypoint xsi:type="dc:Point" x="556" y="481" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="560" y="397.10731155015196" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_07s5r14_di" bpmnElement="SequenceFlow_07s5r14"> - <di:waypoint xsi:type="dc:Point" x="606" y="521" /> - <di:waypoint xsi:type="dc:Point" x="639" y="521" /> - <di:waypoint xsi:type="dc:Point" x="639" y="372" /> - <di:waypoint xsi:type="dc:Point" x="711" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="654" y="446.5" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_1fvr7ad_di" bpmnElement="EndEvent_1fvr7ad"> - <dc:Bounds x="1253" y="252" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1271" y="288" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1eyt8z2_di" bpmnElement="SequenceFlow_1eyt8z2"> - <di:waypoint xsi:type="dc:Point" x="786" y="521" /> - <di:waypoint xsi:type="dc:Point" x="815" y="521" /> - <di:waypoint xsi:type="dc:Point" x="815" y="372" /> - <di:waypoint xsi:type="dc:Point" x="866" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="830" y="446.5" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="SubProcess_1p4663w_di" bpmnElement="SubProcess_1p4663w" isExpanded="true"> - <dc:Bounds x="-6" y="665" width="394" height="188" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_0by1uwk_di" bpmnElement="ScriptTask_0by1uwk"> - <dc:Bounds x="142" y="720" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_1j0eixl_di" bpmnElement="StartEvent_1j0eixl"> - <dc:Bounds x="27" y="742" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="45" y="783" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_0jxh015_di" bpmnElement="EndEvent_0jxh015"> - <dc:Bounds x="303" y="742" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="321" y="783" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0xktw7v_di" bpmnElement="SequenceFlow_0xktw7v"> - <di:waypoint xsi:type="dc:Point" x="63" y="760" /> - <di:waypoint xsi:type="dc:Point" x="142" y="760" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="105" y="760" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0soe5t3_di" bpmnElement="SequenceFlow_0soe5t3"> - <di:waypoint xsi:type="dc:Point" x="242" y="760" /> - <di:waypoint xsi:type="dc:Point" x="303" y="760" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="277" y="760" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="InclusiveGateway_04myanb_di" bpmnElement="ExclusiveGateway_0798yby"> - <dc:Bounds x="1122" y="496" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1147" y="546" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1xs882r_di" bpmnElement="SequenceFlow_1xs882r"> - <di:waypoint xsi:type="dc:Point" x="1147" y="496" /> - <di:waypoint xsi:type="dc:Point" x="1147" y="412" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1162" y="454" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ExclusiveGateway_03d5sol_di" bpmnElement="ExclusiveGateway_03d5sol" isMarkerVisible="true"> - <dc:Bounds x="711" y="347" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="699" y="312" width="74" height="24" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1yj3542_di" bpmnElement="SequenceFlow_1yj3542"> - <di:waypoint xsi:type="dc:Point" x="761" y="372" /> - <di:waypoint xsi:type="dc:Point" x="866" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="774" y="354" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1vx8ti9_di" bpmnElement="ServiceTask_1vx8ti9"> - <dc:Bounds x="686" y="481" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_18e00sw_di" bpmnElement="SequenceFlow_18e00sw"> - <di:waypoint xsi:type="dc:Point" x="736" y="397" /> - <di:waypoint xsi:type="dc:Point" x="736" y="481" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="748" y="394" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ExclusiveGateway_03fn5ks_di" bpmnElement="ExclusiveGateway_03fn5ks" isMarkerVisible="true"> - <dc:Bounds x="866" y="347" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="867" y="310" width="48" height="24" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1ga27si_di" bpmnElement="ExclusiveGateway_1ga27si" isMarkerVisible="true"> - <dc:Bounds x="866" y="496" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="898" y="456" width="82" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1xokvq6_di" bpmnElement="SequenceFlow_1xokvq6"> - <di:waypoint xsi:type="dc:Point" x="916" y="372" /> - <di:waypoint xsi:type="dc:Point" x="1097" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="926" y="353" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_172safw_di" bpmnElement="SequenceFlow_172safw"> - <di:waypoint xsi:type="dc:Point" x="891" y="397" /> - <di:waypoint xsi:type="dc:Point" x="891" y="496" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="898" y="396.5" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1wy1aba_di" bpmnElement="SequenceFlow_1wy1aba"> - <di:waypoint xsi:type="dc:Point" x="891" y="546" /> - <di:waypoint xsi:type="dc:Point" x="891" y="677" /> - <di:waypoint xsi:type="dc:Point" x="955" y="677" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="903" y="541.5" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1yltkyg_di" bpmnElement="SequenceFlow_1yltkyg"> - <di:waypoint xsi:type="dc:Point" x="916" y="521" /> - <di:waypoint xsi:type="dc:Point" x="955" y="521" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="915" y="502" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1hcmrh9_di" bpmnElement="SequenceFlow_1hcmrh9"> - <di:waypoint xsi:type="dc:Point" x="1055" y="521" /> - <di:waypoint xsi:type="dc:Point" x="1122" y="521" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1089" y="506" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1pi168e_di" bpmnElement="SequenceFlow_1pi168e"> - <di:waypoint xsi:type="dc:Point" x="1055" y="677" /> - <di:waypoint xsi:type="dc:Point" x="1147" y="677" /> - <di:waypoint xsi:type="dc:Point" x="1147" y="546" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1101" y="662" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="CallActivity_12rk9t5_di" bpmnElement="Task_1iuumxi"> - <dc:Bounds x="955" y="481" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="CallActivity_0l1dvlv_di" bpmnElement="Task_00chyig"> - <dc:Bounds x="955" y="637" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1ucaagl_di" bpmnElement="SequenceFlow_1ucaagl"> - <di:waypoint xsi:type="dc:Point" x="1147" y="332" /> - <di:waypoint xsi:type="dc:Point" x="1147" y="270" /> - <di:waypoint xsi:type="dc:Point" x="1253" y="270" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1162" y="301" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="SubProcess_02vfqr7_di" bpmnElement="SubProcess_02vfqr7" isExpanded="true"> - <dc:Bounds x="-10" y="898" width="382" height="213" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_0m7hpuj_di" bpmnElement="EndEvent_0m7hpuj"> - <dc:Bounds x="293" y="977" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="311" y="1013" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_0yr3vca_di" bpmnElement="ScriptTask_0yr3vca"> - <dc:Bounds x="120" y="955" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_001ol7f_di" bpmnElement="StartEvent_001ol7f"> - <dc:Bounds x="20" y="977" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="38" y="1013" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1s5yjuu_di" bpmnElement="SequenceFlow_1s5yjuu"> - <di:waypoint xsi:type="dc:Point" x="220" y="995" /> - <di:waypoint xsi:type="dc:Point" x="293" y="995" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="257" y="970" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_01hh1wq_di" bpmnElement="SequenceFlow_01hh1wq"> - <di:waypoint xsi:type="dc:Point" x="56" y="995" /> - <di:waypoint xsi:type="dc:Point" x="120" y="995" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="88" y="980" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="BoundaryEvent_10qmjw0_di" bpmnElement="BoundaryEvent_1mrkh9x"> - <dc:Bounds x="588" y="543" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="606" y="579" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="BoundaryEvent_1n1s1n0_di" bpmnElement="BoundaryEvent_16cracu"> - <dc:Bounds x="668" y="543" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="686" y="579" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_141226w_di" bpmnElement="SequenceFlow_141226w"> - <di:waypoint xsi:type="dc:Point" x="677" y="577" /> - <di:waypoint xsi:type="dc:Point" x="655" y="613" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="666" y="580" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0b0m3o7_di" bpmnElement="SequenceFlow_0b0m3o7"> - <di:waypoint xsi:type="dc:Point" x="615" y="576" /> - <di:waypoint xsi:type="dc:Point" x="637" y="614" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="626" y="580" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_0yeci14_di" bpmnElement="EndEvent_00y9o8y"> - <dc:Bounds x="628" y="611" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="646" y="647" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="BoundaryEvent_10psbey_di" bpmnElement="BoundaryEvent_1gk4tem"> - <dc:Bounds x="1037" y="543" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1055" y="579" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="BoundaryEvent_0wka4xd_di" bpmnElement="BoundaryEvent_1qaz277"> - <dc:Bounds x="1037" y="619" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1055" y="655" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_0c33uj0_di" bpmnElement="EndEvent_1qfbudr"> - <dc:Bounds x="1089" y="587" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1107" y="623" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1lr1613_di" bpmnElement="SequenceFlow_1lr1613"> - <di:waypoint xsi:type="dc:Point" x="1068" y="572" /> - <di:waypoint xsi:type="dc:Point" x="1094" y="594" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1081" y="568" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0np0b8p_di" bpmnElement="SequenceFlow_0np0b8p"> - <di:waypoint xsi:type="dc:Point" x="1070" y="628" /> - <di:waypoint xsi:type="dc:Point" x="1092" y="614" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1081" y="606" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions>
\ No newline at end of file diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModule.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModule.bpmn index 6026fc84b3..e08ffbde2f 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModule.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModule.bpmn @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoDeleteVfModule" name="DoDeleteVfModule" isExecutable="true"> <bpmn2:scriptTask id="UpdateAAIVfModulePrep" name="UpdateAAIVfModule
Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0fp1wqz</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_28</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.prepUpdateAAIVfModule(execution)]]></bpmn2:script> +dvm.prepUpdateAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_28" name="" sourceRef="UpdateAAIVfModulePrep" targetRef="InvokeUpdateAAIVfModule" /> <bpmn2:callActivity id="InvokeUpdateAAIVfModule" name="Invoke
UpdateAAIVfModule" calledElement="UpdateAAIVfModule"> @@ -30,7 +30,7 @@ dvm.prepUpdateAAIVfModule(execution)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_029ioyr</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14xn858</bpmn2:outgoing> </bpmn2:callActivity> - <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="VNFAdapterPrep" targetRef="InvokeVNFAdapterTask" /> + <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="VNFAdapterPrep" targetRef="InvokeopenstackAdapterTask" /> <bpmn2:callActivity id="InvokeSDNCAdapterV1_2" name="Invoke
SDNCAdapterV1" calledElement="sdncAdapter"> <bpmn2:extensionElements> <camunda:out source="WorkflowException" target="WorkflowException" /> @@ -48,22 +48,22 @@ dvm.prepUpdateAAIVfModule(execution)]]></bpmn2:script> <bpmn2:scriptTask id="VNFAdapterPrep" name="VNFAdapter
Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_14xn858</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.prepVNFAdapterRequest(execution)]]></bpmn2:script> +dvm.prepVNFAdapterRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="SDNCAdapterPrep2" name="SDNCAdapter
Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_31</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.prepSDNCAdapterRequest(execution, "delete")]]></bpmn2:script> +dvm.prepSDNCAdapterRequest(execution, "delete")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_32" name="" sourceRef="SDNCAdapterPrep2" targetRef="InvokeSDNCAdapterV1_2" /> - <bpmn2:callActivity id="InvokeVNFAdapterTask" name="Invoke VNFAdapterTask" calledElement="vnfAdapterTask"> + <bpmn2:callActivity id="InvokeopenstackAdapterTask" name="Invoke openstackAdapterTask" calledElement="openstackAdapterTask"> <bpmn2:extensionElements> <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:in source="vnfAdapterTaskRequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="vnfAdapterTaskRequest" target="openstackAdapterTaskRequest" /> <camunda:out source="WorkflowResponse" target="DoDVfMod_doDeleteVfModuleResponse" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> @@ -88,33 +88,33 @@ dvm.prepSDNCAdapterRequest(execution, "delete")]]></bpmn2:script> <bpmn2:scriptTask id="DeleteAAIVfModulePrep" name="DeleteAAIVfModule
Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_34</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.prepDeleteAAIVfModule(execution)]]></bpmn2:script> +dvm.prepDeleteAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_34" name="" sourceRef="DeleteAAIVfModulePrep" targetRef="InvokeDeleteAAIVfModule" /> <bpmn2:scriptTask id="validateSDNCResponse" name="Validate SDNC Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_33</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.sdncValidateResponse(execution, DoDVfMod_doDeleteVfModuleResponse)]]></bpmn2:script> +dvm.sdncValidateResponse(execution, DoDVfMod_doDeleteVfModuleResponse)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="validateSDNCResponse" targetRef="DeleteAAIVfModulePrep" /> <bpmn2:scriptTask id="InitializeVariables" name="Initialize Variables" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.preProcessRequest(execution)]]></bpmn2:script> +dvm.preProcessRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_12" name="" sourceRef="InitializeVariables" targetRef="PrepareUpdateAAIVfModulePrep" /> <bpmn2:scriptTask id="PrepareUpdateAAIVfModulePrep" name="PrepareUpdateAAIVfModule Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_42</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.preProcessRequest(execution)]]></bpmn2:script> +dvm.preProcessRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_42" name="" sourceRef="PrepareUpdateAAIVfModulePrep" targetRef="Task_0h2lui6" /> <bpmn2:startEvent id="StartEvent_1"> @@ -125,16 +125,16 @@ dvm.preProcessRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="DeleteNetworkPoliciesFromAAI" name="Delete Network Policies from AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0coa90m</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_08g02ch</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.deleteNetworkPoliciesFromAAI(execution)]]></bpmn2:script> +dvm.deleteNetworkPoliciesFromAAI(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="PostProcessVNFAdapterRequest" name="PostProcess VNFAdapter Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1xruki1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0coa90m</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.postProcessVNFAdapterRequest(execution)]]></bpmn2:script> +dvm.postProcessVNFAdapterRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_0coa90m" sourceRef="PostProcessVNFAdapterRequest" targetRef="DeleteNetworkPoliciesFromAAI" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_1drlnlk" name="need to update VNF in AAI?" default="SequenceFlow_0ep3hjm"> @@ -144,7 +144,7 @@ dvm.postProcessVNFAdapterRequest(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_08g02ch" sourceRef="DeleteNetworkPoliciesFromAAI" targetRef="ExclusiveGateway_1drlnlk" /> <bpmn2:sequenceFlow id="SequenceFlow_1yehsyc" name="yes" sourceRef="ExclusiveGateway_1drlnlk" targetRef="PreProcessUpdateAAIGenericVnf"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DoDVfMod_oamManagementV4Address") != null || execution.getVariable("DoDVfMod_oamManagementV6Address") != null]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DoDVfMod_oamManagementV4Address") != null || execution.getVariable("DoDVfMod_oamManagementV6Address") != null</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_1a7lzhz" sourceRef="PreProcessUpdateAAIGenericVnf" targetRef="UpdateAAIGenericVnfTask" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_0lsru7z"> @@ -158,9 +158,9 @@ dvm.postProcessVNFAdapterRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="PreProcessUpdateAAIGenericVnf" name="PreProcess Update AAI Generic VNF" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1yehsyc</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1a7lzhz</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doDeleteVfModule = new DoDeleteVfModule() -doDeleteVfModule.prepUpdateAAIGenericVnf(execution)]]></bpmn2:script> +doDeleteVfModule.prepUpdateAAIGenericVnf(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="UpdateAAIGenericVnfTask" name="Update AAI Generic VNF" calledElement="UpdateAAIGenericVnf"> <bpmn2:extensionElements> @@ -177,11 +177,11 @@ doDeleteVfModule.prepUpdateAAIGenericVnf(execution)]]></bpmn2:script> <bpmn2:scriptTask id="Task_0h2lui6" name="Query AAI for Orchestration Status" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_42</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_029ioyr</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def dvm = new DoDeleteVfModule() -dvm.queryAAIVfModuleForStatus(execution)]]></bpmn2:script> +dvm.queryAAIVfModuleForStatus(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_1xruki1" sourceRef="InvokeVNFAdapterTask" targetRef="PostProcessVNFAdapterRequest" /> + <bpmn2:sequenceFlow id="SequenceFlow_1xruki1" sourceRef="InvokeopenstackAdapterTask" targetRef="PostProcessVNFAdapterRequest" /> <bpmn2:sequenceFlow id="SequenceFlow_14xn858" sourceRef="InvokePrepareUpdateAAIVfModule" targetRef="VNFAdapterPrep" /> </bpmn2:process> <bpmn2:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> @@ -189,240 +189,240 @@ dvm.queryAAIVfModuleForStatus(execution)]]></bpmn2:script> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeleteVfModule"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_37" bpmnElement="StartEvent_1"> - <dc:Bounds x="34" y="57" width="36" height="36" /> + <dc:Bounds x="154" y="107" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="52" y="98" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_22" bpmnElement="InitializeVariables"> - <dc:Bounds x="144" y="36" width="100" height="80" /> + <dc:Bounds x="264" y="86" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_37" targetElement="_BPMNShape_ScriptTask_22"> - <di:waypoint xsi:type="dc:Point" x="70" y="75" /> - <di:waypoint xsi:type="dc:Point" x="144" y="76" /> + <di:waypoint x="190" y="125" /> + <di:waypoint x="264" y="126" /> <bpmndi:BPMNLabel> <dc:Bounds x="104" y="0" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_160" bpmnElement="InvokePrepareUpdateAAIVfModule"> - <dc:Bounds x="647" y="36" width="100" height="80" /> + <dc:Bounds x="767" y="86" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_168" bpmnElement="PrepareUpdateAAIVfModulePrep"> - <dc:Bounds x="315" y="36" width="100" height="80" /> + <dc:Bounds x="435" y="86" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_ScriptTask_22" targetElement="_BPMNShape_ScriptTask_168"> - <di:waypoint xsi:type="dc:Point" x="244" y="76" /> - <di:waypoint xsi:type="dc:Point" x="315" y="76" /> + <di:waypoint x="364" y="126" /> + <di:waypoint x="435" y="126" /> <bpmndi:BPMNLabel> <dc:Bounds x="269" y="0" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_170" bpmnElement="VNFAdapterPrep"> - <dc:Bounds x="193" y="206" width="100" height="80" /> + <dc:Bounds x="313" y="256" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_CallActivity_13" bpmnElement="InvokeVNFAdapterTask"> - <dc:Bounds x="404" y="206" width="100" height="80" /> + <bpmndi:BPMNShape id="_BPMNShape_CallActivity_13" bpmnElement="InvokeopenstackAdapterTask"> + <dc:Bounds x="524" y="256" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_171" bpmnElement="UpdateAAIVfModulePrep"> - <dc:Bounds x="844" y="385" width="100" height="80" /> + <dc:Bounds x="964" y="435" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_14" bpmnElement="InvokeUpdateAAIVfModule"> - <dc:Bounds x="995" y="385" width="100" height="80" /> + <dc:Bounds x="1115" y="435" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_28" sourceElement="_BPMNShape_ScriptTask_171" targetElement="_BPMNShape_CallActivity_14"> - <di:waypoint xsi:type="dc:Point" x="944" y="425" /> - <di:waypoint xsi:type="dc:Point" x="995" y="425" /> + <di:waypoint x="1064" y="475" /> + <di:waypoint x="1115" y="475" /> <bpmndi:BPMNLabel> <dc:Bounds x="970" y="410" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_172" bpmnElement="SDNCAdapterPrep2"> - <dc:Bounds x="140" y="665" width="100" height="80" /> + <dc:Bounds x="260" y="715" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_15" bpmnElement="InvokeSDNCAdapterV1_2"> - <dc:Bounds x="272" y="665" width="100" height="80" /> + <dc:Bounds x="392" y="715" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_173" bpmnElement="DeleteAAIVfModulePrep"> - <dc:Bounds x="547" y="665" width="100" height="80" /> + <dc:Bounds x="667" y="715" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_16" bpmnElement="InvokeDeleteAAIVfModule"> - <dc:Bounds x="690" y="665" width="100" height="80" /> + <dc:Bounds x="810" y="715" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_31" bpmnElement="SequenceFlow_31" sourceElement="_BPMNShape_CallActivity_14" targetElement="_BPMNShape_ScriptTask_172"> - <di:waypoint xsi:type="dc:Point" x="1045" y="465" /> - <di:waypoint xsi:type="dc:Point" x="1045" y="603" /> - <di:waypoint xsi:type="dc:Point" x="70" y="603" /> - <di:waypoint xsi:type="dc:Point" x="70" y="705" /> - <di:waypoint xsi:type="dc:Point" x="140" y="705" /> + <di:waypoint x="1165" y="515" /> + <di:waypoint x="1165" y="653" /> + <di:waypoint x="190" y="653" /> + <di:waypoint x="190" y="755" /> + <di:waypoint x="260" y="755" /> <bpmndi:BPMNLabel> <dc:Bounds x="558" y="588" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_32" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ScriptTask_172" targetElement="_BPMNShape_CallActivity_15"> - <di:waypoint xsi:type="dc:Point" x="240" y="705" /> - <di:waypoint xsi:type="dc:Point" x="256" y="705" /> - <di:waypoint xsi:type="dc:Point" x="256" y="706" /> - <di:waypoint xsi:type="dc:Point" x="272" y="706" /> + <di:waypoint x="360" y="755" /> + <di:waypoint x="376" y="755" /> + <di:waypoint x="376" y="756" /> + <di:waypoint x="392" y="756" /> <bpmndi:BPMNLabel> <dc:Bounds x="268" y="558" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_33" bpmnElement="SequenceFlow_33" sourceElement="_BPMNShape_CallActivity_15" targetElement="_BPMNShape_ScriptTask_251"> - <di:waypoint xsi:type="dc:Point" x="372" y="705" /> - <di:waypoint xsi:type="dc:Point" x="404" y="705" /> + <di:waypoint x="492" y="755" /> + <di:waypoint x="524" y="755" /> <bpmndi:BPMNLabel> <dc:Bounds x="388" y="705" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_34" bpmnElement="SequenceFlow_34" sourceElement="_BPMNShape_ScriptTask_173" targetElement="_BPMNShape_CallActivity_16"> - <di:waypoint xsi:type="dc:Point" x="647" y="705" /> - <di:waypoint xsi:type="dc:Point" x="690" y="705" /> + <di:waypoint x="767" y="755" /> + <di:waypoint x="810" y="755" /> <bpmndi:BPMNLabel> <dc:Bounds x="669" y="690" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_169" bpmnElement="EndEvent_9"> - <dc:Bounds x="836" y="687" width="36" height="36" /> + <dc:Bounds x="956" y="737" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="854" y="728" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_CallActivity_16" targetElement="_BPMNShape_EndEvent_169"> - <di:waypoint xsi:type="dc:Point" x="790" y="705" /> - <di:waypoint xsi:type="dc:Point" x="836" y="705" /> + <di:waypoint x="910" y="755" /> + <di:waypoint x="956" y="755" /> <bpmndi:BPMNLabel> <dc:Bounds x="813" y="690" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_42" bpmnElement="SequenceFlow_42" sourceElement="_BPMNShape_ScriptTask_168" targetElement="_BPMNShape_ScriptTask_160"> - <di:waypoint xsi:type="dc:Point" x="415" y="76" /> - <di:waypoint xsi:type="dc:Point" x="483" y="76" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_42" bpmnElement="SequenceFlow_42" sourceElement="_BPMNShape_ScriptTask_168" targetElement="ScriptTask_15vzlxw_di"> + <di:waypoint x="535" y="126" /> + <di:waypoint x="603" y="126" /> <bpmndi:BPMNLabel> <dc:Bounds x="449" y="61" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ScriptTask_160" targetElement="_BPMNShape_ScriptTask_170"> - <di:waypoint xsi:type="dc:Point" x="293" y="246" /> - <di:waypoint xsi:type="dc:Point" x="404" y="246" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ScriptTask_170" targetElement="_BPMNShape_CallActivity_13"> + <di:waypoint x="413" y="296" /> + <di:waypoint x="524" y="296" /> <bpmndi:BPMNLabel> <dc:Bounds x="349" y="231" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_251" bpmnElement="validateSDNCResponse"> - <dc:Bounds x="404" y="665" width="100" height="80" /> + <dc:Bounds x="524" y="715" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_251" targetElement="_BPMNShape_ScriptTask_173"> - <di:waypoint xsi:type="dc:Point" x="504" y="705" /> - <di:waypoint xsi:type="dc:Point" x="547" y="705" /> + <di:waypoint x="624" y="755" /> + <di:waypoint x="667" y="755" /> <bpmndi:BPMNLabel> <dc:Bounds x="526" y="690" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0la8haz_di" bpmnElement="DeleteNetworkPoliciesFromAAI"> - <dc:Bounds x="202" y="385" width="100" height="80" /> + <dc:Bounds x="322" y="435" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0lewl6b_di" bpmnElement="PostProcessVNFAdapterRequest"> - <dc:Bounds x="620" y="206" width="100" height="80" /> + <dc:Bounds x="740" y="256" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0coa90m_di" bpmnElement="SequenceFlow_0coa90m"> - <di:waypoint xsi:type="dc:Point" x="720" y="246" /> - <di:waypoint xsi:type="dc:Point" x="923" y="246" /> - <di:waypoint xsi:type="dc:Point" x="923" y="333" /> - <di:waypoint xsi:type="dc:Point" x="76" y="333" /> - <di:waypoint xsi:type="dc:Point" x="76" y="425" /> - <di:waypoint xsi:type="dc:Point" x="202" y="425" /> + <di:waypoint x="840" y="296" /> + <di:waypoint x="1043" y="296" /> + <di:waypoint x="1043" y="383" /> + <di:waypoint x="196" y="383" /> + <di:waypoint x="196" y="475" /> + <di:waypoint x="322" y="475" /> <bpmndi:BPMNLabel> <dc:Bounds x="500" y="318" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1drlnlk_di" bpmnElement="ExclusiveGateway_1drlnlk" isMarkerVisible="true"> - <dc:Bounds x="415" y="400" width="50" height="50" /> + <dc:Bounds x="535" y="450" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="402" y="362" width="75" height="24" /> + <dc:Bounds x="523" y="412" width="74" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_08g02ch_di" bpmnElement="SequenceFlow_08g02ch"> - <di:waypoint xsi:type="dc:Point" x="302" y="425" /> - <di:waypoint xsi:type="dc:Point" x="415" y="425" /> + <di:waypoint x="422" y="475" /> + <di:waypoint x="535" y="475" /> <bpmndi:BPMNLabel> <dc:Bounds x="359" y="410" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1yehsyc_di" bpmnElement="SequenceFlow_1yehsyc"> - <di:waypoint xsi:type="dc:Point" x="440" y="450" /> - <di:waypoint xsi:type="dc:Point" x="440" y="517" /> - <di:waypoint xsi:type="dc:Point" x="477" y="517" /> + <di:waypoint x="560" y="500" /> + <di:waypoint x="560" y="567" /> + <di:waypoint x="597" y="567" /> <bpmndi:BPMNLabel> - <dc:Bounds x="406" y="473" width="18" height="12" /> + <dc:Bounds x="527" y="523" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1a7lzhz_di" bpmnElement="SequenceFlow_1a7lzhz"> - <di:waypoint xsi:type="dc:Point" x="577" y="517" /> - <di:waypoint xsi:type="dc:Point" x="624" y="517" /> - <di:waypoint xsi:type="dc:Point" x="624" y="517" /> - <di:waypoint xsi:type="dc:Point" x="654" y="517" /> + <di:waypoint x="697" y="567" /> + <di:waypoint x="744" y="567" /> + <di:waypoint x="744" y="567" /> + <di:waypoint x="774" y="567" /> <bpmndi:BPMNLabel> <dc:Bounds x="639" y="517" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_0lsru7z_di" bpmnElement="ExclusiveGateway_0lsru7z" isMarkerVisible="true"> - <dc:Bounds x="759" y="400" width="50" height="50" /> + <dc:Bounds x="879" y="450" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="784" y="450" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0ep3hjm_di" bpmnElement="SequenceFlow_0ep3hjm"> - <di:waypoint xsi:type="dc:Point" x="465" y="425" /> - <di:waypoint xsi:type="dc:Point" x="759" y="425" /> + <di:waypoint x="585" y="475" /> + <di:waypoint x="879" y="475" /> <bpmndi:BPMNLabel> - <dc:Bounds x="606" y="400" width="12" height="12" /> + <dc:Bounds x="726" y="450" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_14l7olw_di" bpmnElement="SequenceFlow_14l7olw"> - <di:waypoint xsi:type="dc:Point" x="754" y="517" /> - <di:waypoint xsi:type="dc:Point" x="784" y="517" /> - <di:waypoint xsi:type="dc:Point" x="784" y="450" /> + <di:waypoint x="874" y="567" /> + <di:waypoint x="904" y="567" /> + <di:waypoint x="904" y="500" /> <bpmndi:BPMNLabel> <dc:Bounds x="769" y="502" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0fp1wqz_di" bpmnElement="SequenceFlow_0fp1wqz"> - <di:waypoint xsi:type="dc:Point" x="809" y="425" /> - <di:waypoint xsi:type="dc:Point" x="844" y="425" /> + <di:waypoint x="929" y="475" /> + <di:waypoint x="964" y="475" /> <bpmndi:BPMNLabel> <dc:Bounds x="827" y="400" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_18y0guc_di" bpmnElement="PreProcessUpdateAAIGenericVnf"> - <dc:Bounds x="477" y="477" width="100" height="80" /> + <dc:Bounds x="597" y="527" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0kbqf50_di" bpmnElement="UpdateAAIGenericVnfTask"> - <dc:Bounds x="654" y="477" width="100" height="80" /> + <dc:Bounds x="774" y="527" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_029ioyr_di" bpmnElement="SequenceFlow_029ioyr"> - <di:waypoint xsi:type="dc:Point" x="583" y="76" /> - <di:waypoint xsi:type="dc:Point" x="647" y="76" /> + <di:waypoint x="703" y="126" /> + <di:waypoint x="767" y="126" /> <bpmndi:BPMNLabel> <dc:Bounds x="615" y="61" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_15vzlxw_di" bpmnElement="Task_0h2lui6"> - <dc:Bounds x="483" y="36" width="100" height="80" /> + <dc:Bounds x="603" y="86" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1xruki1_di" bpmnElement="SequenceFlow_1xruki1"> - <di:waypoint xsi:type="dc:Point" x="504" y="246" /> - <di:waypoint xsi:type="dc:Point" x="620" y="246" /> + <di:waypoint x="624" y="296" /> + <di:waypoint x="740" y="296" /> <bpmndi:BPMNLabel> <dc:Bounds x="562" y="231" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_14xn858_di" bpmnElement="SequenceFlow_14xn858"> - <di:waypoint xsi:type="dc:Point" x="747" y="76" /> - <di:waypoint xsi:type="dc:Point" x="914" y="76" /> - <di:waypoint xsi:type="dc:Point" x="914" y="154" /> - <di:waypoint xsi:type="dc:Point" x="71" y="154" /> - <di:waypoint xsi:type="dc:Point" x="71" y="246" /> - <di:waypoint xsi:type="dc:Point" x="193" y="246" /> + <di:waypoint x="867" y="126" /> + <di:waypoint x="1034" y="126" /> + <di:waypoint x="1034" y="204" /> + <di:waypoint x="191" y="204" /> + <di:waypoint x="191" y="296" /> + <di:waypoint x="313" y="296" /> <bpmndi:BPMNLabel> <dc:Bounds x="493" y="139" width="0" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModuleFromVnf.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModuleFromVnf.bpmn index 918964f8f8..2dcf79ec8b 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModuleFromVnf.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModuleFromVnf.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoDeleteVfModuleFromVnf" name="DoDeleteVfModuleFromVnf" isExecutable="true"> <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="VNFAdapterPrep" targetRef="InvokeVNFAdapter" /> <bpmn2:callActivity id="callSDNCAdapterTopologyUnassign" name="Call SDNC Adapter Topology Unassign" calledElement="sdncAdapter"> @@ -19,22 +19,22 @@ <bpmn2:scriptTask id="VNFAdapterPrep" name="VNFAdapter
Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0kx9e3s</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.prepVNFAdapterRequest(execution)]]></bpmn2:script> +ddvmfv.prepVNFAdapterRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="SDNCAdapterPrep2" name="SDNCAdapter
Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0ltm4jt</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.preProcessSDNCUnassignRequest(execution)]]></bpmn2:script> +ddvmfv.preProcessSDNCUnassignRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_32" name="" sourceRef="SDNCAdapterPrep2" targetRef="callSDNCAdapterTopologyUnassign" /> - <bpmn2:callActivity id="InvokeVNFAdapter" name="Invoke VNFAdapter" calledElement="vnfAdapterTask"> + <bpmn2:callActivity id="InvokeVNFAdapter" name="Invoke VNFAdapter" calledElement="openstackAdapterTask"> <bpmn2:extensionElements> <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:in source="vnfAdapterTaskRequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="vnfAdapterTaskRequest" target="openstackAdapterTaskRequest" /> <camunda:out source="WorkflowResponse" target="DDVMFV_doDeleteVfModuleResponse" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> @@ -48,33 +48,33 @@ ddvmfv.preProcessSDNCUnassignRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="validateSDNCResponse" name="PostProcess SDNC Adapter Unassign Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_33</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() String response = execution.getVariable("DDVMFV_deactivateSDNCAdapterResponse") -ddvmfv.validateSDNCResponse(execution, response, "unassign")]]></bpmn2:script> +ddvmfv.validateSDNCResponse(execution, response, "unassign")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="validateSDNCResponse" targetRef="DeleteAAIVfModulePrep" /> <bpmn2:scriptTask id="InitializeVariables" name="Initialize Variables" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0qbjihn</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.preProcessRequest(execution)]]></bpmn2:script> +ddvmfv.preProcessRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="InitializeVariables" /> <bpmn2:scriptTask id="DeleteNetworkPoliciesFromAAI" name="Delete Network Policies from AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0coa90m</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0ltm4jt</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.deleteNetworkPoliciesFromAAI(execution)]]></bpmn2:script> +ddvmfv.deleteNetworkPoliciesFromAAI(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="PostProcessVNFAdapterRequest" name="PostProcess VNFAdapter Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0hia88a</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0coa90m</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.postProcessVNFAdapterRequest(execution)]]></bpmn2:script> +ddvmfv.postProcessVNFAdapterRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_0coa90m" sourceRef="PostProcessVNFAdapterRequest" targetRef="DeleteNetworkPoliciesFromAAI" /> <bpmn2:startEvent id="StartEvent_1"> @@ -88,9 +88,9 @@ ddvmfv.postProcessVNFAdapterRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="preProcessSDNCDeactivateRequest" name="PreProcess SDNC Deactivate Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1igsfgk</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0y4td40</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.preProcessSDNCDeactivateRequest(execution)]]></bpmn2:script> +ddvmfv.preProcessSDNCDeactivateRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="callSDNCAdapterTopologyDeactivate" name="Call SDNC Adapter Topology Deactivate" calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -108,27 +108,27 @@ ddvmfv.preProcessSDNCDeactivateRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="postProcessSDNCDeactivateRequest" name="PostProcess SDNC Adapter Deactivate Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_12q2r4i</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0kx9e3s</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() String response = execution.getVariable("DDVMFV_deactivateSDNCAdapterResponse") -ddvmfv.validateSDNCResponse(execution, response, "deactivate")]]></bpmn2:script> +ddvmfv.validateSDNCResponse(execution, response, "deactivate")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_0qbjihn" sourceRef="InitializeVariables" targetRef="QueryAAIForVfModule" /> <bpmn2:sequenceFlow id="SequenceFlow_1c2lvlc" sourceRef="QueryAAIForVfModule" targetRef="ValidateVfModule" /> <bpmn2:scriptTask id="QueryAAIForVfModule" name="Query AAI for VF Module" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0qbjihn</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1c2lvlc</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.queryAAIForVfModule(execution)]]></bpmn2:script> +ddvmfv.queryAAIForVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1igsfgk" sourceRef="ValidateVfModule" targetRef="preProcessSDNCDeactivateRequest" /> <bpmn2:scriptTask id="ValidateVfModule" name="Validate VF Module" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1c2lvlc</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1igsfgk</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.validateVfModule(execution)]]></bpmn2:script> +ddvmfv.validateVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:subProcess id="SubProcess_1r8unf9" name="Sub-process for UnexpectedErrors" triggeredByEvent="true"> <bpmn2:startEvent id="StartEvent_1ebrix6"> @@ -141,9 +141,9 @@ ddvmfv.validateVfModule(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_1ypch9x" name="Log / Print Unexpected Error" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_095634c</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0yvjvhu</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* + <bpmn2:script>import org.onap.so.bpmn.common.scripts.* ExceptionUtil ex = new ExceptionUtil() -ex.processJavaException(execution)]]></bpmn2:script> +ex.processJavaException(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_095634c" name="" sourceRef="StartEvent_1ebrix6" targetRef="ScriptTask_1ypch9x" /> <bpmn2:sequenceFlow id="SequenceFlow_0yvjvhu" name="" sourceRef="ScriptTask_1ypch9x" targetRef="EndEvent_0yb2lmo" /> @@ -161,9 +161,9 @@ ex.processJavaException(execution)]]></bpmn2:script> <bpmn2:scriptTask id="DeleteAAIVfModulePrep" name="DeleteAAIVfModule
Prep" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_092kvy3</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def ddvmfv = new DoDeleteVfModuleFromVnf() -ddvmfv.prepDeleteAAIVfModule(execution)]]></bpmn2:script> +ddvmfv.prepDeleteAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_092kvy3" name="" sourceRef="DeleteAAIVfModulePrep" targetRef="DeleteAAIVfModule" /> <bpmn2:sequenceFlow id="SequenceFlow_1eemrjp" sourceRef="DeleteAAIVfModule" targetRef="EndEvent_9" /> @@ -174,218 +174,218 @@ ddvmfv.prepDeleteAAIVfModule(execution)]]></bpmn2:script> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeleteVfModuleFromVnf"> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_22" bpmnElement="InitializeVariables"> - <dc:Bounds x="144" y="36" width="100" height="80" /> + <dc:Bounds x="264" y="86" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" targetElement="_BPMNShape_ScriptTask_22"> - <di:waypoint xsi:type="dc:Point" x="70" y="75" /> - <di:waypoint xsi:type="dc:Point" x="144" y="76" /> + <di:waypoint x="190" y="125" /> + <di:waypoint x="264" y="126" /> <bpmndi:BPMNLabel> <dc:Bounds x="107" y="60.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_170" bpmnElement="VNFAdapterPrep"> - <dc:Bounds x="125" y="330" width="100" height="80" /> + <dc:Bounds x="245" y="380" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_13" bpmnElement="InvokeVNFAdapter"> - <dc:Bounds x="281" y="330" width="100" height="80" /> + <dc:Bounds x="401" y="380" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_172" bpmnElement="SDNCAdapterPrep2"> - <dc:Bounds x="129" y="487" width="100" height="80" /> + <dc:Bounds x="249" y="537" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_15" bpmnElement="callSDNCAdapterTopologyUnassign"> - <dc:Bounds x="281" y="487" width="100" height="80" /> + <dc:Bounds x="401" y="537" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_32" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ScriptTask_172" targetElement="_BPMNShape_CallActivity_15"> - <di:waypoint xsi:type="dc:Point" x="229" y="527" /> - <di:waypoint xsi:type="dc:Point" x="281" y="528" /> + <di:waypoint x="349" y="577" /> + <di:waypoint x="401" y="578" /> <bpmndi:BPMNLabel> <dc:Bounds x="255" y="512.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_33" bpmnElement="SequenceFlow_33" sourceElement="_BPMNShape_CallActivity_15" targetElement="_BPMNShape_ScriptTask_251"> - <di:waypoint xsi:type="dc:Point" x="381" y="527" /> - <di:waypoint xsi:type="dc:Point" x="425" y="527" /> + <di:waypoint x="501" y="577" /> + <di:waypoint x="545" y="577" /> <bpmndi:BPMNLabel> <dc:Bounds x="403" y="512" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_169" bpmnElement="EndEvent_9"> - <dc:Bounds x="873" y="509" width="36" height="36" /> + <dc:Bounds x="993" y="559" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="891" y="550" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_4" targetElement="_BPMNShape_ScriptTask_170"> - <di:waypoint xsi:type="dc:Point" x="225" y="370" /> - <di:waypoint xsi:type="dc:Point" x="281" y="370" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_4" targetElement="_BPMNShape_CallActivity_13"> + <di:waypoint x="345" y="420" /> + <di:waypoint x="401" y="420" /> <bpmndi:BPMNLabel> <dc:Bounds x="253" y="355" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_251" bpmnElement="validateSDNCResponse"> - <dc:Bounds x="425" y="487" width="100" height="80" /> + <dc:Bounds x="545" y="537" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_251"> - <di:waypoint xsi:type="dc:Point" x="525" y="527" /> - <di:waypoint xsi:type="dc:Point" x="548" y="527" /> - <di:waypoint xsi:type="dc:Point" x="548" y="527" /> - <di:waypoint xsi:type="dc:Point" x="570" y="527" /> + <di:waypoint x="645" y="577" /> + <di:waypoint x="668" y="577" /> + <di:waypoint x="668" y="577" /> + <di:waypoint x="690" y="577" /> <bpmndi:BPMNLabel> <dc:Bounds x="563" y="527" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0la8haz_di" bpmnElement="DeleteNetworkPoliciesFromAAI"> - <dc:Bounds x="581" y="330" width="100" height="80" /> + <dc:Bounds x="701" y="380" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0lewl6b_di" bpmnElement="PostProcessVNFAdapterRequest"> - <dc:Bounds x="430" y="330" width="100" height="80" /> + <dc:Bounds x="550" y="380" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0coa90m_di" bpmnElement="SequenceFlow_0coa90m"> - <di:waypoint xsi:type="dc:Point" x="530" y="370" /> - <di:waypoint xsi:type="dc:Point" x="581" y="370" /> + <di:waypoint x="650" y="420" /> + <di:waypoint x="701" y="420" /> <bpmndi:BPMNLabel> <dc:Bounds x="556" y="355" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="StartEvent_1mifg2p_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="34" y="57" width="36" height="36" /> + <dc:Bounds x="154" y="107" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="52" y="98" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0y4td40_di" bpmnElement="SequenceFlow_0y4td40"> - <di:waypoint xsi:type="dc:Point" x="268" y="219" /> - <di:waypoint xsi:type="dc:Point" x="288" y="219" /> - <di:waypoint xsi:type="dc:Point" x="288" y="219" /> - <di:waypoint xsi:type="dc:Point" x="316" y="219" /> + <di:waypoint x="388" y="269" /> + <di:waypoint x="408" y="269" /> + <di:waypoint x="408" y="269" /> + <di:waypoint x="436" y="269" /> <bpmndi:BPMNLabel> <dc:Bounds x="303" y="219" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_12q2r4i_di" bpmnElement="SequenceFlow_12q2r4i"> - <di:waypoint xsi:type="dc:Point" x="416" y="219" /> - <di:waypoint xsi:type="dc:Point" x="464" y="219" /> + <di:waypoint x="536" y="269" /> + <di:waypoint x="584" y="269" /> <bpmndi:BPMNLabel> <dc:Bounds x="440" y="204" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0hia88a_di" bpmnElement="SequenceFlow_0hia88a"> - <di:waypoint xsi:type="dc:Point" x="381" y="370" /> - <di:waypoint xsi:type="dc:Point" x="430" y="370" /> + <di:waypoint x="501" y="420" /> + <di:waypoint x="550" y="420" /> <bpmndi:BPMNLabel> <dc:Bounds x="406" y="345" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0kx9e3s_di" bpmnElement="SequenceFlow_0kx9e3s"> - <di:waypoint xsi:type="dc:Point" x="564" y="219" /> - <di:waypoint xsi:type="dc:Point" x="763" y="219" /> - <di:waypoint xsi:type="dc:Point" x="763" y="293" /> - <di:waypoint xsi:type="dc:Point" x="39" y="293" /> - <di:waypoint xsi:type="dc:Point" x="39" y="370" /> - <di:waypoint xsi:type="dc:Point" x="125" y="370" /> + <di:waypoint x="684" y="269" /> + <di:waypoint x="883" y="269" /> + <di:waypoint x="883" y="343" /> + <di:waypoint x="159" y="343" /> + <di:waypoint x="159" y="420" /> + <di:waypoint x="245" y="420" /> <bpmndi:BPMNLabel> <dc:Bounds x="401" y="278" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0ltm4jt_di" bpmnElement="SequenceFlow_0ltm4jt"> - <di:waypoint xsi:type="dc:Point" x="681" y="370" /> - <di:waypoint xsi:type="dc:Point" x="759" y="370" /> - <di:waypoint xsi:type="dc:Point" x="759" y="442" /> - <di:waypoint xsi:type="dc:Point" x="51" y="442" /> - <di:waypoint xsi:type="dc:Point" x="51" y="527" /> - <di:waypoint xsi:type="dc:Point" x="129" y="527" /> + <di:waypoint x="801" y="420" /> + <di:waypoint x="879" y="420" /> + <di:waypoint x="879" y="492" /> + <di:waypoint x="171" y="492" /> + <di:waypoint x="171" y="577" /> + <di:waypoint x="249" y="577" /> <bpmndi:BPMNLabel> <dc:Bounds x="405" y="427" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1boza4q_di" bpmnElement="preProcessSDNCDeactivateRequest"> - <dc:Bounds x="168" y="179" width="100" height="80" /> + <dc:Bounds x="288" y="229" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0xpc0da_di" bpmnElement="callSDNCAdapterTopologyDeactivate"> - <dc:Bounds x="316" y="179" width="100" height="80" /> + <dc:Bounds x="436" y="229" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1kkyngh_di" bpmnElement="postProcessSDNCDeactivateRequest"> - <dc:Bounds x="464" y="179" width="100" height="80" /> + <dc:Bounds x="584" y="229" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0qbjihn_di" bpmnElement="SequenceFlow_0qbjihn"> - <di:waypoint xsi:type="dc:Point" x="244" y="76" /> - <di:waypoint xsi:type="dc:Point" x="316" y="76" /> + <di:waypoint x="364" y="126" /> + <di:waypoint x="436" y="126" /> <bpmndi:BPMNLabel> <dc:Bounds x="280" y="61" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1c2lvlc_di" bpmnElement="SequenceFlow_1c2lvlc"> - <di:waypoint xsi:type="dc:Point" x="416" y="76" /> - <di:waypoint xsi:type="dc:Point" x="473" y="76" /> + <di:waypoint x="536" y="126" /> + <di:waypoint x="593" y="126" /> <bpmndi:BPMNLabel> <dc:Bounds x="445" y="61" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1gf22c0_di" bpmnElement="QueryAAIForVfModule"> - <dc:Bounds x="316" y="36" width="100" height="80" /> + <dc:Bounds x="436" y="86" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1igsfgk_di" bpmnElement="SequenceFlow_1igsfgk"> - <di:waypoint xsi:type="dc:Point" x="573" y="76" /> - <di:waypoint xsi:type="dc:Point" x="760" y="76" /> - <di:waypoint xsi:type="dc:Point" x="760" y="145" /> - <di:waypoint xsi:type="dc:Point" x="34" y="145" /> - <di:waypoint xsi:type="dc:Point" x="34" y="218" /> - <di:waypoint xsi:type="dc:Point" x="168" y="219" /> + <di:waypoint x="693" y="126" /> + <di:waypoint x="880" y="126" /> + <di:waypoint x="880" y="195" /> + <di:waypoint x="154" y="195" /> + <di:waypoint x="154" y="268" /> + <di:waypoint x="288" y="269" /> <bpmndi:BPMNLabel> <dc:Bounds x="397" y="130" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1jgeknl_di" bpmnElement="ValidateVfModule"> - <dc:Bounds x="473" y="36" width="100" height="80" /> + <dc:Bounds x="593" y="86" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SubProcess_1r8unf9_di" bpmnElement="SubProcess_1r8unf9" isExpanded="true"> - <dc:Bounds x="43" y="622" width="467" height="193" /> + <dc:Bounds x="163" y="672" width="467" height="193" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_1ebrix6_di" bpmnElement="StartEvent_1ebrix6"> - <dc:Bounds x="111" y="689" width="36" height="36" /> + <dc:Bounds x="231" y="739" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="129" y="730" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0yb2lmo_di" bpmnElement="EndEvent_0yb2lmo"> - <dc:Bounds x="404" y="689" width="36" height="36" /> + <dc:Bounds x="524" y="739" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="422" y="730" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1ypch9x_di" bpmnElement="ScriptTask_1ypch9x"> - <dc:Bounds x="215" y="667" width="100" height="80" /> + <dc:Bounds x="335" y="717" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_095634c_di" bpmnElement="SequenceFlow_095634c"> - <di:waypoint xsi:type="dc:Point" x="147" y="707" /> - <di:waypoint xsi:type="dc:Point" x="215" y="707" /> + <di:waypoint x="267" y="757" /> + <di:waypoint x="335" y="757" /> <bpmndi:BPMNLabel> <dc:Bounds x="181" y="692" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0yvjvhu_di" bpmnElement="SequenceFlow_0yvjvhu"> - <di:waypoint xsi:type="dc:Point" x="315" y="707" /> - <di:waypoint xsi:type="dc:Point" x="404" y="707" /> + <di:waypoint x="435" y="757" /> + <di:waypoint x="524" y="757" /> <bpmndi:BPMNLabel> <dc:Bounds x="360" y="692" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_10td9ns_di" bpmnElement="DeleteAAIVfModule"> - <dc:Bounds x="713" y="487" width="100" height="80" /> + <dc:Bounds x="833" y="537" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1rcw5x3_di" bpmnElement="DeleteAAIVfModulePrep"> - <dc:Bounds x="570" y="487" width="100" height="80" /> + <dc:Bounds x="690" y="537" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_092kvy3_di" bpmnElement="SequenceFlow_092kvy3"> - <di:waypoint xsi:type="dc:Point" x="670" y="527" /> - <di:waypoint xsi:type="dc:Point" x="713" y="527" /> + <di:waypoint x="790" y="577" /> + <di:waypoint x="833" y="577" /> <bpmndi:BPMNLabel> <dc:Bounds x="692" y="512" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1eemrjp_di" bpmnElement="SequenceFlow_1eemrjp"> - <di:waypoint xsi:type="dc:Point" x="813" y="527" /> - <di:waypoint xsi:type="dc:Point" x="873" y="527" /> + <di:waypoint x="933" y="577" /> + <di:waypoint x="993" y="577" /> <bpmndi:BPMNLabel> <dc:Bounds x="843" y="502" width="0" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModuleVolumeV2.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModuleVolumeV2.bpmn index e7706c20e6..6a44a117c1 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModuleVolumeV2.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteVfModuleVolumeV2.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0"> <bpmn:process id="DoDeleteVfModuleVolumeV2" name="DoDeleteVfModuleVolumeV2" isExecutable="true"> <bpmn:startEvent id="StartEvent_1" name="Start"> <bpmn:outgoing>SequenceFlow_1gvfdp4</bpmn:outgoing> @@ -7,27 +7,27 @@ <bpmn:scriptTask id="Task_06u1lr0" name="Call REST AAI Query Cloud Region" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_1vy2ojp</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1dlcqmc</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def delVfModuleVol = new DoDeleteVfModuleVolumeV2() -delVfModuleVol.executeMethod('callRESTQueryAAICloudRegion', execution, isDebugLogEnabled)]]></bpmn:script> +delVfModuleVol.executeMethod('callRESTQueryAAICloudRegion', execution, isDebugLogEnabled)</bpmn:script> </bpmn:scriptTask> <bpmn:scriptTask id="Task_1woqfjw" name="Call REST AAI Query for Volume Group" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_1dlcqmc</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1kjccf1</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DoDeleteVfModuleVolumeV2() -deleteVfMod.executeMethod('callRESTQueryAAIForVolumeGroup', execution, isDebugLogEnabled)]]></bpmn:script> +deleteVfMod.executeMethod('callRESTQueryAAIForVolumeGroup', execution, isDebugLogEnabled)</bpmn:script> </bpmn:scriptTask> <bpmn:scriptTask id="Task_0yjx0p2" name="Prepare VNF Adapter Delete" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_1kjccf1</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1tgngf7</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DoDeleteVfModuleVolumeV2() -deleteVfMod.executeMethod('prepareVnfAdapterDeleteRequest', execution, isDebugLogEnabled)]]></bpmn:script> +deleteVfMod.executeMethod('prepareVnfAdapterDeleteRequest', execution, isDebugLogEnabled)</bpmn:script> </bpmn:scriptTask> - <bpmn:callActivity id="Task_14fsstq" name="Call REST VNF Adapter Delete" calledElement="vnfAdapterTask"> + <bpmn:callActivity id="Task_14fsstq" name="Call REST VNF Adapter Delete" calledElement="openstackAdapterTask"> <bpmn:extensionElements> - <camunda:in source="DDVMV_deleteVnfARequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="DDVMV_deleteVnfARequest" target="openstackAdapterTaskRequest" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> <camunda:out source="WorkflowResponse" target="DDVMV_deleteVnfAResponse" /> @@ -40,9 +40,9 @@ deleteVfMod.executeMethod('prepareVnfAdapterDeleteRequest', execution, isDebugLo <bpmn:scriptTask id="Task_17q1roq" name="Call REST AAI Delete Volume Group" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_04zsr0f</bpmn:incoming> <bpmn:outgoing>SequenceFlow_13c3cv2</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DoDeleteVfModuleVolumeV2() -deleteVfMod.executeMethod('callRESTDeleteAAIVolumeGroup', execution, isDebugLogEnabled)]]></bpmn:script> +deleteVfMod.executeMethod('callRESTDeleteAAIVolumeGroup', execution, isDebugLogEnabled)</bpmn:script> </bpmn:scriptTask> <bpmn:endEvent id="EndEvent_0fw1gkf" name="Stop"> <bpmn:incoming>SequenceFlow_1sgtwr2</bpmn:incoming> @@ -53,19 +53,19 @@ deleteVfMod.executeMethod('callRESTDeleteAAIVolumeGroup', execution, isDebugLogE <bpmn:scriptTask id="Task_1i432ud" name="Pre Process Request" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_1gvfdp4</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1vy2ojp</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DoDeleteVfModuleVolumeV2() deleteVfMod.executeMethod('preProcessRequest', execution, isDebugLogEnabled) -]]></bpmn:script> +</bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_1gvfdp4" sourceRef="StartEvent_1" targetRef="Task_1i432ud" /> <bpmn:sequenceFlow id="SequenceFlow_1vy2ojp" sourceRef="Task_1i432ud" targetRef="Task_06u1lr0" /> <bpmn:scriptTask id="Task_018w43g" name="Post Process" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_13c3cv2</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1sgtwr2</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def deleteVfMod = new DoDeleteVfModuleVolumeV2() -deleteVfMod.executeMethod('postProcess', execution, isDebugLogEnabled)]]></bpmn:script> +deleteVfMod.executeMethod('postProcess', execution, isDebugLogEnabled)</bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_13c3cv2" sourceRef="Task_17q1roq" targetRef="Task_018w43g" /> <bpmn:sequenceFlow id="SequenceFlow_1sgtwr2" sourceRef="Task_018w43g" targetRef="EndEvent_0fw1gkf" /> @@ -102,22 +102,22 @@ deleteVfMod.executeMethod('postProcess', execution, isDebugLogEnabled)]]></bpmn: </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1dlcqmc_di" bpmnElement="SequenceFlow_1dlcqmc"> - <di:waypoint xsi:type="dc:Point" x="507" y="120" /> - <di:waypoint xsi:type="dc:Point" x="564" y="120" /> + <di:waypoint x="507" y="120" /> + <di:waypoint x="564" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="536" y="95" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1kjccf1_di" bpmnElement="SequenceFlow_1kjccf1"> - <di:waypoint xsi:type="dc:Point" x="664" y="120" /> - <di:waypoint xsi:type="dc:Point" x="713" y="120" /> + <di:waypoint x="664" y="120" /> + <di:waypoint x="713" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="689" y="95" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1tgngf7_di" bpmnElement="SequenceFlow_1tgngf7"> - <di:waypoint xsi:type="dc:Point" x="813" y="120" /> - <di:waypoint xsi:type="dc:Point" x="865" y="120" /> + <di:waypoint x="813" y="120" /> + <di:waypoint x="865" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="839" y="95" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -126,15 +126,15 @@ deleteVfMod.executeMethod('postProcess', execution, isDebugLogEnabled)]]></bpmn: <dc:Bounds x="247" y="80" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1gvfdp4_di" bpmnElement="SequenceFlow_1gvfdp4"> - <di:waypoint xsi:type="dc:Point" x="209" y="120" /> - <di:waypoint xsi:type="dc:Point" x="247" y="120" /> + <di:waypoint x="209" y="120" /> + <di:waypoint x="247" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="228" y="95" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1vy2ojp_di" bpmnElement="SequenceFlow_1vy2ojp"> - <di:waypoint xsi:type="dc:Point" x="347" y="120" /> - <di:waypoint xsi:type="dc:Point" x="407" y="120" /> + <di:waypoint x="347" y="120" /> + <di:waypoint x="407" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="377" y="95" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -143,22 +143,22 @@ deleteVfMod.executeMethod('postProcess', execution, isDebugLogEnabled)]]></bpmn: <dc:Bounds x="1298" y="80" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_13c3cv2_di" bpmnElement="SequenceFlow_13c3cv2"> - <di:waypoint xsi:type="dc:Point" x="1251" y="120" /> - <di:waypoint xsi:type="dc:Point" x="1298" y="120" /> + <di:waypoint x="1251" y="120" /> + <di:waypoint x="1298" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="1275" y="95" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1sgtwr2_di" bpmnElement="SequenceFlow_1sgtwr2"> - <di:waypoint xsi:type="dc:Point" x="1398" y="120" /> - <di:waypoint xsi:type="dc:Point" x="1463" y="120" /> + <di:waypoint x="1398" y="120" /> + <di:waypoint x="1463" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="1431" y="95" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_04zsr0f_di" bpmnElement="SequenceFlow_04zsr0f"> - <di:waypoint xsi:type="dc:Point" x="965" y="120" /> - <di:waypoint xsi:type="dc:Point" x="1151" y="120" /> + <di:waypoint x="965" y="120" /> + <di:waypoint x="1151" y="120" /> <bpmndi:BPMNLabel> <dc:Bounds x="1058" y="99" width="0" height="12" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateNetworkInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateNetworkInstance.bpmn index b82b1da951..ede63eafac 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateNetworkInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateNetworkInstance.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoUpdateNetworkInstance" name="DoUpdateNetworkInstance" isExecutable="true"> <bpmn2:startEvent id="updateNetwork_startEvent" name="Start Flow"> <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> @@ -8,18 +8,18 @@ <bpmn2:scriptTask id="prepareSDNCTopoRequest_ScriptTask" name="Prepare SDNC Topology Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_32</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_11</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.prepareSDNCRequest(execution) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_11" name="" sourceRef="prepareSDNCTopoRequest_ScriptTask" targetRef="callAssignSDNCAdapter_CallActivity" /> <bpmn2:scriptTask id="validateSDNCResponse_ScriptTask" name="Validate SDNC Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.validateSDNCResponse(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.validateSDNCResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="isSdncTopoOk_ExclusiveGateway" name="Is SDNC Ok?" default="sdncTopoNo_SequenceFlow"> <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming> @@ -28,7 +28,7 @@ DoUpdateNetworkInstance.validateSDNCResponse(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="sdncTopoNo_SequenceFlow" name="No" sourceRef="isSdncTopoOk_ExclusiveGateway" targetRef="sndcError_EndEvent" /> <bpmn2:sequenceFlow id="sdncTopoYes_SequenceFlow" name="Yes" sourceRef="isSdncTopoOk_ExclusiveGateway" targetRef="callRESTReQuery1NetworkID_ScriptTask"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("UPDNETI_sdncResponseSuccess" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("UPDNETI_sdncResponseSuccess" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="validateSDNCResponse_ScriptTask" targetRef="isSdncTopoOk_ExclusiveGateway" /> <bpmn2:boundaryEvent id="BoundaryEvent_4" name="" attachedToRef="validateSDNCResponse_ScriptTask"> @@ -59,9 +59,9 @@ DoUpdateNetworkInstance.validateSDNCResponse(execution)]]></bpmn2:script> <bpmn2:scriptTask id="postProcessAndCompletionRequest_ScriptTask" name="Post Process Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_46</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_29</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.postProcessResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_29" name="" sourceRef="postProcessAndCompletionRequest_ScriptTask" targetRef="EndEvent_3" /> <bpmn2:subProcess id="subProcessException_SubProcess" name="Subprocess For Exception" triggeredByEvent="true"> @@ -71,7 +71,7 @@ DoUpdateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> <bpmn2:outgoing>isRollbackOn_NoNetwork_SequenceFlow</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isRollbackOn_YesNetwork_SequenceFlow" name="Yes" sourceRef="isRollbackOn_Network_ExclusiveGateway" targetRef="isPONR_ExclusiveGateway"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("UPDNETI_rollbackEnabled") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("UPDNETI_rollbackEnabled") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isRollbackOn_NoNetwork_SequenceFlow" name="No" sourceRef="isRollbackOn_Network_ExclusiveGateway" targetRef="ExclusiveGateway_1dcb5p2" /> <bpmn2:startEvent id="subProcessStart_StartEvent" name="Fault Start"> @@ -85,7 +85,7 @@ DoUpdateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> <bpmn2:outgoing>isPONR_No_SequenceFlow</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isPONR_Yes_SequenceFlow" name="Yes" sourceRef="isPONR_ExclusiveGateway" targetRef="ExclusiveGateway_1dcb5p2"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("UPDNETI_isPONR") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("UPDNETI_isPONR") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isPONR_No_SequenceFlow" name="No" sourceRef="isPONR_ExclusiveGateway" targetRef="ExclusiveGateway_1dcb5p2" /> <bpmn2:exclusiveGateway id="sdncOk_ExclusiveGateway" name="is Sdnc Ok?" default="sdncOk_No_ExclusiveGateway"> @@ -94,15 +94,15 @@ DoUpdateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> <bpmn2:outgoing>sdncOk_No_ExclusiveGateway</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="sdncOk_Yeso_ExclusiveGateway" name="Yes" sourceRef="sdncOk_ExclusiveGateway" targetRef="prepareSDNCRollbackRequest_ScriptTask"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("UPDNETI_isSdncRollbackNeeded" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("UPDNETI_isSdncRollbackNeeded" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="sdncOk_No_ExclusiveGateway" name="No" sourceRef="sdncOk_ExclusiveGateway" targetRef="InclusiveGateway_6" /> <bpmn2:scriptTask id="prepareSDNCRollbackRequest_ScriptTask" name="Prepare SDNCRollback Request" scriptFormat="groovy"> <bpmn2:incoming>sdncOk_Yeso_ExclusiveGateway</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_53</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.prepareSDNCRollbackRequest(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.prepareSDNCRollbackRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_53" name="" sourceRef="prepareSDNCRollbackRequest_ScriptTask" targetRef="InclusiveGateway_6" /> <bpmn2:endEvent id="EndEvent_4"> @@ -117,37 +117,17 @@ DoUpdateNetworkInstance.prepareSDNCRollbackRequest(execution)]]></bpmn2:script> <bpmn2:sequenceFlow id="SequenceFlow_47" name="" sourceRef="InclusiveGateway_6" targetRef="ScriptTask_1p6n2yy" /> <bpmn2:scriptTask id="ScriptTask_1p6n2yy" name="Prepare RollbackData" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_47</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_0qr4es6</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.prepareRollbackData(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.prepareRollbackData(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:callActivity id="CallActivity_1kid5y0" name="DoUpdate NetworkInstanceRollback " calledElement="DoCreateNetworkInstanceRollback"> - <bpmn2:extensionElements> - <camunda:in source="msoRequestId" target="msoRequestId" /> - <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> - <camunda:in source="serviceInstanceId" target="serviceInstanceId" /> - <camunda:in source="rollbackData" target="rollbackData" /> - <camunda:in source="mso-request-id" target="mso-request-id" /> - <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> - <camunda:in source="WorkflowException" target="WorkflowException" /> - <camunda:in source="sdncVersion" target="sdncVersion" /> - <camunda:out source="wasDeleted" target="wasDeleted" /> - <camunda:out source="rolledBack" target="rolledBack" /> - <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:out source="workflowException" target="workflowException" /> - <camunda:in source="SavedWorkflowException1" target="SavedWorkflowException1" /> - </bpmn2:extensionElements> - <bpmn2:incoming>SequenceFlow_0qr4es6</bpmn2:incoming> - </bpmn2:callActivity> <bpmn2:scriptTask id="ScriptTask_0voqz6r" name="Post Process Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0ze5k6c</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_04rdjfi</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.postProcessResponse(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_0qr4es6" sourceRef="ScriptTask_1p6n2yy" targetRef="CallActivity_1kid5y0" /> <bpmn2:sequenceFlow id="SequenceFlow_04rdjfi" sourceRef="ScriptTask_0voqz6r" targetRef="EndEvent_4" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_1kjh92x" name="is '1702' SNDC Call?"> <bpmn2:outgoing>SequenceFlow_0nrc66n</bpmn2:outgoing> @@ -155,14 +135,14 @@ DoUpdateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0nrc66n" name="No" sourceRef="ExclusiveGateway_1kjh92x" targetRef="sdncOk_ExclusiveGateway" /> <bpmn2:sequenceFlow id="SequenceFlow_0srdlf3" name="Yes" sourceRef="ExclusiveGateway_1kjh92x" targetRef="InclusiveGateway_6"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion") != '1610'} ]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'} </bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:scriptTask id="ScriptTask_1gedbow" name="Set Exception Flag" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_053re4q</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.setExceptionFlag(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.setExceptionFlag(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_053re4q" sourceRef="ScriptTask_1gedbow" targetRef="isRollbackOn_Network_ExclusiveGateway" /> <bpmn2:inclusiveGateway id="ExclusiveGateway_1dcb5p2"> @@ -172,24 +152,21 @@ DoUpdateNetworkInstance.setExceptionFlag(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_0ze5k6c</bpmn2:outgoing> </bpmn2:inclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0ze5k6c" sourceRef="ExclusiveGateway_1dcb5p2" targetRef="ScriptTask_0voqz6r" /> - <bpmn2:textAnnotation id="TextAnnotation_0qx19b9"> <bpmn2:text>Note: Rollback is not needed for UpdateNetwork,</bpmn2:text> -</bpmn2:textAnnotation> - <bpmn2:association id="Association_10dk4x3" sourceRef="CallActivity_1kid5y0" targetRef="TextAnnotation_0qx19b9" /> </bpmn2:subProcess> <bpmn2:scriptTask id="callRESTReQuery2NetworkID_ScriptTask" name="Call REST ReQuery2 Network Id in AAI" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_13</bpmn2:incoming> + <bpmn2:incoming>Flow_1eutzkj</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_35</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_35" name="" sourceRef="callRESTReQuery2NetworkID_ScriptTask" targetRef="callRESTUpdateContrailNetwork_ScriptTask" /> <bpmn2:scriptTask id="callRESTUpdateContrailNetwork_ScriptTask" name="Call REST Update Contrail Network in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_35</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_46</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_46" name="PONR" sourceRef="callRESTUpdateContrailNetwork_ScriptTask" targetRef="postProcessAndCompletionRequest_ScriptTask" /> <bpmn2:endEvent id="EndEvent_3"> @@ -199,9 +176,9 @@ DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(execution)]]></bpmn2:sc <bpmn2:scriptTask id="ScriptTask_1" name="Log / Print Unexpected Error" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.processJavaException(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.processJavaException(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_14" name="" sourceRef="ScriptTask_1" targetRef="EndEvent_1" /> <bpmn2:startEvent id="StartEvent_1"> @@ -216,570 +193,518 @@ DoUpdateNetworkInstance.processJavaException(execution)]]></bpmn2:script> <bpmn2:scriptTask id="preProcessRequest_ScriptTask" name="PreProcess Incoming Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.preProcessRequest(execution) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_7" name="" sourceRef="preProcessRequest_ScriptTask" targetRef="callGetServiceInstance" /> <bpmn2:scriptTask id="callRESTQueryCloudRegion_ScriptTask" name="Call REST Query Cloud Region " scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_24</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_32" name="" sourceRef="callRESTQueryCloudRegion_ScriptTask" targetRef="prepareSDNCTopoRequest_ScriptTask" /> <bpmn2:scriptTask id="callRESTQueryNetworkId_ScriptTask" name="Call REST Query Network Id In AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_24</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.callRESTQueryAAINetworkId(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.callRESTQueryAAINetworkId(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_24" name="" sourceRef="callRESTQueryNetworkId_ScriptTask" targetRef="callRESTQueryCloudRegion_ScriptTask" /> <bpmn2:sequenceFlow id="SequenceFlow_3" name="" sourceRef="callGetServiceInstance" targetRef="callRESTQueryNetworkId_ScriptTask" /> - <bpmn2:scriptTask id="validateUpdatePONetwork_ScriptTask" name="Validate Update PO Network" scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_59</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.validateUpdateNetworkResponse(execution)]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_13" name="" sourceRef="validateUpdatePONetwork_ScriptTask" targetRef="callRESTReQuery2NetworkID_ScriptTask" /> - <bpmn2:serviceTask id="callUpdateNetwork_ServiceTask" name="Call Update Network"> - <bpmn2:extensionElements> - <camunda:connector> - <camunda:inputOutput> - <camunda:inputParameter name="payload">${UPDNETI_updateNetworkRequest}</camunda:inputParameter> - <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution)}/${UPDNETI_networkId} -]]></camunda:inputParameter> - <camunda:inputParameter name="headers"> - <camunda:map> - <camunda:entry key="Authorization">#{BasicAuthHeaderValuePO}</camunda:entry> - <camunda:entry key="content-type">application/xml</camunda:entry> - </camunda:map> - </camunda:inputParameter> - <camunda:inputParameter name="method">PUT</camunda:inputParameter> - <camunda:outputParameter name="UPDNETI_networkReturnCode">${statusCode}</camunda:outputParameter> - <camunda:outputParameter name="UPDNETI_updateNetworkResponse">${response}</camunda:outputParameter> - </camunda:inputOutput> - <camunda:connectorId>http-connector</camunda:connectorId> - </camunda:connector> - </bpmn2:extensionElements> - <bpmn2:incoming>SequenceFlow_61</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_59</bpmn2:outgoing> - </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_59" name="" sourceRef="callUpdateNetwork_ServiceTask" targetRef="validateUpdatePONetwork_ScriptTask" /> <bpmn2:scriptTask id="prepareNetworkRequest_ScriptTask" name="Prepare Create Network Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_61</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() DoUpdateNetworkInstance.prepareUpdateNetworkRequest(execution) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_61" name="" sourceRef="prepareNetworkRequest_ScriptTask" targetRef="callUpdateNetwork_ServiceTask" /> + <bpmn2:sequenceFlow id="SequenceFlow_61" name="" sourceRef="prepareNetworkRequest_ScriptTask" targetRef="openstackAdapterTask" /> <bpmn2:scriptTask id="callRESTQueryNetworkTableRef_ScriptTask" name="Call REST Query Network TableRef in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_38</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="callRESTQueryNetworkTableRef_ScriptTask" targetRef="prepareNetworkRequest_ScriptTask" /> <bpmn2:scriptTask id="callRESTReQuery1NetworkID_ScriptTask" name="Call REST ReQuery1 Network Id in AAI" scriptFormat="groovy"> <bpmn2:incoming>sdncTopoYes_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="callRESTReQuery1NetworkID_ScriptTask" targetRef="callRESTQueryVpnBinding_ScriptTask" /> <bpmn2:scriptTask id="callRESTQueryVpnBinding_ScriptTask" name="Call REST Query Vpn Binding in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_15</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_15" name="" sourceRef="callRESTQueryVpnBinding_ScriptTask" targetRef="callRESTQueryNetworkPolicy_ScriptTask" /> <bpmn2:scriptTask id="callRESTQueryNetworkPolicy_ScriptTask" name="Call REST Query Network Policy in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_15</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_38</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_38" name="" sourceRef="callRESTQueryNetworkPolicy_ScriptTask" targetRef="callRESTQueryNetworkTableRef_ScriptTask" /> <bpmn2:scriptTask id="callGetServiceInstance" name="AAI Query (svc instance)" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoUpdateNetworkInstance = new DoUpdateNetworkInstance() -DoUpdateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> +DoUpdateNetworkInstance.getServiceInstance(execution)</bpmn2:script> </bpmn2:scriptTask> + <bpmn2:callActivity id="openstackAdapterTask" name="openstack Adapter" calledElement="openstackAdapterTask"> + <bpmn2:extensionElements> + <camunda:in source="UPDNETI_updateNetworkRequest" target="openstackAdapterTaskRequest" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="WorkflowResponse" target="UPDNETI_updateNetworkResponse" /> + </bpmn2:extensionElements> + <bpmn2:incoming>SequenceFlow_61</bpmn2:incoming> + <bpmn2:outgoing>Flow_1eutzkj</bpmn2:outgoing> + </bpmn2:callActivity> + <bpmn2:sequenceFlow id="Flow_1eutzkj" sourceRef="openstackAdapterTask" targetRef="callRESTReQuery2NetworkID_ScriptTask" /> </bpmn2:process> <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoUpdateNetworkInstance"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="updateNetwork_startEvent"> - <dc:Bounds x="286" y="185" width="36" height="36" /> + <dc:Bounds x="596" y="185" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="279" y="226" width="49" height="12" /> + <dc:Bounds x="588" y="226" width="51" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_61" bpmnElement="preProcessRequest_ScriptTask"> - <dc:Bounds x="472" y="163" width="100" height="80" /> + <dc:Bounds x="782" y="163" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_47" targetElement="_BPMNShape_ScriptTask_61"> - <di:waypoint xsi:type="dc:Point" x="322" y="203" /> - <di:waypoint xsi:type="dc:Point" x="472" y="203" /> + <di:waypoint x="632" y="203" /> + <di:waypoint x="782" y="203" /> <bpmndi:BPMNLabel> <dc:Bounds x="397" y="188" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_63" bpmnElement="validateUpdatePONetwork_ScriptTask"> - <dc:Bounds x="1343" y="1311" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_83" bpmnElement="callUpdateNetwork_ServiceTask"> - <dc:Bounds x="1342" y="1176" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_67" bpmnElement="prepareSDNCTopoRequest_ScriptTask"> - <dc:Bounds x="1519" y="100" width="100" height="80" /> + <dc:Bounds x="1829" y="100" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_16" bpmnElement="subProcessException_SubProcess" isExpanded="true"> - <dc:Bounds x="-153" y="594" width="1288" height="701" /> + <dc:Bounds x="157" y="594" width="1288" height="701" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_50" bpmnElement="subProcessStart_StartEvent"> - <dc:Bounds x="-103" y="1160" width="36" height="36" /> + <dc:Bounds x="207" y="1160" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="-109" y="1201" width="50" height="12" /> + <dc:Bounds x="200" y="1201" width="52" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_67" bpmnElement="isSdncTopoOk_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="1544" y="521" width="50" height="50" /> + <dc:Bounds x="1854" y="521" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1535" y="577" width="67" height="12" /> + <dc:Bounds x="1845" y="577" width="67" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="sdncTopoNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_67" targetElement="_BPMNShape_EndEvent_124"> - <di:waypoint xsi:type="dc:Point" x="1594" y="546" /> - <di:waypoint xsi:type="dc:Point" x="1682" y="546" /> + <di:waypoint x="1904" y="546" /> + <di:waypoint x="1992" y="546" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1600" y="546.8622891951518" width="14" height="12" /> + <dc:Bounds x="1910" y="547" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="sdncTopoYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_67" targetElement="_BPMNShape_ScriptTask_336"> - <di:waypoint xsi:type="dc:Point" x="1544" y="546" /> - <di:waypoint xsi:type="dc:Point" x="1393" y="546" /> - <di:waypoint xsi:type="dc:Point" x="1393" y="576" /> + <di:waypoint x="1854" y="546" /> + <di:waypoint x="1703" y="546" /> + <di:waypoint x="1703" y="576" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1526" y="546" width="18" height="12" /> + <dc:Bounds x="1836" y="546" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_80" bpmnElement="postProcessAndCompletionRequest_ScriptTask"> - <dc:Bounds x="743" y="1390" width="100" height="80" /> + <dc:Bounds x="1053" y="1390" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_124" bpmnElement="sndcError_EndEvent"> - <dc:Bounds x="1682" y="528" width="36" height="36" /> + <dc:Bounds x="1992" y="528" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1663" y="569" width="74" height="22" /> + <dc:Bounds x="1980" y="569" width="61" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_19" bpmnElement="callAssignSDNCAdapter_CallActivity"> - <dc:Bounds x="1519" y="242" width="100" height="80" /> + <dc:Bounds x="1829" y="242" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_24" bpmnElement="SequenceFlow_11" sourceElement="_BPMNShape_ScriptTask_67" targetElement="_BPMNShape_CallActivity_19"> - <di:waypoint xsi:type="dc:Point" x="1569" y="180" /> - <di:waypoint xsi:type="dc:Point" x="1569" y="242" /> + <di:waypoint x="1879" y="180" /> + <di:waypoint x="1879" y="242" /> <bpmndi:BPMNLabel> <dc:Bounds x="1584" y="211" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_CallActivity_19" targetElement="_BPMNShape_ScriptTask_131"> - <di:waypoint xsi:type="dc:Point" x="1569" y="322" /> - <di:waypoint xsi:type="dc:Point" x="1569" y="373" /> + <di:waypoint x="1879" y="322" /> + <di:waypoint x="1879" y="373" /> <bpmndi:BPMNLabel> <dc:Bounds x="1584" y="347.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_7" sourceElement="_BPMNShape_ScriptTask_61"> - <di:waypoint xsi:type="dc:Point" x="572" y="203" /> - <di:waypoint xsi:type="dc:Point" x="686" y="203" /> + <di:waypoint x="882" y="203" /> + <di:waypoint x="996" y="203" /> <bpmndi:BPMNLabel> <dc:Bounds x="584" y="188" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_StartEvent_50" targetElement="_BPMNShape_ExclusiveGateway_90"> - <di:waypoint xsi:type="dc:Point" x="-67" y="1178" /> - <di:waypoint xsi:type="dc:Point" x="-40" y="1178" /> - <di:waypoint xsi:type="dc:Point" x="-11" y="1178" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_StartEvent_50" targetElement="ScriptTask_1gedbow_di"> + <di:waypoint x="243" y="1178" /> + <di:waypoint x="270" y="1178" /> + <di:waypoint x="299" y="1178" /> <bpmndi:BPMNLabel> <dc:Bounds x="-53" y="1163" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_131" bpmnElement="validateSDNCResponse_ScriptTask"> - <dc:Bounds x="1519" y="373" width="100" height="80" /> + <dc:Bounds x="1829" y="373" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_131" targetElement="_BPMNShape_ExclusiveGateway_67"> - <di:waypoint xsi:type="dc:Point" x="1569" y="453" /> - <di:waypoint xsi:type="dc:Point" x="1569" y="521" /> + <di:waypoint x="1879" y="453" /> + <di:waypoint x="1879" y="521" /> <bpmndi:BPMNLabel> <dc:Bounds x="1584" y="487" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_42" bpmnElement="SequenceFlow_29" sourceElement="_BPMNShape_ScriptTask_80"> - <di:waypoint xsi:type="dc:Point" x="743" y="1430" /> - <di:waypoint xsi:type="dc:Point" x="635" y="1430" /> + <di:waypoint x="1053" y="1430" /> + <di:waypoint x="945" y="1430" /> <bpmndi:BPMNLabel> <dc:Bounds x="689" y="1415" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_133" bpmnElement="callRESTQueryNetworkId_ScriptTask"> - <dc:Bounds x="984" y="100" width="100" height="80" /> + <dc:Bounds x="1294" y="100" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_134" bpmnElement="callRESTReQuery2NetworkID_ScriptTask"> - <dc:Bounds x="1176" y="1390" width="100" height="80" /> + <dc:Bounds x="1486" y="1390" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_135" bpmnElement="callRESTUpdateContrailNetwork_ScriptTask"> - <dc:Bounds x="984" y="1390" width="100" height="80" /> + <dc:Bounds x="1294" y="1390" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_54" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_ScriptTask_134" targetElement="_BPMNShape_ScriptTask_135"> - <di:waypoint xsi:type="dc:Point" x="1176" y="1430" /> - <di:waypoint xsi:type="dc:Point" x="1084" y="1430" /> + <di:waypoint x="1486" y="1430" /> + <di:waypoint x="1394" y="1430" /> <bpmndi:BPMNLabel> <dc:Bounds x="1130" y="1415" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_65" bpmnElement="SequenceFlow_46" sourceElement="_BPMNShape_ScriptTask_135"> - <di:waypoint xsi:type="dc:Point" x="984" y="1430" /> - <di:waypoint xsi:type="dc:Point" x="843" y="1430" /> + <di:waypoint x="1294" y="1430" /> + <di:waypoint x="1153" y="1430" /> <bpmndi:BPMNLabel> - <dc:Bounds x="935" y="1431.2411831373652" width="32" height="12" /> + <dc:Bounds x="1245" y="1431" width="33" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_156" bpmnElement="callRESTQueryVpnBinding_ScriptTask"> - <dc:Bounds x="1341" y="688" width="100" height="80" /> + <dc:Bounds x="1651" y="688" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ScriptTask_156" targetElement="_BPMNShape_ScriptTask_215"> - <di:waypoint xsi:type="dc:Point" x="1391" y="768" /> - <di:waypoint xsi:type="dc:Point" x="1391" y="810" /> + <di:waypoint x="1701" y="768" /> + <di:waypoint x="1701" y="810" /> <bpmndi:BPMNLabel> <dc:Bounds x="1388" y="781" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_87" bpmnElement="SequenceFlow_59" sourceElement="_BPMNShape_ServiceTask_83" targetElement="_BPMNShape_ScriptTask_63"> - <di:waypoint xsi:type="dc:Point" x="1392" y="1256" /> - <di:waypoint xsi:type="dc:Point" x="1393" y="1311" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1390" y="1284" width="6" height="6" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_157" bpmnElement="prepareNetworkRequest_ScriptTask"> - <dc:Bounds x="1342" y="1052" width="100" height="80" /> + <dc:Bounds x="1652" y="1052" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_89" bpmnElement="SequenceFlow_61" sourceElement="_BPMNShape_ScriptTask_157" targetElement="_BPMNShape_ServiceTask_83"> - <di:waypoint xsi:type="dc:Point" x="1392" y="1132" /> - <di:waypoint xsi:type="dc:Point" x="1392" y="1176" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_89" bpmnElement="SequenceFlow_61" sourceElement="_BPMNShape_ScriptTask_157" targetElement="Activity_06vsf1e_di"> + <di:waypoint x="1702" y="1132" /> + <di:waypoint x="1702" y="1190" /> <bpmndi:BPMNLabel> <dc:Bounds x="1389" y="1159" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_90" bpmnElement="isRollbackOn_Network_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="156" y="1153" width="50" height="50" /> + <dc:Bounds x="466" y="1153" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="143" y="1213" width="78" height="12" /> + <dc:Bounds x="453" y="1213" width="78" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_25" bpmnElement="isRollbackOn_YesNetwork_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_90" targetElement="_BPMNShape_ExclusiveGateway_215"> - <di:waypoint xsi:type="dc:Point" x="181" y="1153" /> - <di:waypoint xsi:type="dc:Point" x="181" y="1089" /> + <di:waypoint x="491" y="1153" /> + <di:waypoint x="491" y="1089" /> <bpmndi:BPMNLabel> - <dc:Bounds x="187" y="1133.4787123394708" width="18" height="12" /> + <dc:Bounds x="497" y="1133" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_34" bpmnElement="isRollbackOn_NoNetwork_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_90" targetElement="_BPMNShape_InclusiveGateway_24"> - <di:waypoint xsi:type="dc:Point" x="206" y="1178" /> - <di:waypoint xsi:type="dc:Point" x="372" y="1178" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_34" bpmnElement="isRollbackOn_NoNetwork_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_90" targetElement="InclusiveGateway_1adrta3_di"> + <di:waypoint x="516" y="1178" /> + <di:waypoint x="682" y="1178" /> <bpmndi:BPMNLabel> - <dc:Bounds x="206" y="1182.7278101950883" width="14" height="12" /> + <dc:Bounds x="516" y="1183" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_215" bpmnElement="callRESTQueryNetworkPolicy_ScriptTask"> - <dc:Bounds x="1341" y="810" width="100" height="80" /> + <dc:Bounds x="1651" y="810" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_60" bpmnElement="SequenceFlow_38" sourceElement="_BPMNShape_ScriptTask_215" targetElement="_BPMNShape_ScriptTask_335"> - <di:waypoint xsi:type="dc:Point" x="1391" y="890" /> - <di:waypoint xsi:type="dc:Point" x="1391" y="926" /> + <di:waypoint x="1701" y="890" /> + <di:waypoint x="1701" y="926" /> <bpmndi:BPMNLabel> <dc:Bounds x="1388" y="900" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_InclusiveGateway_24" bpmnElement="InclusiveGateway_6"> - <dc:Bounds x="626" y="859" width="50" height="50" /> + <dc:Bounds x="936" y="859" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="651" y="914" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_215" bpmnElement="isPONR_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="156" y="1039" width="50" height="50" /> + <dc:Bounds x="466" y="1039" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="90" y="1054" width="46" height="12" /> + <dc:Bounds x="400" y="1054" width="46" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_77" bpmnElement="isPONR_Yes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_215" targetElement="_BPMNShape_InclusiveGateway_24"> - <di:waypoint xsi:type="dc:Point" x="206" y="1064" /> - <di:waypoint xsi:type="dc:Point" x="397" y="1064" /> - <di:waypoint xsi:type="dc:Point" x="397" y="1153" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_77" bpmnElement="isPONR_Yes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_215" targetElement="InclusiveGateway_1adrta3_di"> + <di:waypoint x="516" y="1064" /> + <di:waypoint x="707" y="1064" /> + <di:waypoint x="707" y="1153" /> <bpmndi:BPMNLabel> - <dc:Bounds x="213" y="1067.6448598130842" width="18" height="12" /> + <dc:Bounds x="523" y="1068" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_85" bpmnElement="isPONR_No_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_215"> - <di:waypoint xsi:type="dc:Point" x="181" y="1039" /> - <di:waypoint xsi:type="dc:Point" x="181" y="971" /> - <di:waypoint xsi:type="dc:Point" x="397" y="971" /> - <di:waypoint xsi:type="dc:Point" x="397" y="1153" /> + <di:waypoint x="491" y="1039" /> + <di:waypoint x="491" y="971" /> + <di:waypoint x="707" y="971" /> + <di:waypoint x="707" y="1153" /> <bpmndi:BPMNLabel> - <dc:Bounds x="185" y="1027.872131147541" width="14" height="12" /> + <dc:Bounds x="495" y="1028" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_217" bpmnElement="sdncOk_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="493" y="709" width="50" height="50" /> + <dc:Bounds x="803" y="709" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="488" y="683" width="60" height="12" /> + <dc:Bounds x="798" y="683" width="60" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_92" bpmnElement="sdncOk_Yeso_ExclusiveGateway" sourceElement="_BPMNShape_ExclusiveGateway_217" targetElement="_BPMNShape_ScriptTask_261"> - <di:waypoint xsi:type="dc:Point" x="543" y="734" /> - <di:waypoint xsi:type="dc:Point" x="601" y="733" /> + <di:waypoint x="853" y="734" /> + <di:waypoint x="911" y="733" /> <bpmndi:BPMNLabel> - <dc:Bounds x="545" y="737.2172362208834" width="18" height="12" /> + <dc:Bounds x="855" y="737" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_93" bpmnElement="sdncOk_No_ExclusiveGateway" sourceElement="_BPMNShape_ExclusiveGateway_217"> - <di:waypoint xsi:type="dc:Point" x="517" y="758" /> - <di:waypoint xsi:type="dc:Point" x="517" y="884" /> - <di:waypoint xsi:type="dc:Point" x="626" y="884" /> + <di:waypoint x="827" y="758" /> + <di:waypoint x="827" y="884" /> + <di:waypoint x="936" y="884" /> <bpmndi:BPMNLabel> - <dc:Bounds x="526" y="761.1171067354646" width="14" height="12" /> + <dc:Bounds x="836" y="761" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_177" bpmnElement="EndEvent_3"> - <dc:Bounds x="599" y="1412" width="36" height="36" /> + <dc:Bounds x="909" y="1412" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="617" y="1453" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_178" bpmnElement="EndEvent_4"> - <dc:Bounds x="1029" y="968" width="36" height="36" /> + <dc:Bounds x="1339" y="968" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1047" y="1009" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_245" bpmnElement="callRESTQueryCloudRegion_ScriptTask"> - <dc:Bounds x="1200" y="100" width="100" height="80" /> + <dc:Bounds x="1510" y="100" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_53" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ScriptTask_245" targetElement="_BPMNShape_ScriptTask_67"> - <di:waypoint xsi:type="dc:Point" x="1300" y="140" /> - <di:waypoint xsi:type="dc:Point" x="1519" y="140" /> + <di:waypoint x="1610" y="140" /> + <di:waypoint x="1829" y="140" /> <bpmndi:BPMNLabel> <dc:Bounds x="1410" y="125" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_38" bpmnElement="BoundaryEvent_4"> - <dc:Bounds x="1601" y="355" width="36" height="36" /> + <dc:Bounds x="1911" y="355" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1619" y="391" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_69" bpmnElement="SequenceFlow_34" sourceElement="_BPMNShape_BoundaryEvent_38" targetElement="_BPMNShape_EndEvent_124"> - <di:waypoint xsi:type="dc:Point" x="1637" y="373" /> - <di:waypoint xsi:type="dc:Point" x="1700" y="373" /> - <di:waypoint xsi:type="dc:Point" x="1700" y="528" /> + <di:waypoint x="1947" y="373" /> + <di:waypoint x="2010" y="373" /> + <di:waypoint x="2010" y="528" /> <bpmndi:BPMNLabel> <dc:Bounds x="1669" y="358" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_261" bpmnElement="prepareSDNCRollbackRequest_ScriptTask"> - <dc:Bounds x="601" y="694" width="100" height="79" /> + <dc:Bounds x="911" y="694" width="100" height="79" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_76" bpmnElement="SequenceFlow_47" sourceElement="_BPMNShape_InclusiveGateway_24"> - <di:waypoint xsi:type="dc:Point" x="651" y="909" /> - <di:waypoint xsi:type="dc:Point" x="651" y="946" /> + <di:waypoint x="961" y="909" /> + <di:waypoint x="961" y="946" /> <bpmndi:BPMNLabel> <dc:Bounds x="666" y="927.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_84" bpmnElement="SequenceFlow_53" sourceElement="_BPMNShape_ScriptTask_261"> - <di:waypoint xsi:type="dc:Point" x="651" y="773" /> - <di:waypoint xsi:type="dc:Point" x="651" y="859" /> + <di:waypoint x="961" y="773" /> + <di:waypoint x="961" y="859" /> <bpmndi:BPMNLabel> <dc:Bounds x="666" y="816" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_ScriptTask_63" targetElement="_BPMNShape_ScriptTask_134"> - <di:waypoint xsi:type="dc:Point" x="1393" y="1391" /> - <di:waypoint xsi:type="dc:Point" x="1393" y="1430" /> - <di:waypoint xsi:type="dc:Point" x="1310" y="1430" /> - <di:waypoint xsi:type="dc:Point" x="1276" y="1430" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1390" y="1425" width="6" height="6" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_28" bpmnElement="unexpectedErrors_SubProcess" isExpanded="true"> - <dc:Bounds x="-62" y="375" width="394" height="188" /> + <dc:Bounds x="248" y="375" width="394" height="188" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_71" bpmnElement="StartEvent_1"> - <dc:Bounds x="-29" y="452" width="36" height="36" /> + <dc:Bounds x="281" y="452" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="-11" y="493" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_270" bpmnElement="ScriptTask_1"> - <dc:Bounds x="86" y="430" width="100" height="80" /> + <dc:Bounds x="396" y="430" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_220" bpmnElement="EndEvent_1"> - <dc:Bounds x="247" y="452" width="36" height="36" /> + <dc:Bounds x="557" y="452" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="265" y="493" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_StartEvent_71" targetElement="_BPMNShape_ScriptTask_270"> - <di:waypoint xsi:type="dc:Point" x="7" y="470" /> - <di:waypoint xsi:type="dc:Point" x="86" y="470" /> + <di:waypoint x="317" y="470" /> + <di:waypoint x="396" y="470" /> <bpmndi:BPMNLabel> <dc:Bounds x="49" y="470" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_270" targetElement="_BPMNShape_EndEvent_220"> - <di:waypoint xsi:type="dc:Point" x="186" y="470" /> - <di:waypoint xsi:type="dc:Point" x="247" y="470" /> + <di:waypoint x="496" y="470" /> + <di:waypoint x="557" y="470" /> <bpmndi:BPMNLabel> <dc:Bounds x="221" y="470" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="ScriptTask_0e58tta_di" targetElement="_BPMNShape_ScriptTask_133"> - <di:waypoint xsi:type="dc:Point" x="786" y="203" /> - <di:waypoint xsi:type="dc:Point" x="805" y="203" /> - <di:waypoint xsi:type="dc:Point" x="805" y="202" /> - <di:waypoint xsi:type="dc:Point" x="861" y="202" /> - <di:waypoint xsi:type="dc:Point" x="861" y="140" /> - <di:waypoint xsi:type="dc:Point" x="910" y="140" /> - <di:waypoint xsi:type="dc:Point" x="984" y="140" /> + <di:waypoint x="1096" y="203" /> + <di:waypoint x="1115" y="203" /> + <di:waypoint x="1115" y="202" /> + <di:waypoint x="1171" y="202" /> + <di:waypoint x="1171" y="140" /> + <di:waypoint x="1220" y="140" /> + <di:waypoint x="1294" y="140" /> <bpmndi:BPMNLabel> <dc:Bounds x="788" y="184" width="90" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_22" bpmnElement="SequenceFlow_24" sourceElement="_BPMNShape_ScriptTask_133" targetElement="_BPMNShape_ScriptTask_245"> - <di:waypoint xsi:type="dc:Point" x="1084" y="140" /> - <di:waypoint xsi:type="dc:Point" x="1200" y="140" /> + <di:waypoint x="1394" y="140" /> + <di:waypoint x="1510" y="140" /> <bpmndi:BPMNLabel> <dc:Bounds x="1127" y="140" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_335" bpmnElement="callRESTQueryNetworkTableRef_ScriptTask"> - <dc:Bounds x="1341" y="926" width="100" height="80" /> + <dc:Bounds x="1651" y="926" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_335" targetElement="_BPMNShape_ScriptTask_157"> - <di:waypoint xsi:type="dc:Point" x="1391" y="1006" /> - <di:waypoint xsi:type="dc:Point" x="1392" y="1052" /> + <di:waypoint x="1701" y="1006" /> + <di:waypoint x="1702" y="1052" /> <bpmndi:BPMNLabel> <dc:Bounds x="1388" y="1028" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_336" bpmnElement="callRESTReQuery1NetworkID_ScriptTask"> - <dc:Bounds x="1343" y="576" width="100" height="80" /> + <dc:Bounds x="1653" y="576" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ScriptTask_336" targetElement="_BPMNShape_ScriptTask_156"> - <di:waypoint xsi:type="dc:Point" x="1393" y="656" /> - <di:waypoint xsi:type="dc:Point" x="1393" y="672" /> - <di:waypoint xsi:type="dc:Point" x="1391" y="672" /> - <di:waypoint xsi:type="dc:Point" x="1391" y="688" /> + <di:waypoint x="1703" y="656" /> + <di:waypoint x="1703" y="672" /> + <di:waypoint x="1701" y="672" /> + <di:waypoint x="1701" y="688" /> <bpmndi:BPMNLabel> <dc:Bounds x="1390" y="666" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1p6n2yy_di" bpmnElement="ScriptTask_1p6n2yy"> - <dc:Bounds x="601" y="946" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="CallActivity_1kid5y0_di" bpmnElement="CallActivity_1kid5y0"> - <dc:Bounds x="739" y="946" width="100" height="80" /> + <dc:Bounds x="911" y="946" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0voqz6r_di" bpmnElement="ScriptTask_0voqz6r"> - <dc:Bounds x="883" y="946" width="100" height="80" /> + <dc:Bounds x="1110" y="1138" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0qr4es6_di" bpmnElement="SequenceFlow_0qr4es6"> - <di:waypoint xsi:type="dc:Point" x="701" y="986" /> - <di:waypoint xsi:type="dc:Point" x="739" y="986" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="720" y="971" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_04rdjfi_di" bpmnElement="SequenceFlow_04rdjfi"> - <di:waypoint xsi:type="dc:Point" x="983" y="986" /> - <di:waypoint xsi:type="dc:Point" x="1029" y="986" /> + <di:waypoint x="1210" y="1178" /> + <di:waypoint x="1275" y="1178" /> + <di:waypoint x="1275" y="986" /> + <di:waypoint x="1339" y="986" /> <bpmndi:BPMNLabel> <dc:Bounds x="1006" y="961" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ExclusiveGateway_1kjh92x_di" bpmnElement="ExclusiveGateway_1kjh92x" isMarkerVisible="true"> - <dc:Bounds x="372" y="709" width="50" height="50" /> + <dc:Bounds x="682" y="709" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="368" y="672" width="76" height="24" /> + <dc:Bounds x="679" y="672" width="74" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0nrc66n_di" bpmnElement="SequenceFlow_0nrc66n"> - <di:waypoint xsi:type="dc:Point" x="422" y="734" /> - <di:waypoint xsi:type="dc:Point" x="493" y="734" /> + <di:waypoint x="732" y="734" /> + <di:waypoint x="803" y="734" /> <bpmndi:BPMNLabel> - <dc:Bounds x="427" y="735" width="14" height="12" /> + <dc:Bounds x="737" y="735" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0srdlf3_di" bpmnElement="SequenceFlow_0srdlf3"> - <di:waypoint xsi:type="dc:Point" x="397" y="759" /> - <di:waypoint xsi:type="dc:Point" x="397" y="884" /> - <di:waypoint xsi:type="dc:Point" x="626" y="884" /> + <di:waypoint x="707" y="759" /> + <di:waypoint x="707" y="884" /> + <di:waypoint x="936" y="884" /> <bpmndi:BPMNLabel> - <dc:Bounds x="402" y="760" width="18" height="12" /> + <dc:Bounds x="712" y="760" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1gedbow_di" bpmnElement="ScriptTask_1gedbow"> - <dc:Bounds x="-11" y="1138" width="100" height="80" /> + <dc:Bounds x="299" y="1138" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_053re4q_di" bpmnElement="SequenceFlow_053re4q"> - <di:waypoint xsi:type="dc:Point" x="89" y="1178" /> - <di:waypoint xsi:type="dc:Point" x="156" y="1178" /> + <di:waypoint x="399" y="1178" /> + <di:waypoint x="466" y="1178" /> <bpmndi:BPMNLabel> <dc:Bounds x="123" y="1163" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="InclusiveGateway_1adrta3_di" bpmnElement="ExclusiveGateway_1dcb5p2"> - <dc:Bounds x="372" y="1153" width="50" height="50" /> + <dc:Bounds x="682" y="1153" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="397" y="1203" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0ze5k6c_di" bpmnElement="SequenceFlow_0ze5k6c"> - <di:waypoint xsi:type="dc:Point" x="422" y="1178" /> - <di:waypoint xsi:type="dc:Point" x="933" y="1178" /> - <di:waypoint xsi:type="dc:Point" x="933" y="1026" /> + <di:waypoint x="732" y="1178" /> + <di:waypoint x="1110" y="1178" /> <bpmndi:BPMNLabel> <dc:Bounds x="678" y="1163" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="TextAnnotation_0qx19b9_di" bpmnElement="TextAnnotation_0qx19b9"> - <dc:Bounds x="736" y="808" width="168" height="39" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Association_10dk4x3_di" bpmnElement="Association_10dk4x3"> - <di:waypoint xsi:type="dc:Point" x="797" y="946" /> - <di:waypoint xsi:type="dc:Point" x="816" y="847" /> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0e58tta_di" bpmnElement="callGetServiceInstance"> - <dc:Bounds x="686" y="163" width="100" height="80" /> + <dc:Bounds x="996" y="163" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_06vsf1e_di" bpmnElement="openstackAdapterTask"> + <dc:Bounds x="1653" y="1190" width="100" height="80" /> </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="Flow_1eutzkj_di" bpmnElement="Flow_1eutzkj"> + <di:waypoint x="1704" y="1270" /> + <di:waypoint x="1704" y="1430" /> + <di:waypoint x="1586" y="1430" /> + </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn2:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateNetworkInstanceRollback.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateNetworkInstanceRollback.bpmn deleted file mode 100644 index 9d37d8084e..0000000000 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateNetworkInstanceRollback.bpmn +++ /dev/null @@ -1,374 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0"> - <bpmn:process id="DoUpdateNetworkInstanceRollback" name="DoUpdateNetworkInstanceRollback" isExecutable="true"> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_1krl2dg</bpmn:outgoing> - </bpmn:startEvent> - <bpmn:scriptTask id="Task_0whino1" name="PreProcess Incoming Data" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_1krl2dg</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0u41iz2</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() -DoUpdateNetworkInstanceRollback.preProcessRequest(execution)]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:sequenceFlow id="SequenceFlow_1krl2dg" sourceRef="StartEvent_1" targetRef="Task_0whino1" /> - <bpmn:sequenceFlow id="SequenceFlow_0u41iz2" sourceRef="Task_0whino1" targetRef="ExclusiveGateway_0v0en47" /> - <bpmn:serviceTask id="ServiceTask_0bqh5yl" name="Call Rollback Network"> - <bpmn:extensionElements> - <camunda:connector> - <camunda:inputOutput> - <camunda:inputParameter name="payload">${UPDNETIR_rollbackNetworkRequest}</camunda:inputParameter> - <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution)} -]]></camunda:inputParameter> - <camunda:inputParameter name="headers"> - <camunda:map> - <camunda:entry key="Authorization">#{BasicAuthHeaderValuePO}</camunda:entry> - <camunda:entry key="content-type">application/xml</camunda:entry> - </camunda:map> - </camunda:inputParameter> - <camunda:inputParameter name="method">PUT</camunda:inputParameter> - <camunda:outputParameter name="UPDNETIR_rollbackNetworkReturnCode">${statusCode}</camunda:outputParameter> - <camunda:outputParameter name="UPDNETIR_rollbackNetworkResponse">${response}</camunda:outputParameter> - </camunda:inputOutput> - <camunda:connectorId>http-connector</camunda:connectorId> - </camunda:connector> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_0e1uixp</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_17o4w67</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_0v0en47" name="is PO Network Rollback?" default="SequenceFlow_1lteduj"> - <bpmn:incoming>SequenceFlow_0u41iz2</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0e1uixp</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_1lteduj</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:callActivity id="CallActivity_1xilevb" name="Call Rollback SDNC Adapter" calledElement="sdncAdapter"> - <bpmn:extensionElements> - <camunda:in source="UPDNETIR_rollbackSDNCRequest" target="sdncAdapterWorkflowRequest" /> - <camunda:in source="mso-request-id" target="mso-request-id" /> - <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> - <camunda:out source="SDNCA_ResponseCode" target="UPDNETIR_rollbackSDNCReturnCode" /> - <camunda:out source="sdncAdapterResponse" target="UPDNETIR_rollbackSDNCResponse" /> - <camunda:out source="WorkflowException" target="WorkflowException" /> - <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_101y57s</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0790olb</bpmn:outgoing> - </bpmn:callActivity> - <bpmn:exclusiveGateway id="ExclusiveGateway_17g4q5c" name="is RSRC SDNC?" default="SequenceFlow_101y57s"> - <bpmn:incoming>SequenceFlow_0virkpu</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_101y57s</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0mw0dgd</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:scriptTask id="ScriptTask_1ggaxfu" name="Validate Rollback Responses" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_0qc4v9t</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0el8yzs</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0yto4gz</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() -DoUpdateNetworkInstanceRollback.validateRollbackResponses(execution)]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_1n5jck8" name="is SDNC Rollback?" default="SequenceFlow_0qc4v9t"> - <bpmn:incoming>SequenceFlow_1lteduj</bpmn:incoming> - <bpmn:incoming>SequenceFlow_17o4w67</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0virkpu</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0qc4v9t</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0e1uixp" name="Yes" sourceRef="ExclusiveGateway_0v0en47" targetRef="ServiceTask_0bqh5yl"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("UPDNETIR_rollbackNetworkRequest") != null}]]></bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_1lteduj" name="No" sourceRef="ExclusiveGateway_0v0en47" targetRef="ExclusiveGateway_1n5jck8" /> - <bpmn:sequenceFlow id="SequenceFlow_0virkpu" name="Yes" sourceRef="ExclusiveGateway_1n5jck8" targetRef="ExclusiveGateway_17g4q5c"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("UPDNETIR_rollbackSDNCRequest") != null}]]></bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_17o4w67" sourceRef="ServiceTask_0bqh5yl" targetRef="ExclusiveGateway_1n5jck8" /> - <bpmn:sequenceFlow id="SequenceFlow_101y57s" name="No" sourceRef="ExclusiveGateway_17g4q5c" targetRef="CallActivity_1xilevb" /> - <bpmn:sequenceFlow id="SequenceFlow_0mw0dgd" name="Yes" sourceRef="ExclusiveGateway_17g4q5c" targetRef="ExclusiveGateway_0b9kbop"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion") != '1610'} ]]></bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:endEvent id="EndEvent_1fvr7ad"> - <bpmn:incoming>SequenceFlow_0yto4gz</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0qc4v9t" name="No" sourceRef="ExclusiveGateway_1n5jck8" targetRef="ScriptTask_1ggaxfu" /> - <bpmn:sequenceFlow id="SequenceFlow_0790olb" sourceRef="CallActivity_1xilevb" targetRef="ExclusiveGateway_0b9kbop" /> - <bpmn:subProcess id="SubProcess_1p4663w" name="Sub-process for UnexpectedErrors" triggeredByEvent="true"> - <bpmn:scriptTask id="ScriptTask_0by1uwk" name="Log / Print Unexpected Error" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_0xktw7v</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0soe5t3</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -def DoUpdateNetworkInstanceRollback = new DoUpdateNetworkInstanceRollback() -DoUpdateNetworkInstanceRollback.processJavaException(execution)]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:startEvent id="StartEvent_1j0eixl"> - <bpmn:outgoing>SequenceFlow_0xktw7v</bpmn:outgoing> - <bpmn:errorEventDefinition /> - </bpmn:startEvent> - <bpmn:endEvent id="EndEvent_0jxh015"> - <bpmn:incoming>SequenceFlow_0soe5t3</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0xktw7v" name="" sourceRef="StartEvent_1j0eixl" targetRef="ScriptTask_0by1uwk" /> - <bpmn:sequenceFlow id="SequenceFlow_0soe5t3" name="" sourceRef="ScriptTask_0by1uwk" targetRef="EndEvent_0jxh015" /> - </bpmn:subProcess> - <bpmn:inclusiveGateway id="ExclusiveGateway_0b9kbop"> - <bpmn:incoming>SequenceFlow_0790olb</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0mw0dgd</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0el8yzs</bpmn:outgoing> - </bpmn:inclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0el8yzs" sourceRef="ExclusiveGateway_0b9kbop" targetRef="ScriptTask_1ggaxfu" /> - <bpmn:sequenceFlow id="SequenceFlow_0yto4gz" sourceRef="ScriptTask_1ggaxfu" targetRef="EndEvent_1fvr7ad" /> - <bpmn:subProcess id="SubProcess_1b8rnqv" name="Sub-process for UnexpectedErrors" triggeredByEvent="true"> - <bpmn:scriptTask id="ScriptTask_02d3i14" name="Catch Exception"> - <bpmn:incoming>SequenceFlow_07kf49j</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_01syg1x</bpmn:outgoing> - <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* -execution.setVariable("workflowException", execution.getVariable("WorkflowException")]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:startEvent id="StartEvent_0e8yrgo"> - <bpmn:outgoing>SequenceFlow_07kf49j</bpmn:outgoing> - <bpmn:errorEventDefinition /> - </bpmn:startEvent> - <bpmn:endEvent id="EndEvent_1cmovvm"> - <bpmn:incoming>SequenceFlow_01syg1x</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_07kf49j" name="" sourceRef="StartEvent_0e8yrgo" targetRef="ScriptTask_02d3i14" /> - <bpmn:sequenceFlow id="SequenceFlow_01syg1x" name="" sourceRef="ScriptTask_02d3i14" targetRef="EndEvent_1cmovvm" /> - </bpmn:subProcess> - <bpmn:textAnnotation id="TextAnnotation_000ap15"> <bpmn:text><![CDATA[Include ONLY inputs/varrables: -rollbackData, as Map --rollbackSDNCRequest --rollbackNetworkRequest -WorkflowException - -]]></bpmn:text> -</bpmn:textAnnotation> - <bpmn:association id="Association_0ybkmal" sourceRef="Task_0whino1" targetRef="TextAnnotation_000ap15" /> - <bpmn:textAnnotation id="TextAnnotation_0vwyo82"> <bpmn:text><![CDATA[set value for: -WorkflowException -rolledBack -wasDeleted -]]></bpmn:text> -</bpmn:textAnnotation> - <bpmn:association id="Association_1gx121b" sourceRef="ScriptTask_1ggaxfu" targetRef="TextAnnotation_0vwyo82" /> - </bpmn:process> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoUpdateNetworkInstanceRollback"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> - <dc:Bounds x="240" y="354" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="258" y="390" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_1dqe09s_di" bpmnElement="Task_0whino1"> - <dc:Bounds x="403" y="332" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1krl2dg_di" bpmnElement="SequenceFlow_1krl2dg"> - <di:waypoint xsi:type="dc:Point" x="276" y="372" /> - <di:waypoint xsi:type="dc:Point" x="382" y="372" /> - <di:waypoint xsi:type="dc:Point" x="382" y="372" /> - <di:waypoint xsi:type="dc:Point" x="403" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="397" y="372" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0u41iz2_di" bpmnElement="SequenceFlow_0u41iz2"> - <di:waypoint xsi:type="dc:Point" x="503" y="372" /> - <di:waypoint xsi:type="dc:Point" x="660" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="582" y="357" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0bqh5yl_di" bpmnElement="ServiceTask_0bqh5yl"> - <dc:Bounds x="635" y="481" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0v0en47_di" bpmnElement="ExclusiveGateway_0v0en47" isMarkerVisible="true"> - <dc:Bounds x="660" y="347" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="648" y="312" width="74" height="24" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="TextAnnotation_000ap15_di" bpmnElement="TextAnnotation_000ap15"> - <dc:Bounds x="469" y="133" width="277" height="115" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Association_0ybkmal_di" bpmnElement="Association_0ybkmal"> - <di:waypoint xsi:type="dc:Point" x="487" y="332" /> - <di:waypoint xsi:type="dc:Point" x="559" y="248" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="CallActivity_1xilevb_di" bpmnElement="CallActivity_1xilevb"> - <dc:Bounds x="995" y="610" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_17g4q5c_di" bpmnElement="ExclusiveGateway_17g4q5c" isMarkerVisible="true"> - <dc:Bounds x="879" y="496" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="926" y="474" width="82" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_1ggaxfu_di" bpmnElement="ScriptTask_1ggaxfu"> - <dc:Bounds x="1123" y="332" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1n5jck8_di" bpmnElement="ExclusiveGateway_1n5jck8" isMarkerVisible="true"> - <dc:Bounds x="879" y="347" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="880" y="308" width="48" height="24" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="TextAnnotation_0vwyo82_di" bpmnElement="TextAnnotation_0vwyo82"> - <dc:Bounds x="1287" y="410" width="165" height="60" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Association_1gx121b_di" bpmnElement="Association_1gx121b"> - <di:waypoint xsi:type="dc:Point" x="1223" y="389" /> - <di:waypoint xsi:type="dc:Point" x="1287" y="412" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0e1uixp_di" bpmnElement="SequenceFlow_0e1uixp"> - <di:waypoint xsi:type="dc:Point" x="685" y="397" /> - <di:waypoint xsi:type="dc:Point" x="685" y="439" /> - <di:waypoint xsi:type="dc:Point" x="685" y="439" /> - <di:waypoint xsi:type="dc:Point" x="685" y="481" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="693" y="395" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1lteduj_di" bpmnElement="SequenceFlow_1lteduj"> - <di:waypoint xsi:type="dc:Point" x="710" y="372" /> - <di:waypoint xsi:type="dc:Point" x="879" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="716" y="350" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0virkpu_di" bpmnElement="SequenceFlow_0virkpu"> - <di:waypoint xsi:type="dc:Point" x="904" y="397" /> - <di:waypoint xsi:type="dc:Point" x="904" y="496" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="914" y="392.7469456247061" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_17o4w67_di" bpmnElement="SequenceFlow_17o4w67"> - <di:waypoint xsi:type="dc:Point" x="735" y="521" /> - <di:waypoint xsi:type="dc:Point" x="817" y="521" /> - <di:waypoint xsi:type="dc:Point" x="817" y="372" /> - <di:waypoint xsi:type="dc:Point" x="879" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="832" y="446.5" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_101y57s_di" bpmnElement="SequenceFlow_101y57s"> - <di:waypoint xsi:type="dc:Point" x="904" y="546" /> - <di:waypoint xsi:type="dc:Point" x="904" y="650" /> - <di:waypoint xsi:type="dc:Point" x="995" y="650" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="913" y="544.0784313725491" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0mw0dgd_di" bpmnElement="SequenceFlow_0mw0dgd"> - <di:waypoint xsi:type="dc:Point" x="929" y="521" /> - <di:waypoint xsi:type="dc:Point" x="1148" y="521" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="937" y="500" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_1fvr7ad_di" bpmnElement="EndEvent_1fvr7ad"> - <dc:Bounds x="1352" y="354" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1370" y="390" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0qc4v9t_di" bpmnElement="SequenceFlow_0qc4v9t"> - <di:waypoint xsi:type="dc:Point" x="929" y="372" /> - <di:waypoint xsi:type="dc:Point" x="1123" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="941" y="351.1191898360114" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0790olb_di" bpmnElement="SequenceFlow_0790olb"> - <di:waypoint xsi:type="dc:Point" x="1095" y="650" /> - <di:waypoint xsi:type="dc:Point" x="1173" y="650" /> - <di:waypoint xsi:type="dc:Point" x="1173" y="546" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1134" y="635" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="SubProcess_1p4663w_di" bpmnElement="SubProcess_1p4663w" isExpanded="true"> - <dc:Bounds x="61" y="668" width="394" height="188" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_0by1uwk_di" bpmnElement="ScriptTask_0by1uwk"> - <dc:Bounds x="209" y="723" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_1j0eixl_di" bpmnElement="StartEvent_1j0eixl"> - <dc:Bounds x="94" y="745" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="112" y="786" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_0jxh015_di" bpmnElement="EndEvent_0jxh015"> - <dc:Bounds x="370" y="745" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="388" y="786" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0xktw7v_di" bpmnElement="SequenceFlow_0xktw7v"> - <di:waypoint xsi:type="dc:Point" x="130" y="763" /> - <di:waypoint xsi:type="dc:Point" x="209" y="763" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="172" y="763" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0soe5t3_di" bpmnElement="SequenceFlow_0soe5t3"> - <di:waypoint xsi:type="dc:Point" x="309" y="763" /> - <di:waypoint xsi:type="dc:Point" x="370" y="763" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="344" y="763" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="InclusiveGateway_0dot6c9_di" bpmnElement="ExclusiveGateway_0b9kbop"> - <dc:Bounds x="1148" y="496" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1173" y="546" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0el8yzs_di" bpmnElement="SequenceFlow_0el8yzs"> - <di:waypoint xsi:type="dc:Point" x="1173" y="496" /> - <di:waypoint xsi:type="dc:Point" x="1173" y="412" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1188" y="444" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0yto4gz_di" bpmnElement="SequenceFlow_0yto4gz"> - <di:waypoint xsi:type="dc:Point" x="1223" y="372" /> - <di:waypoint xsi:type="dc:Point" x="1352" y="372" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1288" y="357" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="SubProcess_1b8rnqv_di" bpmnElement="SubProcess_1b8rnqv" isExpanded="true"> - <dc:Bounds x="61" y="916" width="394" height="188" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_02d3i14_di" bpmnElement="ScriptTask_02d3i14"> - <dc:Bounds x="209" y="971" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_0e8yrgo_di" bpmnElement="StartEvent_0e8yrgo"> - <dc:Bounds x="94" y="993" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="112" y="1034" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_1cmovvm_di" bpmnElement="EndEvent_1cmovvm"> - <dc:Bounds x="370" y="993" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="388" y="1034" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_07kf49j_di" bpmnElement="SequenceFlow_07kf49j"> - <di:waypoint xsi:type="dc:Point" x="130" y="1011" /> - <di:waypoint xsi:type="dc:Point" x="209" y="1011" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="172" y="1011" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_01syg1x_di" bpmnElement="SequenceFlow_01syg1x"> - <di:waypoint xsi:type="dc:Point" x="309" y="1011" /> - <di:waypoint xsi:type="dc:Point" x="370" y="1011" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="344" y="1011" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions>
\ No newline at end of file diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateVfModule.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateVfModule.bpmn index cfda2ad73c..d423ae5cba 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateVfModule.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoUpdateVfModule.bpmn @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_Wblj8GyfEeWUWLTvug7ZOg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoUpdateVfModule" name="DoUpdateVfModule" isExecutable="true"> - <bpmn2:documentation><![CDATA[This flow expects its incoming request to be in the variable 'DoUpdateVfModuleRequest'. This flow produces no output.]]></bpmn2:documentation> + <bpmn2:documentation>This flow expects its incoming request to be in the variable 'DoUpdateVfModuleRequest'. This flow produces no output.</bpmn2:documentation> <bpmn2:scriptTask id="PrepareUpdateAAIVfModule_prep" name="Prepare Update AAI Vf Module (prep)" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_38</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.prepPrepareUpdateAAIVfModule(execution)]]></bpmn2:script> +duvm.prepPrepareUpdateAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="PrepareUpdateAAIVfModule_prep" targetRef="ScriptTask_1" /> <bpmn2:callActivity id="ScriptTask_1" name="Prepare Update AAI Vf Module" calledElement="PrepareUpdateAAIVfModule"> @@ -26,18 +26,18 @@ duvm.prepPrepareUpdateAAIVfModule(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ProcessReceivedRequest" name="Process Received Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_38</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.preProcessRequest(execution)]]></bpmn2:script> +duvm.preProcessRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_38" name="" sourceRef="ProcessReceivedRequest" targetRef="PrepareUpdateAAIVfModule_prep" /> <bpmn2:subProcess id="SubProcess_1" name="Catch Exception" triggeredByEvent="true"> <bpmn2:scriptTask id="ScriptTask_16" name="Handle Exception" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_6</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_35</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.handleWorkflowException(execution)]]></bpmn2:script> +duvm.handleWorkflowException(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:endEvent id="EndEvent_3"> <bpmn2:incoming>SequenceFlow_35</bpmn2:incoming> @@ -63,9 +63,9 @@ duvm.handleWorkflowException(execution)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_18</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_25</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.prepUpdateAAIVfModule(execution)]]></bpmn2:script> +duvm.prepUpdateAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_25" name="" sourceRef="ScriptTask_10" targetRef="ScriptTask_11" /> <bpmn2:callActivity id="ScriptTask_11" name="UpdateAAIVfModule" calledElement="UpdateAAIVfModule"> @@ -83,9 +83,9 @@ duvm.prepUpdateAAIVfModule(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_12" name="SDNC Topology Activate (prep)" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_26</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_27</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.prepSDNCTopologyAct(execution)]]></bpmn2:script> +duvm.prepSDNCTopologyAct(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_27" name="" sourceRef="ScriptTask_12" targetRef="ScriptTask_13" /> <bpmn2:callActivity id="ScriptTask_13" name="SDNCAdapter Topology Activate" calledElement="sdncAdapter"> @@ -104,9 +104,9 @@ duvm.prepSDNCTopologyAct(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_14" name="Update AAI Generic Vnf (prep)" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_24</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.prepUpdateAAIGenericVnf(execution)]]></bpmn2:script> +duvm.prepUpdateAAIGenericVnf(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_13" name="" sourceRef="ScriptTask_14" targetRef="ExclusiveGateway_1" /> <bpmn2:callActivity id="CallActivity_1" name="UpdateAAIGenericVnf" calledElement="UpdateAAIGenericVnf"> @@ -128,7 +128,7 @@ duvm.prepUpdateAAIGenericVnf(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_14" name="Do the update" sourceRef="ExclusiveGateway_1" targetRef="CallActivity_1" /> <bpmn2:sequenceFlow id="SequenceFlow_18" name="Skip the update" sourceRef="ExclusiveGateway_1" targetRef="ScriptTask_10"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[${execution.getVariable('DOUPVfMod_skipUpdateGenericVnf')} == true]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">${execution.getVariable('DOUPVfMod_skipUpdateGenericVnf')} == true</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:startEvent id="StartEvent_1" name="Start"> <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> @@ -138,9 +138,9 @@ duvm.prepUpdateAAIGenericVnf(execution)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_16</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_17</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.prepSDNCTopologyChg(execution)]]></bpmn2:script> +duvm.prepSDNCTopologyChg(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_12" name="" sourceRef="ScriptTask_4" targetRef="ScriptTask_5" /> <bpmn2:callActivity id="ScriptTask_5" name="SDNC Adapter Topology Change/Assign" calledElement="sdncAdapter"> @@ -156,9 +156,9 @@ duvm.prepSDNCTopologyChg(execution)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing> </bpmn2:callActivity> - <bpmn2:callActivity id="ScriptTask_9" name="VnfAdapterRest" calledElement="vnfAdapterTask"> + <bpmn2:callActivity id="ScriptTask_9" name="VnfAdapterRest" calledElement="openstackAdapterTask"> <bpmn2:extensionElements> - <camunda:in source="DOUPVfMod_vnfAdapterRestRequest" target="vnfAdapterTaskRequest" /> + <camunda:in source="DOUPVfMod_vnfAdapterRestRequest" target="openstackAdapterTaskRequest" /> <camunda:in source="mso-request-id" target="mso-request-id" /> <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> <camunda:out source="WorkflowException" target="WorkflowException" /> @@ -171,18 +171,18 @@ duvm.prepSDNCTopologyChg(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_8" name="VNF Adapter (prep)" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_21</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.prepVnfAdapterRest(execution)]]></bpmn2:script> +duvm.prepVnfAdapterRest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_21" name="" sourceRef="ScriptTask_8" targetRef="ScriptTask_9" /> <bpmn2:scriptTask id="ScriptTask_15" name="Validate SDNC Query Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_22</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_23</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* String response = execution.getVariable("DOUPVfMod_sdncTopologyResponse") def duvm = new DoUpdateVfModule() -duvm.validateSDNCResponse(execution, response, "query")]]></bpmn2:script> +duvm.validateSDNCResponse(execution, response, "query")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="ScriptTask_7" name="SDNCAdapter Topology Query" calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -200,19 +200,19 @@ duvm.validateSDNCResponse(execution, response, "query")]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_18" name="Validate SDNC Change/Assign Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* String response = execution.getVariable("DOUPVfMod_sdncChangeAssignResponse") def duvm = new DoUpdateVfModule() -duvm.validateSDNCResponse(execution, response, "changeassign")]]></bpmn2:script> +duvm.validateSDNCResponse(execution, response, "changeassign")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_3" name="" sourceRef="ScriptTask_5" targetRef="ScriptTask_18" /> <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="ScriptTask_18" targetRef="ScriptTask_6" /> <bpmn2:scriptTask id="ScriptTask_6" name="SDNC Topology Query (prep)" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_19</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.prepSDNCTopologyQuery(execution)]]></bpmn2:script> +duvm.prepSDNCTopologyQuery(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_19" name="" sourceRef="ScriptTask_6" targetRef="ScriptTask_7" /> <bpmn2:sequenceFlow id="SequenceFlow_22" name="" sourceRef="ScriptTask_7" targetRef="ScriptTask_15" /> @@ -241,9 +241,9 @@ duvm.prepSDNCTopologyQuery(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_2" name="Confirm VolumeGroup Tenant (prep)" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_11</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def duvm = new DoUpdateVfModule() -duvm.prepConfirmVolumeGroupTenant(execution)]]></bpmn2:script> +duvm.prepConfirmVolumeGroupTenant(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_11" name="" sourceRef="ScriptTask_2" targetRef="ScriptTask_3" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_2" name="VolumeGroupId
present?" default="SequenceFlow_16"> @@ -252,18 +252,18 @@ duvm.prepConfirmVolumeGroupTenant(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_16</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_10" name="Yes" sourceRef="ExclusiveGateway_2" targetRef="ScriptTask_2"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[${execution.getVariable('DOUPVfMod_volumeGroupId').isEmpty()} == false]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">${execution.getVariable('DOUPVfMod_volumeGroupId').isEmpty()} == false</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_16" name="No" sourceRef="ExclusiveGateway_2" targetRef="ScriptTask_4" /> <bpmn2:sequenceFlow id="SequenceFlow_28" name="yes" sourceRef="IsBaseVfModule" targetRef="ExclusiveGateway_3"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("DOUPVfMod_isBaseVfModule") == "true"]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy">execution.getVariable("DOUPVfMod_isBaseVfModule") == "true"</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:scriptTask id="QueryAAIVfModule" name="Query AAI Vf Module" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_30</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_34</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def doUpdateVfModule = new DoUpdateVfModule() -doUpdateVfModule.queryAAIVfModule(execution)]]></bpmn2:script> +doUpdateVfModule.queryAAIVfModule(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_30" name="no" sourceRef="IsBaseVfModule" targetRef="QueryAAIVfModule" /> <bpmn2:sequenceFlow id="SequenceFlow_34" name="" sourceRef="QueryAAIVfModule" targetRef="ExclusiveGateway_3" /> @@ -277,16 +277,16 @@ doUpdateVfModule.queryAAIVfModule(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_19" name="PostProcess SDNC Adapter Activate" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_20</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* String response = execution.getVariable("DOUPVfMod_sdncActivateResponse") def duvm = new DoUpdateVfModule() -duvm.validateSDNCResponse(execution, response, "activate")]]></bpmn2:script> +duvm.validateSDNCResponse(execution, response, "activate")</bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="ScriptTask_17" name="Set Success Indicator" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_20</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> - <bpmn2:script><![CDATA[// This variable is checked by the unit test -execution.setVariable('DoUpdateVfModuleSuccessIndicator', true)]]></bpmn2:script> + <bpmn2:script>// This variable is checked by the unit test +execution.setVariable('DoUpdateVfModuleSuccessIndicator', true)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="ScriptTask_17" targetRef="EndEvent_1" /> <bpmn2:endEvent id="EndEvent_1" name="TheEnd"> @@ -299,369 +299,369 @@ execution.setVariable('DoUpdateVfModuleSuccessIndicator', true)]]></bpmn2:script <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoUpdateVfModule"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_37" bpmnElement="StartEvent_1"> - <dc:Bounds x="150" y="214" width="36" height="36" /> + <dc:Bounds x="230" y="214" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="151" y="255" width="34" height="22" /> + <dc:Bounds x="236" y="255" width="25" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_22" bpmnElement="ProcessReceivedRequest"> - <dc:Bounds x="300" y="192" width="100" height="80" /> + <dc:Bounds x="380" y="192" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_37" targetElement="_BPMNShape_ScriptTask_22"> - <di:waypoint xsi:type="dc:Point" x="186" y="232" /> - <di:waypoint xsi:type="dc:Point" x="300" y="232" /> + <di:waypoint x="266" y="232" /> + <di:waypoint x="380" y="232" /> <bpmndi:BPMNLabel> <dc:Bounds x="208" y="232" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_160" bpmnElement="PrepareUpdateAAIVfModule_prep"> - <dc:Bounds x="456" y="192" width="100" height="80" /> + <dc:Bounds x="536" y="192" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_38" bpmnElement="SequenceFlow_38" sourceElement="_BPMNShape_ScriptTask_22" targetElement="_BPMNShape_ScriptTask_160"> - <di:waypoint xsi:type="dc:Point" x="400" y="232" /> - <di:waypoint xsi:type="dc:Point" x="456" y="232" /> + <di:waypoint x="480" y="232" /> + <di:waypoint x="536" y="232" /> <bpmndi:BPMNLabel> <dc:Bounds x="492" y="232" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_164" bpmnElement="ScriptTask_1"> - <dc:Bounds x="624" y="192" width="100" height="80" /> + <dc:Bounds x="704" y="192" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_160" targetElement="_BPMNShape_ScriptTask_164"> - <di:waypoint xsi:type="dc:Point" x="556" y="232" /> - <di:waypoint xsi:type="dc:Point" x="624" y="232" /> + <di:waypoint x="636" y="232" /> + <di:waypoint x="704" y="232" /> <bpmndi:BPMNLabel> <dc:Bounds x="575" y="232" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_88" bpmnElement="ExclusiveGateway_2" isMarkerVisible="true"> - <dc:Bounds x="1039" y="206" width="50" height="50" /> + <dc:Bounds x="1119" y="206" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1011" y="172" width="109" height="38" /> + <dc:Bounds x="1108" y="172" width="76" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_165" bpmnElement="ScriptTask_2"> - <dc:Bounds x="1152" y="192" width="100" height="80" /> + <dc:Bounds x="1232" y="192" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_ExclusiveGateway_88" targetElement="_BPMNShape_ScriptTask_165"> - <di:waypoint xsi:type="dc:Point" x="1089" y="231" /> - <di:waypoint xsi:type="dc:Point" x="1118" y="231" /> - <di:waypoint xsi:type="dc:Point" x="1118" y="232" /> - <di:waypoint xsi:type="dc:Point" x="1152" y="232" /> + <di:waypoint x="1169" y="231" /> + <di:waypoint x="1198" y="231" /> + <di:waypoint x="1198" y="232" /> + <di:waypoint x="1232" y="232" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1099" y="231" width="29" height="22" /> + <dc:Bounds x="1185" y="231" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_166" bpmnElement="ScriptTask_3"> - <dc:Bounds x="1308" y="192" width="100" height="80" /> + <dc:Bounds x="1388" y="192" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_11" sourceElement="_BPMNShape_ScriptTask_165" targetElement="_BPMNShape_ScriptTask_166"> - <di:waypoint xsi:type="dc:Point" x="1252" y="232" /> - <di:waypoint xsi:type="dc:Point" x="1308" y="232" /> + <di:waypoint x="1332" y="232" /> + <di:waypoint x="1388" y="232" /> <bpmndi:BPMNLabel> <dc:Bounds x="1271" y="232" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_167" bpmnElement="ScriptTask_4"> - <dc:Bounds x="72" y="420" width="100" height="80" /> + <dc:Bounds x="152" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_168" bpmnElement="ScriptTask_5"> - <dc:Bounds x="239" y="420" width="100" height="80" /> + <dc:Bounds x="319" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_169" bpmnElement="ScriptTask_6"> - <dc:Bounds x="535" y="420" width="100" height="80" /> + <dc:Bounds x="615" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_ScriptTask_167" targetElement="_BPMNShape_ScriptTask_168"> - <di:waypoint xsi:type="dc:Point" x="172" y="460" /> - <di:waypoint xsi:type="dc:Point" x="239" y="460" /> + <di:waypoint x="252" y="460" /> + <di:waypoint x="319" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="197" y="460" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_16" bpmnElement="SequenceFlow_16" sourceElement="_BPMNShape_ExclusiveGateway_88" targetElement="_BPMNShape_ScriptTask_167"> - <di:waypoint xsi:type="dc:Point" x="1064" y="256" /> - <di:waypoint xsi:type="dc:Point" x="1064" y="351" /> - <di:waypoint xsi:type="dc:Point" x="122" y="351" /> - <di:waypoint xsi:type="dc:Point" x="122" y="420" /> + <di:waypoint x="1144" y="256" /> + <di:waypoint x="1144" y="351" /> + <di:waypoint x="202" y="351" /> + <di:waypoint x="202" y="420" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1073" y="271" width="22" height="22" /> + <dc:Bounds x="1157" y="271" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_17" bpmnElement="SequenceFlow_17" sourceElement="_BPMNShape_ScriptTask_166" targetElement="_BPMNShape_ScriptTask_167"> - <di:waypoint xsi:type="dc:Point" x="1358" y="272" /> - <di:waypoint xsi:type="dc:Point" x="1358" y="352" /> - <di:waypoint xsi:type="dc:Point" x="639" y="352" /> - <di:waypoint xsi:type="dc:Point" x="122" y="352" /> - <di:waypoint xsi:type="dc:Point" x="122" y="420" /> + <di:waypoint x="1438" y="272" /> + <di:waypoint x="1438" y="352" /> + <di:waypoint x="719" y="352" /> + <di:waypoint x="202" y="352" /> + <di:waypoint x="202" y="420" /> <bpmndi:BPMNLabel> <dc:Bounds x="927" y="352" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_170" bpmnElement="ScriptTask_7"> - <dc:Bounds x="684" y="420" width="100" height="80" /> + <dc:Bounds x="764" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_ScriptTask_169" targetElement="_BPMNShape_ScriptTask_170"> - <di:waypoint xsi:type="dc:Point" x="635" y="460" /> - <di:waypoint xsi:type="dc:Point" x="684" y="460" /> + <di:waypoint x="715" y="460" /> + <di:waypoint x="764" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="648" y="460" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_171" bpmnElement="ScriptTask_8"> - <dc:Bounds x="996" y="420" width="100" height="80" /> + <dc:Bounds x="1076" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_172" bpmnElement="ScriptTask_9"> - <dc:Bounds x="1176" y="420" width="100" height="80" /> + <dc:Bounds x="1256" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_21" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_ScriptTask_171" targetElement="_BPMNShape_ScriptTask_172"> - <di:waypoint xsi:type="dc:Point" x="1096" y="460" /> - <di:waypoint xsi:type="dc:Point" x="1176" y="460" /> + <di:waypoint x="1176" y="460" /> + <di:waypoint x="1256" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="1133" y="460" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_173" bpmnElement="ScriptTask_10"> - <dc:Bounds x="466" y="636" width="100" height="80" /> + <dc:Bounds x="546" y="636" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_174" bpmnElement="ScriptTask_11"> - <dc:Bounds x="624" y="636" width="100" height="80" /> + <dc:Bounds x="704" y="636" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_22" bpmnElement="SequenceFlow_24" sourceElement="_BPMNShape_ScriptTask_172" targetElement="_BPMNShape_ScriptTask_219"> - <di:waypoint xsi:type="dc:Point" x="1226" y="500" /> - <di:waypoint xsi:type="dc:Point" x="1226" y="576" /> - <di:waypoint xsi:type="dc:Point" x="194" y="576" /> - <di:waypoint xsi:type="dc:Point" x="194" y="636" /> + <di:waypoint x="1306" y="500" /> + <di:waypoint x="1306" y="576" /> + <di:waypoint x="274" y="576" /> + <di:waypoint x="274" y="636" /> <bpmndi:BPMNLabel> <dc:Bounds x="821" y="576" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_25" bpmnElement="SequenceFlow_25" sourceElement="_BPMNShape_ScriptTask_173" targetElement="_BPMNShape_ScriptTask_174"> - <di:waypoint xsi:type="dc:Point" x="566" y="676" /> - <di:waypoint xsi:type="dc:Point" x="624" y="676" /> + <di:waypoint x="646" y="676" /> + <di:waypoint x="704" y="676" /> <bpmndi:BPMNLabel> <dc:Bounds x="591" y="676" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_175" bpmnElement="ScriptTask_12"> - <dc:Bounds x="804" y="636" width="100" height="80" /> + <dc:Bounds x="884" y="636" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_176" bpmnElement="ScriptTask_13"> - <dc:Bounds x="984" y="636" width="100" height="80" /> + <dc:Bounds x="1064" y="636" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="SequenceFlow_26" sourceElement="_BPMNShape_ScriptTask_174" targetElement="_BPMNShape_ScriptTask_175"> - <di:waypoint xsi:type="dc:Point" x="724" y="676" /> - <di:waypoint xsi:type="dc:Point" x="804" y="676" /> + <di:waypoint x="804" y="676" /> + <di:waypoint x="884" y="676" /> <bpmndi:BPMNLabel> <dc:Bounds x="695" y="674" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_27" bpmnElement="SequenceFlow_27" sourceElement="_BPMNShape_ScriptTask_175" targetElement="_BPMNShape_ScriptTask_176"> - <di:waypoint xsi:type="dc:Point" x="904" y="676" /> - <di:waypoint xsi:type="dc:Point" x="984" y="676" /> + <di:waypoint x="984" y="676" /> + <di:waypoint x="1064" y="676" /> <bpmndi:BPMNLabel> <dc:Bounds x="902" y="676" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_162" bpmnElement="EndEvent_1"> - <dc:Bounds x="1208" y="906" width="36" height="36" /> + <dc:Bounds x="1288" y="906" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1201" y="947" width="50" height="22" /> + <dc:Bounds x="1287" y="947" width="38" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_SubProcess_21" bpmnElement="SubProcess_1" isExpanded="true"> - <dc:Bounds x="239" y="924" width="475" height="198" /> + <dc:Bounds x="319" y="924" width="475" height="198" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_179" bpmnElement="ScriptTask_16"> - <dc:Bounds x="399" y="984" width="100" height="80" /> + <dc:Bounds x="479" y="984" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_163" bpmnElement="EndEvent_3"> - <dc:Bounds x="617" y="1006" width="36" height="36" /> + <dc:Bounds x="697" y="1006" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="635" y="1047" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_ScriptTask_179" targetElement="_BPMNShape_EndEvent_163"> - <di:waypoint xsi:type="dc:Point" x="499" y="1024" /> - <di:waypoint xsi:type="dc:Point" x="617" y="1024" /> + <di:waypoint x="579" y="1024" /> + <di:waypoint x="697" y="1024" /> <bpmndi:BPMNLabel> <dc:Bounds x="555" y="1024" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_46" bpmnElement="BoundaryEvent_1"> - <dc:Bounds x="696" y="1005" width="36" height="36" /> + <dc:Bounds x="776" y="1005" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="711" y="1046" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_EndEvent_164" bpmnElement="EndEvent_5"> - <dc:Bounds x="814" y="1005" width="36" height="36" /> + <dc:Bounds x="894" y="1005" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="832" y="1046" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_36" bpmnElement="SequenceFlow_36" sourceElement="_BPMNShape_BoundaryEvent_46" targetElement="_BPMNShape_EndEvent_164"> - <di:waypoint xsi:type="dc:Point" x="732" y="1023" /> - <di:waypoint xsi:type="dc:Point" x="814" y="1023" /> + <di:waypoint x="812" y="1023" /> + <di:waypoint x="894" y="1023" /> <bpmndi:BPMNLabel> <dc:Bounds x="770" y="1023" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_56" bpmnElement="StartEvent_3"> - <dc:Bounds x="305" y="1006" width="36" height="36" /> + <dc:Bounds x="385" y="1006" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="323" y="1047" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_StartEvent_56" targetElement="_BPMNShape_ScriptTask_179"> - <di:waypoint xsi:type="dc:Point" x="341" y="1024" /> - <di:waypoint xsi:type="dc:Point" x="399" y="1024" /> + <di:waypoint x="421" y="1024" /> + <di:waypoint x="479" y="1024" /> <bpmndi:BPMNLabel> <dc:Bounds x="302" y="1084" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_180" bpmnElement="ScriptTask_17"> - <dc:Bounds x="1176" y="768" width="100" height="80" /> + <dc:Bounds x="1256" y="768" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ScriptTask_180" targetElement="_BPMNShape_EndEvent_162"> - <di:waypoint xsi:type="dc:Point" x="1226" y="848" /> - <di:waypoint xsi:type="dc:Point" x="1226" y="906" /> + <di:waypoint x="1306" y="848" /> + <di:waypoint x="1306" y="906" /> <bpmndi:BPMNLabel> <dc:Bounds x="1223" y="868" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_219" bpmnElement="ScriptTask_14"> - <dc:Bounds x="144" y="636" width="100" height="80" /> + <dc:Bounds x="224" y="636" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_CallActivity_2" bpmnElement="CallActivity_1"> - <dc:Bounds x="300" y="636" width="100" height="80" /> + <dc:Bounds x="380" y="636" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_CallActivity_2" targetElement="_BPMNShape_ScriptTask_173"> - <di:waypoint xsi:type="dc:Point" x="400" y="676" /> - <di:waypoint xsi:type="dc:Point" x="466" y="676" /> + <di:waypoint x="480" y="676" /> + <di:waypoint x="546" y="676" /> <bpmndi:BPMNLabel> <dc:Bounds x="431" y="676" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_ScriptTask_219" targetElement="_BPMNShape_ExclusiveGateway_213"> - <di:waypoint xsi:type="dc:Point" x="194" y="716" /> - <di:waypoint xsi:type="dc:Point" x="195" y="793" /> - <di:waypoint xsi:type="dc:Point" x="284" y="793" /> - <di:waypoint xsi:type="dc:Point" x="324" y="793" /> + <di:waypoint x="274" y="716" /> + <di:waypoint x="275" y="793" /> + <di:waypoint x="364" y="793" /> + <di:waypoint x="404" y="793" /> <bpmndi:BPMNLabel> <dc:Bounds x="191" y="746" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_213" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true"> - <dc:Bounds x="324" y="768" width="50" height="50" /> + <dc:Bounds x="404" y="768" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="349" y="823" width="0" height="0" /> + <dc:Bounds x="397" y="823" width="65" height="40" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ExclusiveGateway_213" targetElement="_BPMNShape_CallActivity_2"> - <di:waypoint xsi:type="dc:Point" x="349" y="768" /> - <di:waypoint xsi:type="dc:Point" x="350" y="716" /> + <di:waypoint x="429" y="768" /> + <di:waypoint x="430" y="716" /> <bpmndi:BPMNLabel> - <dc:Bounds x="357" y="733" width="80" height="22" /> + <dc:Bounds x="442" y="733" width="70" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_18" sourceElement="_BPMNShape_ExclusiveGateway_213" targetElement="_BPMNShape_ScriptTask_173"> - <di:waypoint xsi:type="dc:Point" x="374" y="793" /> - <di:waypoint xsi:type="dc:Point" x="515" y="793" /> - <di:waypoint xsi:type="dc:Point" x="516" y="716" /> + <di:waypoint x="454" y="793" /> + <di:waypoint x="595" y="793" /> + <di:waypoint x="596" y="716" /> <bpmndi:BPMNLabel> - <dc:Bounds x="380" y="768" width="97" height="22" /> + <dc:Bounds x="470" y="768" width="77" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_220" bpmnElement="ScriptTask_15"> - <dc:Bounds x="840" y="420" width="100" height="80" /> + <dc:Bounds x="920" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_221" bpmnElement="ScriptTask_18"> - <dc:Bounds x="384" y="420" width="100" height="80" /> + <dc:Bounds x="464" y="420" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_3" sourceElement="_BPMNShape_ScriptTask_168" targetElement="_BPMNShape_ScriptTask_221"> - <di:waypoint xsi:type="dc:Point" x="339" y="460" /> - <di:waypoint xsi:type="dc:Point" x="384" y="460" /> + <di:waypoint x="419" y="460" /> + <di:waypoint x="464" y="460" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_221" targetElement="_BPMNShape_ScriptTask_169"> - <di:waypoint xsi:type="dc:Point" x="484" y="460" /> - <di:waypoint xsi:type="dc:Point" x="535" y="460" /> + <di:waypoint x="564" y="460" /> + <di:waypoint x="615" y="460" /> <bpmndi:BPMNLabel> <dc:Bounds x="511" y="460" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_23" bpmnElement="SequenceFlow_22" sourceElement="_BPMNShape_ScriptTask_170" targetElement="_BPMNShape_ScriptTask_220"> - <di:waypoint xsi:type="dc:Point" x="784" y="460" /> - <di:waypoint xsi:type="dc:Point" x="840" y="460" /> + <di:waypoint x="864" y="460" /> + <di:waypoint x="920" y="460" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_24" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_ScriptTask_220" targetElement="_BPMNShape_ScriptTask_171"> - <di:waypoint xsi:type="dc:Point" x="940" y="460" /> - <di:waypoint xsi:type="dc:Point" x="996" y="460" /> + <di:waypoint x="1020" y="460" /> + <di:waypoint x="1076" y="460" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_214" bpmnElement="ExclusiveGateway_3" isMarkerVisible="true"> - <dc:Bounds x="965" y="206" width="50" height="50" /> + <dc:Bounds x="1045" y="206" width="50" height="50" /> <bpmndi:BPMNLabel> <dc:Bounds x="990" y="261" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_215" bpmnElement="IsBaseVfModule" isMarkerVisible="true"> - <dc:Bounds x="770" y="206" width="50" height="50" /> + <dc:Bounds x="850" y="206" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="795" y="261" width="0" height="0" /> + <dc:Bounds x="848" y="261" width="55" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_285" bpmnElement="QueryAAIVfModule"> - <dc:Bounds x="849" y="72" width="100" height="80" /> + <dc:Bounds x="929" y="72" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ScriptTask_164" targetElement="_BPMNShape_ExclusiveGateway_215"> - <di:waypoint xsi:type="dc:Point" x="724" y="232" /> - <di:waypoint xsi:type="dc:Point" x="747" y="232" /> - <di:waypoint xsi:type="dc:Point" x="747" y="231" /> - <di:waypoint xsi:type="dc:Point" x="770" y="231" /> + <di:waypoint x="804" y="232" /> + <di:waypoint x="827" y="232" /> + <di:waypoint x="827" y="231" /> + <di:waypoint x="850" y="231" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_28" sourceElement="_BPMNShape_ExclusiveGateway_215" targetElement="_BPMNShape_ExclusiveGateway_214"> - <di:waypoint xsi:type="dc:Point" x="820" y="231" /> - <di:waypoint xsi:type="dc:Point" x="965" y="231" /> + <di:waypoint x="900" y="231" /> + <di:waypoint x="1045" y="231" /> <bpmndi:BPMNLabel> - <dc:Bounds x="888" y="231" width="6" height="6" /> + <dc:Bounds x="963" y="231" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_29" sourceElement="_BPMNShape_ExclusiveGateway_214" targetElement="_BPMNShape_ExclusiveGateway_88"> - <di:waypoint xsi:type="dc:Point" x="1015" y="231" /> - <di:waypoint xsi:type="dc:Point" x="1039" y="231" /> + <di:waypoint x="1095" y="231" /> + <di:waypoint x="1119" y="231" /> <bpmndi:BPMNLabel> <dc:Bounds x="1015" y="231" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_30" bpmnElement="SequenceFlow_30" sourceElement="_BPMNShape_ExclusiveGateway_215" targetElement="_BPMNShape_ScriptTask_285"> - <di:waypoint xsi:type="dc:Point" x="795" y="206" /> - <di:waypoint xsi:type="dc:Point" x="795" y="112" /> - <di:waypoint xsi:type="dc:Point" x="849" y="112" /> + <di:waypoint x="875" y="206" /> + <di:waypoint x="875" y="112" /> + <di:waypoint x="929" y="112" /> <bpmndi:BPMNLabel> - <dc:Bounds x="770" y="151" width="20" height="22" /> + <dc:Bounds x="854" y="151" width="13" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_34" bpmnElement="SequenceFlow_34" sourceElement="_BPMNShape_ScriptTask_285" targetElement="_BPMNShape_ExclusiveGateway_214"> - <di:waypoint xsi:type="dc:Point" x="949" y="112" /> - <di:waypoint xsi:type="dc:Point" x="966" y="112" /> - <di:waypoint xsi:type="dc:Point" x="990" y="112" /> - <di:waypoint xsi:type="dc:Point" x="990" y="206" /> + <di:waypoint x="1029" y="112" /> + <di:waypoint x="1046" y="112" /> + <di:waypoint x="1070" y="112" /> + <di:waypoint x="1070" y="206" /> <bpmndi:BPMNLabel> <dc:Bounds x="987" y="136" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_286" bpmnElement="ScriptTask_19"> - <dc:Bounds x="1176" y="636" width="100" height="80" /> + <dc:Bounds x="1256" y="636" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_7" sourceElement="_BPMNShape_ScriptTask_176" targetElement="_BPMNShape_ScriptTask_286"> - <di:waypoint xsi:type="dc:Point" x="1084" y="676" /> - <di:waypoint xsi:type="dc:Point" x="1176" y="676" /> + <di:waypoint x="1164" y="676" /> + <di:waypoint x="1256" y="676" /> <bpmndi:BPMNLabel> <dc:Bounds x="1121" y="676" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20" bpmnElement="SequenceFlow_20" sourceElement="_BPMNShape_ScriptTask_286" targetElement="_BPMNShape_ScriptTask_180"> - <di:waypoint xsi:type="dc:Point" x="1226" y="716" /> - <di:waypoint xsi:type="dc:Point" x="1226" y="768" /> + <di:waypoint x="1306" y="716" /> + <di:waypoint x="1306" y="768" /> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> diff --git a/bpmn/so-bpmn-tasks/pom.xml b/bpmn/so-bpmn-tasks/pom.xml index 47415240f9..7fbfed7054 100644 --- a/bpmn/so-bpmn-tasks/pom.xml +++ b/bpmn/so-bpmn-tasks/pom.xml @@ -200,7 +200,7 @@ </dependency> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-adapter-api</artifactId> + <artifactId>etsi-sol003-lcm-api</artifactId> <version>${project.version}</version> </dependency> <dependency> diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java index b6ab9d0ce6..0190e693be 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java @@ -31,7 +31,6 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.*; import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; -import org.onap.so.client.exception.BBObjectNotFoundException; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.*; import org.onap.so.db.catalog.beans.OrchestrationStatus; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java index 0ec28d901c..fb5c81a52e 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java @@ -63,7 +63,7 @@ public class NetworkAdapterCreateTasks { gBBInput.getRequestContext(), gBBInput.getCloudRegion(), gBBInput.getOrchContext(), serviceInstance, l3Network, userInput, cloudRegionPo, gBBInput.getCustomer()); - execution.setVariable("networkAdapterRequest", createNetworkRequest); + execution.setVariable("networkAdapterRequest", createNetworkRequest.toXmlString()); } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } @@ -81,13 +81,14 @@ public class NetworkAdapterCreateTasks { execution.setVariable("networkAdapterCreateRollback", true); } } else { - throw new Exception("No response was sent back from NetworkAdapterRestV1 subflow."); + throw new Exception("No response was sent back from NetworkAdapter subflow."); } } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + // TODO is this even used anywhere? public void rollbackCreateNetwork(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java index 7a7d681762..df5e7d2b34 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java @@ -53,7 +53,7 @@ public class NetworkAdapterDeleteTasks { DeleteNetworkRequest deleteNetworkRequest = networkAdapterObjectMapper.deleteNetworkRequestMapper( gBBInput.getRequestContext(), gBBInput.getCloudRegion(), serviceInstance, l3Network); - execution.setVariable("networkAdapterRequest", deleteNetworkRequest); + execution.setVariable("networkAdapterRequest", deleteNetworkRequest.toXmlString()); } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterImpl.java new file mode 100644 index 0000000000..5a84910a29 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterImpl.java @@ -0,0 +1,103 @@ +package org.onap.so.bpmn.infrastructure.adapter.network.tasks; + +import java.io.ByteArrayInputStream; +import java.io.StringReader; +import java.util.Optional; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.onap.so.adapters.nwrest.CreateNetworkError; +import org.onap.so.adapters.nwrest.CreateNetworkRequest; +import org.onap.so.adapters.nwrest.CreateNetworkResponse; +import org.onap.so.adapters.nwrest.DeleteNetworkError; +import org.onap.so.adapters.nwrest.DeleteNetworkRequest; +import org.onap.so.adapters.nwrest.DeleteNetworkResponse; +import org.onap.so.adapters.nwrest.UpdateNetworkError; +import org.onap.so.adapters.nwrest.UpdateNetworkRequest; +import org.onap.so.adapters.nwrest.UpdateNetworkResponse; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; +import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.utils.Components; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class NetworkAdapterImpl { + + private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterImpl.class); + + @Autowired + private ExtractPojosForBB extractPojosForBB; + + @Autowired + private ExceptionBuilder exceptionUtil; + + public void preProcessNetworkAdapter(BuildingBlockExecution execution) { + try { + GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); + ServiceInstance serviceInstance = + extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); + execution.setVariable("mso-request-id", gBBInput.getRequestContext().getMsoRequestId()); + execution.setVariable("mso-service-instance-id", serviceInstance.getServiceInstanceId()); + } catch (Exception ex) { + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); + } + } + + public void postProcessNetworkAdapter(BuildingBlockExecution execution) { + try { + String workflowResponse = (String) execution.getVariable("WorkflowResponse"); + if (workflowResponse != null) { + Optional<String> responseType = findResponseType(workflowResponse); + if ("createNetworkResponse".equals(responseType.get())) { + CreateNetworkResponse createNetworkResponse = + (CreateNetworkResponse) unmarshalXml(workflowResponse, CreateNetworkResponse.class); + execution.setVariable("createNetworkResponse", createNetworkResponse); + } else if ("deleteNetworkResponse".equals(responseType.get())) { + DeleteNetworkResponse deleteNetworkResponse = + (DeleteNetworkResponse) unmarshalXml(workflowResponse, DeleteNetworkResponse.class); + execution.setVariable("deleteNetworkResponse", deleteNetworkResponse); + } else if ("updateNetworkResponse".equals(responseType.get())) { + UpdateNetworkResponse updateNetworkResponse = + (UpdateNetworkResponse) unmarshalXml(workflowResponse, UpdateNetworkResponse.class); + execution.setVariable("updateNetworkResponse", updateNetworkResponse); + } else { + logger.warn("Unable to determine network response type"); + } + } + } catch (Exception e) { + logger.error("Error Network Adapter post process", e); + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), Components.OPENSTACK); + } + } + + protected <T> Object unmarshalXml(String xmlString, Class<T> resultClass) throws JAXBException { + StringReader reader = new StringReader(xmlString); + JAXBContext context = JAXBContext.newInstance(resultClass); + Unmarshaller unmarshaller = context.createUnmarshaller(); + return unmarshaller.unmarshal(reader); + } + + protected Optional<String> findResponseType(String xmlString) { + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + org.w3c.dom.Document doc; + doc = builder.parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8"))); + return Optional.of(doc.getDocumentElement().getNodeName()); + } catch (Exception e) { + logger.error("Error Finding Response Type", e); + return Optional.empty(); + } + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java deleted file mode 100644 index 2705d00d6b..0000000000 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java +++ /dev/null @@ -1,166 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.infrastructure.adapter.network.tasks; - -import java.io.StringReader; -import java.util.Optional; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.onap.so.adapters.nwrest.CreateNetworkError; -import org.onap.so.adapters.nwrest.CreateNetworkRequest; -import org.onap.so.adapters.nwrest.CreateNetworkResponse; -import org.onap.so.adapters.nwrest.DeleteNetworkError; -import org.onap.so.adapters.nwrest.DeleteNetworkRequest; -import org.onap.so.adapters.nwrest.DeleteNetworkResponse; -import org.onap.so.adapters.nwrest.UpdateNetworkError; -import org.onap.so.adapters.nwrest.UpdateNetworkRequest; -import org.onap.so.adapters.nwrest.UpdateNetworkResponse; -import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.so.client.orchestration.NetworkAdapterResources; -import org.onap.logging.filter.base.ONAPComponents; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.onap.so.utils.Components; - -@Component -public class NetworkAdapterRestV1 { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterRestV1.class); - - private static final String NETWORK_REQUEST = "networkAdapterRequest"; - private static final String NETWORK_MESSAGE = "NetworkAResponse_MESSAGE"; - private static final String NETWORK_SYNC_CODE = "NETWORKREST_networkAdapterStatusCode"; - private static final String NETWORK_SYNC_RESPONSE = "NETWORKREST_networkAdapterResponse"; - private static final String NETWORK_CORRELATOR = "NetworkAResponse_CORRELATOR"; - - @Autowired - private ExceptionBuilder exceptionBuilder; - - @Autowired - private NetworkAdapterResources networkAdapterResources; - - public void callNetworkAdapter(DelegateExecution execution) { - try { - Object networkAdapterRequest = execution.getVariable(NETWORK_REQUEST); - if (networkAdapterRequest != null) { - Optional<Response> response = Optional.empty(); - if (networkAdapterRequest instanceof CreateNetworkRequest) { - CreateNetworkRequest createNetworkRequest = (CreateNetworkRequest) networkAdapterRequest; - execution.setVariable(NETWORK_CORRELATOR, createNetworkRequest.getMessageId()); - response = networkAdapterResources.createNetworkAsync(createNetworkRequest); - } else if (networkAdapterRequest instanceof DeleteNetworkRequest) { - DeleteNetworkRequest deleteNetworkRequest = (DeleteNetworkRequest) networkAdapterRequest; - execution.setVariable(NETWORK_CORRELATOR, deleteNetworkRequest.getMessageId()); - response = networkAdapterResources.deleteNetworkAsync(deleteNetworkRequest); - } else if (networkAdapterRequest instanceof UpdateNetworkRequest) { - UpdateNetworkRequest updateNetworkRequest = (UpdateNetworkRequest) networkAdapterRequest; - execution.setVariable(NETWORK_CORRELATOR, updateNetworkRequest.getMessageId()); - response = networkAdapterResources.updateNetworkAsync(updateNetworkRequest); - } - if (response.isPresent()) { - String statusCode = Integer.toString(response.get().getStatus()); - String responseString = ""; - if (response.get().getEntity() != null) { - responseString = (String) response.get().getEntity(); - } - execution.setVariable(NETWORK_SYNC_CODE, statusCode); - execution.setVariable(NETWORK_SYNC_RESPONSE, responseString); - } else { - throw new Exception("No Ack response from Openstack Adapter"); - } - } else { - throw new Exception("No Network Request was created. networkAdapterRequest was null."); - } - } catch (Exception ex) { - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex, ONAPComponents.SO); - } - } - - public void processCallback(DelegateExecution execution) { - try { - Object networkAdapterRequest = execution.getVariable(NETWORK_REQUEST); - String callback = (String) execution.getVariable(NETWORK_MESSAGE); - String logCallbackMessage = "Callback from OpenstackAdapter: " + callback; - logger.debug(logCallbackMessage); - if (networkAdapterRequest != null) { - if (networkAdapterRequest instanceof CreateNetworkRequest) { - if (callback.contains("createNetworkError")) { - CreateNetworkError createNetworkError = - (CreateNetworkError) unmarshalXml(callback, CreateNetworkError.class); - throw new Exception(createNetworkError.getMessage()); - } else { - CreateNetworkResponse createNetworkResponse = - (CreateNetworkResponse) unmarshalXml(callback, CreateNetworkResponse.class); - execution.setVariable("createNetworkResponse", createNetworkResponse); - } - } else if (networkAdapterRequest instanceof DeleteNetworkRequest) { - if (callback.contains("deleteNetworkError")) { - DeleteNetworkError deleteNetworkError = - (DeleteNetworkError) unmarshalXml(callback, DeleteNetworkError.class); - throw new Exception(deleteNetworkError.getMessage()); - } else { - DeleteNetworkResponse deleteNetworkResponse = - (DeleteNetworkResponse) unmarshalXml(callback, DeleteNetworkResponse.class); - execution.setVariable("deleteNetworkResponse", deleteNetworkResponse); - } - } else if (networkAdapterRequest instanceof UpdateNetworkRequest) { - if (callback.contains("updateNetworkError")) { - UpdateNetworkError updateNetworkError = - (UpdateNetworkError) unmarshalXml(callback, UpdateNetworkError.class); - throw new Exception(updateNetworkError.getMessage()); - } else { - UpdateNetworkResponse updateNetworkResponse = - (UpdateNetworkResponse) unmarshalXml(callback, UpdateNetworkResponse.class); - execution.setVariable("updateNetworkResponse", updateNetworkResponse); - } - } - } - } catch (Exception e) { - logger.error("Error in Openstack Adapter callback", e); - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), Components.OPENSTACK); - } - } - - protected <T> Object unmarshalXml(String xmlString, Class<T> resultClass) throws JAXBException { - StringReader reader = new StringReader(xmlString); - JAXBContext context = JAXBContext.newInstance(resultClass); - Unmarshaller unmarshaller = context.createUnmarshaller(); - return unmarshaller.unmarshal(reader); - } - - public void handleTimeOutException(DelegateExecution execution) { - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, - "Error timed out waiting on Openstack Async-Response", ONAPComponents.SO); - } - - public void handleSyncError(DelegateExecution execution) { - String statusCode = (String) execution.getVariable(NETWORK_SYNC_CODE); - String responseString = (String) execution.getVariable(NETWORK_SYNC_RESPONSE); - String errorMessage = "Error with Openstack Adapter Sync Request: StatusCode = " + statusCode + " Response = " - + responseString; - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, errorMessage, Components.OPENSTACK); - } -} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java index 428f5e703d..c64491f71a 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java @@ -32,8 +32,6 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.adapter.network.mapper.NetworkAdapterObjectMapper; import org.onap.so.client.exception.ExceptionBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -57,7 +55,7 @@ public class NetworkAdapterUpdateTasks { UpdateNetworkRequest updateNetworkRequest = networkAdapterObjectMapper.createNetworkUpdateRequestMapper( gBBInput.getRequestContext(), gBBInput.getCloudRegion(), gBBInput.getOrchContext(), serviceInstance, l3Network, gBBInput.getUserInput(), gBBInput.getCustomer()); - execution.setVariable("networkAdapterRequest", updateNetworkRequest); + execution.setVariable("networkAdapterRequest", updateNetworkRequest.toXmlString()); } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java index 5fe80b79f9..09718dc6ec 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java @@ -35,8 +35,6 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.VnfAdapterVfModuleResources; import org.onap.so.client.orchestration.VnfAdapterVolumeGroupResources; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java index 9f85feac07..2252922398 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java @@ -22,9 +22,9 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStatusRetrievalStatusEnum; import com.google.common.collect.ImmutableSet; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.OperationStatusRetrievalStatusEnum; /** * @author waqas.ikram@est.tech diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTask.java index f29f842709..4fe0e674ae 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTask.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTask.java @@ -21,11 +21,11 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; import static org.onap.so.bpmn.servicedecomposition.entities.ResourceKey.GENERIC_VNF_ID; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java index 30f0d38754..727af6c36b 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java @@ -21,10 +21,10 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_RESPONSE_PARAM_NAME; import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.OPERATION_STATUS_PARAM_NAME; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java index 8fecb81d75..9554e67196 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java @@ -21,10 +21,10 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_RESPONSE_PARAM_NAME; import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.OPERATION_STATUS_PARAM_NAME; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmJobTask.java index 395018fb38..e5873ef66e 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmJobTask.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmJobTask.java @@ -22,10 +22,10 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.OPERATION_FINISHED_STATES; import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.OPERATION_RETRIEVAL_STATES; import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.OPERATION_STATUS_PARAM_NAME; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTask.java index 9ff2835480..99732444e0 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTask.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTask.java @@ -27,6 +27,9 @@ import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.INPUT import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.SPACE; import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.UNDERSCORE; import static org.onap.so.bpmn.servicedecomposition.entities.ResourceKey.GENERIC_VNF_ID; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.Tenant; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParameter; import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.NullInputParameter; @@ -36,9 +39,6 @@ import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.Tenant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java index d1b270bc1e..369e68d094 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java @@ -20,10 +20,10 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; import com.google.common.base.Optional; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java index 41649dc838..678c01c684 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java @@ -20,21 +20,21 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; -import com.google.common.base.Optional; -import org.onap.so.rest.exceptions.InvalidRestRequestException; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; import org.onap.so.rest.exceptions.HttpResouceNotFoundException; +import org.onap.so.rest.exceptions.InvalidRestRequestException; import org.onap.so.rest.exceptions.RestProcessingException; import org.onap.so.rest.service.HttpRestServiceProvider; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import com.google.common.base.Optional; /** * @author waqas.ikram@est.tech diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/AbstractInputParametersProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/AbstractInputParametersProvider.java index 5cd84a2e11..329398f352 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/AbstractInputParametersProvider.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/AbstractInputParametersProvider.java @@ -24,7 +24,7 @@ import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.EXT_V import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java index fde69c7e91..9361acc350 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameter.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; /** * Wrapper class for instance parameters which are based on SOL003 diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java index 2eed224eb7..f306ed45f3 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/NullInputParameter.java @@ -22,7 +22,7 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils; import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; /** * @author waqas.ikram@est.tech diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProvider.java index 7d81f4d5c2..11c30c3eae 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProvider.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProvider.java @@ -29,10 +29,10 @@ import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf; import org.onap.so.client.sdnc.SDNCClient; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java index b7ddc11f35..4f3a3291cf 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java @@ -31,8 +31,6 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.adapter.network.mapper.NetworkAdapterObjectMapper; import org.onap.so.client.exception.ExceptionBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java index 1cde9fb8f6..e2dd73f9ec 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java @@ -24,6 +24,8 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; +import java.util.EnumSet; +import java.util.Set; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; @@ -34,11 +36,15 @@ import org.onap.so.db.catalog.beans.BuildingBlockDetail; import org.onap.so.db.catalog.beans.OrchestrationStatus; import org.onap.so.db.catalog.beans.OrchestrationStatusStateTransitionDirective; import org.onap.so.db.catalog.beans.OrchestrationStatusValidationDirective; +import org.onap.so.db.catalog.beans.ResourceType; import org.onap.so.db.catalog.client.CatalogDbClient; +import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.db.request.client.RequestsDbClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.web.client.HttpClientErrorException; @Component public class OrchestrationStatusValidator { @@ -52,6 +58,14 @@ public class OrchestrationStatusValidator { "Orchestration Status Validation failed. ResourceType=(%s), TargetAction=(%s), OrchestrationStatus=(%s)"; private static final String ORCHESTRATION_STATUS_VALIDATION_RESULT = "orchestrationStatusValidationResult"; private static final String ALACARTE = "aLaCarte"; + private static final String MULTI_STAGE_DESIGN_OFF = "false"; + private static final String MULTI_STAGE_DESIGN_ON = "true"; + private static final String RESOURCE_EXIST_STATUS_MESSAGE = + "The %s was found to already exist, thus no new %s was created in the cloud via this request"; + private static final String RESOURCE_NOT_EXIST_STATUS_MESSAGE = + "The %s was not found, thus no %s was deleted in the cloud via this request"; + private static final Set<ResourceType> cloudResources = + EnumSet.of(ResourceType.VF_MODULE, ResourceType.VOLUME_GROUP, ResourceType.NETWORK); @Autowired private ExtractPojosForBB extractPojosForBB; @@ -59,6 +73,8 @@ public class OrchestrationStatusValidator { private ExceptionBuilder exceptionBuilder; @Autowired private CatalogDbClient catalogDbClient; + @Autowired + RequestsDbClient requestDBClient; /** @@ -160,6 +176,13 @@ public class OrchestrationStatusValidator { execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT, orchestrationStatusStateTransitionDirective.getFlowDirective()); + + if (buildingBlockFlowName.matches("Create(.*)|Delete(.*)") && orchestrationStatusStateTransitionDirective + .getFlowDirective() == OrchestrationStatusValidationDirective.SILENT_SUCCESS) { + + updatedResourceStatus(execution, buildingBlockDetail); + } + } catch (BBObjectNotFoundException ex) { logger.error( "Error occurred for bb object notfound in OrchestrationStatusValidator validateOrchestrationStatus ", @@ -175,4 +198,33 @@ public class OrchestrationStatusValidator { exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e); } } + + private void updatedResourceStatus(BuildingBlockExecution execution, BuildingBlockDetail buildingBlockDetail) { + + if (cloudResources.contains(buildingBlockDetail.getResourceType())) { + String resource = buildingBlockDetail.getResourceType().toString(); + + String resourceId = execution.getLookupMap() + .get(ResourceKey.valueOf(buildingBlockDetail.getResourceType().getResourceKey())); + + String resourceStatusMessage = RESOURCE_NOT_EXIST_STATUS_MESSAGE; + if (execution.getFlowToBeCalled().matches("Create(.*)")) { + resourceStatusMessage = RESOURCE_EXIST_STATUS_MESSAGE; + } + + updateRequestsDb(resourceId, String.format(resourceStatusMessage, resource, resource)); + } + + } + + private void updateRequestsDb(String requestId, String resourceStatusMessage) { + InfraActiveRequests request = new InfraActiveRequests(); + request.setRequestId(requestId); + request.setResourceStatusMessage(resourceStatusMessage); + try { + requestDBClient.patchInfraActiveRequests(request); + } catch (HttpClientErrorException e) { + logger.warn("Unable to update active request resource status"); + } + } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java index 56cd9fd70f..8d9e020f67 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java @@ -41,6 +41,7 @@ public class WorkflowActionBBFailure { private static final String DEACTIVATE_FABRIC_CONFIGURATION_FLOW = "DeactivateFabricConfigurationBB"; private static final String UNASSIGN_FABRIC_CONFIGURATION_FLOW = "UnassignFabricConfigurationBB"; + private static final String DELETE_FABRIC_CONFIGURATION_FLOW = "DeleteFabricConfigurationBB"; private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBFailure.class); public static final String ROLLBACK_TARGET_STATE = "rollbackTargetState"; @Autowired @@ -101,7 +102,8 @@ public class WorkflowActionBBFailure { if (ebb != null && ebb.getBuildingBlock() != null && ebb.getBuildingBlock().getBpmnFlowName() != null) { String flowName = ebb.getBuildingBlock().getBpmnFlowName(); if (DEACTIVATE_FABRIC_CONFIGURATION_FLOW.equalsIgnoreCase(flowName) - || UNASSIGN_FABRIC_CONFIGURATION_FLOW.equalsIgnoreCase(flowName)) { + || UNASSIGN_FABRIC_CONFIGURATION_FLOW.equalsIgnoreCase(flowName) + || DELETE_FABRIC_CONFIGURATION_FLOW.equalsIgnoreCase(flowName)) { String statusMessage = String.format( "%s Warning: The vf-module is active but configuration was not removed completely for one or more VMs.", request.getStatusMessage()); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index ba5d283c01..5edb2b9dd8 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -70,8 +70,7 @@ public class WorkflowActionBBTasks { private static final String G_ACTION = "requestAction"; private static final String RETRY_COUNT = "retryCount"; private static final String FABRIC_CONFIGURATION = "FabricConfiguration"; - private static final String ASSIGN_FABRIC_CONFIGURATION_BB = "AssignFabricConfigurationBB"; - private static final String ACTIVATE_FABRIC_CONFIGURATION_BB = "ActivateFabricConfigurationBB"; + private static final String ADD_FABRIC_CONFIGURATION_BB = "AddFabricConfigurationBB"; private static final String COMPLETED = "completed"; private static final String HANDLINGCODE = "handlingCode"; private static final String ROLLBACKTOCREATED = "RollbackToCreated"; @@ -304,6 +303,8 @@ public class WorkflowActionBBTasks { flowName = flowName.replaceFirst("Create", "Delete"); } else if (flowName.startsWith("Activate")) { flowName = flowName.replaceFirst("Activate", "Deactivate"); + } else if (flowName.startsWith("Add")) { + flowName = flowName.replaceFirst("Add", "Delete"); } else { continue; } @@ -415,12 +416,9 @@ public class WorkflowActionBBTasks { configurationResourceKeys.setVfModuleCustomizationUUID(vfModuleCustomizationUUID); configurationResourceKeys.setVnfResourceCustomizationUUID(vnfCustomizationUUID); configurationResourceKeys.setVnfcName(vnfc.getVnfcName()); - ExecuteBuildingBlock assignConfigBB = getExecuteBBForConfig(ASSIGN_FABRIC_CONFIGURATION_BB, ebb, + ExecuteBuildingBlock addConfigBB = getExecuteBBForConfig(ADD_FABRIC_CONFIGURATION_BB, ebb, configurationId, configurationResourceKeys); - ExecuteBuildingBlock activateConfigBB = getExecuteBBForConfig(ACTIVATE_FABRIC_CONFIGURATION_BB, ebb, - configurationId, configurationResourceKeys); - flowsToExecute.add(assignConfigBB); - flowsToExecute.add(activateConfigBB); + flowsToExecute.add(addConfigBB); flowsToExecute.stream() .forEach(executeBB -> logger.info("Flows to Execute After Post Processing: {}", executeBB.getBuildingBlock().getBpmnFlowName())); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java index 9af2128f63..cb04e97d20 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java @@ -33,7 +33,6 @@ import org.onap.so.adapters.vnfrest.RollbackVfModuleResponse; import org.onap.so.adapters.vnfrest.UpdateVfModuleRequest; import org.onap.so.adapters.vnfrest.UpdateVfModuleResponse; import org.onap.so.client.adapter.rest.AdapterRestClient; -import org.onap.so.client.adapter.vnf.mapper.VnfAdapterVfModuleObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClient.java index f4e4ce8cb1..acb2e452da 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClient.java @@ -24,7 +24,6 @@ import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse; import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; import org.onap.so.adapters.vnfrest.DeleteVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.QueryVolumeGroupResponse; import org.onap.so.adapters.vnfrest.RollbackVolumeGroupRequest; import org.onap.so.adapters.vnfrest.RollbackVolumeGroupResponse; import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest; @@ -41,8 +40,4 @@ public interface VnfVolumeAdapterClient { UpdateVolumeGroupResponse updateVNFVolumes(String aaiVolumeGroupId, UpdateVolumeGroupRequest req) throws VnfAdapterClientException; - - QueryVolumeGroupResponse queryVNFVolumes(String aaiVolumeGroupId, String cloudSiteId, String tenantId, - String volumeGroupStackId, Boolean skipAAI, String requestId, String serviceInstanceId) - throws VnfAdapterClientException; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java index c5e8bf7416..073b752348 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientImpl.java @@ -27,7 +27,6 @@ import org.onap.so.adapters.vnfrest.CreateVolumeGroupRequest; import org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse; import org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest; import org.onap.so.adapters.vnfrest.DeleteVolumeGroupResponse; -import org.onap.so.adapters.vnfrest.QueryVolumeGroupResponse; import org.onap.so.adapters.vnfrest.RollbackVolumeGroupRequest; import org.onap.so.adapters.vnfrest.RollbackVolumeGroupResponse; import org.onap.so.adapters.vnfrest.UpdateVolumeGroupRequest; @@ -93,20 +92,6 @@ public class VnfVolumeAdapterClientImpl implements VnfVolumeAdapterClient { } } - @Override - public QueryVolumeGroupResponse queryVNFVolumes(String aaiVolumeGroupId, String cloudSiteId, String tenantId, - String volumeGroupStackId, Boolean skipAAI, String requestId, String serviceInstanceId) - throws VnfAdapterClientException { - try { - String path = buildQueryPath(aaiVolumeGroupId, cloudSiteId, tenantId, volumeGroupStackId, skipAAI, - requestId, serviceInstanceId); - return this.getAdapterRestClient(path).get(QueryVolumeGroupResponse.class).get(); - } catch (InternalServerErrorException e) { - logger.error("InternalServerErrorException in queryVNFVolumes", e); - throw new VnfAdapterClientException(e.getMessage()); - } - } - protected String buildQueryPath(String aaiVolumeGroupId, String cloudSiteId, String tenantId, String volumeGroupStackId, Boolean skipAAI, String requestId, String serviceInstanceId) { javax.ws.rs.core.UriBuilder builder = this.getUri("/" + aaiVolumeGroupId); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofClient.java index e8a7fef1bd..8b0cf69f6c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofClient.java @@ -22,7 +22,6 @@ package org.onap.so.client.oof; import org.camunda.bpm.engine.delegate.BpmnError; -import org.onap.so.bpmn.core.UrnPropertiesReader; import org.onap.so.client.BaseClient; import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.oof.beans.OofProperties; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java index 73896d7d6d..03ffd9c4c1 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java @@ -26,7 +26,6 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.onap.so.bpmn.common.InjectionHelper; import org.onap.so.bpmn.common.data.TestDataSetup; -import org.onap.so.bpmn.core.UrnPropertiesReader; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignNetworkBBUtils; import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionExtractResourcesAAI; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasksTest.java index 00dfd4e236..60bed17447 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasksTest.java @@ -89,7 +89,7 @@ public class NetworkAdapterCreateTasksTest extends BaseTaskTest { networkAdapterCreateTasks.createNetwork(execution); verify(networkAdapterObjectMapper, times(1)).createNetworkRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, l3Network, userInput, cloudRegionPo, customer); - assertEquals(createNetworkRequest, execution.getVariable("networkAdapterRequest")); + assertEquals(createNetworkRequest.toXmlString(), execution.getVariable("networkAdapterRequest")); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterImplTest.java new file mode 100644 index 0000000000..10cc09cdcc --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterImplTest.java @@ -0,0 +1,30 @@ +package org.onap.so.bpmn.infrastructure.adapter.network.tasks; + +import static com.shazam.shazamcrest.MatcherAssert.assertThat; +import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; +import static org.junit.Assert.assertNotNull; +import javax.xml.bind.JAXBException; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.onap.so.FileUtil; +import org.onap.so.adapters.nwrest.CreateNetworkResponse; +import org.onap.so.bpmn.BaseTaskTest; + +public class NetworkAdapterImplTest extends BaseTaskTest { + + @InjectMocks + private NetworkAdapterImpl networkAdapterImpl = new NetworkAdapterImpl(); + + private static final String RESPONSE = + FileUtil.readResourceFile("__files/BuildingBlocks/Network/createNetworkResponse.xml"); + + @Test + public void postProcessNetworkAdapter() throws JAXBException { + execution.setVariable("WorkflowResponse", RESPONSE); + networkAdapterImpl.postProcessNetworkAdapter(execution); + assertNotNull(execution.getVariable("createNetworkResponse")); + assertThat(networkAdapterImpl.unmarshalXml(RESPONSE, CreateNetworkResponse.class), + sameBeanAs(execution.getVariable("createNetworkResponse"))); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java deleted file mode 100644 index 9adae88a5a..0000000000 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java +++ /dev/null @@ -1,261 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2018 Nokia. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.infrastructure.adapter.network.tasks; - -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.xml.bind.JAXBException; -import org.camunda.bpm.engine.delegate.BpmnError; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake; -import org.glassfish.jersey.message.internal.OutboundJaxrsResponse; -import org.glassfish.jersey.message.internal.OutboundMessageContext; -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.onap.so.adapters.nwrest.CreateNetworkRequest; -import org.onap.so.adapters.nwrest.CreateNetworkResponse; -import org.onap.so.adapters.nwrest.DeleteNetworkRequest; -import org.onap.so.adapters.nwrest.DeleteNetworkResponse; -import org.onap.so.adapters.nwrest.UpdateNetworkError; -import org.onap.so.adapters.nwrest.UpdateNetworkRequest; -import org.onap.so.adapters.nwrest.UpdateNetworkResponse; -import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.so.client.orchestration.NetworkAdapterResources; -import org.onap.so.utils.Components; -import org.onap.logging.filter.base.ONAPComponents; -import static org.junit.Assert.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.eq; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; -import static org.mockito.Mockito.when; -import static org.mockito.MockitoAnnotations.initMocks; - -public class NetworkAdapterRestV1Test { - - @Mock - private ExceptionBuilder exceptionBuilder; - @Mock - private NetworkAdapterResources networkAdapterResources; - @InjectMocks - private NetworkAdapterRestV1 networkAdapterRestV1Tasks; - - private DelegateExecution delegateExecution; - - private static final String CREATE_NETWORK_RESPONSE = "createNetworkResponse"; - private static final String DELETE_NETWORK_RESPONSE = "deleteNetworkResponse"; - private static final String CREATE_NETWORK_ERROR = "createNetworkError"; - private static final String DELETE_NETWORK_ERROR = "deleteNetworkError"; - private static final String NET_ID_FOR_CREATE_NETWORK_RESPONSE = "netIdForCreateNetworkResponse"; - private static final String NET_ID_FOR_DELETE_NETWORK_RESPONSE = "netIdForDeleteNetworkResponse"; - private static final String CREATE_NETWORK_ERROR_MESSAGE = "createNetErrorMessage"; - private static final String DELETE_NETWORK_ERROR_MESSAGE = "deleteNetErrorMessage"; - - @Before - public void setup() { - initMocks(this); - delegateExecution = new DelegateExecutionFake(); - } - - @Test - public void testUnmarshalXml() throws JAXBException { - String xml = - "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><createNetworkResponse><messageId>ec37c121-e3ec-4697-8adf-2d7dca7044fc</messageId><networkCreated>true</networkCreated><networkFqdn>someNetworkFqdn</networkFqdn><networkId>991ec7bf-c9c4-4ac1-bb9c-4b61645bddb3</networkId><networkStackId>someStackId</networkStackId><neutronNetworkId>9c47521a-2916-4018-b2bc-71ab767497e3</neutronNetworkId><rollback><cloudId>someCloudId</cloudId><modelCustomizationUuid>b7171cdd-8b05-459b-80ef-2093150e8983</modelCustomizationUuid><msoRequest><requestId>90b32315-176e-4dab-bcf1-80eb97a1c4f4</requestId><serviceInstanceId>71e7db22-7907-4d78-8fcc-8d89d28e90be</serviceInstanceId></msoRequest><networkCreated>true</networkCreated><networkStackId>someStackId</networkStackId><networkType>SomeNetworkType</networkType><neutronNetworkId>9c47521a-2916-4018-b2bc-71ab767497e3</neutronNetworkId><tenantId>b60da4f71c1d4b35b8113d4eca6deaa1</tenantId></rollback><subnetMap><entry><key>6b381fa9-48ce-4e16-9978-d75309565bb6</key><value>bc1d5537-860b-4894-8eba-6faff41e648c</value></entry></subnetMap></createNetworkResponse>"; - CreateNetworkResponse response = - (CreateNetworkResponse) new NetworkAdapterRestV1().unmarshalXml(xml, CreateNetworkResponse.class); - String returnedXml = response.toXmlString(); - System.out.println(returnedXml); - } - - @Test - public void testUnmarshalXmlUpdate() throws JAXBException { - UpdateNetworkResponse expectedResponse = new UpdateNetworkResponse(); - expectedResponse.setMessageId("ec100bcc-2659-4aa4-b4d8-3255715c2a51"); - expectedResponse.setNetworkId("80de31e3-cc78-4111-a9d3-5b92bf0a39eb"); - Map<String, String> subnetMap = new HashMap<>(); - subnetMap.put("95cd8437-25f1-4238-8720-cbfe7fa81476", "d8d16606-5d01-4822-b160-9a0d257303e0"); - expectedResponse.setSubnetMap(subnetMap); - String xml = - "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><updateNetworkResponse><messageId>ec100bcc-2659-4aa4-b4d8-3255715c2a51</messageId><networkId>80de31e3-cc78-4111-a9d3-5b92bf0a39eb</networkId><subnetMap><entry><key>95cd8437-25f1-4238-8720-cbfe7fa81476</key><value>d8d16606-5d01-4822-b160-9a0d257303e0</value></entry></subnetMap></updateNetworkResponse>"; - UpdateNetworkResponse response = - (UpdateNetworkResponse) new NetworkAdapterRestV1().unmarshalXml(xml, UpdateNetworkResponse.class); - assertThat(expectedResponse, sameBeanAs(response)); - } - - @Test - public void processCallbackTest() { - UpdateNetworkRequest updateNetworkRequest = new UpdateNetworkRequest(); - UpdateNetworkResponse updateNetworkResponse = new UpdateNetworkResponse(); - updateNetworkResponse.setMessageId("messageId"); - updateNetworkResponse.setNetworkId("networkId"); - delegateExecution.setVariable("networkAdapterRequest", updateNetworkRequest); - delegateExecution.setVariable("NetworkAResponse_MESSAGE", updateNetworkResponse.toXmlString()); - - networkAdapterRestV1Tasks.processCallback(delegateExecution); - - assertThat(updateNetworkResponse, sameBeanAs(delegateExecution.getVariable("updateNetworkResponse"))); - } - - @Test - public void processCallbackErrorTest() { - UpdateNetworkRequest updateNetworkRequest = new UpdateNetworkRequest(); - UpdateNetworkError updateNetworkResponse = new UpdateNetworkError(); - updateNetworkResponse.setMessageId("messageId"); - updateNetworkResponse.setMessage("test error message"); - delegateExecution.setVariable("networkAdapterRequest", updateNetworkRequest); - delegateExecution.setVariable("NetworkAResponse_MESSAGE", updateNetworkResponse.toXmlString()); - - doThrow(new BpmnError("MSOWorkflowException")).when(exceptionBuilder).buildAndThrowWorkflowException( - any(DelegateExecution.class), anyInt(), any(String.class), any(ONAPComponents.class)); - - try { - networkAdapterRestV1Tasks.processCallback(delegateExecution); - } catch (BpmnError be) { - assertEquals("MSOWorkflowException", be.getErrorCode()); - } - assertNull(delegateExecution.getVariable("updateNetworkResponse")); - verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(any(DelegateExecution.class), eq(7000), - eq("test error message"), eq(Components.OPENSTACK)); - } - - @Test - public void processCallback_createNetworkResponse() { - delegateExecution.setVariable("networkAdapterRequest", new CreateNetworkRequest()); - delegateExecution.setVariable("NetworkAResponse_MESSAGE", - createNetworkResponse(CREATE_NETWORK_RESPONSE, NET_ID_FOR_CREATE_NETWORK_RESPONSE)); - networkAdapterRestV1Tasks.processCallback(delegateExecution); - - Object result = delegateExecution.getVariable("createNetworkResponse"); - assertTrue(result instanceof CreateNetworkResponse); - CreateNetworkResponse createNetworkResponse = (CreateNetworkResponse) result; - assertEquals(createNetworkResponse.getNetworkId(), NET_ID_FOR_CREATE_NETWORK_RESPONSE); - } - - @Test - public void processCallback_deleteNetworkResponse() { - delegateExecution.setVariable("networkAdapterRequest", new DeleteNetworkRequest()); - delegateExecution.setVariable("NetworkAResponse_MESSAGE", - createNetworkResponse(DELETE_NETWORK_RESPONSE, NET_ID_FOR_DELETE_NETWORK_RESPONSE)); - networkAdapterRestV1Tasks.processCallback(delegateExecution); - - Object result = delegateExecution.getVariable("deleteNetworkResponse"); - assertTrue(result instanceof DeleteNetworkResponse); - DeleteNetworkResponse deleteNetworkResponse = (DeleteNetworkResponse) result; - assertEquals(deleteNetworkResponse.getNetworkId(), NET_ID_FOR_DELETE_NETWORK_RESPONSE); - } - - @Test - public void processCallback_createNetworkError() { - try { - delegateExecution.setVariable("networkAdapterRequest", new CreateNetworkRequest()); - delegateExecution.setVariable("NetworkAResponse_MESSAGE", - createNetworkError(CREATE_NETWORK_ERROR, CREATE_NETWORK_ERROR_MESSAGE)); - networkAdapterRestV1Tasks.processCallback(delegateExecution); - } catch (Exception e) { - assertEquals(e.getMessage(), CREATE_NETWORK_ERROR_MESSAGE); - } - } - - @Test - public void processCallback_deleteNetworkError() { - try { - delegateExecution.setVariable("networkAdapterRequest", new DeleteNetworkRequest()); - delegateExecution.setVariable("NetworkAResponse_MESSAGE", - createNetworkError(DELETE_NETWORK_ERROR, DELETE_NETWORK_ERROR_MESSAGE)); - networkAdapterRestV1Tasks.processCallback(delegateExecution); - } catch (Exception e) { - assertEquals(e.getMessage(), DELETE_NETWORK_ERROR_MESSAGE); - } - } - - @Test - public void callNetworkAdapter_CreateNetworkRequestSuccess() throws Exception { - // given - String messageId = "createNetReqMessageId"; - CreateNetworkRequest createNetworkRequest = new CreateNetworkRequest(); - createNetworkRequest.setMessageId(messageId); - delegateExecution.setVariable("networkAdapterRequest", createNetworkRequest); - Status status = Status.OK; - String responseEntity = "createNetworkResponse"; - Optional<Response> response = Optional.of(createResponse(status, responseEntity)); - when(networkAdapterResources.createNetworkAsync(createNetworkRequest)).thenReturn(response); - // when - networkAdapterRestV1Tasks.callNetworkAdapter(delegateExecution); - // then - verifyExecutionContent(status, responseEntity, messageId); - } - - @Test - public void callNetworkAdapter_DeleteNetworkRequestSuccess() throws Exception { - // given - String messageId = "DeleteNetReqMessageId"; - DeleteNetworkRequest deleteNetworkRequest = new DeleteNetworkRequest(); - deleteNetworkRequest.setMessageId(messageId); - delegateExecution.setVariable("networkAdapterRequest", deleteNetworkRequest); - Status status = Status.OK; - String responseEntity = "createNetworkResponse"; - Optional<Response> response = Optional.of(createResponse(status, responseEntity)); - when(networkAdapterResources.deleteNetworkAsync(deleteNetworkRequest)).thenReturn(response); - // when - networkAdapterRestV1Tasks.callNetworkAdapter(delegateExecution); - // then - verifyExecutionContent(status, responseEntity, messageId); - } - - private void verifyExecutionContent(Status status, String responseEntity, String messageId) { - assertEquals(delegateExecution.getVariable("NETWORKREST_networkAdapterStatusCode"), - Integer.toString(status.getStatusCode())); - assertEquals(delegateExecution.getVariable("NETWORKREST_networkAdapterResponse"), responseEntity); - assertEquals(delegateExecution.getVariable("NetworkAResponse_CORRELATOR"), messageId); - } - - private Response createResponse(Status status, String responseEntity) { - OutboundMessageContext outboundMessageContext = new OutboundMessageContext(); - outboundMessageContext.setEntity(responseEntity); - return new OutboundJaxrsResponse(status, outboundMessageContext); - } - - private String createNetworkResponse(String networkResponseType, String networkId) { - - return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><" + networkResponseType + "><networkId>" - + networkId + "</networkId></" + networkResponseType + ">"; - } - - private String createNetworkError(String networkErrorType, String message) { - - return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><" + networkErrorType + "><message>" - + message + "</message></" + networkErrorType + ">"; - } - -} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java index af97c3d038..64a315ad4d 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasksTest.java @@ -95,7 +95,7 @@ public class NetworkAdapterUpdateTasksTest extends BaseTaskTest { networkAdapterUpdateTasks.updateNetwork(execution); verify(networkAdapterObjectMapper, times(1)).createNetworkUpdateRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, network, userInput, customer); - assertEquals(updateNetworkRequest, execution.getVariable("networkAdapterRequest")); + assertEquals(updateNetworkRequest.toXmlString(), execution.getVariable("networkAdapterRequest")); } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java index 5233203c05..41eaad3ed1 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java @@ -36,7 +36,7 @@ import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; import com.google.common.base.Optional; /** diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTaskTest.java index 718418eae0..cc34d1da16 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTaskTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTaskTest.java @@ -34,12 +34,12 @@ import java.util.UUID; import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStatusRetrievalStatusEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.OperationStatusRetrievalStatusEnum; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; import com.google.common.base.Optional; /** diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTaskTest.java index a821de1cd1..9aa739769c 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTaskTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTaskTest.java @@ -35,12 +35,12 @@ import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStatusRetrievalStatusEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.common.BuildingBlockExecution; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.OperationStatusRetrievalStatusEnum; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; import com.google.common.base.Optional; /** diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java index cfa5aaa4b8..17d6398d74 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java @@ -34,15 +34,15 @@ import java.util.Collections; import java.util.UUID; import org.junit.Test; import org.mockito.Mock; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.Tenant; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParameter; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.Tenant; import com.google.common.base.Optional; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java index e94d7c2923..b32ce4a06a 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java @@ -34,13 +34,13 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.etsi.sol003.adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.etsi.sol003.adapter.lcm.v1.model.OperationStateEnum; +import org.onap.etsi.sol003.adapter.lcm.v1.model.QueryJobResponse; import org.onap.so.rest.exceptions.RestProcessingException; import org.onap.so.rest.service.HttpRestServiceProvider; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import com.google.common.base.Optional; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterRetrieverTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterRetrieverTaskTest.java index 9003510be7..2d380b8063 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterRetrieverTaskTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterRetrieverTaskTest.java @@ -40,6 +40,9 @@ import java.util.UUID; import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLinkCpConfig; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLinkExtCps; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception; @@ -52,9 +55,6 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters; import org.onap.so.client.exception.BBObjectNotFoundException; import org.onap.so.client.sdnc.SDNCClient; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLinkCpConfig; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLinkExtCps; /** * @author waqas.ikram@est.tech diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterTest.java index 6dee904fde..f683433d1d 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/InputParameterTest.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; import org.junit.Test; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; /** * @author Waqas Ikram (waqas.ikram@ericsson.com) diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProviderImplTest.java index e2e37ac6e4..69e2d4f283 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProviderImplTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/SdncInputParametersProviderImplTest.java @@ -37,12 +37,12 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf; import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.MapperException; import org.onap.so.client.sdnc.SDNCClient; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; /** * @author waqas.ikram@est.tech diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProviderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProviderTest.java index e6d4ad056a..169b15d978 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProviderTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/utils/UserParamInputParametersProviderTest.java @@ -30,7 +30,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; import org.junit.Test; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; +import org.onap.etsi.sol003.adapter.lcm.v1.model.ExternalVirtualLink; /** * @author Waqas Ikram (waqas.ikram@ericsson.com) diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java index ffe48876c4..b9feeedc14 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidatorTest.java @@ -34,8 +34,10 @@ import org.camunda.bpm.engine.delegate.BpmnError; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; +import org.mockito.ArgumentCaptor; import org.mockito.ArgumentMatchers; import org.mockito.InjectMocks; +import org.mockito.Mockito; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration; @@ -49,13 +51,19 @@ import org.onap.so.db.catalog.beans.OrchestrationStatus; import org.onap.so.db.catalog.beans.OrchestrationStatusStateTransitionDirective; import org.onap.so.db.catalog.beans.OrchestrationStatusValidationDirective; import org.onap.so.db.catalog.beans.ResourceType; +import org.onap.so.db.request.beans.InfraActiveRequests; import org.springframework.beans.factory.annotation.Autowired; public class OrchestrationStatusValidatorTest extends BaseTaskTest { - @InjectMocks - protected OrchestrationStatusValidator orchestrationStatusValidator = new OrchestrationStatusValidator(); + private static final String vfModuleExistExpectedMessage = + "The VfModule was found to already exist, thus no new VfModule was created in the cloud via this request"; + + private static final String vfModuleNotExistExpectedMessage = + "The VfModule was not found, thus no VfModule was deleted in the cloud via this request"; + @InjectMocks + protected OrchestrationStatusValidator orchestrationStatusValidator = new OrchestrationStatusValidator(); @Test public void test_validateOrchestrationStatus() throws Exception { @@ -95,6 +103,8 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.CONTINUE, execution.getVariable("orchestrationStatusValidationResult")); + + Mockito.verifyZeroInteractions(requestsDbClient); } @Test @@ -146,6 +156,8 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult")); + + Mockito.verifyZeroInteractions(requestsDbClient); } @Ignore @@ -192,6 +204,8 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { OrchestrationAction.ASSIGN); orchestrationStatusValidator.validateOrchestrationStatus(execution); + + Mockito.verifyZeroInteractions(requestsDbClient); } @Ignore @@ -224,6 +238,8 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { OrchestrationAction.ASSIGN); orchestrationStatusValidator.validateOrchestrationStatus(execution); + + Mockito.verifyZeroInteractions(requestsDbClient); } @Test @@ -293,6 +309,8 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.CONTINUE, execution.getVariable("orchestrationStatusValidationResult")); + + Mockito.verifyZeroInteractions(requestsDbClient); } @@ -337,10 +355,21 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { .getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, OrchestrationStatus.PENDING_ACTIVATION, OrchestrationAction.CREATE); + InfraActiveRequests request = new InfraActiveRequests(); + request.setRequestId("testVfModuleId1"); + request.setResourceStatusMessage(vfModuleExistExpectedMessage); + + Mockito.doNothing().when(requestsDbClient).patchInfraActiveRequests(request); + orchestrationStatusValidator.validateOrchestrationStatus(execution); assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult")); + + ArgumentCaptor<InfraActiveRequests> argument = ArgumentCaptor.forClass(InfraActiveRequests.class); + Mockito.verify(requestsDbClient).patchInfraActiveRequests(argument.capture()); + + assertEquals(vfModuleExistExpectedMessage, argument.getValue().getResourceStatusMessage()); } @Test @@ -385,10 +414,21 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { .getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, OrchestrationStatus.PENDING_ACTIVATION, OrchestrationAction.CREATE); + InfraActiveRequests request = new InfraActiveRequests(); + request.setRequestId("testVfModuleId1"); + request.setResourceStatusMessage(vfModuleExistExpectedMessage); + + Mockito.doNothing().when(requestsDbClient).patchInfraActiveRequests(request); + orchestrationStatusValidator.validateOrchestrationStatus(execution); assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult")); + + ArgumentCaptor<InfraActiveRequests> argument = ArgumentCaptor.forClass(InfraActiveRequests.class); + Mockito.verify(requestsDbClient).patchInfraActiveRequests(argument.capture()); + + assertEquals(vfModuleExistExpectedMessage, argument.getValue().getResourceStatusMessage()); } @Test @@ -433,10 +473,21 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { .getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, OrchestrationStatus.ASSIGNED, OrchestrationAction.CREATE); + InfraActiveRequests request = new InfraActiveRequests(); + request.setRequestId("testVfModuleId1"); + request.setResourceStatusMessage(vfModuleExistExpectedMessage); + + Mockito.doNothing().when(requestsDbClient).patchInfraActiveRequests(request); + orchestrationStatusValidator.validateOrchestrationStatus(execution); assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult")); + + ArgumentCaptor<InfraActiveRequests> argument = ArgumentCaptor.forClass(InfraActiveRequests.class); + Mockito.verify(requestsDbClient).patchInfraActiveRequests(argument.capture()); + + assertEquals(vfModuleExistExpectedMessage, argument.getValue().getResourceStatusMessage()); } @Test @@ -481,10 +532,21 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { .getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, OrchestrationStatus.PENDING_ACTIVATION, OrchestrationAction.ACTIVATE); + InfraActiveRequests request = new InfraActiveRequests(); + request.setRequestId("testVfModuleId1"); + request.setResourceStatusMessage(vfModuleExistExpectedMessage); + + Mockito.doNothing().when(requestsDbClient).patchInfraActiveRequests(request); + orchestrationStatusValidator.validateOrchestrationStatus(execution); assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult")); + + ArgumentCaptor<InfraActiveRequests> argument = ArgumentCaptor.forClass(InfraActiveRequests.class); + Mockito.verify(requestsDbClient).patchInfraActiveRequests(argument.capture()); + + assertEquals(vfModuleExistExpectedMessage, argument.getValue().getResourceStatusMessage()); } @Test @@ -529,10 +591,21 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { .getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, OrchestrationStatus.PENDING_ACTIVATION, OrchestrationAction.CREATE); + InfraActiveRequests request = new InfraActiveRequests(); + request.setRequestId("testVfModuleId1"); + request.setResourceStatusMessage(vfModuleExistExpectedMessage); + + Mockito.doNothing().when(requestsDbClient).patchInfraActiveRequests(request); + orchestrationStatusValidator.validateOrchestrationStatus(execution); assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, execution.getVariable("orchestrationStatusValidationResult")); + + ArgumentCaptor<InfraActiveRequests> argument = ArgumentCaptor.forClass(InfraActiveRequests.class); + Mockito.verify(requestsDbClient).patchInfraActiveRequests(argument.capture()); + + assertEquals(vfModuleExistExpectedMessage, argument.getValue().getResourceStatusMessage()); } @Test @@ -568,5 +641,66 @@ public class OrchestrationStatusValidatorTest extends BaseTaskTest { assertEquals(OrchestrationStatusValidationDirective.CONTINUE, execution.getVariable("orchestrationStatusValidationResult")); + + Mockito.verifyZeroInteractions(requestsDbClient); + } + + @Test + public void test_validateOrchestrationStatusDeleteVfModuleSilentSuccess() throws Exception { + String flowToBeCalled = "DeleteVfModuleBB"; + + execution.setVariable("orchestrationStatusValidationResult", + OrchestrationStatusValidationDirective.SILENT_SUCCESS); + execution.setVariable("aLaCarte", true); + execution.setVariable("flowToBeCalled", flowToBeCalled); + + GenericVnf genericVnf = buildGenericVnf(); + ModelInfoGenericVnf modelInfoGenericVnf = genericVnf.getModelInfoGenericVnf(); + modelInfoGenericVnf.setMultiStageDesign("true"); + setGenericVnf().setModelInfoGenericVnf(modelInfoGenericVnf); + setVfModule().setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + + org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule vfModule = + new org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule(); + vfModule.setVfModuleId("vfModuleId"); + vfModule.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule); + + BuildingBlockDetail buildingBlockDetail = new BuildingBlockDetail(); + buildingBlockDetail.setBuildingBlockName("DeleteVfModuleBB"); + buildingBlockDetail.setId(1); + buildingBlockDetail.setResourceType(ResourceType.VF_MODULE); + buildingBlockDetail.setTargetAction(OrchestrationAction.CREATE); + + doReturn(buildingBlockDetail).when(catalogDbClient).getBuildingBlockDetail(flowToBeCalled); + + OrchestrationStatusStateTransitionDirective orchestrationStatusStateTransitionDirective = + new OrchestrationStatusStateTransitionDirective(); + orchestrationStatusStateTransitionDirective + .setFlowDirective(OrchestrationStatusValidationDirective.SILENT_SUCCESS); + orchestrationStatusStateTransitionDirective.setId(1); + orchestrationStatusStateTransitionDirective.setOrchestrationStatus(OrchestrationStatus.PENDING_ACTIVATION); + orchestrationStatusStateTransitionDirective.setResourceType(ResourceType.VF_MODULE); + orchestrationStatusStateTransitionDirective.setTargetAction(OrchestrationAction.CREATE); + + doReturn(orchestrationStatusStateTransitionDirective).when(catalogDbClient) + .getOrchestrationStatusStateTransitionDirective(ResourceType.VF_MODULE, + OrchestrationStatus.PENDING_ACTIVATION, OrchestrationAction.CREATE); + + InfraActiveRequests request = new InfraActiveRequests(); + request.setRequestId("testVfModuleId1"); + request.setResourceStatusMessage(vfModuleNotExistExpectedMessage); + + Mockito.doNothing().when(requestsDbClient).patchInfraActiveRequests(request); + + orchestrationStatusValidator.validateOrchestrationStatus(execution); + + assertEquals(OrchestrationStatusValidationDirective.SILENT_SUCCESS, + execution.getVariable("orchestrationStatusValidationResult")); + + ArgumentCaptor<InfraActiveRequests> argument = ArgumentCaptor.forClass(InfraActiveRequests.class); + Mockito.verify(requestsDbClient).patchInfraActiveRequests(argument.capture()); + + assertEquals(vfModuleNotExistExpectedMessage, argument.getValue().getResourceStatusMessage()); } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index ff1246bc46..fc7f603d17 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -328,25 +328,20 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { ExecuteBuildingBlock ebb3 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock3); flowsToExecute.add(ebb3); - BuildingBlock buildingBlock4 = new BuildingBlock().setBpmnFlowName("AssignFabricConfigurationBB"); + BuildingBlock buildingBlock4 = new BuildingBlock().setBpmnFlowName("AddFabricConfigurationBB"); ExecuteBuildingBlock ebb4 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock4); flowsToExecute.add(ebb4); - BuildingBlock buildingBlock5 = new BuildingBlock().setBpmnFlowName("ActivateFabricConfigurationBB"); - ExecuteBuildingBlock ebb5 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock5); - flowsToExecute.add(ebb5); - execution.setVariable("flowsToExecute", flowsToExecute); - execution.setVariable("gCurrentSequence", 5); + execution.setVariable("gCurrentSequence", 4); workflowActionBBTasks.rollbackExecutionPath(execution); List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); assertEquals(0, execution.getVariable("gCurrentSequence")); - assertEquals(4, ebbs.size()); - assertEquals("DeactivateFabricConfigurationBB", ebbs.get(0).getBuildingBlock().getBpmnFlowName()); - assertEquals("UnassignFabricConfigurationBB", ebbs.get(1).getBuildingBlock().getBpmnFlowName()); - assertEquals("DeactivateVfModuleBB", ebbs.get(2).getBuildingBlock().getBpmnFlowName()); - assertEquals("DeleteVfModuleBB", ebbs.get(3).getBuildingBlock().getBpmnFlowName()); + assertEquals(3, ebbs.size()); + assertEquals("DeleteFabricConfigurationBB", ebbs.get(0).getBuildingBlock().getBpmnFlowName()); + assertEquals("DeactivateVfModuleBB", ebbs.get(1).getBuildingBlock().getBpmnFlowName()); + assertEquals("DeleteVfModuleBB", ebbs.get(2).getBuildingBlock().getBpmnFlowName()); } diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/model/Deployment.java b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/model/Deployment.java index 811cdc7333..86a2b5f1bb 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/model/Deployment.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/model/Deployment.java @@ -25,7 +25,6 @@ import java.io.Serializable; import java.util.Date; import java.util.List; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/model/DeploymentOutputs.java b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/model/DeploymentOutputs.java index 5d828720b0..1f34534a15 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/model/DeploymentOutputs.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/model/DeploymentOutputs.java @@ -23,7 +23,6 @@ package org.onap.so.cloudify.v3.model; import java.io.IOException; import java.io.Serializable; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/common/pom.xml b/common/pom.xml index d373d620cd..b998a0adfa 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -16,7 +16,6 @@ <protobuf.version>3.6.1</protobuf.version> <grpc.netty.version>4.1.30.Final</grpc.netty.version> <ccsdk.version>0.4.2</ccsdk.version> - <appc.client.version>1.7.1-SNAPSHOT</appc.client.version> </properties> <dependencies> diff --git a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVm.java b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVm.java index 75e2053077..59fb33c07f 100644 --- a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVm.java +++ b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVm.java @@ -1,7 +1,6 @@ package org.onap.so.appc.orchestrator.service.beans; import java.io.Serializable; -import java.util.List; public class ApplicationControllerVm implements Serializable { diff --git a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVnf.java b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVnf.java index 526941dc39..b23566a0d9 100644 --- a/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVnf.java +++ b/common/src/main/java/org/onap/so/appc/orchestrator/service/beans/ApplicationControllerVnf.java @@ -1,7 +1,6 @@ package org.onap.so.appc.orchestrator.service.beans; import java.io.Serializable; -import java.util.List; public class ApplicationControllerVnf implements Serializable { diff --git a/common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java index cc6c9bbb82..6c5d9c6909 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/ServiceProfile.java @@ -21,11 +21,7 @@ package org.onap.so.beans.nsmf; import java.io.Serializable; -import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java b/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java index 48c2d1495d..0f3d968ecd 100644 --- a/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java +++ b/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java @@ -7,7 +7,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software @@ -21,7 +21,6 @@ package org.onap.so.client.dmaap; import java.io.IOException; -import java.security.GeneralSecurityException; import java.util.Base64; import java.util.Map; import java.util.Optional; @@ -31,7 +30,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; -import org.onap.so.utils.CryptoUtils; public abstract class DmaapClient { diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java index 3e85cc5ec6..9552755544 100644 --- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java +++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/SOAuditLogContainerFilter.java @@ -2,7 +2,6 @@ package org.onap.so.logging.jaxrs.filter; import javax.annotation.Priority; import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerResponseContext; import javax.ws.rs.container.PreMatching; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.logger.HttpHeadersConstants; diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java index 75a6ba8280..2d8b12c12f 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java @@ -35,6 +35,8 @@ public class Request { protected String finishTime; protected String requestScope; protected String requestType; + protected String workflowName; + protected String operationName; protected String originalRequestId; protected RequestDetails requestDetails; protected InstanceReferences instanceReferences; @@ -83,6 +85,22 @@ public class Request { this.requestType = requestType; } + public String getWorkflowName() { + return workflowName; + } + + public void setWorkflowName(String workflowName) { + this.workflowName = workflowName; + } + + public String getOperationName() { + return operationName; + } + + public void setOperationName(String operationName) { + this.operationName = operationName; + } + public RequestStatus getRequestStatus() { return requestStatus; } @@ -136,9 +154,9 @@ public class Request { public String toString() { return new ToStringBuilder(this).append("requestId", requestId).append("startTime", startTime) .append("finishTime", finishTime).append("requestScope", requestScope) - .append("requestType", requestType).append("requestDetails", requestDetails) - .append("instanceReferences", instanceReferences).append("requestStatus", requestStatus) - .append("requestProcessingData", requestProcessingData).append("cloudRequestData", cloudRequestData) - .append("originalRequestId", originalRequestId).toString(); + .append("requestType", requestType).append("workflowName", workflowName) + .append("requestDetails", requestDetails).append("instanceReferences", instanceReferences) + .append("requestStatus", requestStatus).append("requestProcessingData", requestProcessingData) + .append("cloudRequestData", cloudRequestData).append("originalRequestId", originalRequestId).toString(); } } diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestList.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestList.java index 8374aa7638..afae5c2bd1 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestList.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestList.java @@ -20,7 +20,6 @@ package org.onap.so.serviceinstancebeans; -import java.util.List; import org.apache.commons.lang3.builder.ToStringBuilder; diff --git a/deployment-configs/src/main/resources/logger/logback-spring.xml b/deployment-configs/src/main/resources/logger/logback-spring.xml index 3f022f55fb..76dbc1d1ab 100644 --- a/deployment-configs/src/main/resources/logger/logback-spring.xml +++ b/deployment-configs/src/main/resources/logger/logback-spring.xml @@ -157,6 +157,7 @@ <pattern>${debugPattern}</pattern> </encoder> </appender> + <appender name="asyncDebug" class="ch.qos.logback.classic.AsyncAppender"> <queueSize>256</queueSize> @@ -190,28 +191,29 @@ <logger name="org.springframework" level="WARN" /> <logger name="org.springframework.security.authentication.dao.DaoAuthenticationProvider" - level="DEBUG" /> + level="${LOG_LEVEL:-DEBUG}" /> <!-- Camunda related loggers --> - <logger name="org.camunda.bpm.engine.jobexecutor.level" level="DEBUG" /> + <logger name="org.camunda.bpm.engine.jobexecutor.level" level="${LOG_LEVEL:-DEBUG}" /> <logger name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity.level" - level="DEBUG" /> + level="${LOG_LEVEL:-DEBUG}" /> - <logger name="org.flywaydb" level="DEBUG"/> - <logger name="org.apache.wire" level="DEBUG" /> - <logger name="org.onap" level="DEBUG" /> - <logger name="org.apache.cxf.interceptor" level="DEBUG" /> - <logger name="com.woorea.openstack.connector" level="DEBUG" /> + <logger name="org.flywaydb" level="${LOG_LEVEL:-DEBUG}"/> + <logger name="org.apache.wire" level="${LOG_LEVEL:-DEBUG}" /> + <logger name="org.onap" level="${LOG_LEVEL:-DEBUG}" /> + <logger name="org.apache.cxf.interceptor" level="${LOG_LEVEL:-DEBUG}" /> + <logger name="com.woorea.openstack.connector" level="${LOG_LEVEL:-DEBUG}" /> <!-- AAF Logs go here--> <logger name="org.apache.catalina.core.ContainerBase" level="INFO" additivity="false"> <appender-ref ref="asyncCadi" /> </logger> - - <logger name="org.reflections.Reflections" level="ERROR" additivity="false"> - <appender-ref ref="asyncCadi" /> - </logger> + + <!-- Jersey Openstack Connector Logs Go Here for Openstack4J --> + <logger name="os" level="${LOG_LEVEL:-DEBUG}" /> + + <logger name="org.reflections" level="ERROR" additivity="false" /> <logger name="AUDIT" level="INFO" additivity="false"> <appender-ref ref="asyncAudit" /> diff --git a/docs/api/offered_consumed_apis.rst b/docs/api/offered_consumed_apis.rst index 1d0a8f005b..0b0ba81b4d 100644 --- a/docs/api/offered_consumed_apis.rst +++ b/docs/api/offered_consumed_apis.rst @@ -1,6 +1,7 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 .. Copyright 2018 Huawei Technologies Co., Ltd. +.. _offeredapis: SO Offered and Consumed APIs ============================ diff --git a/docs/architecture/architecture.rst b/docs/architecture/architecture.rst index 72b108a271..d59429a366 100644 --- a/docs/architecture/architecture.rst +++ b/docs/architecture/architecture.rst @@ -1,6 +1,7 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 .. Copyright 2018 Huawei Technologies Co., Ltd. +.. _architecture: SO - Architecture ================= @@ -15,6 +16,8 @@ SO Deployment View .. image:: ../images/SO_Architecture_Internal.png +.. image:: ../images/so-architecture.png + SO Sub-Components ------------------ @@ -25,7 +28,7 @@ SO Sub-Components * Handle service-level and infrastructure (VNF & network) requests Service-agnostic APIs - * “Service Instantiation API” + * "Service Instantiation API" Model-driven recipe selection * Use SO Catalog to map input requests to BPMN flows @@ -43,7 +46,7 @@ SO Sub-Components Expose RESTful interface to API-H (unique path per recipe) - Make use of common “building block” sub-flows + Make use of common "building block" sub-flows Sequence orchestration steps for each Resource in the recipe * Request and configure network resources via SDN-C @@ -120,4 +123,4 @@ Third Party and Open Source **Other Open Source Components of Note:** Tomcat MySQL/MariaDB - Openstack Java SDK (“woorea”) + Openstack Java SDK ("woorea") diff --git a/docs/images/so-architecture.png b/docs/images/so-architecture.png Binary files differnew file mode 100644 index 0000000000..3904c46cf3 --- /dev/null +++ b/docs/images/so-architecture.png diff --git a/docs/index.rst b/docs/index.rst index cae4ff02dc..fbf83063a1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,15 +1,16 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2018 Huawei Technologies Co., Ltd.
-
-ONAP SO
-========================================
-
-.. toctree::
- :maxdepth: 1
-
- installconfigure/Install_Configure_SO.rst
- architecture/architecture.rst
- api/offered_consumed_apis.rst
- developer_info/developer_information.rst
- release-notes.rst
+.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 Huawei Technologies Co., Ltd. +.. _master_index: + +ONAP SO +======================================== + +.. toctree:: + :maxdepth: 1 + + installconfigure/Install_Configure_SO.rst + architecture/architecture.rst + api/offered_consumed_apis.rst + developer_info/developer_information.rst + release-notes.rst diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 4ad5f5876f..d052eb72fe 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -1,6 +1,7 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 .. Copyright 2018 Huawei Intellectual Property. All rights reserved. +.. _release_notes: Service Orchestrator Release Notes @@ -369,7 +370,7 @@ The main goal of the Dublin release was to: - [`SO-1206 <https://jira.onap.org/browse/SO-1206>`__\ ] - Added groupInstanceId and groupInstanceName columns - [`SO-1205 <https://jira.onap.org/browse/SO-1205>`__\ ] - separate error status from progression status in req db - [`SO-806 <https://jira.onap.org/browse/SO-806>`__\ ] - SO PNF PnP workflow shall not set "in-maint" AAI flag -- [`SO-798 <https://jira.onap.org/browse/SO-798>`__\ ] - Externalize the PNF PnP workflow 鈥?as a Service Instance Deployment workflow 鈥?adding the Controller +- [`SO-798 <https://jira.onap.org/browse/SO-798>`__\ ] - Externalize the PNF PnP workflow? as a Service Instance Deployment workflow? adding the Controller - [`SO-747 <https://jira.onap.org/browse/SO-747>`__\ ] - POC - Enable SO use of Multicloud Generic VNF Instantiation API - [`SO-700 <https://jira.onap.org/browse/SO-700>`__\ ] - SO should be able to support CCVPN service assurance - [`SO-588 <https://jira.onap.org/browse/SO-588>`__\ ] - Automate robot heatbridge manual step to add VF Module stack resources in AAI diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java index 62f39d9148..696a518ceb 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java @@ -22,14 +22,9 @@ package org.onap.so.apihandlerinfra.exceptions; -import java.io.StringWriter; -import java.util.ArrayList; import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; @@ -41,10 +36,7 @@ import org.onap.so.serviceinstancebeans.RequestError; import org.onap.so.serviceinstancebeans.ServiceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; @Provider public class ApiExceptionMapper implements ExceptionMapper<ApiException> { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java index f30b66c6b5..4e0ba083ea 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java @@ -13,7 +13,6 @@ import org.json.JSONObject; import org.onap.logging.filter.spring.SpringClientPayloadFilter; import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter; import org.onap.so.utils.CryptoUtils; -import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java index 3007ddd7c9..f39a95e92c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java @@ -197,6 +197,7 @@ public class InstanceManagement { vnfId = sir.getVnfInstanceId(); } + currentActiveReq = setWorkflowNameAndOperationName(currentActiveReq, workflowUuid); saveCurrentActiveRequest(currentActiveReq); RequestClientParameter requestClientParameter; @@ -293,6 +294,7 @@ public class InstanceManagement { RecipeLookupResult recipeLookupResult = getInstanceManagementWorkflowRecipe(currentActiveReq, workflowUuid); + currentActiveReq = setWorkflowNameAndOperationName(currentActiveReq, workflowUuid); saveCurrentActiveRequest(currentActiveReq); RequestClientParameter requestClientParameter; @@ -357,4 +359,14 @@ public class InstanceManagement { } return null; } + + protected InfraActiveRequests setWorkflowNameAndOperationName(InfraActiveRequests currentActiveReq, + String workflowUuid) { + Workflow workflow = catalogDbClient.findWorkflowByArtifactUUID(workflowUuid); + if (workflow != null) { + currentActiveReq.setWorkflowName(workflow.getName()); + currentActiveReq.setOperationName(workflow.getOperationName()); + } + return currentActiveReq; + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java index c43a050500..acd3a8321e 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java @@ -49,7 +49,6 @@ import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.apihandler.common.ErrorNumbers; import org.onap.so.apihandler.common.ResponseBuilder; import org.onap.so.apihandlerinfra.exceptions.ApiException; -import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException; import org.onap.so.apihandlerinfra.exceptions.ValidateException; import org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo; import org.onap.so.constants.OrchestrationRequestFormat; @@ -311,6 +310,19 @@ public class OrchestrationRequests { request.setOriginalRequestId(originalRequestId); } + if (!version.matches("v[1-7]")) { + String workflowName = iar.getWorkflowName(); + if (workflowName == null) { + workflowName = iar.getRequestAction(); + } + request.setWorkflowName(workflowName); + + String operationName = iar.getOperationName(); + if (operationName != null) { + request.setOperationName(operationName); + } + } + InstanceReferences ir = new InstanceReferences(); if (iar.getNetworkId() != null) ir.setNetworkInstanceId(iar.getNetworkId()); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java index 9b37043b2d..a1e878176b 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java @@ -40,7 +40,6 @@ import javax.ws.rs.core.Response; import org.apache.commons.lang.StringUtils; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; -import org.camunda.bpm.engine.history.HistoricProcessInstance; import org.camunda.bpm.engine.impl.persistence.entity.HistoricProcessInstanceEntity; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.apihandler.camundabeans.CamundaResponse; @@ -74,7 +73,6 @@ import org.onap.so.db.catalog.beans.VnfResource; import org.onap.so.db.catalog.beans.VnfResourceCustomization; import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.db.request.beans.InfraActiveRequests; -import org.onap.so.db.request.client.RequestsDbClient; import org.onap.so.exceptions.ValidationException; import org.onap.logging.filter.base.ErrorCode; import org.onap.so.logger.LogConstants; diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java index 4e3d8736c2..a522129c31 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java @@ -1,19 +1,29 @@ package org.onap.so.apihandlerinfra.infra.rest; +import java.util.List; import java.util.Optional; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.L3Network; +import org.onap.aai.domain.yang.LInterface; import org.onap.aai.domain.yang.Service; import org.onap.aai.domain.yang.ServiceInstance; import org.onap.aai.domain.yang.Tenant; import org.onap.aai.domain.yang.VfModule; import org.onap.aai.domain.yang.VolumeGroup; import org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound; +import org.onap.so.client.aai.AAIDSLQueryClient; import org.onap.so.client.aai.AAIObjectPlurals; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.AAIResourcesClient; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.uri.AAIUriFactory; +import org.onap.so.client.graphinventory.entities.DSLQuery; +import org.onap.so.client.graphinventory.entities.DSLQueryBuilder; +import org.onap.so.client.graphinventory.entities.DSLStartNode; +import org.onap.so.client.graphinventory.entities.Node; +import org.onap.so.client.graphinventory.entities.Start; +import org.onap.so.client.graphinventory.entities.TraversalBuilder; +import org.onap.so.client.graphinventory.entities.__; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -25,6 +35,8 @@ public class AAIDataRetrieval { private AAIResourcesClient aaiResourcesClient; + private AAIDSLQueryClient aaiDslQueryClient; + private static final Logger logger = LoggerFactory.getLogger(AAIDataRetrieval.class); public ServiceInstance getServiceInstance(String serviceInstanceId) { @@ -129,6 +141,22 @@ public class AAIDataRetrieval { }); } + public List<LInterface> getLinterfacesOfVnf(String vnfId) { + DSLStartNode startNode = new DSLStartNode(AAIObjectType.GENERIC_VNF, __.key("generic-vnf-id", vnfId)); + DSLQueryBuilder<Start, Node> builder = TraversalBuilder.fragment(startNode) + .to(__.node(AAIObjectType.VSERVER).to(__.node(AAIObjectType.L_INTERFACE).output())); + List<LInterface> linterfaces = + getAAIDSLQueryClient().querySingleResource(new DSLQuery(builder.build()), LInterface.class); + return linterfaces; + } + + private AAIDSLQueryClient getAAIDSLQueryClient() { + if (aaiDslQueryClient == null) { + aaiDslQueryClient = new AAIDSLQueryClient(); + } + return aaiDslQueryClient; + } + protected AAIResourcesClient getAaiResourcesClient() { if (aaiResourcesClient == null) { aaiResourcesClient = new AAIResourcesClient(); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/ServiceInstanceDeleteValidator.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/ServiceInstanceDeleteValidator.java index 0c7ba65cf4..61f757ba64 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/ServiceInstanceDeleteValidator.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/ServiceInstanceDeleteValidator.java @@ -6,11 +6,10 @@ import java.util.regex.Pattern; import org.onap.so.apihandlerinfra.Action; import org.onap.so.apihandlerinfra.Actions; import org.onap.so.apihandlerinfra.infra.rest.AAIDataRetrieval; -import org.onap.so.listener.Skip; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; import org.springframework.beans.factory.annotation.Autowired; -@Skip + public class ServiceInstanceDeleteValidator implements RequestValidator { @Autowired diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java index ba7fe2b9cb..081f235db1 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/InstanceManagementTest.java @@ -45,9 +45,11 @@ import org.apache.http.HttpStatus; import org.junit.Before; import org.junit.Test; import org.onap.logging.ref.slf4j.ONAPLogConstants; +import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.logger.HttpHeadersConstants; import org.onap.so.serviceinstancebeans.RequestReferences; import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -63,6 +65,9 @@ public class InstanceManagementTest extends BaseTest { private final ObjectMapper mapper = new ObjectMapper(); private ObjectMapper errorMapper = new ObjectMapper(); + @Autowired + InstanceManagement instanceManagement; + @Value("${wiremock.server.port}") private String wiremockPort; @@ -201,4 +206,18 @@ public class InstanceManagementTest extends BaseTest { ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class); assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId")); } + + @Test + public void workflowAndOperationNameTest() { + wireMockServer.stubFor(get(urlMatching( + ".*/workflow/search/findByArtifactUUID[?]artifactUUID=71526781-e55c-4cb7-adb3-97e09d9c76be")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("workflow_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + InfraActiveRequests activeReq = new InfraActiveRequests(); + activeReq = + instanceManagement.setWorkflowNameAndOperationName(activeReq, "71526781-e55c-4cb7-adb3-97e09d9c76be"); + assertEquals(activeReq.getWorkflowName(), "testingWorkflow"); + assertEquals(activeReq.getOperationName(), "testOperation"); + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java index 3db2b2d96d..fdaca3566f 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java @@ -85,6 +85,9 @@ public class OrchestrationRequestsUnitTest { private static final String RETRY_STATUS_MESSAGE = "RetryStatusMessage"; private static final String ROLLBACK_STATUS_MESSAGE = "RollbackStatusMessage"; private static final String TASK_INFORMATION = " TASK INFORMATION: Last task executed: Call SDNC"; + private static final String WORKFLOW_NAME = "testWorkflowName"; + private static final String OPERATION_NAME = "testOperationName"; + private static final String REQUEST_ACTION = "createInstance"; private InfraActiveRequests iar; boolean includeCloudRequest = false; private static final String ROLLBACK_EXT_SYSTEM_ERROR_SOURCE = "SDNC"; @@ -152,12 +155,80 @@ public class OrchestrationRequestsUnitTest { expected.setRequestScope(SERVICE); expected.setStartTime(new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(startTime) + " GMT"); + iar.setWorkflowName(WORKFLOW_NAME); + iar.setOperationName(OPERATION_NAME); + Request result = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest, OrchestrationRequestFormat.DETAIL.toString(), "v7"); assertThat(result, sameBeanAs(expected)); } @Test + public void mapInfraActiveRequestToRequestWithWorkflowNameAndOperationNameTest() throws ApiException { + doReturn("Last task executed: Call SDNC").when(camundaRequestHandler).getTaskName(REQUEST_ID); + InstanceReferences instanceReferences = new InstanceReferences(); + instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID); + RequestStatus requestStatus = new RequestStatus(); + requestStatus.setRequestState(iar.getRequestStatus()); + requestStatus.setStatusMessage( + String.format("FLOW STATUS: %s RETRY STATUS: %s ROLLBACK STATUS: %s RESOURCE STATUS: %s", + FLOW_STATUS + TASK_INFORMATION, RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE, + "The vf module already exist")); + + Request expected = new Request(); + expected.setRequestId(REQUEST_ID); + expected.setOriginalRequestId(ORIGINAL_REQUEST_ID); + expected.setInstanceReferences(instanceReferences); + expected.setRequestStatus(requestStatus); + expected.setRequestScope(SERVICE); + expected.setStartTime(new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(startTime) + " GMT"); + expected.setWorkflowName(WORKFLOW_NAME); + expected.setOperationName(OPERATION_NAME); + + iar.setOriginalRequestId(ORIGINAL_REQUEST_ID); + iar.setWorkflowName(WORKFLOW_NAME); + iar.setOperationName(OPERATION_NAME); + + Request result = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest, + OrchestrationRequestFormat.DETAIL.toString(), "v8"); + assertThat(result, sameBeanAs(expected)); + } + + @Test + public void mapInfraActiveRequestToRequestWithNoWorkflowNameAndNoOperationNameTest() throws ApiException { + doReturn("Last task executed: Call SDNC").when(camundaRequestHandler).getTaskName(REQUEST_ID); + InstanceReferences instanceReferences = new InstanceReferences(); + instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID); + RequestStatus requestStatus = new RequestStatus(); + requestStatus.setRequestState(iar.getRequestStatus()); + requestStatus.setStatusMessage( + String.format("FLOW STATUS: %s RETRY STATUS: %s ROLLBACK STATUS: %s RESOURCE STATUS: %s", + FLOW_STATUS + TASK_INFORMATION, RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE, + "The vf module already exist")); + + Request expected = new Request(); + expected.setRequestId(REQUEST_ID); + expected.setOriginalRequestId(ORIGINAL_REQUEST_ID); + expected.setInstanceReferences(instanceReferences); + expected.setRequestStatus(requestStatus); + expected.setRequestScope(SERVICE); + expected.setStartTime(new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(startTime) + " GMT"); + + + expected.setWorkflowName(REQUEST_ACTION); + expected.setRequestType(REQUEST_ACTION); + + iar.setOriginalRequestId(ORIGINAL_REQUEST_ID); + iar.setRequestAction(REQUEST_ACTION); + iar.setWorkflowName(null); + iar.setOperationName(null); + + Request result = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest, + OrchestrationRequestFormat.DETAIL.toString(), "v8"); + assertThat(result, sameBeanAs(expected)); + } + + @Test public void mapRequestStatusAndExtSysErrSrcToRequestFalseTest() throws ApiException { doReturn("Last task executed: Call SDNC").when(camundaRequestHandler).getTaskName(REQUEST_ID); InstanceReferences instanceReferences = new InstanceReferences(); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json index d6ed585537..5877f43a92 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json @@ -1,5 +1,6 @@ { "artifactUUID": "71526781-e55c-4cb7-adb3-97e09d9c76be", "artifactName": "testingWorkflow.bpmn", - "name": "testingWorkflow" + "name": "testingWorkflow", + "operationName": "testOperation" }
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_pnf_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_pnf_Response.json index 133d8bed9b..1d6cd43bf7 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_pnf_Response.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_pnf_Response.json @@ -1,5 +1,6 @@ { "artifactUUID": "81526781-e55c-4cb7-adb3-97e09d9c76bf", "artifactName": "testingPNFWorkflow.bpmn", - "name": "testingPNFWorkflow" + "name": "testingPNFWorkflow", + "operationName": "testPnfOperation" }
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql index 19855bc85e..fd8c273b57 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql @@ -1300,6 +1300,8 @@ CREATE TABLE `infra_active_requests` ( `TENANT_NAME` varchar(200) DEFAULT NULL, `PRODUCT_FAMILY_NAME` varchar(200) DEFAULT NULL, `RESOURCE_STATUS_MESSAGE` longtext, + `WORKFLOW_NAME` varchar(200) DEFAULT NULL, + `OPERATION_NAME` varchar(200) DEFAULT NULL, PRIMARY KEY (`REQUEST_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql index 4c376c7af8..e8f2002399 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql +++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql @@ -103,8 +103,9 @@ CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS( ROLLBACK_EXT_SYSTEM_ERROR_SOURCE VARCHAR SELECTIVITY 1, TENANT_NAME VARCHAR SELECTIVITY 1, PRODUCT_FAMILY_NAME VARCHAR SELECTIVITY 1, - RESOURCE_STATUS_MESSAGE VARCHAR SELECTIVITY 36 - + RESOURCE_STATUS_MESSAGE VARCHAR SELECTIVITY 36, + WORKFLOW_NAME VARCHAR SELECTIVITY 1, + OPERATION_NAME VARCHAR SELECTIVITY 1 ); INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, TENANT_ID, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME, REQUEST_URL) VALUES @@ -177,7 +178,9 @@ CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS( REQUEST_URL VARCHAR SELECTIVITY 1, TENANT_NAME VARCHAR SELECTIVITY 1, PRODUCT_FAMILY_NAME VARCHAR SELECTIVITY 1, - RESOURCE_STATUS_MESSAGE VARCHAR SELECTIVITY 36 + RESOURCE_STATUS_MESSAGE VARCHAR SELECTIVITY 36, + WORKFLOW_NAME VARCHAR SELECTIVITY 1, + OPERATION_NAME VARCHAR SELECTIVITY 1 ); CREATE TABLE IF NOT EXISTS cloud_api_requests( diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java index 8c4d0718b1..019530aea4 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java @@ -78,7 +78,9 @@ public class ArchivedInfraRequests extends InfraRequests { .append("networkName", getNetworkName()).append("networkType", getNetworkType()) .append("requestorId", getRequestorId()).append("configurationId", getConfigurationId()) .append("configurationName", getConfigurationName()).append("operationalEnvId", getOperationalEnvId()) - .append("operationalEnvName", getOperationalEnvName()).append("requestUrl", getRequestUrl()).toString(); + .append("operationalEnvName", getOperationalEnvName()).append("requestUrl", getRequestUrl()) + .append("tenantName", getTenantName()).append("productFamilyName", getProductFamilyName()) + .append("workflowName", getWorkflowName()).append("operationName", getOperationName()).toString(); } } diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java index 750fa13c77..02e403c37e 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java @@ -69,10 +69,10 @@ public class InfraActiveRequests extends InfraRequests { @Override public String toString() { return new ToStringBuilder(this).append("requestId", getRequestId()).append("requestStatus", getRequestStatus()) - .append("statusMessage", getStatusMessage()).append("progress", getProgress()) - .append("startTime", getStartTime()).append("endTime", getEndTime()).append("source", getSource()) - .append("vnfId", getVnfId()).append("vnfName", getVnfName()).append("vnfType", getVnfType()) - .append("pnfName", getPnfName()).append("serviceType", getServiceType()) + .append("statusMessage", getStatusMessage()).append("resourceStatusMessage", getResourceStatusMessage()) + .append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime()) + .append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName()) + .append("vnfType", getVnfType()).append("pnfName", getPnfName()).append("serviceType", getServiceType()) .append("tenantId", getTenantId()).append("vnfParams", getVnfParams()) .append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody()) .append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy()) @@ -90,6 +90,7 @@ public class InfraActiveRequests extends InfraRequests { .append("originalRequestId", getOriginalRequestId()) .append("extSystemErrorSource", getExtSystemErrorSource()) .append("rollbackExtSystemErrorSource", getRollbackExtSystemErrorSource()) - .append("tenantName", getTenantName()).append("productFamilyName", getProductFamilyName()).toString(); + .append("tenantName", getTenantName()).append("productFamilyName", getProductFamilyName()) + .append("workflowName", getWorkflowName()).append("operationName", getOperationName()).toString(); } } diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java index a6d6af8a07..cf6cf687b0 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java @@ -155,6 +155,10 @@ public abstract class InfraRequests implements java.io.Serializable { private String tenantName; @Column(name = "PRODUCT_FAMILY_NAME", length = 80) private String productFamilyName; + @Column(name = "WORKFLOW_NAME", length = 200) + private String workflowName; + @Column(name = "OPERATION_NAME", length = 200) + private String operationName; @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinColumn(name = "SO_REQUEST_ID", referencedColumnName = "REQUEST_ID", updatable = false) @@ -580,6 +584,22 @@ public abstract class InfraRequests implements java.io.Serializable { this.productFamilyName = productFamilyName; } + public String getWorkflowName() { + return workflowName; + } + + public void setWorkflowName(String workflowName) { + this.workflowName = workflowName; + } + + public String getOperationName() { + return operationName; + } + + public void setOperationName(String operationName) { + this.operationName = operationName; + } + @PrePersist protected void onCreate() { if (requestScope == null) @@ -641,6 +661,7 @@ public abstract class InfraRequests implements java.io.Serializable { .append("instanceGroupName", getInstanceGroupName()).append("requestUrl", getRequestUrl()) .append("originalRequestId", originalRequestId).append("extSystemErrorSource", extSystemErrorSource) .append("rollbackExtSystemErrorSource", rollbackExtSystemErrorSource).append("tenantName", tenantName) - .append("productFamilyName", productFamilyName).toString(); + .append("productFamilyName", productFamilyName).append("workflowName", workflowName) + .append("operationName", operationName).toString(); } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java index b340fdea2b..a49be130e4 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java @@ -30,6 +30,7 @@ public enum OrchestrationAction { CREATE("Create"), DELETE("Delete"), UPDATE("Update"), + ADD("Add"), ADD_MEMBERS("AddMembers"), REMOVE_MEMBERS("RemoveMembers"), CUSTOM("Custom"); diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ProcessingFlags.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ProcessingFlags.java new file mode 100644 index 0000000000..211da5d90b --- /dev/null +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ProcessingFlags.java @@ -0,0 +1,187 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.db.catalog.beans; + +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Lob; +import javax.persistence.PrePersist; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.annotations.UpdateTimestamp; +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.openpojo.business.annotation.BusinessKey; +import uk.co.blackpepper.bowman.annotation.RemoteResource; + + +/** + * EntityBean class for ProcessingFlags. This bean represents a set of flags governing request processing. + * + */ +@RemoteResource("/processingFlags") +@Entity +@Table(name = "processing_flags") +@JsonAutoDetect(fieldVisibility = Visibility.ANY) +public class ProcessingFlags { + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @JsonProperty("flag") + @BusinessKey + @Column(name = "FLAG") + private String flag; + + @JsonProperty("value") + @BusinessKey + @Column(name = "VALUE") + private String value; + + @JsonProperty("endpoint") + @BusinessKey + @Column(name = "ENDPOINT") + private String endpoint; + + @JsonProperty("description") + @Lob + @Column(name = "DESCRIPTION", columnDefinition = "LONGTEXT") + private String description = null; + + @JsonProperty("creation_timestamp") + @BusinessKey + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @JsonProperty("update_timestamp") + @BusinessKey + @Column(name = "UPDATE_TIMESTAMP") + @Temporal(TemporalType.TIMESTAMP) + @UpdateTimestamp + private Date updated; + + public ProcessingFlags() { + + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + // this.updated = new Date(); + } + + public ProcessingFlags(ProcessingFlags flags) { + this.flag = flags.getFlag(); + this.value = flags.getValue(); + this.endpoint = flags.getEndpoint(); + this.description = flags.getDescription(); + } + + public Integer getId() { + return this.id; + } + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + public Date getUpdated() { + return updated; + } + + public void setUpdated(Date updated) { + this.updated = updated; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("flag", getFlag()) + .append("value", getValue()).append("endpoint", getEndpoint()).append("description", getDescription()) + .toString(); + } + + @Override + public boolean equals(final Object other) { + if (other == null) { + return false; + } + if (!getClass().equals(other.getClass())) { + return false; + } + ProcessingFlags castOther = (ProcessingFlags) other; + return new EqualsBuilder().append(getFlag(), castOther.getFlag()).append(getValue(), castOther.getValue()) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(1, 31).append(getFlag()).append(getValue()).append(getEndpoint()).toHashCode(); + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java index 4fd28c910e..74f58a210c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java @@ -21,24 +21,30 @@ package org.onap.so.db.catalog.beans; public enum ResourceType { - SERVICE("Service"), - VNF("Vnf"), - VOLUME_GROUP("VolumeGroup"), - VF_MODULE("VfModule"), - NETWORK("Network"), - NETWORK_COLLECTION("NetworkCollection"), - CONFIGURATION("Configuration"), - INSTANCE_GROUP("InstanceGroup"), - NO_VALIDATE("NoValidate"); + SERVICE("Service", "SERVICE_INSTANCE_ID"), + VNF("Vnf", "GENERIC_VNF_ID"), + VOLUME_GROUP("VolumeGroup", "VOLUME_GROUP_ID"), + VF_MODULE("VfModule", "VF_MODULE_ID"), + NETWORK("Network", "NETWORK_ID"), + NETWORK_COLLECTION("NetworkCollection", "NETWORK_COLLECTION_ID"), + CONFIGURATION("Configuration", "CONFIGURATION_ID"), + INSTANCE_GROUP("InstanceGroup", "INSTANCE_GROUP_ID"), + NO_VALIDATE("NoValidate", ""); private final String name; + private final String resourceKey; - private ResourceType(String name) { + private ResourceType(String name, String resourceKey) { this.name = name; + this.resourceKey = resourceKey; } @Override public String toString() { return name; } + + public String getResourceKey() { + return resourceKey; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java index 4c5bbaf7ec..a68ed44ee7 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java @@ -52,6 +52,7 @@ import org.onap.so.db.catalog.beans.OrchestrationStatus; import org.onap.so.db.catalog.beans.OrchestrationStatusStateTransitionDirective; import org.onap.so.db.catalog.beans.PnfResource; import org.onap.so.db.catalog.beans.PnfResourceCustomization; +import org.onap.so.db.catalog.beans.ProcessingFlags; import org.onap.so.db.catalog.beans.ResourceType; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.ServiceRecipe; @@ -121,6 +122,7 @@ public class CatalogDbClient { private static final String PNF_RESOURCE_CUSTOMIZATION = "/pnfResourceCustomization"; private static final String WORKFLOW = "/workflow"; private static final String BB_NAME_SELECTION_REFERENCE = "/bbNameSelectionReference"; + private static final String PROCESSING_FLAGS = "/processingFlags"; private static final String SEARCH = "/search"; @@ -159,6 +161,7 @@ public class CatalogDbClient { protected static final String ARTIFACT_UUID = "artifactUUID"; protected static final String SOURCE = "source"; protected static final String RESOURCE_TARGET = "resourceTarget"; + protected static final String FLAG = "flag"; private static final String TARGET_ENTITY = "SO:CatalogDB"; private static final String ASTERISK = "*"; @@ -211,6 +214,7 @@ public class CatalogDbClient { private String findBBNameSelectionReferenceByControllerActorAndScopeAndAction = "/findBBNameSelectionReferenceByControllerActorAndScopeAndAction"; private String findWorkflowByResourceTarget = "/findByResourceTarget"; + private String findProcessingFlagsByFlag = "/findByFlag"; private String serviceURI; private String vfModuleURI; @@ -285,6 +289,8 @@ public class CatalogDbClient { private final Client<BBNameSelectionReference> bbNameSelectionReferenceClient; + private final Client<ProcessingFlags> processingFlagsClient; + @Value("${mso.catalog.db.spring.endpoint:#{null}}") private String endpoint; @@ -358,6 +364,8 @@ public class CatalogDbClient { findBBNameSelectionReferenceByControllerActorAndScopeAndAction = endpoint + BB_NAME_SELECTION_REFERENCE + SEARCH + findBBNameSelectionReferenceByControllerActorAndScopeAndAction; + findProcessingFlagsByFlag = endpoint + PROCESSING_FLAGS + SEARCH + findProcessingFlagsByFlag; + serviceURI = endpoint + SERVICE + URI_SEPARATOR; vfModuleURI = endpoint + VFMODULE + URI_SEPARATOR; vnfResourceURI = endpoint + VNF_RESOURCE + URI_SEPARATOR; @@ -425,6 +433,7 @@ public class CatalogDbClient { pnfResourceCustomizationClient = clientFactory.create(PnfResourceCustomization.class); workflowClient = clientFactory.create(Workflow.class); bbNameSelectionReferenceClient = clientFactory.create(BBNameSelectionReference.class); + processingFlagsClient = clientFactory.create(ProcessingFlags.class); } @@ -477,6 +486,7 @@ public class CatalogDbClient { pnfResourceCustomizationClient = clientFactory.create(PnfResourceCustomization.class); workflowClient = clientFactory.create(Workflow.class); bbNameSelectionReferenceClient = clientFactory.create(BBNameSelectionReference.class); + processingFlagsClient = clientFactory.create(ProcessingFlags.class); } public NetworkCollectionResourceCustomization getNetworkCollectionResourceCustomizationByID( @@ -1091,6 +1101,11 @@ public class CatalogDbClient { .queryParam(RESOURCE_TARGET, resourceTarget).build().toString())); } + public ProcessingFlags findProcessingFlagsByFlag(String flag) { + return this.getSingleResource(processingFlagsClient, + getUri(UriBuilder.fromUri(findProcessingFlagsByFlag).queryParam(FLAG, flag).build().toString())); + } + public String getEndpoint() { return endpoint; } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/DeleteNetworkNotificationResponse.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ProcessingFlagsRepository.java index 7f7d0ae569..b6583035df 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/DeleteNetworkNotificationResponse.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ProcessingFlagsRepository.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP - SO * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,36 +18,16 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.network.async.client; +package org.onap.so.db.catalog.data.repository; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for deleteNetworkNotificationResponse complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="deleteNetworkNotificationResponse"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteNetworkNotificationResponse") -public class DeleteNetworkNotificationResponse { +import org.onap.so.db.catalog.beans.ProcessingFlags; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import javax.transaction.Transactional; +@RepositoryRestResource(collectionResourceRel = "processingFlags", path = "processingFlags") +@Transactional +public interface ProcessingFlagsRepository extends JpaRepository<ProcessingFlags, String> { + ProcessingFlags findByFlag(String flag); } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/QueryNetworkNotificationResponse.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/ProcessingFlagsRepositoryTest.java index 2e18e05860..e8a8263d95 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/async/client/QueryNetworkNotificationResponse.java +++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/ProcessingFlagsRepositoryTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP - SO * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,36 +18,23 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.network.async.client; +package org.onap.so.db.catalog.data.repository; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; +import org.junit.Assert; +import org.junit.Test; +import org.onap.so.db.catalog.BaseTest; +import org.onap.so.db.catalog.beans.ProcessingFlags; +import org.springframework.beans.factory.annotation.Autowired; +public class ProcessingFlagsRepositoryTest extends BaseTest { -/** - * <p> - * Java class for queryNetworkNotificationResponse complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="queryNetworkNotificationResponse"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "queryNetworkNotificationResponse") -public class QueryNetworkNotificationResponse { - + @Autowired + private ProcessingFlagsRepository processingFlagsRepository; + @Test + public void findByFlagTest() throws Exception { + ProcessingFlags processingFlags = processingFlagsRepository.findByFlag("TESTFLAG"); + Assert.assertNotNull(processingFlags); + Assert.assertEquals("TESTENDPOINT", processingFlags.getEndpoint()); + } } diff --git a/mso-catalog-db/src/test/resources/data.sql b/mso-catalog-db/src/test/resources/data.sql index b38d4d9376..0913aef01b 100644 --- a/mso-catalog-db/src/test/resources/data.sql +++ b/mso-catalog-db/src/test/resources/data.sql @@ -962,4 +962,8 @@ INSERT INTO bbname_selection_reference (CONTROLLER_ACTOR,SCOPE,ACTION,BB_NAME) VALUES ('APPC', 'vfModule', 'healthCheck','GenericVnfHealthCheckBB'), ('APPC', 'vfModule', 'configScaleOut','ConfigurationScaleOutBB'), -('APPC', 'vnf', 'healthCheck','GenericVnfHealthCheckBB');
\ No newline at end of file +('APPC', 'vnf', 'healthCheck','GenericVnfHealthCheckBB'); + +INSERT INTO processing_flags (FLAG,VALUE,ENDPOINT,DESCRIPTION) +VALUES +('TESTFLAG', 'NO', 'TESTENDPOINT', 'TEST FLAG');
\ No newline at end of file diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql index 0d49903e51..68f272cca0 100644 --- a/mso-catalog-db/src/test/resources/schema.sql +++ b/mso-catalog-db/src/test/resources/schema.sql @@ -1403,4 +1403,14 @@ CREATE TABLE IF NOT EXISTS `bbname_selection_reference` ( PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; - +CREATE TABLE IF NOT EXISTS `processing_flags` ( + `ID` INT(11) NOT NULL AUTO_INCREMENT, + `FLAG` varchar(200) NOT NULL, + `VALUE` varchar(200) NOT NULL, + `ENDPOINT` varchar(200) NOT NULL, + `DESCRIPTION` longtext NOT NULL, + `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(), + `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`ID`), + UNIQUE KEY `UK_processing_flags` (`FLAG`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index 3a9ec375da..538f13c7ec 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -95,7 +95,7 @@ <dependencySets> <dependencySet> <includes> - <include>org.onap.so.adapters:mso-vnfm-etsi-adapter</include> + <include>org.onap.so.adapters:etsi-sol003-adapter-application</include> </includes> <outputFileNameMapping>app.jar</outputFileNameMapping> </dependencySet> @@ -249,29 +249,29 @@ </build> </image> <image> - <name>${docker.image.prefix}/nssmf-adapter</name> + <name>${docker.image.prefix}/nssmf-adapter</name> <build> - <cleanup>try</cleanup> - <dockerFile>docker-files/Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so.adapters:mso-nssmf-adapter</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> + <cleanup>try</cleanup> + <dockerFile>docker-files/Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.adapters:mso-nssmf-adapter</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> <image> <name>${docker.image.prefix}/so-appc-orchestrator</name> <build> @@ -467,7 +467,7 @@ <dependencies> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-etsi-adapter</artifactId> + <artifactId>etsi-sol003-adapter-application</artifactId> <version>${project.version}</version> </dependency> <dependency> @@ -49,7 +49,7 @@ <sonar.cpd.exclusions>**/*</sonar.cpd.exclusions> <jacoco.version>0.8.5</jacoco.version> <org.apache.maven.user-settings /> - <openstack.version>1.5.2-SNAPSHOT</openstack.version> + <openstack.version>1.6.1-SNAPSHOT</openstack.version> <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format> <originalClassifier>original</originalClassifier> <docker.skip>true</docker.skip> @@ -71,6 +71,7 @@ <format.skipValidate>false</format.skipValidate> <format.skipExecute>true</format.skipExecute> <io.fabric8.version>4.1.0</io.fabric8.version> + <appc.client.version>1.7.1</appc.client.version> </properties> <distributionManagement> <repository> @@ -560,7 +561,7 @@ <images> <image> <alias>service</alias> - <name>${artifactId}:${project.version}</name> + <name>${project.artifactId}:${project.version}</name> <build> <dockerFileDir>${project.build.directory}</dockerFileDir> </build> @@ -670,17 +671,14 @@ <dependency> <groupId>org.onap.logging-analytics</groupId> <artifactId>logging-slf4j</artifactId> - <version>1.6.6-SNAPSHOT</version> </dependency> <dependency> <groupId>org.onap.logging-analytics</groupId> <artifactId>logging-filter-base</artifactId> - <version>1.6.6-SNAPSHOT</version> </dependency> <dependency> <groupId>org.onap.logging-analytics</groupId> <artifactId>logging-filter-spring</artifactId> - <version>1.6.6-SNAPSHOT</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> @@ -830,6 +828,21 @@ <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --> <!-- force use of version 4.5 everywhere in transient deps, aligned on WildFly 10 version --> <dependency> + <groupId>org.onap.logging-analytics</groupId> + <artifactId>logging-slf4j</artifactId> + <version>1.6.6</version> + </dependency> + <dependency> + <groupId>org.onap.logging-analytics</groupId> + <artifactId>logging-filter-base</artifactId> + <version>1.6.6</version> + </dependency> + <dependency> + <groupId>org.onap.logging-analytics</groupId> + <artifactId>logging-filter-spring</artifactId> + <version>1.6.6</version> + </dependency> + <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version>4.4.4</version> diff --git a/so-simulator/pom.xml b/so-simulator/pom.xml index 35964d6de6..e264c534d2 100644 --- a/so-simulator/pom.xml +++ b/so-simulator/pom.xml @@ -62,7 +62,6 @@ <dependency> <groupId>org.onap.logging-analytics</groupId> <artifactId>logging-slf4j</artifactId> - <version>1.6.3-SNAPSHOT</version> </dependency> <dependency> <groupId>com.consol.citrus</groupId> diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdDoubleFailure.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdDoubleFailure.java index 2fa8725d56..a9f879413f 100644 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdDoubleFailure.java +++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryStackByIdDoubleFailure.java @@ -39,23 +39,18 @@ public class QueryStackByIdDoubleFailure extends AbstractSimulatorScenario { scenario.http().send().response(HttpStatus.OK) .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json")); - // Rollback Delete of the stack - scenario.http().receive().delete(); // step 7 - scenario.action(new DeleteVServers()); - scenario.http().send().response(HttpStatus.NO_CONTENT); - // Rollback Poll - scenario.http().receive().get(); // step 10 + scenario.http().receive().get(); // step 7 scenario.http().send().response(HttpStatus.OK) .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json")); // Rollback Poll Retry - scenario.http().receive().get(); + scenario.http().receive().get(); // step 9 scenario.http().send().response(HttpStatus.OK) .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json")); // Create Poll - scenario.http().receive().get(); // step 14 + scenario.http().receive().get(); // step 11 scenario.http().send().response(HttpStatus.OK) .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json")); @@ -64,30 +59,16 @@ public class QueryStackByIdDoubleFailure extends AbstractSimulatorScenario { scenario.http().send().response(HttpStatus.OK) .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json")); - // Rollback Delete - scenario.http().receive().delete(); - scenario.action(new DeleteVServers()); - scenario.http().send().response(HttpStatus.NO_CONTENT); - // Rollback Poll - scenario.http().receive().get(); // step 18 + scenario.http().receive().get(); // step 15 scenario.http().send().response(HttpStatus.OK) .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json")); // Rollback Poll Retry - scenario.http().receive().get(); + scenario.http().receive().get(); // step 17 scenario.http().send().response(HttpStatus.OK) .payload(new ClassPathResource("openstack/gr_api/Stack_Failure.json")); - // Delete - scenario.http().receive().delete(); - scenario.http().send().response(HttpStatus.NO_CONTENT); - - // Delete Poll - scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); - } } |