From: Rob Daugherty Date: Wed, 8 Nov 2017 23:35:49 +0000 (-0500) Subject: Clean up Process Engine selection logic X-Git-Tag: v1.1.0~21 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=d750eabf5de2423f0a7c89ffbfbcc0d65bb4623e;p=so.git Clean up Process Engine selection logic 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 --- diff --git a/.gitignore b/.gitignore index 04bad35c02..958c3e2f76 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ target .project .buildpath .idea +.checkstyle *.iml **/logs/ **/debug-logs/ diff --git a/bpmn/MSOCommonBPMN/pom.xml b/bpmn/MSOCommonBPMN/pom.xml index 9650b4ca9b..d75d055a7c 100644 --- a/bpmn/MSOCommonBPMN/pom.xml +++ b/bpmn/MSOCommonBPMN/pom.xml @@ -10,7 +10,7 @@ MSOCommonBPMN MSOCommonBPMN - war + jar 7.6.0 @@ -22,7 +22,6 @@ 1.8 - @@ -41,67 +40,21 @@ - org.apache.maven.plugins maven-jar-plugin - 2.6 + 3.0.2 - - - default-jar - package - - jar - - - - org/openecomp/mso/bpmn/common/MSOCommonApplication.class - - - - test-jar - true false - - org.codehaus.mojo - build-helper-maven-plugin - 3.0.0 - - - - attach-artifact - - package - - - - ${project.build.directory}/${project.artifactId}-${project.version}.jar - jar - - - - - - - - - org.apache.maven.plugins - maven-war-plugin - 2.3 - - false - - org.apache.cxf cxf-codegen-plugin @@ -244,35 +197,19 @@ - - - - org.camunda.bpm camunda-engine - compile - - - org.slf4j - slf4j-api - - - - org.camunda.bpm camunda-engine-cdi - org.camunda.bpm.extension camunda-bpm-assert @@ -284,53 +221,35 @@ 1.10.19 test - - org.camunda.spin camunda-spin-dataformat-all - compile org.camunda.bpm camunda-engine-plugin-spin - compile - org.camunda.bpm camunda-engine-plugin-connect - compile - org.webjars bootstrap 2.3.2 - org.jboss.resteasy resteasy-client 3.0.19.Final - provided - - - org.apache.httpcomponents - httpclient - - - com.h2database h2 test - com.fasterxml.uuid java-uuid-generator @@ -358,16 +277,15 @@ test - org.openecomp.so - common - ${project.version} - + org.openecomp.so + common + ${project.version} + javax.ws.rs javax.ws.rs-api 2.0 - org.openecomp.so MSOMockServer @@ -380,20 +298,16 @@ MSORESTClient ${project.version} - javax.servlet javax.servlet-api 3.0.1 - provided - org.springframework spring-test ${spring.version} - com.github.tomakehurst wiremock @@ -487,14 +401,11 @@ client-lib 1.1.0 - org.onap.aai.aai-common aai-schema 1.1.0 - - com.fasterxml.jackson.core jackson-databind @@ -545,7 +456,6 @@ javax.ws.rs-api ${jax.ws.rs} - org.openecomp.appc.client client-kit @@ -556,7 +466,6 @@ client-lib 1.1.0 - com.fasterxml.jackson.core jackson-databind @@ -595,15 +504,14 @@ test - org.jboss.resteasy - resteasy-jackson2-provider - 3.0.11.Final - - - com.google.guava - guava - 22.0 - - + org.jboss.resteasy + resteasy-jackson2-provider + 3.0.11.Final + + + com.google.guava + guava + 22.0 + 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 index 3e8fd6ee05..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.openecomp.mso.bpmn.common; -/*- - * ============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========================================================= - */ - - - -import java.util.List; - -import org.camunda.bpm.application.PostDeploy; -import org.camunda.bpm.application.PreUndeploy; -import org.camunda.bpm.application.ProcessApplication; -import org.camunda.bpm.application.ProcessApplicationInfo; -import org.camunda.bpm.application.impl.ServletProcessApplication; -import org.camunda.bpm.engine.ProcessEngine; - -import org.openecomp.mso.logger.MsoLogger; - -/** - * @since Version 1.0 - * - */ -@ProcessApplication(name="MSO Common Application", deploymentDescriptors={"../processes.xml"}) -public class MSOCommonApplication extends ServletProcessApplication { - - private MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL); - - @PostDeploy - public void postDeploy(ProcessEngine processEngineInstance) { - long startTime = System.currentTimeMillis(); - - msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Post deployment complete..."); - } - - @PreUndeploy - public void cleanup(ProcessEngine processEngine, ProcessApplicationInfo processApplicationInfo, List processEngines) { - long startTime = System.currentTimeMillis(); - - msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Pre Undeploy complete..."); - - } - -} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java index c0be8992ef..d65311dfe8 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java @@ -26,8 +26,6 @@ import java.util.List; import java.util.Map; import org.camunda.bpm.engine.MismatchingMessageCorrelationException; -import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.ProcessEngines; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.runtime.Execution; import org.camunda.bpm.engine.runtime.MessageCorrelationResult; @@ -38,7 +36,7 @@ import org.openecomp.mso.logger.MsoLogger; /** * Abstract base class for callback services. */ -public abstract class AbstractCallbackService { +public abstract class AbstractCallbackService extends ProcessEngineAwareService { public static final long DEFAULT_TIMEOUT_SECONDS = 60; public static final long FAST_POLL_DUR_SECONDS = 5; public static final long FAST_POLL_INT_MS = 100; @@ -46,8 +44,6 @@ public abstract class AbstractCallbackService { private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL); - protected volatile ProcessEngineServices pes4junit = null; - /** * Parameterized callback handler. */ @@ -368,16 +364,4 @@ public abstract class AbstractCallbackService { + ":" + execution.getId() + "]"; } } - - protected ProcessEngineServices getProcessEngineServices() { - if (pes4junit == null) { - return ProcessEngines.getProcessEngine("infrastructure"); - } else { - return pes4junit; - } - } - - public void setProcessEngineServices4junit(ProcessEngineServices pes) { - pes4junit = pes; - } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java similarity index 50% rename from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java rename to bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java index 4534b56efc..dbb6674a64 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java @@ -1,32 +1,64 @@ -/*- - * ============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.openecomp.mso.bpmn.common.workflow.service; - -import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.ProcessEngines; - - -public class WorkflowAsyncCommonResource extends WorkflowAsyncResource { - - protected ProcessEngineServices getProcessEngineServices() { - return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure")); - } -} +/*- + * ============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 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); + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java index 2186e071f4..c5f0d02dff 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java @@ -20,9 +20,6 @@ package org.openecomp.mso.bpmn.common.workflow.service; -import java.util.HashMap; -import java.util.Map; - import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; @@ -30,16 +27,9 @@ import javax.jws.WebService; import javax.ws.rs.core.Context; import javax.xml.ws.WebServiceContext; -import org.camunda.bpm.BpmPlatform; -import org.camunda.bpm.engine.MismatchingMessageCorrelationException; -import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.RuntimeService; -import org.camunda.bpm.engine.runtime.ExecutionQuery; import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterCallbackRequest; import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterResponse; import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCCallbackAdapterPortType; -import org.openecomp.mso.bpmn.core.PropertyConfiguration; -import org.openecomp.mso.logger.MessageEnum; import org.openecomp.mso.logger.MsoLogger; /** diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java index 99909b68a0..608adcf756 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java @@ -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 */ @Path("/async") -public abstract class WorkflowAsyncResource { +public class WorkflowAsyncResource extends ProcessEngineAwareService { private static final WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance(); protected Optional pes4junit = Optional.empty(); @@ -274,12 +274,6 @@ public abstract class WorkflowAsyncResource { } - protected abstract ProcessEngineServices getProcessEngineServices(); - - public void setProcessEngineServices4junit(ProcessEngineServices pes) { - pes4junit = Optional.ofNullable(pes); - } - private static Map getInputVariables(VariableMapImpl variableMap) { Map inputVariables = new HashMap<>(); @SuppressWarnings("unchecked") diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java index 0521fb4df3..76ff221018 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java @@ -39,7 +39,6 @@ import javax.ws.rs.core.UriInfo; import org.camunda.bpm.engine.HistoryService; import org.camunda.bpm.engine.ProcessEngineException; import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.ProcessEngines; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.history.HistoricVariableInstance; import org.camunda.bpm.engine.runtime.ProcessInstance; @@ -53,10 +52,8 @@ import org.openecomp.mso.logger.MsoLogger; import org.slf4j.MDC; @Path("/workflow") -public class WorkflowResource { +public class WorkflowResource extends ProcessEngineAwareService { - private ProcessEngineServices pes4junit = null; - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL); private static final String LOGMARKER = "[WRKFLOW-RESOURCE]"; @@ -615,16 +612,4 @@ public class WorkflowResource { return response; } - - private ProcessEngineServices getProcessEngineServices() { - if (pes4junit == null) { - return ProcessEngines.getProcessEngine("infrastructure"); - } else { - return pes4junit; - } - } - - public void setProcessEngineServices4junit(ProcessEngineServices pes) { - pes4junit = pes; - } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java index 4f99edd660..193b8fe903 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java @@ -26,23 +26,12 @@ import java.util.Set; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource; - -/** - * @version 1.0 - * RESTeasy workflow application which wires synchronous and asynchronous response - * - */ @ApplicationPath("/") public class WorkflowResourceApplication extends Application { private Set singletons = new HashSet(); private Set> classes = new HashSet>(); public WorkflowResourceApplication() { - singletons.add(new WorkflowResource()); - singletons.add(new WorkflowAsyncCommonResource()); - singletons.add(new WorkflowMessageResource()); } @Override diff --git a/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml b/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml index d328246b2c..772867d3f2 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml +++ b/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml @@ -22,7 +22,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - infrastructure + default false true 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 index 6f61c8fbf4..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - 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 index b68ebd943c..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - 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 index a9a263b684..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - other - /mso/common - 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 index 3a42877715..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - MSO Common BPMN Workflow Servlet - - resteasy-servlet - org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher - - javax.ws.rs.Application - org.openecomp.mso.bpmn.common.workflow.service.WorkflowResourceApplication - - - - resteasy-servlet - /* - - - contextConfigLocation - /WEB-INF/applicationContext.xml - - - mso.configuration - MSO_PROP_TOPOLOGY=topology.properties - - - log.configuration - logback.bpmn.xml - - - resteasy.resources - org.openecomp.mso.logger.MsoLoggingServlet,org.openecomp.mso.bpmn.core.HealthCheckHandler - - - org.springframework.web.context.ContextLoaderListener - - - LogFilter - org.openecomp.mso.logger.LogFilter - - - LogFilter - /* - - - - HTTPBasicAuth - Authentication for Client Apps - /workflow/* - GET - POST - - - BPMN-Client - - - - BASIC - ApplicationRealm - - - BPMN-Client - - \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java index f60d984a6d..eef9ed8ee0 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java @@ -42,7 +42,6 @@ import org.camunda.bpm.engine.variable.impl.VariableMapImpl; import org.jboss.resteasy.spi.AsynchronousResponse; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -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.WorkflowResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; @@ -201,7 +200,7 @@ public class BPMNUtil { * @param variables */ private static void executeAsyncFlow(ProcessEngineServices processEngineServices, String processKey, AsynchronousResponse asyncResponse, Map variables) { - WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource(); + WorkflowAsyncResource workflowResource = new WorkflowAsyncResource(); VariableMapImpl variableMap = new VariableMapImpl(); Map variableValueType = new HashMap(); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java index 51a1484cf9..426bceef4b 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java @@ -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 variableValueType = new HashMap(); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java index 63403f40ce..15dc4f4609 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java @@ -75,7 +75,6 @@ import org.openecomp.mso.bpmn.common.adapter.vnf.UpdateVnfNotification; import org.openecomp.mso.bpmn.common.adapter.vnf.VnfRollback; import org.openecomp.mso.bpmn.common.workflow.service.SDNCAdapterCallbackServiceImpl; import org.openecomp.mso.bpmn.common.workflow.service.VnfAdapterNotifyServiceImpl; -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.WorkflowMessageResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; @@ -273,7 +272,7 @@ public class WorkflowTest { VariableMapImpl variableMapImpl = createVariableMapImpl(variables); System.out.println("Sending " + request + " to " + processKey + " process"); - WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource(); + WorkflowAsyncResource workflowResource = new WorkflowAsyncResource(); workflowResource.setProcessEngineServices4junit(processEngineRule); TestAsyncResponse asyncResponse = new TestAsyncResponse(); @@ -306,7 +305,7 @@ public class WorkflowTest { VariableMapImpl variableMapImpl = createVariableMapImpl(variables); System.out.println("Sending " + request + " to " + processKey + " process"); - WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource(); + WorkflowAsyncResource workflowResource = new WorkflowAsyncResource(); workflowResource.setProcessEngineServices4junit(processEngineRule); TestAsyncResponse asyncResponse = new TestAsyncResponse(); 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 index 33b40b7bf0..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java +++ /dev/null @@ -1,46 +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.openecomp.mso.bpmn.infrastructure.workflow.service; - -import javax.ws.rs.Path; - -import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.ProcessEngines; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource; - - -/** - * - * @version 1.0 - * Asynchronous Workflow processing using JAX RS RESTeasy implementation - * Both Synchronous and Asynchronous BPMN process can benefit from this implementation since the workflow gets executed in the background - * and the server thread is freed up, server scales better to process more incoming requests - * - * Usage: For synchronous process, when you are ready to send the response invoke the callback to write the response - * For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process - */ -@Path("/async") -public class WorkflowAsyncInfrastructureResource extends WorkflowAsyncResource { - - protected ProcessEngineServices getProcessEngineServices() { - return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure")); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java index 16811979c1..80b11bbdf5 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java @@ -26,14 +26,10 @@ import java.util.Set; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; +import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource; -/** - * @version 1.0 - * RESTeasy workflow application which wires synchronous and asynchronous response - * - */ @ApplicationPath("/") public class WorkflowResourceApplication extends Application { private Set singletons = new HashSet(); @@ -41,7 +37,7 @@ public class WorkflowResourceApplication extends Application { public WorkflowResourceApplication() { singletons.add(new WorkflowResource()); - singletons.add(new WorkflowAsyncInfrastructureResource()); + singletons.add(new WorkflowAsyncResource()); singletons.add(new WorkflowMessageResource()); } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml b/bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml index 4053de8e28..3e81a6a136 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml @@ -23,7 +23,7 @@ - + org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration java:jboss/datasources/ProcessEngine @@ -71,7 +71,7 @@ - infrastructure + default false true diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java index b7a3b04d96..868de8d089 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java @@ -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"); diff --git a/packages/deliveries/src/main/assembly/war-pack/mso-wars.xml b/packages/deliveries/src/main/assembly/war-pack/mso-wars.xml index efbd78740b..e909b116e3 100644 --- a/packages/deliveries/src/main/assembly/war-pack/mso-wars.xml +++ b/packages/deliveries/src/main/assembly/war-pack/mso-wars.xml @@ -101,13 +101,6 @@ artifacts - - - MSOCommonBPMN*.war - - ../../bpmn/MSOCommonBPMN/target/ - artifacts - MSOInfrastructureBPMN*.war