Clean up Process Engine selection logic 59/22859/2
authorRob Daugherty <rd472p@att.com>
Wed, 8 Nov 2017 23:35:49 +0000 (18:35 -0500)
committerRob Daugherty <rd472p@att.com>
Thu, 9 Nov 2017 02:27:10 +0000 (21:27 -0500)
Several failed attempts to split the BPMN application into
multiple applications with separate camunda process engines
have left a mess of confusing classes and process engine
definitions.

In the Amsterdam release, there should be only one BPMN
application war.  This is MSOInfrastructureBPMN.
MSOCommonBPMN should not be deployed as a separate
application.  Its classes are compiled into a jar and
this is included inside MSOInfrastructureBPMN.

The MSOInfrastructureBPMN application should use the
"default" process engine.

WorkflowAsyncInfrastructureResource and
MSOCommonApplication classes are not needed.

Issue: SO-322
Change-Id: Ifdb3b33541346b561a16361d1aa791e8342a34fa
Signed-off-by: Rob Daugherty <rd472p@att.com>
22 files changed:
.gitignore
bpmn/MSOCommonBPMN/pom.xml
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java [deleted file]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java [moved from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java with 50% similarity]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java
bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml
bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml [deleted file]
bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml [deleted file]
bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml [deleted file]
bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml [deleted file]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java [deleted file]
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml
packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java
packages/deliveries/src/main/assembly/war-pack/mso-wars.xml

index 04bad35..958c3e2 100644 (file)
@@ -4,6 +4,7 @@ target
 .project
 .buildpath
 .idea
+.checkstyle
 *.iml
 **/logs/
 **/debug-logs/
index 9650b4c..d75d055 100644 (file)
@@ -10,7 +10,7 @@
        </parent>
        <artifactId>MSOCommonBPMN</artifactId>
        <name>MSOCommonBPMN</name>
-       <packaging>war</packaging>
+       <packaging>jar</packaging>
 
        <properties>
                <camunda.version>7.6.0</camunda.version>
@@ -22,7 +22,6 @@
                <maven.compiler.source>1.8</maven.compiler.source>
        </properties>
 
-
        <build>
                <plugins>
                        <plugin>
                                        </execution>
                                </executions>
                        </plugin>
-
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-jar-plugin</artifactId>
-                               <version>2.6</version>
+                               <version>3.0.2</version>
                                <executions>
-                                       <execution>
-                                               <!-- Build MSOCommonBPMN-${version}.jar -->
-                                               <id>default-jar</id>
-                                               <phase>package</phase>
-                                               <goals>
-                                                       <goal>jar</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <excludes>
-                                                               <exclude>org/openecomp/mso/bpmn/common/MSOCommonApplication.class</exclude>
-                                                               <!-- <exclude>META-INF/</exclude> -->
-                                                       </excludes>
-                                               </configuration>
-                                       </execution>
                                        <execution>
                                                <goals>
                                                        <goal>test-jar</goal>
                                                </goals>
                                                <configuration>
-                                                       <forceCreation>true</forceCreation>
                                                        <skip>false</skip>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
-                       <plugin>
-                               <groupId>org.codehaus.mojo</groupId>
-                               <artifactId>build-helper-maven-plugin</artifactId>
-                               <version>3.0.0</version>
-                               <executions>
-                                       <execution>
-                                               <goals>
-                                                       <goal>attach-artifact</goal>
-                                               </goals>
-                                               <phase>package</phase>
-                                               <configuration>
-                                                       <artifacts>
-                                                               <artifact>
-                                                                       <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
-                                                                       <type>jar</type>
-                                                               </artifact>
-                                                       </artifacts>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-war-plugin</artifactId>
-                               <version>2.3</version>
-                               <configuration>
-                                       <failOnMissingWebXml>false</failOnMissingWebXml>
-                               </configuration>
-                       </plugin>
                        <plugin>
                                <groupId>org.apache.cxf</groupId>
                                <artifactId>cxf-codegen-plugin</artifactId>
                                                </lifecycleMappingMetadata>
                                        </configuration>
                                </plugin>
