.project
.buildpath
.idea
+.checkstyle
*.iml
**/logs/
**/debug-logs/
</parent>
<artifactId>MSOCommonBPMN</artifactId>
<name>MSOCommonBPMN</name>
- <packaging>war</packaging>
+ <packaging>jar</packaging>
<properties>
<camunda.version>7.6.0</camunda.version>
<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>
+++ /dev/null
-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
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
/**\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
\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
+ ":" + 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
}
-/*-\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);
+ }
+}
\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
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
* 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
}\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
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
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
\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
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
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>
+++ /dev/null
-<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
+++ /dev/null
-<!--\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
+++ /dev/null
-<?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
+++ /dev/null
-<?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
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
* @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
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 {
}
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>();
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
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
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
+++ /dev/null
-/*-\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
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
\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
<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
\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
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");
<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>