Skip to content

Commit

Permalink
The BPMN, CMMN and App Spring Engines should use the SpringEventRegis…
Browse files Browse the repository at this point in the history
…tryConfigurator
  • Loading branch information
filiphr committed Feb 16, 2020
1 parent b960d6a commit 35f751d
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 115 deletions.
4 changes: 4 additions & 0 deletions modules/flowable-app-engine-spring/pom.xml
Expand Up @@ -97,6 +97,10 @@
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-common</artifactId>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-event-registry-spring-configurator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
Expand Down
Expand Up @@ -24,12 +24,14 @@
import org.flowable.app.engine.AppEngines;
import org.flowable.app.spring.autodeployment.DefaultAutoDeploymentStrategy;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.impl.EngineConfigurator;
import org.flowable.common.engine.impl.interceptor.CommandConfig;
import org.flowable.common.engine.impl.interceptor.CommandInterceptor;
import org.flowable.common.spring.AutoDeploymentStrategy;
import org.flowable.common.spring.SpringEngineConfiguration;
import org.flowable.common.spring.SpringTransactionContextFactory;
import org.flowable.common.spring.SpringTransactionInterceptor;
import org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
Expand Down Expand Up @@ -66,6 +68,10 @@ public AppEngine buildAppEngine() {
return appEngine;
}

protected EngineConfigurator createDefaultEventRegistryEngineConfigurator() {
return new SpringEventRegistryConfigurator();
}

public void setTransactionSynchronizationAdapterOrder(Integer transactionSynchronizationAdapterOrder) {
this.transactionSynchronizationAdapterOrder = transactionSynchronizationAdapterOrder;
}
Expand Down
Expand Up @@ -491,7 +491,7 @@ protected List<EngineConfigurator> getEngineSpecificEngineConfigurators() {
if (eventRegistryConfigurator != null) {
specificConfigurators.add(eventRegistryConfigurator);
} else {
specificConfigurators.add(new EventRegistryEngineConfigurator());
specificConfigurators.add(createDefaultEventRegistryEngineConfigurator());
}
}

Expand All @@ -500,6 +500,10 @@ protected List<EngineConfigurator> getEngineSpecificEngineConfigurators() {
return Collections.emptyList();
}

protected EngineConfigurator createDefaultEventRegistryEngineConfigurator() {
return new EventRegistryEngineConfigurator();
}