-
-
                        </plugins>
                </pluginManagement>
        </build>
 
        <dependencies>
-
                <dependency>
-                       <!-- process engine, in compile scope to include it in the war file -->
                        <groupId>org.camunda.bpm</groupId>
                        <artifactId>camunda-engine</artifactId>
-                       <scope>compile</scope>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.slf4j</groupId>
-                                       <artifactId>slf4j-api</artifactId>
-                               </exclusion>
-                       </exclusions>
                </dependency>
-               <!-- Using the `DefaultEjbProcessApplication` result in: `java.sql.SQLException: 
-                       You cannot commit during a managed transaction!` -->
                <dependency>
-                       <!-- CDI integration, needs to be included in WAR, otherwise CDI can not 
-                               work correctly -->
                        <groupId>org.camunda.bpm</groupId>
                        <artifactId>camunda-engine-cdi</artifactId>
                </dependency>
-
                <dependency>
                        <groupId>org.camunda.bpm.extension</groupId>
                        <artifactId>camunda-bpm-assert</artifactId>
                        <version>1.10.19</version>
                        <scope>test</scope>
                </dependency>
-               
-               <!-- Spin dataformat support, in compile scope to include it in the war 
-                       file -->
                <dependency>
                        <groupId>org.camunda.spin</groupId>
                        <artifactId>camunda-spin-dataformat-all</artifactId>
-                       <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>org.camunda.bpm</groupId>
                        <artifactId>camunda-engine-plugin-spin</artifactId>
-                       <scope>compile</scope>
                </dependency>
-
                <dependency>
                        <groupId>org.camunda.bpm</groupId>
                        <artifactId>camunda-engine-plugin-connect</artifactId>
-                       <scope>compile</scope>
                </dependency>
-
                <dependency>
                        <!-- Bootstrap for styling via Webjars project -->
                        <groupId>org.webjars</groupId>
                        <artifactId>bootstrap</artifactId>
                        <version>2.3.2</version>
                </dependency>
-
                <dependency>
                        <groupId>org.jboss.resteasy</groupId>
                        <artifactId>resteasy-client</artifactId>
                        <version>3.0.19.Final</version>
-                       <scope>provided</scope>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.apache.httpcomponents</groupId>
-                                       <artifactId>httpclient</artifactId>
-                               </exclusion>
-                       </exclusions>
                </dependency>
-
                <dependency>
                        <!-- Needed for InMemoryH2Test -->
                        <groupId>com.h2database</groupId>
                        <artifactId>h2</artifactId>
                        <scope>test</scope>
                </dependency>
-
                <dependency>
                        <groupId>com.fasterxml.uuid</groupId>
                        <artifactId>java-uuid-generator</artifactId>
                        <scope>test</scope>
                </dependency>
                <dependency>
-            <groupId>org.openecomp.so</groupId>
-            <artifactId>common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
+                       <groupId>org.openecomp.so</groupId>
+                       <artifactId>common</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
                <dependency>
                        <groupId>javax.ws.rs</groupId>
                        <artifactId>javax.ws.rs-api</artifactId>
                        <version>2.0</version>
                </dependency>
-               <!-- for encoding the url the same way A&AI does -->
                <dependency>
                        <groupId>org.openecomp.so</groupId>
                        <artifactId>MSOMockServer</artifactId>
                        <artifactId>MSORESTClient</artifactId>
                        <version>${project.version}</version>
                </dependency>
-
                <dependency>
                        <groupId>javax.servlet</groupId>
                        <artifactId>javax.servlet-api</artifactId>
                        <version>3.0.1</version>
-                       <scope>provided</scope>
                </dependency>
-
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-test</artifactId>
                        <version>${spring.version}</version>
                </dependency>
-
                <dependency>
                        <groupId>com.github.tomakehurst</groupId>
                        <artifactId>wiremock</artifactId>
                        <artifactId>client-lib</artifactId>
                        <version>1.1.0</version>
                </dependency>
