Skip to content

Commit

Permalink
Merge branch 'flowable:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
marcberger authored Mar 7, 2024
2 parents 433921d + dc2b970 commit 7028e2f
Showing 72 changed files with 1,615 additions and 246 deletions.
46 changes: 23 additions & 23 deletions distro/src/notice.txt
Original file line number Diff line number Diff line change
@@ -97,32 +97,32 @@ org.apache.httpcomponents httpclient 4.5.13 Apac
org.apache.httpcomponents httpcore 4.4.15 Apache License, Version 2.0
org.apache.httpcomponents httpmime 4.5.13 Apache License, Version 2.0
org.apache.geronimo.bundles json 20090211_1 The Apache Software License, Version 2.0
org.apache.groovy groovy 4.0.15 The Apache Software License, Version 2.0
org.apache.groovy groovy-jsr223 4.0.15 The Apache Software License, Version 2.0
org.apache.groovy groovy 4.0.17 The Apache Software License, Version 2.0
org.apache.groovy groovy-jsr223 4.0.17 The Apache Software License, Version 2.0
org.eclipse.angus angus-mail 2.0.2 EDL 1.0 / EPL 2.0
org.liquibase liquibase-core 4.5.0 Apache License, Version 2.0
org.mybatis mybatis 3.5.11 The Apache Software License, Version 2.0
org.mybatis mybatis-spring 3.0.0 The Apache Software License, Version 2.0
org.mybatis mybatis 3.5.13 The Apache Software License, Version 2.0
org.mybatis mybatis-spring 3.0.3 The Apache Software License, Version 2.0
org.mvel mvel2 2.2.6.Final The Apache Software License, Version 2.0
org.slf4j jcl-over-slf4j 2.0.9 MIT License
org.slf4j slf4j-api 2.0.9 MIT License
org.slf4j slf4j-log4j12 2.0.9 MIT License
org.springframework spring-beans 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-core 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-context 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-context-support 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-jdbc 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-tx 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-web 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-webmvc 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-aop 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-core 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-expression 6.0.14 The Apache Software License, Version 2.0
org.springframework spring-orm 6.0.14 The Apache Software License, Version 2.0
org.springframework.security spring-security-config 6.1.5 The Apache Software License, Version 2.0
org.springframework.security spring-security-core 6.1.5 The Apache Software License, Version 2.0
org.springframework.security spring-security-crypto 6.1.5 The Apache Software License, Version 2.0
org.springframework.security spring-security-web 6.1.5 The Apache Software License, Version 2.0
org.slf4j jcl-over-slf4j 2.0.11 MIT License
org.slf4j slf4j-api 2.0.11 MIT License
org.slf4j slf4j-log4j12 2.0.11 MIT License
org.springframework spring-beans 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-core 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-context 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-context-support 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-jdbc 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-tx 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-web 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-webmvc 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-aop 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-core 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-expression 6.1.3 The Apache Software License, Version 2.0
org.springframework spring-orm 6.1.3 The Apache Software License, Version 2.0
org.springframework.security spring-security-config 6.2.1 The Apache Software License, Version 2.0
org.springframework.security spring-security-core 6.2.1 The Apache Software License, Version 2.0
org.springframework.security spring-security-crypto 6.2.1 The Apache Software License, Version 2.0
org.springframework.security spring-security-web 6.2.1 The Apache Software License, Version 2.0
org.tinyjee.jgraphx jgraphx 1.10.4.1 JGraph Ltd - 3 clause BSD license
org.yaml snakeyaml 1.17 The Apache Software License, Version 2.0
xerces xercesImpl 2.12.1 The Apache Software License, Version 2.0
3 changes: 3 additions & 0 deletions modules/flowable-batch-service/pom.xml
Original file line number Diff line number Diff line change
@@ -89,6 +89,9 @@
<flowable.osgi.export.additional>
org.flowable.batch.service.db.mapping.entity
</flowable.osgi.export.additional>
<flowable.osgi.import.additional>
org.springframework*;resolution:=optional
</flowable.osgi.import.additional>
</properties>

<build>
Original file line number Diff line number Diff line change
@@ -12,9 +12,27 @@
*/
package org.flowable.cmmn.api.migration;

import java.util.LinkedHashMap;
import java.util.Map;

public class MoveToAvailablePlanItemDefinitionMapping extends PlanItemDefinitionMapping {

protected Map<String, Object> withLocalVariables = new LinkedHashMap<>();

public MoveToAvailablePlanItemDefinitionMapping(String planItemDefinitionId) {
super(planItemDefinitionId);
}

public MoveToAvailablePlanItemDefinitionMapping(String planItemDefinitionId, Map<String, Object> withLocalVariables) {
super(planItemDefinitionId);
this.withLocalVariables = withLocalVariables;
}

public Map<String, Object> getWithLocalVariables() {
return withLocalVariables;
}

public void setWithLocalVariables(Map<String, Object> withLocalVariables) {
this.withLocalVariables = withLocalVariables;
}
}
Original file line number Diff line number Diff line change
@@ -38,6 +38,12 @@ public static MoveToAvailablePlanItemDefinitionMapping createMoveToAvailablePlan
return new MoveToAvailablePlanItemDefinitionMapping(planItemDefinitionId);
}

public static MoveToAvailablePlanItemDefinitionMapping createMoveToAvailablePlanItemDefinitionMappingFor(
String planItemDefinitionId, Map<String, Object> withLocalVariables) {

return new MoveToAvailablePlanItemDefinitionMapping(planItemDefinitionId, withLocalVariables);
}