@Override
public String getEngineName() {
return appEngineName;
Expand Down
Expand Up @@ -1935,6 +1935,10 @@ protected List<EngineConfigurator> getEngineSpecificEngineConfigurators() {
return Collections.emptyList();
}

protected EngineConfigurator createDefaultEventRegistryEngineConfigurator() {
return new EventRegistryEngineConfigurator();
}

@Override
public String getEngineName() {
return cmmnEngineName;
Expand Down
4 changes: 4 additions & 0 deletions modules/flowable-cmmn-spring/pom.xml
Expand Up @@ -101,6 +101,10 @@
<groupId>org.flowable</groupId>
<artifactId>flowable-job-spring-service</artifactId>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-event-registry-spring-configurator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
Expand Down
Expand Up @@ -26,12 +26,14 @@
import org.flowable.cmmn.spring.autodeployment.ResourceParentFolderAutoDeploymentStrategy;
import org.flowable.cmmn.spring.autodeployment.SingleResourceAutoDeploymentStrategy;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.impl.EngineConfigurator;
import org.flowable.common.engine.impl.interceptor.CommandConfig;
import org.flowable.common.engine.impl.interceptor.CommandInterceptor;
import org.flowable.common.spring.AutoDeploymentStrategy;
import org.flowable.common.spring.SpringEngineConfiguration;
import org.flowable.common.spring.SpringTransactionContextFactory;
import org.flowable.common.spring.SpringTransactionInterceptor;
import org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
Expand Down Expand Up @@ -72,6 +74,10 @@ public CmmnEngine buildCmmnEngine() {
return cmmnEngine;
}

protected EngineConfigurator createDefaultEventRegistryEngineConfigurator() {
return new SpringEventRegistryConfigurator();
}

public void setTransactionSynchronizationAdapterOrder(Integer transactionSynchronizationAdapterOrder) {
this.transactionSynchronizationAdapterOrder = transactionSynchronizationAdapterOrder;
}
Expand Down
Expand Up @@ -2659,6 +2659,10 @@ protected List<EngineConfigurator> getEngineSpecificEngineConfigurators() {
return Collections.emptyList();
}

protected EngineConfigurator createDefaultEventRegistryEngineConfigurator() {
return new EventRegistryEngineConfigurator();
}

@Override
public ProcessEngineConfigurationImpl addConfigurator(EngineConfigurator configurator) {
super.addConfigurator(configurator);
Expand Down
Expand Up @@ -66,7 +66,9 @@
*/
@EnsureCleanDb(excludeTables = {
"ACT_GE_PROPERTY",
"ACT_ID_PROPERTY"
"ACT_ID_PROPERTY",
"FLW_EV_DATABASECHANGELOGLOCK",
"FLW_EV_DATABASECHANGELOG"
})
public abstract class AbstractFlowableTestCase extends AbstractTestCase {

Expand Down
5 changes: 0 additions & 5 deletions modules/flowable-event-registry-spring-configurator/pom.xml
Expand Up @@ -29,11 +29,6 @@
<groupId>org.flowable</groupId>
<artifactId>flowable-event-registry-configurator</artifactId>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -26,10 +26,6 @@
<groupId>org.flowable</groupId>
<artifactId>flowable-app-engine-spring</artifactId>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-event-registry-spring-configurator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
Expand Down
Expand Up @@ -26,10 +26,6 @@
<groupId>org.flowable</groupId>
<artifactId>flowable-cmmn-spring</artifactId>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-event-registry-spring-configurator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
Expand Down
Expand Up @@ -26,10 +26,6 @@
<groupId>org.flowable</groupId>
<artifactId>flowable-spring</artifactId>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-event-registry-spring-configurator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions modules/flowable-spring/pom.xml
Expand Up @@ -101,6 +101,10 @@
<groupId>org.flowable</groupId>
<artifactId>flowable-job-spring-service</artifactId>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-event-registry-spring-configurator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
Expand Down
Expand Up @@ -20,6 +20,7 @@
import javax.sql.DataSource;

import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.impl.EngineConfigurator;
import org.flowable.common.engine.impl.interceptor.CommandConfig;
import org.flowable.common.engine.impl.interceptor.CommandInterceptor;
import org.flowable.common.spring.AutoDeploymentStrategy;
Expand All @@ -31,6 +32,7 @@
import org.flowable.engine.ProcessEngines;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator;
import org.flowable.spring.configurator.DefaultAutoDeploymentStrategy;
import org.flowable.spring.configurator.ResourceParentFolderAutoDeploymentStrategy;
import org.flowable.spring.configurator.SingleResourceAutoDeploymentStrategy;
Expand Down Expand Up @@ -76,6 +78,10 @@ public ProcessEngine buildProcessEngine() {
return processEngine;
}

protected EngineConfigurator createDefaultEventRegistryEngineConfigurator() {
return new SpringEventRegistryConfigurator();
}

public void setTransactionSynchronizationAdapterOrder(Integer transactionSynchronizationAdapterOrder) {
this.transactionSynchronizationAdapterOrder = transactionSynchronizationAdapterOrder;
}
Expand Down
Expand Up @@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.eventregistry.spring.configurator.test;
package org.flowable.spring.test.eventregistry;

import java.util.List;
import java.util.Random;
Expand All @@ -26,6 +26,7 @@
import org.flowable.eventregistry.impl.EventRegistryEngineConfiguration;
import org.flowable.eventregistry.model.InboundChannelModel;
import org.flowable.eventsubscription.api.EventSubscription;
import org.flowable.spring.impl.test.SpringFlowableTestCase;
import org.flowable.task.api.Task;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -40,7 +41,7 @@
* @author Tijs Rademakers
*/
@ContextConfiguration("classpath:flowable-context.xml")
public class EventWithSpringBeanTest extends SpringEventFlowableTestCase {
public class EventWithSpringBeanTest extends SpringFlowableTestCase {

protected TestInboundEventChannelAdapter inboundEventChannelAdapter;

Expand Down Expand Up @@ -84,8 +85,8 @@ protected TestInboundEventChannelAdapter setupTestChannel() {
}

@Test
@Deployment(resources = { "org/flowable/eventregistry/spring/configurator/test/taskWithEventProcess.bpmn20.xml",
"org/flowable/eventregistry/spring/configurator/test/simpleEvent.event" })
@Deployment(resources = { "org/flowable/spring/test/eventregistry/taskWithEventProcess.bpmn20.xml",
"org/flowable/spring/test/eventregistry/simpleEvent.event" })
public void testEventOnUserTask() {

EventRegistryEngineConfiguration eventEngineConfiguration = (EventRegistryEngineConfiguration) processEngineConfiguration.getEngineConfigurations()
Expand Down Expand Up @@ -116,14 +117,14 @@ public void testEventOnUserTask() {
}

@Test
@Deployment(resources = { "org/flowable/eventregistry/spring/configurator/test/taskWithEventProcess.bpmn20.xml"})
@Deployment(resources = { "org/flowable/spring/test/eventregistry/taskWithEventProcess.bpmn20.xml"})
public void testEventOnUserTaskWithoutVariablesSeparateDeployments() {

EventRegistryEngineConfiguration eventEngineConfiguration = (EventRegistryEngineConfiguration) processEngineConfiguration.getEngineConfigurations()
.get(EngineConfigurationConstants.KEY_EVENT_REGISTRY_CONFIG);

EventRepositoryService eventRepositoryService = eventEngineConfiguration.getEventRepositoryService();
EventDeployment eventDeployment = eventRepositoryService.createDeployment().addClasspathResource("org/flowable/eventregistry/spring/configurator/test/simpleEvent.event").deploy();
EventDeployment eventDeployment = eventRepositoryService.createDeployment().addClasspathResource("org/flowable/spring/test/eventregistry/simpleEvent.event").deploy();

try {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("taskWithEventProcess");
Expand Down

0 comments on commit 35f751d

Please sign in to comment.