-               
                <dependency>
                        <groupId>org.onap.aai.aai-common</groupId>
                        <artifactId>aai-schema</artifactId>
                        <version>1.1.0</version>
                </dependency>
-               
-               
                <dependency>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                        <artifactId>javax.ws.rs-api</artifactId>
                        <version>${jax.ws.rs}</version>
                </dependency>
-
                <dependency>
                        <groupId>org.openecomp.appc.client</groupId>
                        <artifactId>client-kit</artifactId>
                        <artifactId>client-lib</artifactId>
                        <version>1.1.0</version>
                </dependency>
-               
                <dependency>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                        <scope>test</scope>
                </dependency>
                <dependency>
-       <groupId>org.jboss.resteasy</groupId>
-       <artifactId>resteasy-jackson2-provider</artifactId>
-       <version>3.0.11.Final</version>
-    </dependency>
-    <dependency>
-               <groupId>com.google.guava</groupId>
-               <artifactId>guava</artifactId>
-               <version>22.0</version>
-       </dependency>
-                               
+                       <groupId>org.jboss.resteasy</groupId>
+                       <artifactId>resteasy-jackson2-provider</artifactId>
+                       <version>3.0.11.Final</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.google.guava</groupId>
+                       <artifactId>guava</artifactId>
+                       <version>22.0</version>
+               </dependency>
        </dependencies>
 </project>
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java
deleted file mode 100644 (file)
index 3e8fd6e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.openecomp.mso.bpmn.common;\r
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-\r
-\r
-import java.util.List;\r
-\r
-import org.camunda.bpm.application.PostDeploy;\r
-import org.camunda.bpm.application.PreUndeploy;\r
-import org.camunda.bpm.application.ProcessApplication;\r
-import org.camunda.bpm.application.ProcessApplicationInfo;\r
-import org.camunda.bpm.application.impl.ServletProcessApplication;\r
-import org.camunda.bpm.engine.ProcessEngine;\r
-\r
-import org.openecomp.mso.logger.MsoLogger;\r
-\r
-/**\r
- * @since Version 1.0\r
- *\r
- */\r
-@ProcessApplication(name="MSO Common Application", deploymentDescriptors={"../processes.xml"})\r
-public class MSOCommonApplication extends ServletProcessApplication {\r
-       \r
-       private MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
-       \r
-       @PostDeploy\r
-       public void postDeploy(ProcessEngine processEngineInstance) {\r
-               long startTime = System.currentTimeMillis();\r
-               \r
-               msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Post deployment complete...");               \r
-       }\r
-       \r
-       @PreUndeploy\r
-       public void cleanup(ProcessEngine processEngine, ProcessApplicationInfo processApplicationInfo, List<ProcessEngine> processEngines) {\r
-               long startTime = System.currentTimeMillis();\r
-               \r
-               msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Pre Undeploy complete...");  \r
-               \r
-       }\r
-       \r
-}\r
index c0be899..d65311d 100644 (file)
@@ -26,8 +26,6 @@ import java.util.List;
 import java.util.Map;\r
 \r
 import org.camunda.bpm.engine.MismatchingMessageCorrelationException;\r
-import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.ProcessEngines;\r
 import org.camunda.bpm.engine.RuntimeService;\r
 import org.camunda.bpm.engine.runtime.Execution;\r
 import org.camunda.bpm.engine.runtime.MessageCorrelationResult;\r
@@ -38,7 +36,7 @@ import org.openecomp.mso.logger.MsoLogger;
 /**\r
  * Abstract base class for callback services.\r
  */\r