public static WaitingForRepetitionPlanItemDefinitionMapping createWaitingForRepetitionPlanItemDefinitionMappingFor(String planItemDefinitionId) {
return new WaitingForRepetitionPlanItemDefinitionMapping(planItemDefinitionId);
}
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
import java.util.Map;

import org.flowable.cmmn.api.migration.ActivatePlanItemDefinitionMapping;
import org.flowable.cmmn.api.migration.MoveToAvailablePlanItemDefinitionMapping;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.api.FlowableObjectNotFoundException;

@@ -63,6 +64,11 @@ public interface ChangePlanItemStateBuilder {
*/
ChangePlanItemStateBuilder changeToAvailableStateByPlanItemDefinitionIds(List<String> planItemDefinitionIds);

/**
* Set a plan item to available state by definition mapping.
*/
ChangePlanItemStateBuilder changeToAvailableStateByPlanItemDefinition(MoveToAvailablePlanItemDefinitionMapping planItemDefinitionMapping);

/**
* Terminate a plan item by definition id without terminating another plan item instance.
*/
5 changes: 5 additions & 0 deletions modules/flowable-cmmn-engine-configurator/pom.xml
Original file line number Diff line number Diff line change
@@ -62,6 +62,11 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-assertj</artifactId>
Original file line number Diff line number Diff line change
@@ -15,7 +15,9 @@
import static org.assertj.core.api.Assertions.assertThat;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.flowable.cmmn.api.CmmnHistoryService;
@@ -52,6 +54,8 @@ public abstract class AbstractProcessEngineIntegrationTest {
protected static CmmnEngineConfiguration cmmnEngineConfiguration;
protected static ProcessEngine processEngine;

protected static Map<Object, Object> beans = new HashMap<>();

protected CmmnRepositoryService cmmnRepositoryService;
protected CmmnRuntimeService cmmnRuntimeService;
protected CmmnTaskService cmmnTaskService;
@@ -69,7 +73,9 @@ public abstract class AbstractProcessEngineIntegrationTest {
@BeforeClass
public static void bootProcessEngine() {
if (processEngine == null) {
processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("flowable.cfg.xml").buildProcessEngine();
ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("flowable.cfg.xml");
processEngineConfiguration.setBeans(beans);
processEngine = processEngineConfiguration.buildProcessEngine();
cmmnEngineConfiguration = (CmmnEngineConfiguration) processEngine.getProcessEngineConfiguration()
.getEngineConfigurations().get(EngineConfigurationConstants.KEY_CMMN_ENGINE_CONFIG);
CmmnTestRunner.setCmmnEngineConfiguration(cmmnEngineConfiguration);
@@ -91,6 +97,12 @@ public void setupServices() {
this.processEngineHistoryService = processEngine.getHistoryService();
this.processEngineConfiguration = processEngine.getProcessEngineConfiguration();
this.processEngineDynamicBpmnService = processEngine.getDynamicBpmnService();

beans.put("cmmnRepositoryService", cmmnEngineConfiguration.getCmmnRepositoryService());
beans.put("cmmnRuntimeService", cmmnEngineConfiguration.getCmmnRuntimeService());
beans.put("cmmnTaskService", cmmnEngineConfiguration.getCmmnTaskService());
beans.put("cmmnHistoryService", cmmnEngineConfiguration.getCmmnHistoryService());
beans.put("cmmnManagementService", cmmnEngineConfiguration.getCmmnManagementService());
}

@After
@@ -102,6 +114,8 @@ public void cleanup() {
for (CmmnDeployment deployment : cmmnRepositoryService.createDeploymentQuery().list()) {
cmmnRepositoryService.deleteDeployment(deployment.getId(), true);
}

beans.clear();
}

protected Date setCmmnClockFixedToCurrentTime() {
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* 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.
*/
package org.flowable.cmmn.test;

import static org.assertj.core.api.Assertions.assertThat;

import java.util.List;

import org.flowable.cmmn.api.runtime.CaseInstance;
import org.flowable.cmmn.engine.test.CmmnDeployment;
import org.flowable.cmmn.engine.test.impl.CmmnHistoryTestHelper;
import org.flowable.common.engine.impl.history.HistoryLevel;
import org.flowable.engine.test.Deployment;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.junit.Test;

/**
* @author Joram Barrez
*/
public class VariablesTest extends AbstractProcessEngineIntegrationTest {

@Test
@Deployment
@CmmnDeployment
public void testSettingAndRemovingVariableThroughCmmnRuntimeService() {
processEngineRepositoryService.createDeployment()
.addClasspathResource("org/flowable/cmmn/test/VariablesTest.testSettingAndRemovingVariableThroughCmmnRuntimeService.bpmn20.xml")
.deploy();

CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder()
.caseDefinitionKey("varSyncTestCase")
.variable("loopNum", 100)
.variable("round", 5)
.start();

// The case instance ending means all variable lookups succeeded
assertCaseInstanceEnded(caseInstance);
assertThat(cmmnRuntimeService.getVariables(caseInstance.getId())).isEmpty();

if (CmmnHistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, cmmnEngineConfiguration)) {
List<HistoricVariableInstance> historicVariables = cmmnHistoryService.createHistoricVariableInstanceQuery()
.caseInstanceId(caseInstance.getId()).list();

// The variables are recreated each loop with a non-null value
assertThat(historicVariables).hasSize(102); // 100 from the variables and 2 for round and loopNum
for (HistoricVariableInstance historicVariable : historicVariables) {
assertThat(historicVariable.getValue()).isNotNull();
}
}
}

}
Loading

0 comments on commit 7028e2f

Please sign in to comment.