From f889726e17341c183f0a37f4d079119eda96ae0a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Aug 2023 12:02:41 +0200 Subject: [PATCH] Bump h2 from 1.4.197 to 2.2.220 (#2302) (#2306) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump h2 from 1.4.197 to 2.2.220 - remove MVCC * [bump to h2-220]: add param NON_KEYWORDS=VALUE * [bump h2 220] Fix container tests * [bump h2-220] Parameterize drop script for other dbs * [bump h2-220] Changes after review --------- Co-authored-by: Toshiya Kobayashi Co-authored-by: Gonzalo Muñoz --- jbpm-audit/pom.xml | 4 +- .../java/org/jbpm/bpmn2/ActivityTest.java | 9 +- .../java/org/jbpm/bpmn2/CompensationTest.java | 23 +- .../test/java/org/jbpm/bpmn2/DataTest.java | 1 + .../java/org/jbpm/bpmn2/EndEventTest.java | 1 + .../java/org/jbpm/bpmn2/ErrorEventTest.java | 3 +- .../org/jbpm/bpmn2/EscalationEventTest.java | 1 + .../test/java/org/jbpm/bpmn2/FlowTest.java | 1 + .../org/jbpm/bpmn2/JbpmBpmn2TestCase.java | 1 - .../jbpm/bpmn2/StandaloneBPMNProcessTest.java | 119 ++--- .../LoggingTaskHandlerWrapperTest.java | 1 + .../src/test/resources/drop-tables.sql | 1 + .../archive/ejbservices/persistence.xml | 2 + jbpm-container-test/pom.xml | 6 +- .../db/ddl-scripts/h2/h2-jbpm-drop-schema.sql | 47 +- .../db/ddl-scripts/h2/h2-jbpm-schema.sql | 412 +++++++++--------- .../db/ddl-scripts/h2/quartz_tables_h2.sql | 50 +-- .../src/main/resources/datasource.properties | 2 +- .../executor/DBUnavilabilityExecutorTest.java | 2 +- .../jbpm/executor/ExtendedExecutorTest.java | 2 +- .../util/ArquillianTestWrapperExtension.java | 2 +- .../quartz-db-short-misfire.properties | 2 +- .../filtered-resources/quartz-db.properties | 2 +- .../scripts/JbpmDialectResolver.java | 3 +- .../persistence/util/PersistenceUtil.java | 4 +- .../org/jbpm/test/ProcessKModuleMain.java | 4 +- .../test/java/org/jbpm/test/ProcessMain.java | 2 +- jbpm-xes/README.md | 4 +- jbpm-xes/pom.xml | 1 - .../java/org/jbpm/xes/EvaluationExport.java | 2 +- pom.xml | 4 +- 31 files changed, 352 insertions(+), 366 deletions(-) create mode 100644 jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/src/test/resources/drop-tables.sql diff --git a/jbpm-audit/pom.xml b/jbpm-audit/pom.xml index 15f1dbd009..cf4324a6b1 100644 --- a/jbpm-audit/pom.xml +++ b/jbpm-audit/pom.xml @@ -18,7 +18,9 @@ org.jbpm.process.audit - jdbc:h2:mem:bamTest;MVCC=TRUE + + + jdbc:h2:mem:bamTest;MODE=LEGACY;NON_KEYWORDS=VALUE diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java index a3040c5d5d..82d98fbd87 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java @@ -55,7 +55,7 @@ import org.jbpm.workflow.instance.node.DynamicUtils; import org.jbpm.workflow.instance.node.WorkItemNodeInstance; import org.junit.After; -import org.junit.BeforeClass; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -115,8 +115,8 @@ public ActivityTest(boolean persistence) throws Exception { super(persistence); } - @BeforeClass - public static void setup() throws Exception { + @Before + public void setup() throws Exception { setUpDataSource(); } @@ -128,6 +128,7 @@ public void dispose() { ksession = null; } if (ksession2 != null) { + abortProcessInstances(ksession2); ksession2.dispose(); ksession2 = null; } @@ -687,7 +688,7 @@ public void testCallActivityMIWrongInputTypeStrictDisabled() throws Exception { VariableScope.setVariableStrictOption(true); } } - + @Test public void testCallActivityMISequential() throws Exception { KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-CallActivityMISequential.bpmn2", diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompensationTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompensationTest.java index 511251b53d..9cd15fb511 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompensationTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompensationTest.java @@ -107,6 +107,7 @@ public void prepare() { @After public void dispose() { if (ksession != null) { + abortProcessInstances(ksession); ksession.dispose(); ksession = null; } @@ -118,7 +119,7 @@ public void dispose() { @Test public void compensationViaIntermediateThrowEventProcess() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -135,7 +136,7 @@ public void compensationViaIntermediateThrowEventProcess() throws Exception { @Test public void compensationTwiceViaSignal() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -155,7 +156,7 @@ public void compensationTwiceViaSignal() throws Exception { @Test public void subprocessLevelCompensationViaEventSubProcess() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-EventSubProcess.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-EventSubProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -171,7 +172,7 @@ public void subprocessLevelCompensationViaEventSubProcess() throws Exception { @Test public void processLevelCompensationViaEventSubProcess() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-EventSubProcess2.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-EventSubProcess2.bpmn2"); Map params = new HashMap(); params.put("x", "0"); @@ -182,7 +183,7 @@ public void processLevelCompensationViaEventSubProcess() throws Exception { @Test public void compensationOnlyAfterAssociatedActivityHasCompleted() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2"); ksession.addEventListener(LOGGING_EVENT_LISTENER); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -204,7 +205,7 @@ public void compensationOnlyAfterAssociatedActivityHasCompleted() throws Excepti @Test public void orderedCompensation() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -242,7 +243,7 @@ public void orderedCompensation() throws Exception { @Test public void compensationInSubSubProcesses() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-InSubSubProcess.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-InSubSubProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -263,7 +264,7 @@ public void compensationInSubSubProcesses() throws Exception { @Test public void specificCompensationOfASubProcess() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -286,7 +287,7 @@ public void specificCompensationOfASubProcess() throws Exception { @Test @Ignore public void compensationViaCancellation() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -304,7 +305,7 @@ public void compensationViaCancellation() throws Exception { @Test public void compensationInvokingSubProcess() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-UserTaskCompensation.bpmn2"); + ksession = createKnowledgeSession("compensation/BPMN2-UserTaskCompensation.bpmn2"); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); Map params = new HashMap(); @@ -323,7 +324,7 @@ public void compensationInvokingSubProcess() throws Exception { */ @Test public void compensationWithReusableSubprocess() throws Exception { - KieSession ksession = createKnowledgeSession("compensation/BPMN2-Booking.bpmn2", + ksession = createKnowledgeSession("compensation/BPMN2-Booking.bpmn2", "compensation/BPMN2-BookResource.bpmn2", "compensation/BPMN2-CancelResource.bpmn2"); ProcessInstance processInstance = ksession.startProcess("Booking"); assertProcessInstanceCompleted(processInstance.getId(), ksession); diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DataTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DataTest.java index 1847846e33..73f59a3064 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DataTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DataTest.java @@ -227,6 +227,7 @@ public static void setup() throws Exception { @After public void dispose() { if (ksession != null) { + abortProcessInstances(ksession); ksession.dispose(); ksession = null; } diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EndEventTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EndEventTest.java index 042c19e1cd..f27f6706ac 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EndEventTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EndEventTest.java @@ -67,6 +67,7 @@ public static void setup() throws Exception { @After public void dispose() { if (ksession != null) { + abortProcessInstances(ksession); ksession.dispose(); ksession = null; } diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java index f8baffed15..89c6ef3609 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java @@ -77,10 +77,11 @@ public ErrorEventTest(boolean persistence) { public static void setup() throws Exception { setUpDataSource(); } - + @After public void dispose() { if (ksession != null) { + abortProcessInstances(ksession); ksession.dispose(); ksession = null; } diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java index 5ddf415598..ee6fba8f22 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java @@ -70,6 +70,7 @@ public static void setup() throws Exception { @After public void dispose() { if (ksession != null) { + abortProcessInstances(ksession); ksession.dispose(); ksession = null; } diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java index 34742411d1..8d23baa2de 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java @@ -94,6 +94,7 @@ public static void setup() throws Exception { @After public void dispose() { if (ksession != null) { + abortProcessInstances(ksession); ksession.dispose(); ksession = null; } diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java index 173619ce1c..0c1c10af80 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java @@ -740,7 +740,6 @@ protected void abortProcessInstances(KieSession ksession) { logService.findActiveProcessInstances().forEach(pi -> ksession.abortProcessInstance(pi.getId())); } catch(Exception e) { - } } } diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java index 1848515579..223bacd2d7 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java @@ -42,6 +42,7 @@ import org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler; import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler; import org.jbpm.test.listener.process.NodeLeftCountDownProcessEventListener; +import org.junit.After; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; @@ -72,6 +73,8 @@ public class StandaloneBPMNProcessTest extends JbpmBpmn2TestCase { private static final Logger logger = LoggerFactory.getLogger(StandaloneBPMNProcessTest.class); + private KieSession ksession; + @Parameters public static Collection persistence() { Object[][] data = new Object[][] { @@ -90,6 +93,16 @@ public StandaloneBPMNProcessTest(boolean persistence, boolean locking) { public static void setup() throws Exception { setUpDataSource(); } + + @After + public void dispose() { + if (ksession != null) { + abortProcessInstances(ksession); + ksession.dispose(); + ksession = null; + } + } + /** * Tests @@ -98,7 +111,7 @@ public static void setup() throws Exception { @Test public void testMinimalProcess() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-MinimalProcess.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("Minimal"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); } @@ -106,7 +119,7 @@ public void testMinimalProcess() throws Exception { @Test public void testMinimalProcessWithGraphical() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-MinimalProcessWithGraphical.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("Minimal"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); } @@ -114,7 +127,7 @@ public void testMinimalProcessWithGraphical() throws Exception { @Test public void testMinimalProcessWithDIGraphical() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-MinimalProcessWithDIGraphical.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("Minimal"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); } @@ -122,7 +135,7 @@ public void testMinimalProcessWithDIGraphical() throws Exception { @Test public void testCompositeProcessWithDIGraphical() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-CompositeProcessWithDIGraphical.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("Composite"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); } @@ -130,7 +143,7 @@ public void testCompositeProcessWithDIGraphical() throws Exception { @Test public void testScriptTask() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ScriptTask.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("ScriptTask"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); } @@ -138,7 +151,7 @@ public void testScriptTask() throws Exception { @Test public void testDataObject() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-DataObject.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); Map params = new HashMap(); params.put("employee", "UserId-12345"); ProcessInstance processInstance = ksession.startProcess("Evaluation", params); @@ -148,7 +161,7 @@ public void testDataObject() throws Exception { @Test public void testEvaluationProcess() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EvaluationProcess.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("RegisterRequest", new SystemOutWorkItemHandler()); Map params = new HashMap(); @@ -160,7 +173,7 @@ public void testEvaluationProcess() throws Exception { @Test public void testEvaluationProcess2() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EvaluationProcess2.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); Map params = new HashMap(); params.put("employee", "UserId-12345"); @@ -171,7 +184,7 @@ public void testEvaluationProcess2() throws Exception { @Test public void testEvaluationProcess3() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EvaluationProcess3.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("RegisterRequest", new SystemOutWorkItemHandler()); @@ -184,7 +197,7 @@ public void testEvaluationProcess3() throws Exception { @Test public void testUserTask() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-UserTask.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -221,7 +234,7 @@ public void testUserTask() throws Exception { @Test public void testLane() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-Lane.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); ProcessInstance processInstance = ksession.startProcess("UserTask"); @@ -246,7 +259,7 @@ public void testLane() throws Exception { @Test public void testExclusiveSplit() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ExclusiveSplit.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler()); Map params = new HashMap(); params.put("x", "First"); @@ -258,7 +271,7 @@ public void testExclusiveSplit() throws Exception { @Test public void testExclusiveSplitDefault() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ExclusiveSplitDefault.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler()); Map params = new HashMap(); params.put("x", "NotFirst"); @@ -270,7 +283,7 @@ public void testExclusiveSplitDefault() throws Exception { @Test public void testInclusiveSplit() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-InclusiveSplit.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); Map params = new HashMap(); params.put("x", 15); ProcessInstance processInstance = ksession.startProcess("com.sample.test", params); @@ -280,7 +293,7 @@ public void testInclusiveSplit() throws Exception { @Test public void testInclusiveSplitDefault() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-InclusiveSplitDefault.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); Map params = new HashMap(); params.put("x", -5); ProcessInstance processInstance = ksession.startProcess("com.sample.test", params); @@ -291,7 +304,7 @@ public void testInclusiveSplitDefault() throws Exception { @Ignore public void testExclusiveSplitXPath() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ExclusiveSplitXPath.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler()); Document document = DocumentBuilderFactory @@ -309,7 +322,7 @@ public void testExclusiveSplitXPath() throws Exception { @Test public void testEventBasedSplit() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // Yes @@ -334,7 +347,7 @@ public void testEventBasedSplit() throws Exception { public void testEventBasedSplitBefore() throws Exception { // signaling before the split is reached should have no effect KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); // Yes @@ -360,7 +373,7 @@ public void testEventBasedSplitAfter() throws Exception { // signaling the other alternative after one has been selected should // have no effect KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); // Yes @@ -382,7 +395,7 @@ public void testEventBasedSplitAfter() throws Exception { public void testEventBasedSplit2() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 2); KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit2.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.addEventListener(countDownListener); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); @@ -420,7 +433,7 @@ public void testEventBasedSplit2() throws Exception { @Ignore("process does not complete") public void testEventBasedSplit3() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit3.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); Person jack = new Person(); @@ -446,7 +459,7 @@ public void testEventBasedSplit3() throws Exception { @Test public void testEventBasedSplit4() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit4.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // Yes @@ -469,7 +482,7 @@ public void testEventBasedSplit4() throws Exception { @Test public void testEventBasedSplit5() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-EventBasedSplit5.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ReceiveTaskHandler receiveTaskHandler = new ReceiveTaskHandler(ksession); @@ -510,7 +523,7 @@ public void testCallActivity() throws Exception { } InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addPackages(kbuilder.getKnowledgePackages()); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); Map params = new HashMap(); params.put("x", "oldValue"); @@ -522,7 +535,7 @@ public void testCallActivity() throws Exception { @Test public void testSubProcess() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-SubProcess.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("SubProcess"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); } @@ -530,7 +543,7 @@ public void testSubProcess() throws Exception { @Test public void testMultiInstanceLoopCharacteristicsProcess() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); Map params = new HashMap(); List myList = new ArrayList(); myList.add("First Item"); @@ -543,7 +556,7 @@ public void testMultiInstanceLoopCharacteristicsProcess() throws Exception { @Test public void testErrorBoundaryEvent() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ErrorBoundaryEventInterrupting.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); ProcessInstance processInstance = ksession.startProcess("ErrorBoundaryEvent"); assertProcessInstanceCompleted(processInstance.getId(), ksession); @@ -553,7 +566,7 @@ public void testErrorBoundaryEvent() throws Exception { public void testTimerBoundaryEvent() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 1); KieBase kbase = createKnowledgeBase("BPMN2-TimerBoundaryEventDuration.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.addEventListener(countDownListener); ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent"); @@ -566,7 +579,7 @@ public void testTimerBoundaryEvent() throws Exception { public void testTimerBoundaryEventInterrupting() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 1); KieBase kbase = createKnowledgeBase("BPMN2-TimerBoundaryEventInterrupting.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.addEventListener(countDownListener); ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); ProcessInstance processInstance = ksession.startProcess("TimerBoundaryEvent"); @@ -579,7 +592,7 @@ public void testTimerBoundaryEventInterrupting() throws Exception { @Ignore("Process does not complete.") public void testAdHocSubProcess() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-AdHocSubProcess.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -605,7 +618,7 @@ public void testAdHocSubProcess() throws Exception { @Ignore("Process does not complete.") public void testAdHocSubProcessAutoComplete() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-AdHocSubProcessAutoComplete.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -629,7 +642,7 @@ public void testAdHocSubProcessAutoComplete() throws Exception { @Test public void testIntermediateCatchEventSignal() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventSignal.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE); @@ -642,7 +655,7 @@ public void testIntermediateCatchEventSignal() throws Exception { @Test public void testIntermediateCatchEventMessage() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventMessage.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE); @@ -656,7 +669,7 @@ public void testIntermediateCatchEventMessage() throws Exception { public void testIntermediateCatchEventTimer() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 1); KieBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventTimerDuration.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.addEventListener(countDownListener); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent"); @@ -672,7 +685,7 @@ public void testIntermediateCatchEventTimer() throws Exception { @Ignore("process does not complete") public void testIntermediateCatchEventCondition() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventCondition.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE); ksession = restoreSession(ksession); @@ -686,7 +699,7 @@ public void testIntermediateCatchEventCondition() throws Exception { @Test public void testErrorEndEventProcess() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ErrorEndEvent.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("ErrorEndEvent"); assertProcessInstanceAborted(processInstance.getId(), ksession); } @@ -694,7 +707,7 @@ public void testErrorEndEventProcess() throws Exception { @Test public void testServiceTask() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ServiceProcess.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler()); Map params = new HashMap(); params.put("s", "john"); @@ -706,7 +719,7 @@ public void testServiceTask() throws Exception { @Test public void testSendTask() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-SendTask.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler()); Map params = new HashMap(); params.put("s", "john"); @@ -717,7 +730,7 @@ public void testSendTask() throws Exception { @Test public void testReceiveTask() throws Exception { KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-ReceiveTask.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ReceiveTaskHandler receiveTaskHandler = new ReceiveTaskHandler(ksession); ksession.getWorkItemManager().registerWorkItemHandler("Receive Task", receiveTaskHandler); WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.startProcess("ReceiveTask"); @@ -731,7 +744,7 @@ public void testReceiveTask() throws Exception { @Ignore("bpmn does not compile") public void testConditionalStart() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ConditionalStart.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); Person person = new Person(); person.setName("jack"); ksession.insert(person); @@ -746,7 +759,7 @@ public void testConditionalStart() throws Exception { public void testTimerStart() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartProcess", 5); KieBase kbase = createKnowledgeBase("BPMN2-TimerStart.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.addEventListener(countDownListener); final List list = new ArrayList(); ksession.addEventListener(new DefaultProcessEventListener() { @@ -765,7 +778,7 @@ public void beforeProcessStarted(ProcessStartedEvent event) { @Test public void testSignalStart() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-SignalStart.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); final List list = new ArrayList(); ksession.addEventListener(new DefaultProcessEventListener() { public void afterProcessStarted(ProcessStartedEvent event) { @@ -779,16 +792,16 @@ public void afterProcessStarted(ProcessStartedEvent event) { @Test public void testSignalEnd() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-SignalEndEvent.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); Map params = new HashMap(); params.put("x", "MyValue"); - ksession.startProcess("SignalEndEvent", params); + ProcessInstance pi = ksession.startProcess("SignalEndEvent", params); } @Test public void testMessageStart() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-MessageStart.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); final List list = new ArrayList(); ksession.addEventListener(new DefaultProcessEventListener() { public void afterProcessStarted(ProcessStartedEvent event) { @@ -802,7 +815,7 @@ public void afterProcessStarted(ProcessStartedEvent event) { @Test public void testMessageEnd() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-MessageEndEvent.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler()); Map params = new HashMap(); params.put("x", "MyValue"); @@ -813,7 +826,7 @@ public void testMessageEnd() throws Exception { @Test public void testMessageIntermediateThrow() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-IntermediateThrowEventMessage.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler()); Map params = new HashMap(); params.put("x", "MyValue"); @@ -824,7 +837,7 @@ public void testMessageIntermediateThrow() throws Exception { @Test public void testSignalIntermediateThrow() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-IntermediateThrowEventSignal.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); Map params = new HashMap(); params.put("x", "MyValue"); ProcessInstance processInstance = ksession.startProcess("SignalIntermediateEvent", params); @@ -834,7 +847,7 @@ public void testSignalIntermediateThrow() throws Exception { @Test public void testNoneIntermediateThrow() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-IntermediateThrowEventNone.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("NoneIntermediateEvent"); assertThat(processInstance.getState()).isEqualTo(ProcessInstance.STATE_COMPLETED); } @@ -842,7 +855,7 @@ public void testNoneIntermediateThrow() throws Exception { @Test public void testErrorSignallingExceptionServiceTask() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-ExceptionServiceProcess-ErrorSignalling.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); runTestErrorSignallingExceptionServiceTask(ksession); } @@ -892,7 +905,7 @@ public void testSignallingExceptionServiceTask() throws Exception { // dump/reread functionality seems to work for this test // .. but I'm pretty sure that's more coincidence than design (mriet, 2013-03-06) KieBase kbase = createKnowledgeBase("BPMN2-ExceptionServiceProcess-Signalling.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); runTestSignallingExceptionServiceTask(ksession); } @@ -924,7 +937,7 @@ public void testXXEProcessVulnerability() throws Exception { resource.setTargetPath(processResource.getTargetPath()); KieBase kbase = createKnowledgeBaseFromResources(resource); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ProcessInstance processInstance = ksession.startProcess("async-examples.bp1"); String var1 = getProcessVarValue(processInstance, "testScript1"); @@ -938,7 +951,7 @@ public void testXXEProcessVulnerability() throws Exception { @Test public void testVariableRefInIntermediateThrowEvent() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-WorkingMessageModel.bpmn2"); - KieSession ksession = createKnowledgeSession(kbase); + ksession = createKnowledgeSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new DoNothingWorkItemHandler()); ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new DoNothingWorkItemHandler()); diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java index 7bc9e152bc..dff178b0d3 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java @@ -59,6 +59,7 @@ public static void setup() throws Exception { @After public void dispose() { if (ksession != null) { + abortProcessInstances(ksession); ksession.dispose(); ksession = null; } diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/src/test/resources/drop-tables.sql b/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/src/test/resources/drop-tables.sql new file mode 100644 index 0000000000..f39df8b8a9 --- /dev/null +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/src/test/resources/drop-tables.sql @@ -0,0 +1 @@ +DROP ALL OBJECTS diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/src/test/resources/org/jbpm/test/container/archive/ejbservices/persistence.xml b/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/src/test/resources/org/jbpm/test/container/archive/ejbservices/persistence.xml index 85f647c42a..da5bd62e46 100644 --- a/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/src/test/resources/org/jbpm/test/container/archive/ejbservices/persistence.xml +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/src/test/resources/org/jbpm/test/container/archive/ejbservices/persistence.xml @@ -66,6 +66,8 @@ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistenc + + diff --git a/jbpm-container-test/pom.xml b/jbpm-container-test/pom.xml index d350bb3352..12d32cd9a0 100644 --- a/jbpm-container-test/pom.xml +++ b/jbpm-container-test/pom.xml @@ -21,7 +21,9 @@ org.hibernate.dialect.H2Dialect - jdbc:h2:mem:test-db;MVCC=TRUE + + + jdbc:h2:mem:test-db;MODE=LEGACY;NON_KEYWORDS=VALUE sa org.h2.jdbcx.JdbcDataSource @@ -32,6 +34,8 @@ create-drop + script + drop-tables.sql diff --git a/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/h2-jbpm-drop-schema.sql b/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/h2-jbpm-drop-schema.sql index 86750424c1..b1306d7359 100644 --- a/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/h2-jbpm-drop-schema.sql +++ b/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/h2-jbpm-drop-schema.sql @@ -1,46 +1 @@ -drop table Attachment if exists; -drop table AuditTaskImpl if exists; -drop table BAMTaskSummary if exists; -drop table BooleanExpression if exists; -drop table CaseFileDataLog if exists; -drop table CaseIdInfo if exists; -drop table CaseRoleAssignmentLog if exists; -drop table Content if exists; -drop table ContextMappingInfo if exists; -drop table TimerMappingInfo if exists; -drop table CorrelationKeyInfo if exists; -drop table CorrelationPropertyInfo if exists; -drop table Deadline if exists; -drop table Delegation_delegates if exists; -drop table DeploymentStore if exists; -drop table email_header if exists; -drop table ErrorInfo if exists; -drop table Escalation if exists; -drop table EventTypes if exists; -drop table ExecutionErrorInfo if exists; -drop table I18NText if exists; -drop table NodeInstanceLog if exists; -drop table Notification if exists; -drop table Notification_BAs if exists; -drop table Notification_email_header if exists; -drop table Notification_Recipients if exists; -drop table OrganizationalEntity if exists; -drop table PeopleAssignments_BAs if exists; -drop table PeopleAssignments_ExclOwners if exists; -drop table PeopleAssignments_PotOwners if exists; -drop table PeopleAssignments_Recipients if exists; -drop table PeopleAssignments_Stakeholders if exists; -drop table ProcessInstanceInfo if exists; -drop table ProcessInstanceLog if exists; -drop table QueryDefinitionStore if exists; -drop table Reassignment if exists; -drop table Reassignment_potentialOwners if exists; -drop table RequestInfo if exists; -drop table SessionInfo if exists; -drop table Task if exists; -drop table task_comment if exists; -drop table TaskDef if exists; -drop table TaskEvent if exists; -drop table TaskVariableImpl if exists; -drop table VariableInstanceLog if exists; -drop table WorkItemInfo if exists; +DROP ALL OBJECTS; diff --git a/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/h2-jbpm-schema.sql b/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/h2-jbpm-schema.sql index 0f5774a323..4948d050db 100644 --- a/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/h2-jbpm-schema.sql +++ b/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/h2-jbpm-schema.sql @@ -1,4 +1,4 @@ - create table Attachment ( + create table if not exists Attachment ( id bigint generated by default as identity, accessType integer, attachedAt timestamp, @@ -11,7 +11,7 @@ primary key (id) ); - create table AuditTaskImpl ( + create table if not exists AuditTaskImpl ( id bigint generated by default as identity, activationTime timestamp, actualOwner varchar(255), @@ -33,7 +33,7 @@ primary key (id) ); - create table BAMTaskSummary ( + create table if not exists BAMTaskSummary ( pk bigint generated by default as identity, createdDate timestamp, duration bigint, @@ -48,7 +48,7 @@ primary key (pk) ); - create table BooleanExpression ( + create table if not exists BooleanExpression ( id bigint generated by default as identity, expression clob, type varchar(255), @@ -56,14 +56,14 @@ primary key (id) ); - create table CaseIdInfo ( + create table if not exists CaseIdInfo ( id bigint generated by default as identity, caseIdPrefix varchar(255), currentValue bigint, primary key (id) ); - create table CaseFileDataLog ( + create table if not exists CaseFileDataLog ( id bigint generated by default as identity, caseDefId varchar(255), caseId varchar(255), @@ -75,7 +75,7 @@ primary key (id) ); - create table CaseRoleAssignmentLog ( + create table if not exists CaseRoleAssignmentLog ( id bigint generated by default as identity, caseId varchar(255), entityId varchar(255), @@ -85,13 +85,13 @@ primary key (id) ); - create table Content ( + create table if not exists Content ( id bigint generated by default as identity, content blob, primary key (id) ); - create table ContextMappingInfo ( + create table if not exists ContextMappingInfo ( mappingId bigint generated by default as identity, CONTEXT_ID varchar(255) not null, KSESSION_ID bigint not null, @@ -100,7 +100,7 @@ primary key (mappingId) ); - create table TimerMappingInfo ( + create table if not exists TimerMappingInfo ( id bigint generated by default as identity, externalTimerId varchar(255), kieSessionId bigint not null, @@ -111,7 +111,7 @@ primary key (id) ); - create table CorrelationKeyInfo ( + create table if not exists CorrelationKeyInfo ( keyId bigint generated by default as identity, name varchar(255) not null, processInstanceId bigint not null, @@ -119,7 +119,7 @@ primary key (keyId) ); - create table CorrelationPropertyInfo ( + create table if not exists CorrelationPropertyInfo ( propertyId bigint generated by default as identity, name varchar(255), value varchar(255), @@ -128,7 +128,7 @@ primary key (propertyId) ); - create table Deadline ( + create table if not exists Deadline ( id bigint generated by default as identity, deadline_date timestamp, escalated smallint, @@ -137,12 +137,12 @@ primary key (id) ); - create table Delegation_delegates ( + create table if not exists Delegation_delegates ( task_id bigint not null, entity_id varchar(255) not null ); - create table DeploymentStore ( + create table if not exists DeploymentStore ( id bigint generated by default as identity, attributes varchar(255), DEPLOYMENT_ID varchar(255), @@ -152,7 +152,7 @@ primary key (id) ); - create table ErrorInfo ( + create table if not exists ErrorInfo ( id bigint generated by default as identity, message varchar(255), stacktrace varchar(5000), @@ -161,19 +161,19 @@ primary key (id) ); - create table Escalation ( + create table if not exists Escalation ( id bigint generated by default as identity, name varchar(255), Deadline_Escalation_Id bigint, primary key (id) ); - create table EventTypes ( + create table if not exists EventTypes ( InstanceId bigint not null, element varchar(255) ); - create table ExecutionErrorInfo ( + create table if not exists ExecutionErrorInfo ( id bigint generated by default as identity, ERROR_ACK smallint, ERROR_ACK_AT timestamp, @@ -193,7 +193,7 @@ primary key (id) ); - create table I18NText ( + create table if not exists I18NText ( id bigint generated by default as identity, language varchar(255), shortText varchar(255), @@ -210,7 +210,7 @@ primary key (id) ); - create table NodeInstanceLog ( + create table if not exists NodeInstanceLog ( id bigint generated by default as identity, connection varchar(255), log_date timestamp, @@ -231,7 +231,7 @@ primary key (id) ); - create table Notification ( + create table if not exists Notification ( DTYPE varchar(31) not null, id bigint generated by default as identity, priority integer not null, @@ -239,55 +239,55 @@ primary key (id) ); - create table Notification_BAs ( + create table if not exists Notification_BAs ( task_id bigint not null, entity_id varchar(255) not null ); - create table Notification_Recipients ( + create table if not exists Notification_Recipients ( task_id bigint not null, entity_id varchar(255) not null ); - create table Notification_email_header ( + create table if not exists Notification_email_header ( Notification_id bigint not null, emailHeaders_id bigint not null, mapkey varchar(255) not null, primary key (Notification_id, mapkey) ); - create table OrganizationalEntity ( + create table if not exists OrganizationalEntity ( DTYPE varchar(31) not null, id varchar(255) not null, primary key (id) ); - create table PeopleAssignments_BAs ( + create table if not exists PeopleAssignments_BAs ( task_id bigint not null, entity_id varchar(255) not null ); - create table PeopleAssignments_ExclOwners ( + create table if not exists PeopleAssignments_ExclOwners ( task_id bigint not null, entity_id varchar(255) not null ); - create table PeopleAssignments_PotOwners ( + create table if not exists PeopleAssignments_PotOwners ( task_id bigint not null, entity_id varchar(255) not null ); - create table PeopleAssignments_Recipients ( + create table if not exists PeopleAssignments_Recipients ( task_id bigint not null, entity_id varchar(255) not null ); - create table PeopleAssignments_Stakeholders ( + create table if not exists PeopleAssignments_Stakeholders ( task_id bigint not null, entity_id varchar(255) not null ); - create table ProcessInstanceInfo ( + create table if not exists ProcessInstanceInfo ( InstanceId bigint generated by default as identity, lastModificationDate timestamp, lastReadDate timestamp, @@ -299,7 +299,7 @@ primary key (InstanceId) ); - create table ProcessInstanceLog ( + create table if not exists ProcessInstanceLog ( id bigint generated by default as identity, correlationKey varchar(255), duration bigint, @@ -321,7 +321,7 @@ primary key (id) ); - create table QueryDefinitionStore ( + create table if not exists QueryDefinitionStore ( id bigint generated by default as identity, qExpression clob, qName varchar(255), @@ -330,18 +330,18 @@ primary key (id) ); - create table Reassignment ( + create table if not exists Reassignment ( id bigint generated by default as identity, Escalation_Reassignments_Id bigint, primary key (id) ); - create table Reassignment_potentialOwners ( + create table if not exists Reassignment_potentialOwners ( task_id bigint not null, entity_id varchar(255) not null ); - create table RequestInfo ( + create table if not exists RequestInfo ( id bigint generated by default as identity, commandName varchar(255), deploymentId varchar(255), @@ -359,7 +359,7 @@ primary key (id) ); - create table SessionInfo ( + create table if not exists SessionInfo ( id bigint generated by default as identity, lastModificationDate timestamp, rulesByteArray blob, @@ -368,7 +368,7 @@ primary key (id) ); - create table Task ( + create table if not exists Task ( id bigint generated by default as identity, archived smallint, allowedToDelegate varchar(255), @@ -408,14 +408,14 @@ primary key (id) ); - create table TaskDef ( + create table if not exists TaskDef ( id bigint generated by default as identity, name varchar(255), priority integer not null, primary key (id) ); - create table TaskEvent ( + create table if not exists TaskEvent ( id bigint generated by default as identity, logTime timestamp, message varchar(255), @@ -431,7 +431,7 @@ primary key (id) ); - create table TaskVariableImpl ( + create table if not exists TaskVariableImpl ( id bigint generated by default as identity, modificationDate timestamp, name varchar(255), @@ -443,7 +443,7 @@ primary key (id) ); - create table VariableInstanceLog ( + create table if not exists VariableInstanceLog ( id bigint generated by default as identity, log_date timestamp, externalId varchar(255), @@ -456,7 +456,7 @@ primary key (id) ); - create table WorkItemInfo ( + create table if not exists WorkItemInfo ( workItemId bigint generated by default as identity, creationDate timestamp, name varchar(255), @@ -467,7 +467,7 @@ primary key (workItemId) ); - create table email_header ( + create table if not exists email_header ( id bigint generated by default as identity, body clob, fromAddress varchar(255), @@ -477,7 +477,7 @@ primary key (id) ); - create table task_comment ( + create table if not exists task_comment ( id bigint generated by default as identity, addedAt timestamp, text clob, @@ -487,362 +487,362 @@ ); alter table DeploymentStore - add constraint UK_85rgskt09thd8mkkfl3tb0y81 unique (DEPLOYMENT_ID); + add constraint if not exists UK_85rgskt09thd8mkkfl3tb0y81 unique (DEPLOYMENT_ID); alter table Notification_email_header - add constraint UK_ptaka5kost68h7l3wflv7w6y8 unique (emailHeaders_id); + add constraint if not exists UK_ptaka5kost68h7l3wflv7w6y8 unique (emailHeaders_id); alter table QueryDefinitionStore - add constraint UK_4ry5gt77jvq0orfttsoghta2j unique (qName); + add constraint if not exists UK_4ry5gt77jvq0orfttsoghta2j unique (qName); alter table Attachment - add constraint FK_7ndpfa311i50bq7hy18q05va3 + add constraint if not exists FK_7ndpfa311i50bq7hy18q05va3 foreign key (attachedBy_id) references OrganizationalEntity; alter table Attachment - add constraint FK_hqupx569krp0f0sgu9kh87513 + add constraint if not exists FK_hqupx569krp0f0sgu9kh87513 foreign key (TaskData_Attachments_Id) references Task; alter table BooleanExpression - add constraint FK_394nf2qoc0k9ok6omgd6jtpso + add constraint if not exists FK_394nf2qoc0k9ok6omgd6jtpso foreign key (Escalation_Constraints_Id) references Escalation; alter table CaseIdInfo - add constraint UK_CaseIdInfo_1 unique (caseIdPrefix); + add constraint if not exists UK_CaseIdInfo_1 unique (caseIdPrefix); alter table CorrelationPropertyInfo - add constraint FK_hrmx1m882cejwj9c04ixh50i4 + add constraint if not exists FK_hrmx1m882cejwj9c04ixh50i4 foreign key (correlationKey_keyId) references CorrelationKeyInfo; - alter table CorrelationKeyInfo add constraint IDX_CorrelationKeyInfo_name unique (name); + alter table CorrelationKeyInfo add constraint if not exists IDX_CorrelationKeyInfo_name unique (name); alter table Deadline - add constraint FK_68w742sge00vco2cq3jhbvmgx + add constraint if not exists FK_68w742sge00vco2cq3jhbvmgx foreign key (Deadlines_StartDeadLine_Id) references Task; alter table Deadline - add constraint FK_euoohoelbqvv94d8a8rcg8s5n + add constraint if not exists FK_euoohoelbqvv94d8a8rcg8s5n foreign key (Deadlines_EndDeadLine_Id) references Task; alter table Delegation_delegates - add constraint FK_gn7ula51sk55wj1o1m57guqxb + add constraint if not exists FK_gn7ula51sk55wj1o1m57guqxb foreign key (entity_id) references OrganizationalEntity; alter table Delegation_delegates - add constraint FK_fajq6kossbsqwr3opkrctxei3 + add constraint if not exists FK_fajq6kossbsqwr3opkrctxei3 foreign key (task_id) references Task; alter table ErrorInfo - add constraint FK_cms0met37ggfw5p5gci3otaq0 + add constraint if not exists FK_cms0met37ggfw5p5gci3otaq0 foreign key (REQUEST_ID) references RequestInfo; alter table Escalation - add constraint FK_ay2gd4fvl9yaapviyxudwuvfg + add constraint if not exists FK_ay2gd4fvl9yaapviyxudwuvfg foreign key (Deadline_Escalation_Id) references Deadline; alter table EventTypes - add constraint FK_nrecj4617iwxlc65ij6m7lsl1 + add constraint if not exists FK_nrecj4617iwxlc65ij6m7lsl1 foreign key (InstanceId) references ProcessInstanceInfo; alter table I18NText - add constraint FK_k16jpgrh67ti9uedf6konsu1p + add constraint if not exists FK_k16jpgrh67ti9uedf6konsu1p foreign key (Task_Subjects_Id) references Task; alter table I18NText - add constraint FK_fd9uk6hemv2dx1ojovo7ms3vp + add constraint if not exists FK_fd9uk6hemv2dx1ojovo7ms3vp foreign key (Task_Names_Id) references Task; alter table I18NText - add constraint FK_4eyfp69ucrron2hr7qx4np2fp + add constraint if not exists FK_4eyfp69ucrron2hr7qx4np2fp foreign key (Task_Descriptions_Id) references Task; alter table I18NText - add constraint FK_pqarjvvnwfjpeyb87yd7m0bfi + add constraint if not exists FK_pqarjvvnwfjpeyb87yd7m0bfi foreign key (Reassignment_Documentation_Id) references Reassignment; alter table I18NText - add constraint FK_o84rkh69r47ti8uv4eyj7bmo2 + add constraint if not exists FK_o84rkh69r47ti8uv4eyj7bmo2 foreign key (Notification_Subjects_Id) references Notification; alter table I18NText - add constraint FK_g1trxri8w64enudw2t1qahhk5 + add constraint if not exists FK_g1trxri8w64enudw2t1qahhk5 foreign key (Notification_Names_Id) references Notification; alter table I18NText - add constraint FK_qoce92c70adem3ccb3i7lec8x + add constraint if not exists FK_qoce92c70adem3ccb3i7lec8x foreign key (Notification_Documentation_Id) references Notification; alter table I18NText - add constraint FK_bw8vmpekejxt1ei2ge26gdsry + add constraint if not exists FK_bw8vmpekejxt1ei2ge26gdsry foreign key (Notification_Descriptions_Id) references Notification; alter table I18NText - add constraint FK_21qvifarxsvuxeaw5sxwh473w + add constraint if not exists FK_21qvifarxsvuxeaw5sxwh473w foreign key (Deadline_Documentation_Id) references Deadline; alter table Notification - add constraint FK_bdbeml3768go5im41cgfpyso9 + add constraint if not exists FK_bdbeml3768go5im41cgfpyso9 foreign key (Escalation_Notifications_Id) references Escalation; alter table Notification_BAs - add constraint FK_mfbsnbrhth4rjhqc2ud338s4i + add constraint if not exists FK_mfbsnbrhth4rjhqc2ud338s4i foreign key (entity_id) references OrganizationalEntity; alter table Notification_BAs - add constraint FK_fc0uuy76t2bvxaxqysoo8xts7 + add constraint if not exists FK_fc0uuy76t2bvxaxqysoo8xts7 foreign key (task_id) references Notification; alter table Notification_Recipients - add constraint FK_blf9jsrumtrthdaqnpwxt25eu + add constraint if not exists FK_blf9jsrumtrthdaqnpwxt25eu foreign key (entity_id) references OrganizationalEntity; alter table Notification_Recipients - add constraint FK_3l244pj8sh78vtn9imaymrg47 + add constraint if not exists FK_3l244pj8sh78vtn9imaymrg47 foreign key (task_id) references Notification; alter table Notification_email_header - add constraint FK_ptaka5kost68h7l3wflv7w6y8 + add constraint if not exists FK_ptaka5kost68h7l3wflv7w6y8 foreign key (emailHeaders_id) references email_header; alter table Notification_email_header - add constraint FK_eth4nvxn21fk1vnju85vkjrai + add constraint if not exists FK_eth4nvxn21fk1vnju85vkjrai foreign key (Notification_id) references Notification; alter table PeopleAssignments_BAs - add constraint FK_t38xbkrq6cppifnxequhvjsl2 + add constraint if not exists FK_t38xbkrq6cppifnxequhvjsl2 foreign key (entity_id) references OrganizationalEntity; alter table PeopleAssignments_BAs - add constraint FK_omjg5qh7uv8e9bolbaq7hv6oh + add constraint if not exists FK_omjg5qh7uv8e9bolbaq7hv6oh foreign key (task_id) references Task; alter table PeopleAssignments_ExclOwners - add constraint FK_pth28a73rj6bxtlfc69kmqo0a + add constraint if not exists FK_pth28a73rj6bxtlfc69kmqo0a foreign key (entity_id) references OrganizationalEntity; alter table PeopleAssignments_ExclOwners - add constraint FK_b8owuxfrdng050ugpk0pdowa7 + add constraint if not exists FK_b8owuxfrdng050ugpk0pdowa7 foreign key (task_id) references Task; alter table PeopleAssignments_PotOwners - add constraint FK_tee3ftir7xs6eo3fdvi3xw026 + add constraint if not exists FK_tee3ftir7xs6eo3fdvi3xw026 foreign key (entity_id) references OrganizationalEntity; alter table PeopleAssignments_PotOwners - add constraint FK_4dv2oji7pr35ru0w45trix02x + add constraint if not exists FK_4dv2oji7pr35ru0w45trix02x foreign key (task_id) references Task; alter table PeopleAssignments_Recipients - add constraint FK_4g7y3wx6gnokf6vycgpxs83d6 + add constraint if not exists FK_4g7y3wx6gnokf6vycgpxs83d6 foreign key (entity_id) references OrganizationalEntity; alter table PeopleAssignments_Recipients - add constraint FK_enhk831fghf6akjilfn58okl4 + add constraint if not exists FK_enhk831fghf6akjilfn58okl4 foreign key (task_id) references Task; alter table PeopleAssignments_Stakeholders - add constraint FK_met63inaep6cq4ofb3nnxi4tm + add constraint if not exists FK_met63inaep6cq4ofb3nnxi4tm foreign key (entity_id) references OrganizationalEntity; alter table PeopleAssignments_Stakeholders - add constraint FK_4bh3ay74x6ql9usunubttfdf1 + add constraint if not exists FK_4bh3ay74x6ql9usunubttfdf1 foreign key (task_id) references Task; alter table Reassignment - add constraint FK_pnpeue9hs6kx2ep0sp16b6kfd + add constraint if not exists FK_pnpeue9hs6kx2ep0sp16b6kfd foreign key (Escalation_Reassignments_Id) references Escalation; alter table Reassignment_potentialOwners - add constraint FK_8frl6la7tgparlnukhp8xmody + add constraint if not exists FK_8frl6la7tgparlnukhp8xmody foreign key (entity_id) references OrganizationalEntity; alter table Reassignment_potentialOwners - add constraint FK_qbega5ncu6b9yigwlw55aeijn + add constraint if not exists FK_qbega5ncu6b9yigwlw55aeijn foreign key (task_id) references Reassignment; alter table Task - add constraint FK_dpk0f9ucm14c78bsxthh7h8yh + add constraint if not exists FK_dpk0f9ucm14c78bsxthh7h8yh foreign key (taskInitiator_id) references OrganizationalEntity; alter table Task - add constraint FK_nh9nnt47f3l61qjlyedqt05rf + add constraint if not exists FK_nh9nnt47f3l61qjlyedqt05rf foreign key (actualOwner_id) references OrganizationalEntity; alter table Task - add constraint FK_k02og0u71obf1uxgcdjx9rcjc + add constraint if not exists FK_k02og0u71obf1uxgcdjx9rcjc foreign key (createdBy_id) references OrganizationalEntity; alter table task_comment - add constraint FK_aax378yjnsmw9kb9vsu994jjv + add constraint if not exists FK_aax378yjnsmw9kb9vsu994jjv foreign key (addedBy_id) references OrganizationalEntity; alter table task_comment - add constraint FK_1ws9jdmhtey6mxu7jb0r0ufvs + add constraint if not exists FK_1ws9jdmhtey6mxu7jb0r0ufvs foreign key (TaskData_Comments_Id) references Task; - create index IDX_Attachment_Id ON Attachment(attachedBy_id); - create index IDX_Attachment_DataId ON Attachment(TaskData_Attachments_Id); - create index IDX_BoolExpr_Id ON BooleanExpression(Escalation_Constraints_Id); - create index IDX_CorrPropInfo_Id ON CorrelationPropertyInfo(correlationKey_keyId); - create index IDX_Deadline_StartId ON Deadline(Deadlines_StartDeadLine_Id); - create index IDX_Deadline_EndId ON Deadline(Deadlines_EndDeadLine_Id); - create index IDX_Delegation_EntityId ON Delegation_delegates(entity_id); - create index IDX_Delegation_TaskId ON Delegation_delegates(task_id); - create index IDX_ErrorInfo_Id ON ErrorInfo(REQUEST_ID); - create index IDX_Escalation_Id ON Escalation(Deadline_Escalation_Id); - create index IDX_EventTypes_Id ON EventTypes(InstanceId); - create index IDX_I18NText_SubjId ON I18NText(Task_Subjects_Id); - create index IDX_I18NText_NameId ON I18NText(Task_Names_Id); - create index IDX_I18NText_DescrId ON I18NText(Task_Descriptions_Id); - create index IDX_I18NText_ReassignId ON I18NText(Reassignment_Documentation_Id); - create index IDX_I18NText_NotSubjId ON I18NText(Notification_Subjects_Id); - create index IDX_I18NText_NotNamId ON I18NText(Notification_Names_Id); - create index IDX_I18NText_NotDocId ON I18NText(Notification_Documentation_Id); - create index IDX_I18NText_NotDescrId ON I18NText(Notification_Descriptions_Id); - create index IDX_I18NText_DeadDocId ON I18NText(Deadline_Documentation_Id); - create index IDX_Not_EscId ON Notification(Escalation_Notifications_Id); - create index IDX_NotBAs_Entity ON Notification_BAs(entity_id); - create index IDX_NotBAs_Task ON Notification_BAs(task_id); - create index IDX_NotRec_Entity ON Notification_Recipients(entity_id); - create index IDX_NotRec_Task ON Notification_Recipients(task_id); - create index IDX_NotEmail_Header ON Notification_email_header(emailHeaders_id); - create index IDX_NotEmail_Not ON Notification_email_header(Notification_id); - create index IDX_PAsBAs_Entity ON PeopleAssignments_BAs(entity_id); - create index IDX_PAsBAs_Task ON PeopleAssignments_BAs(task_id); - create index IDX_PAsExcl_Entity ON PeopleAssignments_ExclOwners(entity_id); - create index IDX_PAsExcl_Task ON PeopleAssignments_ExclOwners(task_id); - create index IDX_PAsPot_TaskEntity ON PeopleAssignments_PotOwners(task_id,entity_id); - create index IDX_PAsRecip_Entity ON PeopleAssignments_Recipients(entity_id); - create index IDX_PAsRecip_Task ON PeopleAssignments_Recipients(task_id); - create index IDX_PAsStake_Entity ON PeopleAssignments_Stakeholders(entity_id); - create index IDX_PAsStake_Task ON PeopleAssignments_Stakeholders(task_id); - create index IDX_Reassign_Esc ON Reassignment(Escalation_Reassignments_Id); - create index IDX_ReassignPO_Entity ON Reassignment_potentialOwners(entity_id); - create index IDX_ReassignPO_Task ON Reassignment_potentialOwners(task_id); - create index IDX_Task_Initiator ON Task(taskInitiator_id); - create index IDX_Task_ActualOwner ON Task(actualOwner_id); - create index IDX_Task_CreatedBy ON Task(createdBy_id); - create index IDX_TaskComments_CreatedBy ON task_comment(addedBy_id); - create index IDX_TaskComments_Id ON task_comment(TaskData_Comments_Id); + create index if not exists IDX_Attachment_Id ON Attachment(attachedBy_id); + create index if not exists IDX_Attachment_DataId ON Attachment(TaskData_Attachments_Id); + create index if not exists IDX_BoolExpr_Id ON BooleanExpression(Escalation_Constraints_Id); + create index if not exists IDX_CorrPropInfo_Id ON CorrelationPropertyInfo(correlationKey_keyId); + create index if not exists IDX_Deadline_StartId ON Deadline(Deadlines_StartDeadLine_Id); + create index if not exists IDX_Deadline_EndId ON Deadline(Deadlines_EndDeadLine_Id); + create index if not exists IDX_Delegation_EntityId ON Delegation_delegates(entity_id); + create index if not exists IDX_Delegation_TaskId ON Delegation_delegates(task_id); + create index if not exists IDX_ErrorInfo_Id ON ErrorInfo(REQUEST_ID); + create index if not exists IDX_Escalation_Id ON Escalation(Deadline_Escalation_Id); + create index if not exists IDX_EventTypes_Id ON EventTypes(InstanceId); + create index if not exists IDX_I18NText_SubjId ON I18NText(Task_Subjects_Id); + create index if not exists IDX_I18NText_NameId ON I18NText(Task_Names_Id); + create index if not exists IDX_I18NText_DescrId ON I18NText(Task_Descriptions_Id); + create index if not exists IDX_I18NText_ReassignId ON I18NText(Reassignment_Documentation_Id); + create index if not exists IDX_I18NText_NotSubjId ON I18NText(Notification_Subjects_Id); + create index if not exists IDX_I18NText_NotNamId ON I18NText(Notification_Names_Id); + create index if not exists IDX_I18NText_NotDocId ON I18NText(Notification_Documentation_Id); + create index if not exists IDX_I18NText_NotDescrId ON I18NText(Notification_Descriptions_Id); + create index if not exists IDX_I18NText_DeadDocId ON I18NText(Deadline_Documentation_Id); + create index if not exists IDX_Not_EscId ON Notification(Escalation_Notifications_Id); + create index if not exists IDX_NotBAs_Entity ON Notification_BAs(entity_id); + create index if not exists IDX_NotBAs_Task ON Notification_BAs(task_id); + create index if not exists IDX_NotRec_Entity ON Notification_Recipients(entity_id); + create index if not exists IDX_NotRec_Task ON Notification_Recipients(task_id); + create index if not exists IDX_NotEmail_Header ON Notification_email_header(emailHeaders_id); + create index if not exists IDX_NotEmail_Not ON Notification_email_header(Notification_id); + create index if not exists IDX_PAsBAs_Entity ON PeopleAssignments_BAs(entity_id); + create index if not exists IDX_PAsBAs_Task ON PeopleAssignments_BAs(task_id); + create index if not exists IDX_PAsExcl_Entity ON PeopleAssignments_ExclOwners(entity_id); + create index if not exists IDX_PAsExcl_Task ON PeopleAssignments_ExclOwners(task_id); + create index if not exists IDX_PAsPot_TaskEntity ON PeopleAssignments_PotOwners(task_id,entity_id); + create index if not exists IDX_PAsRecip_Entity ON PeopleAssignments_Recipients(entity_id); + create index if not exists IDX_PAsRecip_Task ON PeopleAssignments_Recipients(task_id); + create index if not exists IDX_PAsStake_Entity ON PeopleAssignments_Stakeholders(entity_id); + create index if not exists IDX_PAsStake_Task ON PeopleAssignments_Stakeholders(task_id); + create index if not exists IDX_Reassign_Esc ON Reassignment(Escalation_Reassignments_Id); + create index if not exists IDX_ReassignPO_Entity ON Reassignment_potentialOwners(entity_id); + create index if not exists IDX_ReassignPO_Task ON Reassignment_potentialOwners(task_id); + create index if not exists IDX_Task_Initiator ON Task(taskInitiator_id); + create index if not exists IDX_Task_ActualOwner ON Task(actualOwner_id); + create index if not exists IDX_Task_CreatedBy ON Task(createdBy_id); + create index if not exists IDX_TaskComments_CreatedBy ON task_comment(addedBy_id); + create index if not exists IDX_TaskComments_Id ON task_comment(TaskData_Comments_Id); - create index IDX_Task_processInstanceId on Task(processInstanceId); - create index IDX_Task_processId on Task(processId); - create index IDX_Task_status on Task(status); - create index IDX_Task_archived on Task(archived); - create index IDX_Task_workItemId on Task(workItemId); + create index if not exists IDX_Task_processInstanceId on Task(processInstanceId); + create index if not exists IDX_Task_processId on Task(processId); + create index if not exists IDX_Task_status on Task(status); + create index if not exists IDX_Task_archived on Task(archived); + create index if not exists IDX_Task_workItemId on Task(workItemId); - create index IDX_TaskEvent_taskId on TaskEvent (taskId); - create index IDX_TaskEvent_processInstanceId on TaskEvent (processInstanceId); + create index if not exists IDX_TaskEvent_taskId on TaskEvent (taskId); + create index if not exists IDX_TaskEvent_processInstanceId on TaskEvent (processInstanceId); - create index IDX_EventTypes_IdElement ON EventTypes(InstanceId,element); + create index if not exists IDX_EventTypes_IdElement ON EventTypes(InstanceId,element); - create index IDX_CMI_Context ON ContextMappingInfo(CONTEXT_ID); - create index IDX_CMI_KSession ON ContextMappingInfo(KSESSION_ID); - create index IDX_CMI_Owner ON ContextMappingInfo(OWNER_ID); + create index if not exists IDX_CMI_Context ON ContextMappingInfo(CONTEXT_ID); + create index if not exists IDX_CMI_KSession ON ContextMappingInfo(KSESSION_ID); + create index if not exists IDX_CMI_Owner ON ContextMappingInfo(OWNER_ID); create unique index IDX_TMI_KSessionUUID on TimerMappingInfo (kieSessionId, uuid); - create index IDX_RequestInfo_status ON RequestInfo(status); - create index IDX_RequestInfo_timestamp ON RequestInfo(timestamp); - create index IDX_RequestInfo_owner ON RequestInfo(owner); + create index if not exists IDX_RequestInfo_status ON RequestInfo(status); + create index if not exists IDX_RequestInfo_timestamp ON RequestInfo(timestamp); + create index if not exists IDX_RequestInfo_owner ON RequestInfo(owner); - create index IDX_BAMTaskSumm_createdDate on BAMTaskSummary(createdDate); - create index IDX_BAMTaskSumm_duration on BAMTaskSummary(duration); - create index IDX_BAMTaskSumm_endDate on BAMTaskSummary(endDate); - create index IDX_BAMTaskSumm_pInstId on BAMTaskSummary(processInstanceId); - create index IDX_BAMTaskSumm_startDate on BAMTaskSummary(startDate); - create index IDX_BAMTaskSumm_status on BAMTaskSummary(status); - create index IDX_BAMTaskSumm_taskId on BAMTaskSummary(taskId); - create index IDX_BAMTaskSumm_taskName on BAMTaskSummary(taskName); - create index IDX_BAMTaskSumm_userId on BAMTaskSummary(userId); + create index if not exists IDX_BAMTaskSumm_createdDate on BAMTaskSummary(createdDate); + create index if not exists IDX_BAMTaskSumm_duration on BAMTaskSummary(duration); + create index if not exists IDX_BAMTaskSumm_endDate on BAMTaskSummary(endDate); + create index if not exists IDX_BAMTaskSumm_pInstId on BAMTaskSummary(processInstanceId); + create index if not exists IDX_BAMTaskSumm_startDate on BAMTaskSummary(startDate); + create index if not exists IDX_BAMTaskSumm_status on BAMTaskSummary(status); + create index if not exists IDX_BAMTaskSumm_taskId on BAMTaskSummary(taskId); + create index if not exists IDX_BAMTaskSumm_taskName on BAMTaskSummary(taskName); + create index if not exists IDX_BAMTaskSumm_userId on BAMTaskSummary(userId); - create index IDX_PInstLog_duration on ProcessInstanceLog(duration); - create index IDX_PInstLog_end_date on ProcessInstanceLog(end_date); - create index IDX_PInstLog_extId on ProcessInstanceLog(externalId); - create index IDX_PInstLog_user_identity on ProcessInstanceLog(user_identity); - create index IDX_PInstLog_outcome on ProcessInstanceLog(outcome); - create index IDX_PInstLog_parentPInstId on ProcessInstanceLog(parentProcessInstanceId); - create index IDX_PInstLog_pId on ProcessInstanceLog(processId); - create index IDX_PInstLog_pInsteDescr on ProcessInstanceLog(processInstanceDescription); - create index IDX_PInstLog_pInstId on ProcessInstanceLog(processInstanceId); - create index IDX_PInstLog_pName on ProcessInstanceLog(processName); - create index IDX_PInstLog_pVersion on ProcessInstanceLog(processVersion); - create index IDX_PInstLog_start_date on ProcessInstanceLog(start_date); - create index IDX_PInstLog_status on ProcessInstanceLog(status); - create index IDX_PInstLog_correlation on ProcessInstanceLog(correlationKey); - - create index IDX_VInstLog_pInstId on VariableInstanceLog(processInstanceId); - create index IDX_VInstLog_varId on VariableInstanceLog(variableId); - create index IDX_VInstLog_pId on VariableInstanceLog(processId); - - create index IDX_NInstLog_pInstId on NodeInstanceLog(processInstanceId); - create index IDX_NInstLog_nodeType on NodeInstanceLog(nodeType); - create index IDX_NInstLog_pId on NodeInstanceLog(processId); - create index IDX_NInstLog_workItemId on NodeInstanceLog (workItemId); - - create index IDX_ErrorInfo_pInstId on ExecutionErrorInfo(PROCESS_INST_ID); - create index IDX_ErrorInfo_errorAck on ExecutionErrorInfo(ERROR_ACK); - - create index IDX_AuditTaskImpl_taskId on AuditTaskImpl(taskId); - create index IDX_AuditTaskImpl_pInstId on AuditTaskImpl(processInstanceId); - create index IDX_AuditTaskImpl_workItemId on AuditTaskImpl(workItemId); - create index IDX_AuditTaskImpl_name on AuditTaskImpl(name); - create index IDX_AuditTaskImpl_processId on AuditTaskImpl(processId); - create index IDX_AuditTaskImpl_status on AuditTaskImpl(status); - - create index IDX_TaskVariableImpl_taskId on TaskVariableImpl(taskId); - create index IDX_TaskVariableImpl_pInstId on TaskVariableImpl(processInstanceId); - create index IDX_TaskVariableImpl_processId on TaskVariableImpl(processId); - - create index IDX_CaseRoleAssignLog_caseId on CaseRoleAssignmentLog(caseId); - create index IDX_CaseRoleAssignLog_processInstanceId on CaseRoleAssignmentLog(processInstanceId); - - create index IDX_CaseFileDataLog_caseId on CaseFileDataLog(caseId); - create index IDX_CaseFileDataLog_itemName on CaseFileDataLog(itemName); + create index if not exists IDX_PInstLog_duration on ProcessInstanceLog(duration); + create index if not exists IDX_PInstLog_end_date on ProcessInstanceLog(end_date); + create index if not exists IDX_PInstLog_extId on ProcessInstanceLog(externalId); + create index if not exists IDX_PInstLog_user_identity on ProcessInstanceLog(user_identity); + create index if not exists IDX_PInstLog_outcome on ProcessInstanceLog(outcome); + create index if not exists IDX_PInstLog_parentPInstId on ProcessInstanceLog(parentProcessInstanceId); + create index if not exists IDX_PInstLog_pId on ProcessInstanceLog(processId); + create index if not exists IDX_PInstLog_pInsteDescr on ProcessInstanceLog(processInstanceDescription); + create index if not exists IDX_PInstLog_pInstId on ProcessInstanceLog(processInstanceId); + create index if not exists IDX_PInstLog_pName on ProcessInstanceLog(processName); + create index if not exists IDX_PInstLog_pVersion on ProcessInstanceLog(processVersion); + create index if not exists IDX_PInstLog_start_date on ProcessInstanceLog(start_date); + create index if not exists IDX_PInstLog_status on ProcessInstanceLog(status); + create index if not exists IDX_PInstLog_correlation on ProcessInstanceLog(correlationKey); + + create index if not exists IDX_VInstLog_pInstId on VariableInstanceLog(processInstanceId); + create index if not exists IDX_VInstLog_varId on VariableInstanceLog(variableId); + create index if not exists IDX_VInstLog_pId on VariableInstanceLog(processId); + + create index if not exists IDX_NInstLog_pInstId on NodeInstanceLog(processInstanceId); + create index if not exists IDX_NInstLog_nodeType on NodeInstanceLog(nodeType); + create index if not exists IDX_NInstLog_pId on NodeInstanceLog(processId); + create index if not exists IDX_NInstLog_workItemId on NodeInstanceLog (workItemId); + + create index if not exists IDX_ErrorInfo_pInstId on ExecutionErrorInfo(PROCESS_INST_ID); + create index if not exists IDX_ErrorInfo_errorAck on ExecutionErrorInfo(ERROR_ACK); + + create index if not exists IDX_AuditTaskImpl_taskId on AuditTaskImpl(taskId); + create index if not exists IDX_AuditTaskImpl_pInstId on AuditTaskImpl(processInstanceId); + create index if not exists IDX_AuditTaskImpl_workItemId on AuditTaskImpl(workItemId); + create index if not exists IDX_AuditTaskImpl_name on AuditTaskImpl(name); + create index if not exists IDX_AuditTaskImpl_processId on AuditTaskImpl(processId); + create index if not exists IDX_AuditTaskImpl_status on AuditTaskImpl(status); + + create index if not exists IDX_TaskVariableImpl_taskId on TaskVariableImpl(taskId); + create index if not exists IDX_TaskVariableImpl_pInstId on TaskVariableImpl(processInstanceId); + create index if not exists IDX_TaskVariableImpl_processId on TaskVariableImpl(processId); + + create index if not exists IDX_CaseRoleAssignLog_caseId on CaseRoleAssignmentLog(caseId); + create index if not exists IDX_CaseRoleAssignLog_processInstanceId on CaseRoleAssignmentLog(processInstanceId); + + create index if not exists IDX_CaseFileDataLog_caseId on CaseFileDataLog(caseId); + create index if not exists IDX_CaseFileDataLog_itemName on CaseFileDataLog(itemName); diff --git a/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/quartz_tables_h2.sql b/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/quartz_tables_h2.sql index 9bbe2bc52e..1f7c9de3eb 100644 --- a/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/quartz_tables_h2.sql +++ b/jbpm-db-scripts/src/main/resources/db/ddl-scripts/h2/quartz_tables_h2.sql @@ -8,13 +8,13 @@ -- In your Quartz properties file, you'll need to set -- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate -CREATE TABLE QRTZ_CALENDARS ( +CREATE TABLE IF NOT EXISTS QRTZ_CALENDARS ( SCHED_NAME VARCHAR(120) NOT NULL, CALENDAR_NAME VARCHAR (200) NOT NULL , CALENDAR IMAGE NOT NULL ); -CREATE TABLE QRTZ_CRON_TRIGGERS ( +CREATE TABLE IF NOT EXISTS QRTZ_CRON_TRIGGERS ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR (200) NOT NULL , TRIGGER_GROUP VARCHAR (200) NOT NULL , @@ -22,7 +22,7 @@ CREATE TABLE QRTZ_CRON_TRIGGERS ( TIME_ZONE_ID VARCHAR (80) ); -CREATE TABLE QRTZ_FIRED_TRIGGERS ( +CREATE TABLE IF NOT EXISTS QRTZ_FIRED_TRIGGERS ( SCHED_NAME VARCHAR(120) NOT NULL, ENTRY_ID VARCHAR (95) NOT NULL , TRIGGER_NAME VARCHAR (200) NOT NULL , @@ -38,24 +38,24 @@ CREATE TABLE QRTZ_FIRED_TRIGGERS ( REQUESTS_RECOVERY BOOLEAN NULL ); -CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS ( +CREATE TABLE IF NOT EXISTS QRTZ_PAUSED_TRIGGER_GRPS ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_GROUP VARCHAR (200) NOT NULL ); -CREATE TABLE QRTZ_SCHEDULER_STATE ( +CREATE TABLE IF NOT EXISTS QRTZ_SCHEDULER_STATE ( SCHED_NAME VARCHAR(120) NOT NULL, INSTANCE_NAME VARCHAR (200) NOT NULL , LAST_CHECKIN_TIME BIGINT NOT NULL , CHECKIN_INTERVAL BIGINT NOT NULL ); -CREATE TABLE QRTZ_LOCKS ( +CREATE TABLE IF NOT EXISTS QRTZ_LOCKS ( SCHED_NAME VARCHAR(120) NOT NULL, LOCK_NAME VARCHAR (40) NOT NULL ); -CREATE TABLE QRTZ_JOB_DETAILS ( +CREATE TABLE IF NOT EXISTS QRTZ_JOB_DETAILS ( SCHED_NAME VARCHAR(120) NOT NULL, JOB_NAME VARCHAR (200) NOT NULL , JOB_GROUP VARCHAR (200) NOT NULL , @@ -68,7 +68,7 @@ CREATE TABLE QRTZ_JOB_DETAILS ( JOB_DATA IMAGE NULL ); -CREATE TABLE QRTZ_SIMPLE_TRIGGERS ( +CREATE TABLE IF NOT EXISTS QRTZ_SIMPLE_TRIGGERS ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR (200) NOT NULL , TRIGGER_GROUP VARCHAR (200) NOT NULL , @@ -77,7 +77,7 @@ CREATE TABLE QRTZ_SIMPLE_TRIGGERS ( TIMES_TRIGGERED BIGINT NOT NULL ); -CREATE TABLE qrtz_simprop_triggers +CREATE TABLE IF NOT EXISTS qrtz_simprop_triggers ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR(200) NOT NULL, @@ -95,14 +95,14 @@ CREATE TABLE qrtz_simprop_triggers BOOL_PROP_2 BOOLEAN NULL ); -CREATE TABLE QRTZ_BLOB_TRIGGERS ( +CREATE TABLE IF NOT EXISTS QRTZ_BLOB_TRIGGERS ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR (200) NOT NULL , TRIGGER_GROUP VARCHAR (200) NOT NULL , BLOB_DATA IMAGE NULL ); -CREATE TABLE QRTZ_TRIGGERS ( +CREATE TABLE IF NOT EXISTS QRTZ_TRIGGERS ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR (200) NOT NULL , TRIGGER_GROUP VARCHAR (200) NOT NULL , @@ -122,14 +122,14 @@ CREATE TABLE QRTZ_TRIGGERS ( ); ALTER TABLE QRTZ_CALENDARS ADD - CONSTRAINT PK_QRTZ_CALENDARS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_CALENDARS PRIMARY KEY ( SCHED_NAME, CALENDAR_NAME ); ALTER TABLE QRTZ_CRON_TRIGGERS ADD - CONSTRAINT PK_QRTZ_CRON_TRIGGERS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_CRON_TRIGGERS PRIMARY KEY ( SCHED_NAME, TRIGGER_NAME, @@ -137,35 +137,35 @@ ALTER TABLE QRTZ_CRON_TRIGGERS ADD ); ALTER TABLE QRTZ_FIRED_TRIGGERS ADD - CONSTRAINT PK_QRTZ_FIRED_TRIGGERS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_FIRED_TRIGGERS PRIMARY KEY ( SCHED_NAME, ENTRY_ID ); ALTER TABLE QRTZ_PAUSED_TRIGGER_GRPS ADD - CONSTRAINT PK_QRTZ_PAUSED_TRIGGER_GRPS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_PAUSED_TRIGGER_GRPS PRIMARY KEY ( SCHED_NAME, TRIGGER_GROUP ); ALTER TABLE QRTZ_SCHEDULER_STATE ADD - CONSTRAINT PK_QRTZ_SCHEDULER_STATE PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_SCHEDULER_STATE PRIMARY KEY ( SCHED_NAME, INSTANCE_NAME ); ALTER TABLE QRTZ_LOCKS ADD - CONSTRAINT PK_QRTZ_LOCKS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_LOCKS PRIMARY KEY ( SCHED_NAME, LOCK_NAME ); ALTER TABLE QRTZ_JOB_DETAILS ADD - CONSTRAINT PK_QRTZ_JOB_DETAILS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_JOB_DETAILS PRIMARY KEY ( SCHED_NAME, JOB_NAME, @@ -173,7 +173,7 @@ ALTER TABLE QRTZ_JOB_DETAILS ADD ); ALTER TABLE QRTZ_SIMPLE_TRIGGERS ADD - CONSTRAINT PK_QRTZ_SIMPLE_TRIGGERS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_SIMPLE_TRIGGERS PRIMARY KEY ( SCHED_NAME, TRIGGER_NAME, @@ -181,7 +181,7 @@ ALTER TABLE QRTZ_SIMPLE_TRIGGERS ADD ); ALTER TABLE QRTZ_SIMPROP_TRIGGERS ADD - CONSTRAINT PK_QRTZ_SIMPROP_TRIGGERS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_SIMPROP_TRIGGERS PRIMARY KEY ( SCHED_NAME, TRIGGER_NAME, @@ -189,7 +189,7 @@ ALTER TABLE QRTZ_SIMPROP_TRIGGERS ADD ); ALTER TABLE QRTZ_TRIGGERS ADD - CONSTRAINT PK_QRTZ_TRIGGERS PRIMARY KEY + CONSTRAINT IF NOT EXISTS PK_QRTZ_TRIGGERS PRIMARY KEY ( SCHED_NAME, TRIGGER_NAME, @@ -197,7 +197,7 @@ ALTER TABLE QRTZ_TRIGGERS ADD ); ALTER TABLE QRTZ_CRON_TRIGGERS ADD - CONSTRAINT FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY + CONSTRAINT IF NOT EXISTS FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY ( SCHED_NAME, TRIGGER_NAME, @@ -210,7 +210,7 @@ ALTER TABLE QRTZ_CRON_TRIGGERS ADD ALTER TABLE QRTZ_SIMPLE_TRIGGERS ADD - CONSTRAINT FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY + CONSTRAINT IF NOT EXISTS FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY ( SCHED_NAME, TRIGGER_NAME, @@ -222,7 +222,7 @@ ALTER TABLE QRTZ_SIMPLE_TRIGGERS ADD ) ON DELETE CASCADE; ALTER TABLE QRTZ_SIMPROP_TRIGGERS ADD - CONSTRAINT FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY + CONSTRAINT IF NOT EXISTS FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS FOREIGN KEY ( SCHED_NAME, TRIGGER_NAME, @@ -235,7 +235,7 @@ ALTER TABLE QRTZ_SIMPROP_TRIGGERS ADD ALTER TABLE QRTZ_TRIGGERS ADD - CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS FOREIGN KEY + CONSTRAINT IF NOT EXISTS FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS FOREIGN KEY ( SCHED_NAME, JOB_NAME, diff --git a/jbpm-examples/src/main/resources/datasource.properties b/jbpm-examples/src/main/resources/datasource.properties index 23e4ff85a7..d259cd7d74 100644 --- a/jbpm-examples/src/main/resources/datasource.properties +++ b/jbpm-examples/src/main/resources/datasource.properties @@ -3,7 +3,7 @@ driverClassName=org.h2.Driver className=org.h2.jdbcx.JdbcDataSource user=sa password= -url=jdbc:h2:tcp://localhost/~/jbpm-db +url=jdbc:h2:tcp://localhost/~/jbpm-db;MODE=LEGACY;NON_KEYWORDS=VALUE datasourceName=jdbc/jbpm-ds # for configuring persistence of the session diff --git a/jbpm-services/jbpm-executor/src/test/java/org/jbpm/executor/DBUnavilabilityExecutorTest.java b/jbpm-services/jbpm-executor/src/test/java/org/jbpm/executor/DBUnavilabilityExecutorTest.java index 1ba0c5f58a..8d3c3ba1c4 100644 --- a/jbpm-services/jbpm-executor/src/test/java/org/jbpm/executor/DBUnavilabilityExecutorTest.java +++ b/jbpm-services/jbpm-executor/src/test/java/org/jbpm/executor/DBUnavilabilityExecutorTest.java @@ -58,7 +58,7 @@ public class DBUnavilabilityExecutorTest{ @BeforeClass public static void createDBServer() { dsProps = ExecutorTestUtil.getDatasourceProperties(); - dsProps.setProperty("url", "jdbc:h2:tcp://localhost:9123/target/./jbpm-exec-test;MVCC=TRUE"); + dsProps.setProperty("url", "jdbc:h2:tcp://localhost:9123/./target/jbpm-exec-test;MODE=LEGACY;NON_KEYWORDS=VALUE"); dsProps.setProperty("tcpPort", "9123"); PersistenceUtil.startH2TcpServer(dsProps); } diff --git a/jbpm-services/jbpm-executor/src/test/java/org/jbpm/executor/ExtendedExecutorTest.java b/jbpm-services/jbpm-executor/src/test/java/org/jbpm/executor/ExtendedExecutorTest.java index 43cf63bd0e..9db7f48472 100644 --- a/jbpm-services/jbpm-executor/src/test/java/org/jbpm/executor/ExtendedExecutorTest.java +++ b/jbpm-services/jbpm-executor/src/test/java/org/jbpm/executor/ExtendedExecutorTest.java @@ -66,7 +66,7 @@ public static void createDBServer() { System.setProperty("org.kie.executor.setDefaultOwner", "true"); System.setProperty("org.kie.executor.olderThan", "2"); dsProps = ExecutorTestUtil.getDatasourceProperties(); - dsProps.setProperty("url", "jdbc:h2:tcp://localhost:9123/target/./jbpm-exec-test;MVCC=TRUE"); + dsProps.setProperty("url", "jdbc:h2:tcp://localhost:9123/./target/jbpm-exec-test;MODE=LEGACY;NON_KEYWORDS=VALUE"); dsProps.setProperty("tcpPort", "9123"); PersistenceUtil.startH2TcpServer(dsProps); IdProvider.reset(); diff --git a/jbpm-services/jbpm-services-cdi/src/test/java/org/jbpm/services/cdi/test/util/ArquillianTestWrapperExtension.java b/jbpm-services/jbpm-services-cdi/src/test/java/org/jbpm/services/cdi/test/util/ArquillianTestWrapperExtension.java index 63885244c6..8e33d4a679 100644 --- a/jbpm-services/jbpm-services-cdi/src/test/java/org/jbpm/services/cdi/test/util/ArquillianTestWrapperExtension.java +++ b/jbpm-services/jbpm-services-cdi/src/test/java/org/jbpm/services/cdi/test/util/ArquillianTestWrapperExtension.java @@ -41,7 +41,7 @@ public void init(@Observes BeforeSuite event, ContainerRegistry registry) { Properties driverProperties = new Properties(); driverProperties.put("user", "sa"); driverProperties.put("password", "sasa"); - driverProperties.put("url", "jdbc:h2:mem:mydb"); + driverProperties.put("url", "jdbc:h2:mem:mydb;MODE=LEGACY;NON_KEYWORDS=VALUE"); driverProperties.put("driverClassName", "org.h2.Driver"); driverProperties.put("className", "org.h2.jdbcx.JdbcDataSource"); diff --git a/jbpm-test-coverage/src/test/filtered-resources/quartz-db-short-misfire.properties b/jbpm-test-coverage/src/test/filtered-resources/quartz-db-short-misfire.properties index 349948b695..c3d130f007 100644 --- a/jbpm-test-coverage/src/test/filtered-resources/quartz-db-short-misfire.properties +++ b/jbpm-test-coverage/src/test/filtered-resources/quartz-db-short-misfire.properties @@ -56,7 +56,7 @@ org.quartz.jobStore.lockOnInsert=false org.quartz.dataSource.myDS.jndiURL=jdbc/jbpm-ds #this notManagedDS should be same as one defined in TimerBaseTest class #org.quartz.dataSource.notManagedDS.driver=org.h2.Driver -#org.quartz.dataSource.notManagedDS.URL=jdbc:h2:mem:test;MVCC=true +#org.quartz.dataSource.notManagedDS.URL=jdbc:h2:mem:test;MODE=LEGACY;NON_KEYWORDS=VALUE #org.quartz.dataSource.notManagedDS.user=sa #org.quartz.dataSource.notManagedDS.password= #org.quartz.dataSource.notManagedDS.maxConnections=5 diff --git a/jbpm-test-coverage/src/test/filtered-resources/quartz-db.properties b/jbpm-test-coverage/src/test/filtered-resources/quartz-db.properties index 635af4c462..8f992a275b 100644 --- a/jbpm-test-coverage/src/test/filtered-resources/quartz-db.properties +++ b/jbpm-test-coverage/src/test/filtered-resources/quartz-db.properties @@ -56,7 +56,7 @@ org.quartz.jobStore.lockOnInsert=false org.quartz.dataSource.myDS.jndiURL=jdbc/jbpm-ds #this notManagedDS should be same as one defined in TimerBaseTest class #org.quartz.dataSource.notManagedDS.driver=org.h2.Driver -#org.quartz.dataSource.notManagedDS.URL=jdbc:h2:mem:test;MVCC=true +#org.quartz.dataSource.notManagedDS.URL=jdbc:h2:mem:test;MODE=LEGACY;NON_KEYWORDS=VALUE #org.quartz.dataSource.notManagedDS.user=sa #org.quartz.dataSource.notManagedDS.password= #org.quartz.dataSource.notManagedDS.maxConnections=5 diff --git a/jbpm-test-util/src/main/java/org/jbpm/test/persistence/scripts/JbpmDialectResolver.java b/jbpm-test-util/src/main/java/org/jbpm/test/persistence/scripts/JbpmDialectResolver.java index 7c92cb8b99..524b195870 100644 --- a/jbpm-test-util/src/main/java/org/jbpm/test/persistence/scripts/JbpmDialectResolver.java +++ b/jbpm-test-util/src/main/java/org/jbpm/test/persistence/scripts/JbpmDialectResolver.java @@ -34,7 +34,8 @@ public Dialect resolveDialect(DialectResolutionInfo info){ if ("Adaptive Server Enterprise".equals(info.getDatabaseName())) { return new SybaseJbpmDialect(); } else { - d = StandardDialectResolver.INSTANCE.resolveDialect(info); + DialectResolver dialectResolver = new StandardDialectResolver(); + d = dialectResolver.resolveDialect(info); } logger.info("resolveDialect: {}", d); return d; diff --git a/jbpm-test-util/src/main/java/org/jbpm/test/persistence/util/PersistenceUtil.java b/jbpm-test-util/src/main/java/org/jbpm/test/persistence/util/PersistenceUtil.java index 517ea150a5..13cd82af1d 100644 --- a/jbpm-test-util/src/main/java/org/jbpm/test/persistence/util/PersistenceUtil.java +++ b/jbpm-test-util/src/main/java/org/jbpm/test/persistence/util/PersistenceUtil.java @@ -213,7 +213,7 @@ private static Properties getDefaultProperties() { DRIVER_CLASS_NAME, DATASOURCE_CLASS_NAME, MAX_POOL_SIZE, ALLOW_LOCAL_TXS }; String[] defaultPropArr = { - "", "", "", "jdbc:h2:mem:jbpm-db;MVCC=true", + "", "", "", "jdbc:h2:mem:jbpm-db;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE;NON_KEYWORDS=VALUE", "sa", "", "org.h2.Driver", "org.h2.jdbcx.JdbcDataSource", "16", "true" }; @@ -294,7 +294,7 @@ public synchronized void start(String port) { if (realH2Server == null || !realH2Server.isRunning(false)) { try { DeleteDbFiles.execute("", null, true); - realH2Server = Server.createTcpServer((port != null && !port.isEmpty()) ? new String[]{"-tcpPort", port} : new String[0]); + realH2Server = Server.createTcpServer((port != null && !port.isEmpty()) ? new String[]{"-tcpPort", port, "-ifNotExists"} : new String[]{"-ifNotExists"}); realH2Server.start(); } catch (SQLException e) { throw new RuntimeException("can't start h2 server db", e); diff --git a/jbpm-test/src/test/java/org/jbpm/test/ProcessKModuleMain.java b/jbpm-test/src/test/java/org/jbpm/test/ProcessKModuleMain.java index ca78e9b2a4..06784b1f2b 100644 --- a/jbpm-test/src/test/java/org/jbpm/test/ProcessKModuleMain.java +++ b/jbpm-test/src/test/java/org/jbpm/test/ProcessKModuleMain.java @@ -74,7 +74,7 @@ private static RuntimeManager createRuntimeManager() { properties.put("className", "org.h2.jdbcx.JdbcDataSource"); properties.put("user", "sa"); properties.put("password", ""); - properties.put("url", "jdbc:h2:tcp://localhost/~/jbpm-db"); + properties.put("url", "jdbc:h2:tcp://localhost/~/jbpm-db;MODE=LEGACY;NON_KEYWORDS=VALUE"); properties.put("datasourceName", "jdbc/jbpm-ds"); PersistenceUtil.setupPoolingDataSource(properties); Map map = new HashMap(); @@ -108,4 +108,4 @@ public boolean accept(File dir, String name) { } } -} \ No newline at end of file +} diff --git a/jbpm-test/src/test/java/org/jbpm/test/ProcessMain.java b/jbpm-test/src/test/java/org/jbpm/test/ProcessMain.java index 344dd2947a..8358268394 100644 --- a/jbpm-test/src/test/java/org/jbpm/test/ProcessMain.java +++ b/jbpm-test/src/test/java/org/jbpm/test/ProcessMain.java @@ -75,7 +75,7 @@ public static StatefulKnowledgeSession newStatefulKnowledgeSession(KieBase kbase properties.put("className", "org.h2.jdbcx.JdbcDataSource"); properties.put("user", "sa"); properties.put("password", ""); - properties.put("url", "jdbc:h2:tcp://localhost/~/jbpm-db"); + properties.put("url", "jdbc:h2:tcp://localhost/~/jbpm-db;MODE=LEGACY;NON_KEYWORDS=VALUE"); properties.put("datasourceName", "jdbc/jbpm-ds"); PersistenceUtil.setupPoolingDataSource(properties); Map map = new HashMap(); diff --git a/jbpm-xes/README.md b/jbpm-xes/README.md index 09cf795b2f..53407f47d1 100644 --- a/jbpm-xes/README.md +++ b/jbpm-xes/README.md @@ -202,7 +202,7 @@ usage: xes -driver [-file ] [-logtype ] ### Example using a local H2 database file ``` -java -jar target/jbpm-xes-1.0.0-SNAPSHOT-jar-with-dependencies.jar -driver org.h2.Driver -user sa -password sa -url jdbc:h2:file:./spring-boot-jbpm -process evaluation -file jbpm.xes +java -jar target/jbpm-xes-1.0.0-SNAPSHOT-jar-with-dependencies.jar -driver org.h2.Driver -user sa -password sa -url jdbc:h2:file:./spring-boot-jbpm;MODE=LEGACY;NON_KEYWORDS=VALUE -process evaluation -file jbpm.xes ``` ### Example using MySQL database @@ -213,4 +213,4 @@ java -jar target/jbpm-xes-1.0.0-SNAPSHOT-jar-with-dependencies.jar -driver com.m ## Feedback -Feel free to open issues if you face any problems using this tool, we would love to help you in your process mining journey! \ No newline at end of file +Feel free to open issues if you face any problems using this tool, we would love to help you in your process mining journey! diff --git a/jbpm-xes/pom.xml b/jbpm-xes/pom.xml index 2b703db946..0c305788eb 100644 --- a/jbpm-xes/pom.xml +++ b/jbpm-xes/pom.xml @@ -30,7 +30,6 @@ 1.4 - 1.4.193 diff --git a/jbpm-xes/src/test/java/org/jbpm/xes/EvaluationExport.java b/jbpm-xes/src/test/java/org/jbpm/xes/EvaluationExport.java index 019e4222ec..8d0db0b5f9 100644 --- a/jbpm-xes/src/test/java/org/jbpm/xes/EvaluationExport.java +++ b/jbpm-xes/src/test/java/org/jbpm/xes/EvaluationExport.java @@ -54,7 +54,7 @@ public static BasicDataSource setupDataSource(String connectURI) { @Before public void setup() { - xesDataSource = setupDataSource("jdbc:h2:mem:jbpm-db;MVCC=true"); + xesDataSource = setupDataSource("jdbc:h2:mem:jbpm-db;MODE=LEGACY;NON_KEYWORDS=VALUE"); } @After diff --git a/pom.xml b/pom.xml index 740b312ff3..c3f7070a0a 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,9 @@ sa sasa - jdbc:h2:mem:jbpm-db;MVCC=true + + + jdbc:h2:mem:jbpm-db;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE;NON_KEYWORDS=VALUE PUBLIC true