-public abstract class AbstractCallbackService {\r
+public abstract class AbstractCallbackService extends ProcessEngineAwareService {\r
        public static final long DEFAULT_TIMEOUT_SECONDS = 60;\r
        public static final long FAST_POLL_DUR_SECONDS = 5;\r
        public static final long FAST_POLL_INT_MS = 100;\r
@@ -46,8 +44,6 @@ public abstract class AbstractCallbackService {
        \r
        private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
 \r
-       protected volatile ProcessEngineServices pes4junit = null;\r
-       \r
        /**\r
         * Parameterized callback handler.\r
         */\r
@@ -368,16 +364,4 @@ public abstract class AbstractCallbackService {
                                + ":" + execution.getId() + "]";\r
                }\r
        }\r
-       \r
-       protected ProcessEngineServices getProcessEngineServices() {\r
-               if (pes4junit == null) {\r
-                       return ProcessEngines.getProcessEngine("infrastructure");\r
-               } else {\r
-                       return pes4junit;\r
-               }\r
-       }\r
-\r
-       public void setProcessEngineServices4junit(ProcessEngineServices pes) {\r
-               pes4junit = pes;\r
-       }\r
 }
@@ -1,32 +1,64 @@
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-package org.openecomp.mso.bpmn.common.workflow.service;\r
-\r
-import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.ProcessEngines;\r
-\r
-\r
-public class WorkflowAsyncCommonResource extends WorkflowAsyncResource {\r
-\r
-    protected ProcessEngineServices getProcessEngineServices() {\r
-        return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure"));\r
-    }\r
-}\r
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * 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.openecomp.mso.bpmn.common.workflow.service;
+
+import java.util.Optional;
+
+import org.camunda.bpm.engine.ProcessEngineServices;
+import org.camunda.bpm.engine.ProcessEngines;
+
+/**
+ * Base class for services that must be process-engine aware. The only
+ * process engine currently supported is the "default" process engine.
+ */
+public class ProcessEngineAwareService {
+       
+       private final String processEngineName = "default";
+       private volatile Optional<ProcessEngineServices> pes4junit = Optional.empty();
+       
+       /**
+        * Gets the process engine name.
+        * @return the process engine name
+        */
+       public String getProcessEngineName() {
+               return processEngineName;
+       }
+
+       /**
+        * Gets process engine services.
+        * @return process engine services
+        */
+       public ProcessEngineServices getProcessEngineServices() {
+               return pes4junit.orElse(ProcessEngines.getProcessEngine(
+                               getProcessEngineName()));
+       }
+
+       /**
+        * Allows a particular process engine to be specified, overriding the
+        * usual process engine lookup by name.  Intended primarily for the
+        * unit test environment.
+        * @param pes process engine services
+        */
+       public void setProcessEngineServices4junit(ProcessEngineServices pes) {
+               pes4junit = Optional.ofNullable(pes);
+       }
+}
index 2186e07..c5f0d02 100644 (file)
@@ -20,9 +20,6 @@
 \r
 package org.openecomp.mso.bpmn.common.workflow.service;\r
 \r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
 import javax.jws.WebMethod;\r
 import javax.jws.WebParam;\r
 import javax.jws.WebResult;\r
@@ -30,16 +27,9 @@ import javax.jws.WebService;
 import javax.ws.rs.core.Context;\r
 import javax.xml.ws.WebServiceContext;\r
 \r
-import org.camunda.bpm.BpmPlatform;\r
-import org.camunda.bpm.engine.MismatchingMessageCorrelationException;\r
-import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.RuntimeService;\r
-import org.camunda.bpm.engine.runtime.ExecutionQuery;\r
 import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterCallbackRequest;\r
 import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterResponse;\r
 import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCCallbackAdapterPortType;\r
-import org.openecomp.mso.bpmn.core.PropertyConfiguration;\r
-import org.openecomp.mso.logger.MessageEnum;\r
 import org.openecomp.mso.logger.MsoLogger;\r
 \r
 /**\r
index 99909b6..608adcf 100644 (file)
@@ -53,7 +53,7 @@ import org.slf4j.MDC;
  * For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process\r
  */\r
 @Path("/async")\r
-public abstract class WorkflowAsyncResource {\r
+public class WorkflowAsyncResource extends ProcessEngineAwareService {\r
 \r
        private static final WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance();\r
        protected Optional<ProcessEngineServices> pes4junit = Optional.empty();\r
@@ -274,12 +274,6 @@ public abstract class WorkflowAsyncResource {
        }\r
        \r
        \r
-       protected abstract ProcessEngineServices getProcessEngineServices();\r
-       \r
-       public void setProcessEngineServices4junit(ProcessEngineServices pes) {\r
-               pes4junit = Optional.ofNullable(pes);\r
-       }\r
-\r
        private static Map<String, Object> getInputVariables(VariableMapImpl variableMap) {\r
                Map<String, Object> inputVariables = new HashMap<>();\r
                @SuppressWarnings("unchecked")\r
index 0521fb4..76ff221 100644 (file)
@@ -39,7 +39,6 @@ import javax.ws.rs.core.UriInfo;
 import org.camunda.bpm.engine.HistoryService;\r
 import org.camunda.bpm.engine.ProcessEngineException;\r
 import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.ProcessEngines;\r
 import org.camunda.bpm.engine.RuntimeService;\r
 import org.camunda.bpm.engine.history.HistoricVariableInstance;\r
 import org.camunda.bpm.engine.runtime.ProcessInstance;\r
@@ -53,10 +52,8 @@ import org.openecomp.mso.logger.MsoLogger;
 import org.slf4j.MDC;\r
 \r
 @Path("/workflow")\r
-public class WorkflowResource {\r
+public class WorkflowResource extends ProcessEngineAwareService {\r
        \r
-       private ProcessEngineServices pes4junit = null;\r
-\r
        private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
        private static final String LOGMARKER = "[WRKFLOW-RESOURCE]";\r
 \r
@@ -615,16 +612,4 @@ public class WorkflowResource {
                \r
                return response;\r
        }\r
-\r
-       private ProcessEngineServices getProcessEngineServices() {\r
-               if (pes4junit == null) {\r
-                       return ProcessEngines.getProcessEngine("infrastructure");\r
-               } else {\r
-                       return pes4junit;\r
-               }\r
-       }\r
-\r
-       public void setProcessEngineServices4junit(ProcessEngineServices pes) {\r
-               pes4junit = pes;\r
-       }\r
 }\r
index 4f99edd..193b8fe 100644 (file)
@@ -26,23 +26,12 @@ import java.util.Set;
 import javax.ws.rs.ApplicationPath;\r
 import javax.ws.rs.core.Application;\r
 \r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;\r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;\r
-\r
-/**\r
- * @version 1.0\r
- * RESTeasy workflow application which wires synchronous and asynchronous response\r
- *\r
- */\r
 @ApplicationPath("/")\r
 public class WorkflowResourceApplication extends Application {\r
     private Set<Object> singletons = new HashSet<Object>();\r
     private Set<Class<?>> classes = new HashSet<Class<?>>();\r
 \r
     public WorkflowResourceApplication() {\r
-        singletons.add(new WorkflowResource());\r
-        singletons.add(new WorkflowAsyncCommonResource());\r
-        singletons.add(new WorkflowMessageResource());\r
     }\r
 \r
     @Override\r
index d328246..772867d 100644 (file)
@@ -22,7 +22,7 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
     <process-archive name="MSOCommonBPMN">
-        <process-engine>infrastructure</process-engine>
+        <process-engine>default</process-engine>
         <properties>
             <property name="isDeleteUponUndeploy">false</property>
             <property name="isScanForProcessDefinitions">true</property>
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml
deleted file mode 100644 (file)
index 6f61c8f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<beans xmlns="http://www.springframework.org/schema/beans"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/beans\r
-                           http://www.springframework.org/schema/beans/spring-beans.xsd">\r
-\r
-  <!-- Spring bean to be invoked through the ApplicationContextElResolver -->\r
-\r
-</beans>\r
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
deleted file mode 100644 (file)
index b68ebd9..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<!--\r
-  ============LICENSE_START=======================================================\r
-  ECOMP MSO\r
-  ================================================================================\r
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
-  ================================================================================\r
-  Licensed under the Apache License, Version 2.0 (the "License");\r
-  you may not use this file except in compliance with the License.\r
-  You may obtain a copy of the License at\r
-  \r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-  \r
-  Unless required by applicable law or agreed to in writing, software\r
-  distributed under the License is distributed on an "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  See the License for the specific language governing permissions and\r
-  limitations under the License.\r
-  ============LICENSE_END=========================================================\r
-  -->\r
-\r
-<jboss-deployment-structure>\r
-       <deployment>\r
-               <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->\r
-               <exclusions>\r
-                       <module name="org.apache.log4j" />\r
-                       <module name="org.slf4j" />\r
-                       <module name="org.slf4j.impl" />\r
-                       <module name="org.jboss.resteasy.resteasy-jackson-provider" />\r
-                       <module name="org.jboss.resteasy.resteasy-jettison-provider" />\r
-               </exclusions>\r
-               <dependencies>\r
-                       <module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import" />\r
-                       <!-- This module contain the ProviderBase class: -->\r
-                       <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" export="true"/>\r
-               </dependencies>\r
-       </deployment>\r
-</jboss-deployment-structure>\r
-\r
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml
deleted file mode 100644 (file)
index a9a263b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-  ============LICENSE_START=======================================================\r
-  ECOMP MSO\r
-  ================================================================================\r
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
-  ================================================================================\r
-  Licensed under the Apache License, Version 2.0 (the "License");\r
-  you may not use this file except in compliance with the License.\r
-  You may obtain a copy of the License at\r
-  \r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-  \r
-  Unless required by applicable law or agreed to in writing, software\r
-  distributed under the License is distributed on an "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  See the License for the specific language governing permissions and\r
-  limitations under the License.\r
-  ============LICENSE_END=========================================================\r
-  -->\r
-  \r
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">\r
-<jboss-web>\r
-  <security-domain>other</security-domain>\r
-  <context-root>/mso/common</context-root>\r
-</jboss-web>  \r
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644 (file)
index 3a42877..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-  ============LICENSE_START=======================================================\r
-  ECOMP MSO\r
-  ================================================================================\r
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
-  ================================================================================\r
-  Licensed under the Apache License, Version 2.0 (the "License");\r
-  you may not use this file except in compliance with the License.\r
-  You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-  Unless required by applicable law or agreed to in writing, software\r
-  distributed under the License is distributed on an "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  See the License for the specific language governing permissions and\r
-  limitations under the License.\r
-  ============LICENSE_END=========================================================\r
-  -->\r
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">\r
-  <display-name>MSO Common BPMN Workflow Servlet</display-name>\r
-  <servlet>\r
-    <servlet-name>resteasy-servlet</servlet-name>\r
-    <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>\r
-    <init-param>\r
-      <param-name>javax.ws.rs.Application</param-name>\r
-      <param-value>org.openecomp.mso.bpmn.common.workflow.service.WorkflowResourceApplication</param-value>\r
-    </init-param>\r
-  </servlet>\r
-  <servlet-mapping>\r
-    <servlet-name>resteasy-servlet</servlet-name>\r
-    <url-pattern>/*</url-pattern>\r
-  </servlet-mapping>\r
-  <context-param>\r
-    <param-name>contextConfigLocation</param-name>\r
-    <param-value>/WEB-INF/applicationContext.xml</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>mso.configuration</param-name>\r
-    <param-value>MSO_PROP_TOPOLOGY=topology.properties</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>log.configuration</param-name>\r
-    <param-value>logback.bpmn.xml</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>resteasy.resources</param-name>\r
-    <param-value>org.openecomp.mso.logger.MsoLoggingServlet,org.openecomp.mso.bpmn.core.HealthCheckHandler</param-value>\r
-  </context-param>\r
-  <listener>\r
-    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\r
-  </listener>\r
-  <filter>\r
-    <filter-name>LogFilter</filter-name>\r
-    <filter-class>org.openecomp.mso.logger.LogFilter</filter-class>\r
-  </filter>\r
-  <filter-mapping>\r
-    <filter-name>LogFilter</filter-name>\r
-    <url-pattern>/*</url-pattern>\r
-  </filter-mapping>\r
-  <security-constraint>\r
-    <web-resource-collection>\r
-      <web-resource-name>HTTPBasicAuth</web-resource-name>\r
-      <description>Authentication for Client Apps</description>\r
-      <url-pattern>/workflow/*</url-pattern>\r
-      <http-method>GET</http-method>\r
-      <http-method>POST</http-method>\r
-    </web-resource-collection>\r
-    <auth-constraint>\r
-      <role-name>BPMN-Client</role-name>\r
-    </auth-constraint>\r
-  </security-constraint>\r
-  <login-config>\r
-    <auth-method>BASIC</auth-method>\r
-    <realm-name>ApplicationRealm</realm-name>\r
-  </login-config>\r
-  <security-role>\r
-    <role-name>BPMN-Client</role-name>\r
-  </security-role>\r
-</web-app>
\ No newline at end of file
index f60d984..eef9ed8 100644 (file)
@@ -42,7 +42,6 @@ import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
 import org.jboss.resteasy.spi.AsynchronousResponse;\r
 import org.mockito.invocation.InvocationOnMock;\r
 import org.mockito.stubbing.Answer;\r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;\r
@@ -201,7 +200,7 @@ public class BPMNUtil {
         * @param variables\r
         */\r
        private static void executeAsyncFlow(ProcessEngineServices processEngineServices, String processKey, AsynchronousResponse asyncResponse, Map<String,String> variables) {\r
-               WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();\r
+               WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();\r
                VariableMapImpl variableMap = new VariableMapImpl();\r
 \r
                Map<String, Object> variableValueType = new HashMap<String, Object>();\r
index 51a1484..426bcee 100644 (file)
@@ -31,7 +31,7 @@ import org.camunda.bpm.engine.test.Deployment;
 import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
 import org.jboss.resteasy.spi.AsynchronousResponse;
 import org.junit.Test;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
 
 public class WorkflowAsyncResourceTest extends WorkflowTest {
@@ -53,7 +53,7 @@ public class WorkflowAsyncResourceTest extends WorkflowTest {
        }
 
        private void executeWorkflow(String request, String requestId, AsynchronousResponse asyncResponse, String processKey) {
-               WorkflowAsyncCommonResource workflowResource = new WorkflowAsyncCommonResource();
+               WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
                VariableMapImpl variableMap = new VariableMapImpl();
 
                Map<String, Object> variableValueType = new HashMap<String, Object>();
index 63403f4..15dc4f4 100644 (file)
@@ -75,7 +75,6 @@ import org.openecomp.mso.bpmn.common.adapter.vnf.UpdateVnfNotification;
 import org.openecomp.mso.bpmn.common.adapter.vnf.VnfRollback;\r
 import org.openecomp.mso.bpmn.common.workflow.service.SDNCAdapterCallbackServiceImpl;\r
 import org.openecomp.mso.bpmn.common.workflow.service.VnfAdapterNotifyServiceImpl;\r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;\r
@@ -273,7 +272,7 @@ public class WorkflowTest {
                VariableMapImpl variableMapImpl = createVariableMapImpl(variables);\r
 \r
                System.out.println("Sending " + request + " to " + processKey + " process");\r
-               WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();\r
+               WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();\r
                workflowResource.setProcessEngineServices4junit(processEngineRule);\r
 \r
                TestAsyncResponse asyncResponse = new TestAsyncResponse();\r
@@ -306,7 +305,7 @@ public class WorkflowTest {
                VariableMapImpl variableMapImpl = createVariableMapImpl(variables);\r
 \r
                System.out.println("Sending " + request + " to " + processKey + " process");\r
-               WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();\r
+               WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();\r
                workflowResource.setProcessEngineServices4junit(processEngineRule);\r
 \r
                TestAsyncResponse asyncResponse = new TestAsyncResponse();\r
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java
deleted file mode 100644 (file)
index 33b40b7..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-package org.openecomp.mso.bpmn.infrastructure.workflow.service;\r
-\r
-import javax.ws.rs.Path;\r
-\r
-import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.ProcessEngines;\r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;\r
-\r
-\r
-/**\r
- * \r
- * @version 1.0\r
- * Asynchronous Workflow processing using JAX RS RESTeasy implementation\r
- * Both Synchronous and Asynchronous BPMN process can benefit from this implementation since the workflow gets executed in the background\r
- * and the server thread is freed up, server scales better to process more incoming requests\r
- * \r
- * Usage: For synchronous process, when you are ready to send the response invoke the callback to write the response\r
- * For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process\r
- */\r
-@Path("/async")\r
-public class WorkflowAsyncInfrastructureResource extends WorkflowAsyncResource {\r
-       \r
-    protected ProcessEngineServices getProcessEngineServices() {\r
-        return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure"));\r
-    }\r
-}\r
index 1681197..80b11bb 100644 (file)
@@ -26,14 +26,10 @@ import java.util.Set;
 import javax.ws.rs.ApplicationPath;\r
 import javax.ws.rs.core.Application;\r
 \r
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;\r
 \r
-/**\r
- * @version 1.0\r
- * RESTeasy workflow application which wires synchronous and asynchronous response\r
- *\r
- */\r
 @ApplicationPath("/")\r
 public class WorkflowResourceApplication extends Application {\r
     private Set<Object> singletons = new HashSet<Object>();\r
@@ -41,7 +37,7 @@ public class WorkflowResourceApplication extends Application {
 \r
     public WorkflowResourceApplication() {\r
         singletons.add(new WorkflowResource());\r
-        singletons.add(new WorkflowAsyncInfrastructureResource());\r
+        singletons.add(new WorkflowAsyncResource());\r
         singletons.add(new WorkflowMessageResource());\r
     }\r
 \r
index 4053de8..3e81a6a 100644 (file)
@@ -23,7 +23,7 @@
 <process-application\r
     xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"\r
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-  <process-engine name="infrastructure">\r
+  <process-engine name="default">\r
     <configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>\r
     <datasource>java:jboss/datasources/ProcessEngine</datasource>\r
     <properties>\r
@@ -71,7 +71,7 @@
 \r
 \r
        <process-archive name="MSOInfrastructureBPMN">\r
-               <process-engine>infrastructure</process-engine>\r
+               <process-engine>default</process-engine>\r
                <properties>\r
                <property name="isDeleteUponUndeploy">false</property>\r
                <property name="isScanForProcessDefinitions">true</property>\r
index b7a3b04..868de8d 100644 (file)
@@ -105,12 +105,6 @@ public class SoapUiITCase {
                return warArchive;
        }
        
-       @Deployment(name="common-bpmn",testable=false)
-       public static Archive<?> createCommonBPMNDeployment () {
-               System.out.println("Deploying Common BPMN WAR on default server");
-               return ArquillianPackagerForITCases.createPackageFromExistingOne("../../bpmn/MSOCommonBPMN/target/", "MSOCommonBPMN*.war", "MSOCommonBPMN.war");
-       }
-       
         @Deployment(name = "infrastructure-bpmn", testable = false)
         public static Archive<?> createInfraBPMNDeployment() {
             System.out.println("Deploying Infrastructure BPMN WAR on default server");
index efbd787..e909b11 100644 (file)
                        <outputDirectory>artifacts</outputDirectory>
                </fileSet>
 
-               <fileSet>
-                       <includes>
-                               <include>MSOCommonBPMN*.war</include>
-                       </includes>
-                       <directory>../../bpmn/MSOCommonBPMN/target/</directory>
-                       <outputDirectory>artifacts</outputDirectory>
-               </fileSet>
                <fileSet>
             <includes>
                 <include>MSOInfrastructureBPMN*.war</include>