diff --git a/jbpm-audit/pom.xml b/jbpm-audit/pom.xml index 09878e3b16..ae28ab0a68 100644 --- a/jbpm-audit/pom.xml +++ b/jbpm-audit/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-audit diff --git a/jbpm-audit/src/main/java/org/jbpm/process/audit/event/DefaultAuditEventBuilderImpl.java b/jbpm-audit/src/main/java/org/jbpm/process/audit/event/DefaultAuditEventBuilderImpl.java index ab1b75eb2d..107ac72de3 100644 --- a/jbpm-audit/src/main/java/org/jbpm/process/audit/event/DefaultAuditEventBuilderImpl.java +++ b/jbpm-audit/src/main/java/org/jbpm/process/audit/event/DefaultAuditEventBuilderImpl.java @@ -86,6 +86,7 @@ public AuditEvent buildEvent(ProcessCompletedEvent pce, Object log) { logEvent.setDuration(logEvent.getEnd().getTime() - logEvent.getStart().getTime()); logEvent.setProcessInstanceDescription( pi.getDescription() ); logEvent.setSlaCompliance(pi.getSlaCompliance()); + logEvent.setSlaDueDate(pi.getSlaDueDate()); return logEvent; } diff --git a/jbpm-bpmn2-emfextmodel/pom.xml b/jbpm-bpmn2-emfextmodel/pom.xml index 859c7b409a..990dec247a 100644 --- a/jbpm-bpmn2-emfextmodel/pom.xml +++ b/jbpm-bpmn2-emfextmodel/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-bpmn2-emfextmodel diff --git a/jbpm-bpmn2/pom.xml b/jbpm-bpmn2/pom.xml index 251f282537..f4a5677783 100644 --- a/jbpm-bpmn2/pom.xml +++ b/jbpm-bpmn2/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-bpmn2 diff --git a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java index c493cfbe5a..9eba57b2f3 100644 --- a/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java +++ b/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java @@ -16,6 +16,7 @@ package org.jbpm.bpmn2; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; @@ -31,11 +32,17 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import org.drools.core.command.SingleSessionCommandService; +import org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession; +import org.drools.core.impl.StatefulKnowledgeSessionImpl; import org.jbpm.bpmn2.objects.TestWorkItemHandler; import org.jbpm.process.audit.NodeInstanceLog; import org.jbpm.process.audit.ProcessInstanceLog; +import org.jbpm.process.instance.InternalProcessRuntime; import org.jbpm.process.instance.command.UpdateTimerCommand; import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler; +import org.jbpm.process.instance.timer.TimerInstance; +import org.jbpm.process.instance.timer.TimerManager; import org.jbpm.workflow.instance.node.HumanTaskNodeInstance; import org.junit.After; import org.junit.BeforeClass; @@ -126,6 +133,49 @@ public void afterSLAViolated(SLAViolatedEvent event) { ksession.dispose(); } + @Test + public void testSLAonProcessUpdated() throws Exception { + CountDownLatch latch = new CountDownLatch(1); + KieBase kbase = createKnowledgeBase("BPMN2-UserTaskWithSLA.bpmn2"); + KieSession ksession = createKnowledgeSession(kbase); + + ProcessInstance processInstance = ksession.startProcess("UserTask"); + assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE); + + Date firstSlaDueDate = getSLADueDateForProcessInstance(processInstance.getId(), + (org.jbpm.workflow.instance.WorkflowProcessInstance) processInstance); + + Collection timers = getTimerManager(ksession).getTimers(); + assertThat(timers.size()).isEqualTo(1); + + ksession.execute(new UpdateTimerCommand(processInstance.getId(), timers.iterator().next().getId(), 7)); + + boolean slaViolated = latch.await(5, TimeUnit.SECONDS); + assertFalse("Process SLA was violated while it is not expected after update SLA", slaViolated); + + processInstance = ksession.getProcessInstance(processInstance.getId()); + assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE); + + int slaCompliance = getSLAComplianceForProcessInstance(processInstance); + assertEquals(ProcessInstance.SLA_PENDING, slaCompliance); + + slaViolated = latch.await(5, TimeUnit.SECONDS); + assertFalse("Process SLA was not violated while it is expected after 10s", slaViolated); + + slaCompliance = getSLAComplianceForProcessInstance(processInstance); + assertEquals(ProcessInstance.SLA_VIOLATED, slaCompliance); + + ksession.abortProcessInstance(processInstance.getId()); + Date updatedSlaDueDate = getSLADueDateForProcessInstance(processInstance.getId(), + (org.jbpm.workflow.instance.WorkflowProcessInstance) processInstance); + + assertTrue(String.format("updatedSlaDueDate '%tc' should be around 4-5 seconds after firstSlaDueDate '%tc'", + updatedSlaDueDate, firstSlaDueDate), + updatedSlaDueDate.after(firstSlaDueDate)); + + ksession.dispose(); + } + @Test public void testSLAonProcessMet() throws Exception { KieBase kbase = createKnowledgeBase("BPMN2-UserTaskWithSLA.bpmn2"); @@ -306,7 +356,7 @@ class TimerIdListener extends DefaultProcessEventListener { public TimerIdListener(CountDownLatch latch) { this.latch = latch; } - + @Override public void afterNodeTriggered(ProcessNodeTriggeredEvent event) { if (event.getNodeInstance() instanceof HumanTaskNodeInstance) { @@ -664,4 +714,31 @@ private Date getSLADueDateForNodeInstance(long processInstanceId, org.jbpm.workf throw new RuntimeException("NodeInstanceLog not found for id "+nodeInstance.getId()+" and type "+logType); } + + private Date getSLADueDateForProcessInstance(long processInstanceId, org.jbpm.workflow.instance.WorkflowProcessInstance processInstance) { + if (!sessionPersistence) { + return processInstance.getSlaDueDate(); + } + + List logs = logService.findProcessInstances(); + if (logs == null) + throw new RuntimeException("ProcessInstanceLog not found"); + + for (ProcessInstanceLog log : logs) { + if (log.getId() == processInstanceId) { + return log.getSlaDueDate(); + } + } + + throw new RuntimeException("ProcessInstanceLog not found for id "+processInstanceId); + } + + private TimerManager getTimerManager(KieSession ksession) { + KieSession internal = ksession; + if (ksession instanceof CommandBasedStatefulKnowledgeSession) { + internal = ( (SingleSessionCommandService) ( (CommandBasedStatefulKnowledgeSession) ksession ).getRunner() ).getKieSession();; + } + + return ((InternalProcessRuntime)((StatefulKnowledgeSessionImpl)internal).getProcessRuntime()).getTimerManager(); + } } \ No newline at end of file diff --git a/jbpm-case-mgmt/jbpm-case-mgmt-api/pom.xml b/jbpm-case-mgmt/jbpm-case-mgmt-api/pom.xml index a7bd0a06e1..2814429666 100644 --- a/jbpm-case-mgmt/jbpm-case-mgmt-api/pom.xml +++ b/jbpm-case-mgmt/jbpm-case-mgmt-api/pom.xml @@ -4,7 +4,7 @@ org.jbpm jbpm-case-mgmt - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-case-mgmt-api diff --git a/jbpm-case-mgmt/jbpm-case-mgmt-cmmn/pom.xml b/jbpm-case-mgmt/jbpm-case-mgmt-cmmn/pom.xml index 64e2930488..637ad5f133 100644 --- a/jbpm-case-mgmt/jbpm-case-mgmt-cmmn/pom.xml +++ b/jbpm-case-mgmt/jbpm-case-mgmt-cmmn/pom.xml @@ -3,7 +3,7 @@ org.jbpm jbpm-case-mgmt - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-case-mgmt-cmmn diff --git a/jbpm-case-mgmt/jbpm-case-mgmt-impl/pom.xml b/jbpm-case-mgmt/jbpm-case-mgmt-impl/pom.xml index da75f8ff76..2cae13d59c 100644 --- a/jbpm-case-mgmt/jbpm-case-mgmt-impl/pom.xml +++ b/jbpm-case-mgmt/jbpm-case-mgmt-impl/pom.xml @@ -4,7 +4,7 @@ org.jbpm jbpm-case-mgmt - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-case-mgmt-impl jBPM :: Case Management Impl diff --git a/jbpm-case-mgmt/pom.xml b/jbpm-case-mgmt/pom.xml index 24d7fc410e..80fc3ea107 100644 --- a/jbpm-case-mgmt/pom.xml +++ b/jbpm-case-mgmt/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-case-mgmt diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/hibernate-core/pom.xml b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/hibernate-core/pom.xml index 409811e1be..c17b8ce3ee 100644 --- a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/hibernate-core/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/hibernate-core/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-container-integration-deps - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT idep-hibernate-core diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm-ejb-services/pom.xml b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm-ejb-services/pom.xml index a088843f87..eaa1710269 100644 --- a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm-ejb-services/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm-ejb-services/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-container-integration-deps - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT idep-jbpm-ejb-services diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm-persistence/pom.xml b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm-persistence/pom.xml index f760d149ad..35589a8a34 100644 --- a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm-persistence/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm-persistence/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-container-integration-deps - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT idep-jbpm-persistence diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm/pom.xml b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm/pom.xml index 5114011e28..8df57bdaba 100644 --- a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/jbpm/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-container-integration-deps - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT idep-jbpm diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/pom.xml b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/pom.xml index 82b5b4ae6b..61beeb1b17 100644 --- a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-in-container-test - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-container-integration-deps diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/rest/pom.xml b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/rest/pom.xml index 0662bfe30d..90dbd67e57 100644 --- a/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/rest/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-integration-deps/rest/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-container-integration-deps - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT idep-rest diff --git a/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/pom.xml b/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/pom.xml index 407ef1f914..66a1131fa2 100644 --- a/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/jbpm-container-test-suite/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-in-container-test - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-container-test-suite diff --git a/jbpm-container-test/jbpm-in-container-test/pom.xml b/jbpm-container-test/jbpm-in-container-test/pom.xml index 417d2733e4..f9ecfa199a 100644 --- a/jbpm-container-test/jbpm-in-container-test/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-container-test - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-in-container-test diff --git a/jbpm-container-test/jbpm-in-container-test/shrinkwrap-war-profiles/pom.xml b/jbpm-container-test/jbpm-in-container-test/shrinkwrap-war-profiles/pom.xml index 27078a8b6c..6370d1fdab 100644 --- a/jbpm-container-test/jbpm-in-container-test/shrinkwrap-war-profiles/pom.xml +++ b/jbpm-container-test/jbpm-in-container-test/shrinkwrap-war-profiles/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-in-container-test - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT shrinkwrap-war-profiles diff --git a/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-app/pom.xml b/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-app/pom.xml index 31857e1926..96e73ea218 100644 --- a/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-app/pom.xml +++ b/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-app/pom.xml @@ -6,7 +6,7 @@ jbpm-remote-ejb-test org.jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-remote-ejb-test-app diff --git a/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-domain/pom.xml b/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-domain/pom.xml index 220a7bc313..7b3b119fc2 100644 --- a/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-domain/pom.xml +++ b/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-domain/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-remote-ejb-test - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-remote-ejb-test-domain diff --git a/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-suite/pom.xml b/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-suite/pom.xml index 60f7b20ff8..224bc32f1d 100644 --- a/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-suite/pom.xml +++ b/jbpm-container-test/jbpm-remote-ejb-test/jbpm-remote-ejb-test-suite/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-remote-ejb-test - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-remote-ejb-test-suite diff --git a/jbpm-container-test/jbpm-remote-ejb-test/pom.xml b/jbpm-container-test/jbpm-remote-ejb-test/pom.xml index f35ac00f99..3b22279fa3 100644 --- a/jbpm-container-test/jbpm-remote-ejb-test/pom.xml +++ b/jbpm-container-test/jbpm-remote-ejb-test/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-container-test - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-remote-ejb-test diff --git a/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/pom.xml b/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/pom.xml index 21f9f7d3f5..7524d411d5 100644 --- a/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/pom.xml +++ b/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/pom.xml @@ -7,7 +7,7 @@ jbpm-remote-ejb-test org.jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT test-kjar-parent diff --git a/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-bpmn-build/pom.xml b/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-bpmn-build/pom.xml index 43a17865db..fa4d85ee10 100644 --- a/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-bpmn-build/pom.xml +++ b/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-bpmn-build/pom.xml @@ -5,7 +5,7 @@ test-kjar-parent org.jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT test-kjar-bpmn-build diff --git a/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-evaluation/pom.xml b/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-evaluation/pom.xml index bae23658a5..fb1f2b92fd 100644 --- a/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-evaluation/pom.xml +++ b/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-evaluation/pom.xml @@ -6,7 +6,7 @@ test-kjar-parent org.jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT test-kjar-evaluation diff --git a/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-integration/pom.xml b/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-integration/pom.xml index 21ce4c6378..6d72fab913 100644 --- a/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-integration/pom.xml +++ b/jbpm-container-test/jbpm-remote-ejb-test/test-kjar-parent/test-kjar-integration/pom.xml @@ -5,7 +5,7 @@ test-kjar-parent org.jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT 4.0.0 diff --git a/jbpm-container-test/pom.xml b/jbpm-container-test/pom.xml index 0f762fa844..b00b84e0a5 100644 --- a/jbpm-container-test/pom.xml +++ b/jbpm-container-test/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-container-test diff --git a/jbpm-db-scripts/pom.xml b/jbpm-db-scripts/pom.xml index f392aa49f7..6d964a426c 100644 --- a/jbpm-db-scripts/pom.xml +++ b/jbpm-db-scripts/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-db-scripts diff --git a/jbpm-distribution/pom.xml b/jbpm-distribution/pom.xml index 589845ffdf..40add86441 100644 --- a/jbpm-distribution/pom.xml +++ b/jbpm-distribution/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-distribution diff --git a/jbpm-document/pom.xml b/jbpm-document/pom.xml index e69e77849c..9c185c2fb7 100644 --- a/jbpm-document/pom.xml +++ b/jbpm-document/pom.xml @@ -5,7 +5,7 @@ jbpm org.jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-document diff --git a/jbpm-event-emitters/jbpm-event-emitters-elasticsearch/pom.xml b/jbpm-event-emitters/jbpm-event-emitters-elasticsearch/pom.xml index 5a58ae7ebc..e3cb05ac28 100644 --- a/jbpm-event-emitters/jbpm-event-emitters-elasticsearch/pom.xml +++ b/jbpm-event-emitters/jbpm-event-emitters-elasticsearch/pom.xml @@ -5,7 +5,7 @@ org.jbpm jbpm-event-emitters - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-event-emitters-elasticsearch jBPM :: Event Emitters :: ElasticSearch diff --git a/jbpm-event-emitters/jbpm-event-emitters-kafka/pom.xml b/jbpm-event-emitters/jbpm-event-emitters-kafka/pom.xml index 4faebb2f6d..23bec74a96 100644 --- a/jbpm-event-emitters/jbpm-event-emitters-kafka/pom.xml +++ b/jbpm-event-emitters/jbpm-event-emitters-kafka/pom.xml @@ -5,7 +5,7 @@ org.jbpm jbpm-event-emitters - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-event-emitters-kafka jBPM :: Event Emitters :: Kafka diff --git a/jbpm-event-emitters/pom.xml b/jbpm-event-emitters/pom.xml index 64db6f28d2..e2e125d2d0 100644 --- a/jbpm-event-emitters/pom.xml +++ b/jbpm-event-emitters/pom.xml @@ -3,7 +3,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-event-emitters pom diff --git a/jbpm-examples/pom.xml b/jbpm-examples/pom.xml index c5ae4818fd..21a36b9b7c 100644 --- a/jbpm-examples/pom.xml +++ b/jbpm-examples/pom.xml @@ -5,7 +5,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-examples diff --git a/jbpm-flow-builder/pom.xml b/jbpm-flow-builder/pom.xml index e69b4397e4..ad65c34627 100644 --- a/jbpm-flow-builder/pom.xml +++ b/jbpm-flow-builder/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-flow-builder diff --git a/jbpm-flow/pom.xml b/jbpm-flow/pom.xml index 4f13fb0d80..35fbd8613e 100644 --- a/jbpm-flow/pom.xml +++ b/jbpm-flow/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-flow @@ -106,6 +106,11 @@ org.drools drools-core + + org.jpmml + pmml-model + true + org.drools drools-mvel diff --git a/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/VariableScope.java b/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/VariableScope.java index 4f22535b5a..4619da58c9 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/VariableScope.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/core/context/variable/VariableScope.java @@ -102,18 +102,13 @@ public Object validateVariable(String processName, String name, Object value) { } } else if (value != null) { DataType type = var.getType(); - ObjectDataType obj = new ObjectDataType(); boolean isRightType = type == null || type.verifyDataType(value); if (!isRightType ) { if (variableStrictEnabled) { throw new IllegalArgumentException("Variable '" + name + "' has incorrect data type expected:" + var .getType().getStringType() + " actual:" + value.getClass().getName()); } else if (value instanceof String) { - if (type.getClass() == obj.getClass()) { - value = type.readValue(value.toString()); - } else { - value = type.valueOf(value.toString()); - } + value = type.valueOf(value.toString()); } } } diff --git a/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/ObjectDataType.java b/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/ObjectDataType.java index f94b9a335f..11f7c85f63 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/ObjectDataType.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/core/datatype/impl/type/ObjectDataType.java @@ -19,16 +19,24 @@ import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZonedDateTime; +import java.util.Arrays; +import java.util.Collection; import java.util.Date; import java.util.Map; +import java.util.Optional; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.security.ExplicitTypePermission; import org.drools.reflective.classloader.ProjectClassLoader; import org.jbpm.process.core.datatype.DataType; +import org.slf4j.LoggerFactory; +import org.slf4j.Logger; import static org.kie.soup.xstream.XStreamUtils.createTrustingXStream; @@ -37,6 +45,7 @@ */ public class ObjectDataType implements DataType { + private static final Logger logger = LoggerFactory.getLogger(ObjectDataType.class); private static final long serialVersionUID = 510l; private String className; @@ -79,55 +88,83 @@ public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(className); } - public boolean verifyDataType(final Object value) { - if (value == null || className == null) { - return true; - } + private static final Collection prefixes = Arrays.asList("java.lang", "java.util", "java.time"); + + private Optional> getClass(Object value) { try { - Class clazz = Class.forName(className, true, value.getClass().getClassLoader()); - if (clazz.isInstance(value) || isValidDate(value)) { - return true; - } + return Optional.of(Class.forName(className, true, value.getClass().getClassLoader())); } catch (ClassNotFoundException e) { - // check class again + logger.info("Error {} loading class {}", e, className); } - // try to expand fundamental classes if it's not a FQCN - if(!className.contains(".")) { - try { - className = "java.lang."+className; - Class clazz = Class.forName(className, true, value.getClass().getClassLoader()); - if (clazz.isInstance(value)) { - return true; + if (!className.contains(".")) { + for (String prefix : prefixes) { + String altName = prefix + "." + className; + try { + return Optional.of(Class.forName(altName, true, classLoader)); + } catch (ClassNotFoundException e) { + logger.debug("Error {} loading class {}", e, altName); } - } catch (ClassNotFoundException e) { - return false; } } - return false; + return Optional.empty(); } - private boolean isValidDate(Object value) { - boolean parseable = false; - try{ - parseable = LocalDate.parse((String)value)!=null; - } catch(Exception e) { - // ignore parse exception + public boolean verifyDataType(final Object value) { + if (value == null || className == null) { + return true; } - try{ - parseable = LocalDateTime.parse((String)value)!=null; - } catch(Exception e) { - // ignore parse exception + return getClass(value).map(c -> c.isInstance(value)).orElse(false); + } + + private Optional getObjectFromClass(final Object value) { + Optional> clazz = getClass(value); + if (clazz.isPresent()) { + Class objectClass = clazz.get(); + if (objectClass.isInstance(value)) { + return Optional.of(value); + } + if (Date.class.isAssignableFrom(objectClass)) { + return Optional.of(parseDate(value.toString())); + } else if (LocalDate.class.isAssignableFrom(objectClass)) { + return Optional.of(LocalDate.parse((value.toString()))); + } else if (LocalDateTime.class.isAssignableFrom(objectClass)) { + return Optional.of(LocalDateTime.parse((value.toString()))); + } else if (ZonedDateTime.class.isAssignableFrom(objectClass)) { + return Optional.of(ZonedDateTime.parse((value.toString()))); + } } - try{ - parseable = ZonedDateTime.parse((String)value)!=null; - } catch(Exception e) { - // ignore parse exception + return Optional.empty(); + } + + private static Collection dateFormats = Arrays.asList(new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"), + new SimpleDateFormat("yyyy-MM-dd"), new SimpleDateFormat("HH:mm:ss"), DateFormat.getDateInstance(), + DateFormat.getTimeInstance(), + DateFormat.getDateTimeInstance()); + + private Date parseDate(String toBeParsed) { + StringBuilder sb = new StringBuilder(); + for (DateFormat dateFormat : dateFormats) { + try { + return dateFormat.parse(toBeParsed); + } catch (ParseException ex) { + sb.append(ex.getMessage()).append(System.lineSeparator()); + } } - return parseable; + throw new IllegalArgumentException(sb.toString()); } + @Override public Object readValue(String value) { - return getXStream().fromXML(value); + return value != null ? getObjectFromClass(value).orElseGet(() -> getXStream().fromXML(value)) : null; + } + + @Override + public Object valueOf(String value) { + try { + return value != null ? getObjectFromClass(value).orElse(value) : null; + } catch (IllegalArgumentException e) { + return value; + } } public String writeValue(Object value) { diff --git a/jbpm-flow/src/main/java/org/jbpm/process/instance/AbstractProcessInstanceFactory.java b/jbpm-flow/src/main/java/org/jbpm/process/instance/AbstractProcessInstanceFactory.java index 544c5fd1fe..e0bc28c823 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/instance/AbstractProcessInstanceFactory.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/instance/AbstractProcessInstanceFactory.java @@ -64,7 +64,7 @@ public ProcessInstance createProcessInstance(Process process, CorrelationKey cor throw new IllegalArgumentException( "This process does not support parameters!" ); } } - variableScopeInstance.setDefaultValue(process,variableScope,variableScopeInstance); + variableScopeInstance.setDefaultValues(variableScope, variableScopeInstance); variableScopeInstance.enforceRequiredVariables(); return processInstance; diff --git a/jbpm-flow/src/main/java/org/jbpm/process/instance/command/UpdateTimerCommand.java b/jbpm-flow/src/main/java/org/jbpm/process/instance/command/UpdateTimerCommand.java index d98a9037b0..4b61a9391b 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/instance/command/UpdateTimerCommand.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/instance/command/UpdateTimerCommand.java @@ -109,6 +109,17 @@ public UpdateTimerCommand(long processInstanceId, long timerId, long delay, long this.repeatLimit = repeatLimit; } + private TimerInstance handleSla(long slaTimerId, TimerManager tm, RuleFlowProcessInstance wfp) { + if (slaTimerId != -1 && slaTimerId == timerId) { + TimerInstance newTimer = rescheduleTimer(tm.getTimerMap().get(timerId), tm); + logger.debug("New SLA timer {} about to be registered", newTimer); + tm.registerTimer(newTimer, wfp); + logger.debug("New SLA timer {} successfully registered", newTimer); + return newTimer; + } + return null; + } + @Override public Void execute(Context context ) { logger.debug("About to cancel timer in process instance {} by name '{}' or id {}", processInstanceId, timerName, timerId); @@ -119,32 +130,30 @@ public Void execute(Context context ) { if (wfp == null) { throw new IllegalArgumentException("Process instance with id " + processInstanceId + " not found"); } + + TimerInstance newTimer = handleSla(wfp.getSlaTimerId(), tm, wfp); + if (newTimer != null) { + wfp.internalSetSlaTimerId(newTimer.getId()); + wfp.internalSetSlaDueDate(new Date(System.currentTimeMillis() + newTimer.getDelay())); + return null; + } + for (NodeInstance nodeInstance : wfp.getNodeInstances(true)) { - long slaTimerId = ((NodeInstanceImpl) nodeInstance).getSlaTimerId(); - if (slaTimerId != -1 && slaTimerId == timerId) { - TimerInstance timer = tm.getTimerMap().get(timerId); - - TimerInstance newTimer = rescheduleTimer(timer, tm); - logger.debug("New SLA timer {} about to be registered", newTimer); - tm.registerTimer(newTimer, wfp); - + newTimer = handleSla(((NodeInstanceImpl) nodeInstance).getSlaTimerId(), tm, wfp); + if (newTimer != null) { ((NodeInstanceImpl) nodeInstance).internalSetSlaTimerId(newTimer.getId()); ((NodeInstanceImpl) nodeInstance).internalSetSlaDueDate(new Date(System.currentTimeMillis() + newTimer.getDelay())); - logger.debug("New SLA timer {} successfully registered", newTimer); break; } - if (nodeInstance instanceof TimerNodeInstance) { TimerNodeInstance tni = (TimerNodeInstance) nodeInstance; if (tni.getTimerId() == timerId || (tni.getNodeName() != null && tni.getNodeName().equals(timerName))) { TimerInstance timer = tm.getTimerMap().get(tni.getTimerId()); - - TimerInstance newTimer = rescheduleTimer(timer, tm); + newTimer = rescheduleTimer(timer, tm); logger.debug("New timer {} about to be registered", newTimer); tm.registerTimer(newTimer, wfp); tni.internalSetTimerId(newTimer.getId()); logger.debug("New timer {} successfully registered", newTimer); - break; } } @@ -157,7 +166,7 @@ public Void execute(Context context ) { if (timerList != null && timerList.size() == 1) { TimerInstance timer = tm.getTimerMap().get(timerList.get(0)); - TimerInstance newTimer = rescheduleTimer(timer, tm); + newTimer = rescheduleTimer(timer, tm); logger.debug("New timer {} about to be registered", newTimer); tm.registerTimer(newTimer, wfp); timerList.clear(); @@ -174,7 +183,7 @@ public Void execute(Context context ) { HumanTaskNodeInstance htni = (HumanTaskNodeInstance) nodeInstance; if (htni.getSuspendUntilTimerId() != -1 && htni.getSuspendUntilTimerId() == this.timerId) { TimerInstance timer = tm.getTimerMap().get(this.timerId); - TimerInstance newTimer = rescheduleTimer(timer, tm); + newTimer = rescheduleTimer(timer, tm); logger.debug("New timer {} about to be registered", newTimer); tm.registerTimer(newTimer, wfp); htni.setSuspendUntilTimerId(newTimer.getId()); diff --git a/jbpm-flow/src/main/java/org/jbpm/process/instance/context/variable/VariableScopeInstance.java b/jbpm-flow/src/main/java/org/jbpm/process/instance/context/variable/VariableScopeInstance.java index 0a466ef4ca..873c7859a6 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/instance/context/variable/VariableScopeInstance.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/instance/context/variable/VariableScopeInstance.java @@ -31,7 +31,6 @@ import org.jbpm.process.instance.context.AbstractContextInstance; import org.jbpm.workflow.core.Node; import org.jbpm.workflow.instance.node.CompositeContextNodeInstance; -import org.kie.api.definition.process.Process; import org.kie.api.runtime.KieSession; import org.kie.api.runtime.process.CaseData; import org.kie.api.runtime.process.ProcessInstance; @@ -210,18 +209,15 @@ private boolean hasData(Object data) { return data != null && (!(data instanceof CharSequence) || !data.toString().trim().isEmpty()); } - public void setDefaultValue(Process process,VariableScope variableScope,VariableScopeInstance variableScopeInstance) { + public void setDefaultValues(VariableScope variableScope, VariableScopeInstance variableScopeInstance) { if (variableScope != null) { for (Variable variable : variableScope.getVariables()) { String name = variable.getName(); Object defaultValue = variable.getMetaData("defaultValue"); if (variableScopeInstance.getVariable(name) == null && defaultValue != null) { - variableScopeInstance.setVariable(name, - variableScope.validateVariable(process.getName(), name, defaultValue)); - + variableScopeInstance.setVariable(name, variable.getType().readValue(defaultValue.toString())); } } } - } - + } } diff --git a/jbpm-flow/src/main/java/org/jbpm/process/instance/timer/TimerManager.java b/jbpm-flow/src/main/java/org/jbpm/process/instance/timer/TimerManager.java index 0b4f07adb8..ebd61b9555 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/instance/timer/TimerManager.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/instance/timer/TimerManager.java @@ -399,7 +399,7 @@ public static class ProcessJobContext implements JobContext { private JobHandle jobHandle; private Long sessionId; - private boolean newTimer; + private boolean isNew; public ProcessJobContext(final TimerInstance timer, final Trigger trigger, final Long processInstanceId, final InternalKnowledgeRuntime kruntime) { @@ -408,17 +408,17 @@ public ProcessJobContext(final TimerInstance timer, final Trigger trigger, final this.processInstanceId = processInstanceId; this.kruntime = kruntime; this.sessionId = timer.getSessionId(); - this.newTimer = true; + this.isNew = true; } public ProcessJobContext(final TimerInstance timer, final Trigger trigger, final Long processInstanceId, - final InternalKnowledgeRuntime kruntime, boolean newTimer) { + final InternalKnowledgeRuntime kruntime, boolean isNew) { this.timer = timer; this.trigger = trigger; this.processInstanceId = processInstanceId; this.kruntime = kruntime; this.sessionId = timer.getSessionId(); - this.newTimer = newTimer; + this.isNew = isNew; } public Long getProcessInstanceId() { @@ -457,9 +457,10 @@ public void setKnowledgeRuntime(InternalKnowledgeRuntime kruntime) { public InternalWorkingMemory getWorkingMemory() { return kruntime instanceof InternalWorkingMemory ? (InternalWorkingMemory)kruntime : null; } - - public boolean isNewTimer() { - return newTimer; + + @Override + public boolean isNew() { + return isNew; } } @@ -493,7 +494,7 @@ public void setParamaeters(Map paramaeters) { } @Override - public boolean isNewTimer() { + public boolean isNew() { return false; } diff --git a/jbpm-flow/src/test/java/org/jbpm/process/core/datatype/impl/ObjectDataTypeTest.java b/jbpm-flow/src/test/java/org/jbpm/process/core/datatype/impl/ObjectDataTypeTest.java new file mode 100644 index 0000000000..0b1461350a --- /dev/null +++ b/jbpm-flow/src/test/java/org/jbpm/process/core/datatype/impl/ObjectDataTypeTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2023 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jbpm.process.core.datatype.impl; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZonedDateTime; +import java.util.Date; + +import org.jbpm.process.core.datatype.impl.type.ObjectDataType; +import org.junit.Test; + + +public class ObjectDataTypeTest { + + @Test + public void testReadValueNull() { + ObjectDataType dateType = new ObjectDataType(Date.class.getCanonicalName()); + assertThat(dateType.readValue(null)).isNull(); + assertThat(dateType.valueOf(null)).isNull(); + assertThat(dateType.verifyDataType(null)).isTrue(); + } + + @Test + public void testReadValueDate() { + ObjectDataType dateType = new ObjectDataType(Date.class.getCanonicalName()); + assertThat(dateType.readValue("2012-02-02")).isInstanceOf(Date.class); + assertThat(dateType.readValue("12:12:12")).isInstanceOf(Date.class); + assertThat(dateType.valueOf("2012-02-02")).isInstanceOf(Date.class); + assertThat(dateType.valueOf("12:12:12")).isInstanceOf(Date.class); + assertThat(dateType.valueOf("pepe")).isInstanceOf(String.class); + assertThatThrownBy(() -> dateType.readValue("pepe")).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void testReadValueLocalDate() { + ObjectDataType dateType = new ObjectDataType(LocalDate.class.getCanonicalName()); + assertThat(dateType.readValue("2012-02-02")).isInstanceOf(LocalDate.class); + assertThat(dateType.valueOf("2012-02-02")).isInstanceOf(LocalDate.class); + } + + @Test + public void testReadValueLocalDateTime() { + ObjectDataType dateType = new ObjectDataType(LocalDateTime.class.getCanonicalName()); + assertThat(dateType.readValue("2012-02-02T12:12:12")).isInstanceOf(LocalDateTime.class); + assertThat(dateType.valueOf("2012-02-02T12:12:12")).isInstanceOf(LocalDateTime.class); + } + + @Test + public void testReadValueZonedDateTime() { + ObjectDataType dateType = new ObjectDataType(ZonedDateTime.class.getCanonicalName()); + assertThat(dateType.readValue("2012-02-02T12:12:12+00:01")).isInstanceOf(ZonedDateTime.class); + assertThat(dateType.valueOf("2012-02-02T12:12:12+00:01")).isInstanceOf(ZonedDateTime.class); + } +} diff --git a/jbpm-human-task/jbpm-human-task-audit/pom.xml b/jbpm-human-task/jbpm-human-task-audit/pom.xml index 85348bb85e..c21e9ba7a0 100644 --- a/jbpm-human-task/jbpm-human-task-audit/pom.xml +++ b/jbpm-human-task/jbpm-human-task-audit/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-human-task - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-human-task-audit diff --git a/jbpm-human-task/jbpm-human-task-core/pom.xml b/jbpm-human-task/jbpm-human-task-core/pom.xml index 2a2eabd964..d8daaeb528 100644 --- a/jbpm-human-task/jbpm-human-task-core/pom.xml +++ b/jbpm-human-task/jbpm-human-task-core/pom.xml @@ -5,7 +5,7 @@ org.jbpm jbpm-human-task - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-human-task-core bundle diff --git a/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/TaskDeadlinesServiceImpl.java b/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/TaskDeadlinesServiceImpl.java index 163737a007..3562afb59e 100644 --- a/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/TaskDeadlinesServiceImpl.java +++ b/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/TaskDeadlinesServiceImpl.java @@ -82,8 +82,15 @@ public void setPersistenceContext(TaskPersistenceContext persistenceContext) { this.persistenceContext = persistenceContext; } + public void scheduleNew(long taskId, long deadlineId, long delay, DeadlineType type) { + schedule(taskId, deadlineId, delay, type, true); + } public void schedule(long taskId, long deadlineId, long delay, DeadlineType type) { + schedule(taskId, deadlineId, delay, type, false); + } + + public void schedule(long taskId, long deadlineId, long delay, DeadlineType type, boolean isNew) { Task task = persistenceContext.findTask(taskId); String deploymentId = task.getTaskData().getDeploymentId(); @@ -99,7 +106,7 @@ public void schedule(long taskId, long deadlineId, long delay, DeadlineType type 0, null, null ) ; - JobHandle handle = timerService.scheduleJob(deadlineJob, new TaskDeadlineJobContext(deadlineJob.getId(), task.getTaskData().getProcessInstanceId(), deploymentId), trigger); + JobHandle handle = timerService.scheduleJob(deadlineJob, new TaskDeadlineJobContext(deadlineJob.getId(), task.getTaskData().getProcessInstanceId(), deploymentId, isNew), trigger); jobHandles.put(deadlineJob.getId(), handle); } else { @@ -363,13 +370,24 @@ private static class TaskDeadlineJobContext implements NamedJobContext { private String jobName; private Long processInstanceId; private String deploymentId; + private boolean isNew; public TaskDeadlineJobContext(String jobName, Long processInstanceId, String deploymentId) { + this(jobName, processInstanceId, deploymentId, false); + } + + public TaskDeadlineJobContext(String jobName, Long processInstanceId, String deploymentId, boolean isNew) { this.jobName = jobName; this.processInstanceId = processInstanceId; this.deploymentId = deploymentId; + this.isNew = isNew; } + @Override + public boolean isNew() { + return isNew; + } + @Override public void setJobHandle(JobHandle jobHandle) { this.jobHandle = jobHandle; diff --git a/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/util/DeadlineSchedulerHelper.java b/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/util/DeadlineSchedulerHelper.java index 276d3d20c4..95122592ab 100644 --- a/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/util/DeadlineSchedulerHelper.java +++ b/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/services/task/impl/util/DeadlineSchedulerHelper.java @@ -138,7 +138,7 @@ public static void scheduleDeadlines(final List deadlines, f for (Deadline deadline : deadlines) { if (Boolean.FALSE.equals(deadline.isEscalated())) { Date date = deadline.getDate(); - deadlineService.schedule(taskId, deadline.getId(), date.getTime() - now, type); + deadlineService.scheduleNew(taskId, deadline.getId(), date.getTime() - now, type); } } } diff --git a/jbpm-human-task/jbpm-human-task-jpa/pom.xml b/jbpm-human-task/jbpm-human-task-jpa/pom.xml index 8bc9fee016..5db64d94c4 100644 --- a/jbpm-human-task/jbpm-human-task-jpa/pom.xml +++ b/jbpm-human-task/jbpm-human-task-jpa/pom.xml @@ -3,7 +3,7 @@ org.jbpm jbpm-human-task - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-human-task-jpa bundle diff --git a/jbpm-human-task/jbpm-human-task-workitems/pom.xml b/jbpm-human-task/jbpm-human-task-workitems/pom.xml index 141887001e..f7ec087a4f 100644 --- a/jbpm-human-task/jbpm-human-task-workitems/pom.xml +++ b/jbpm-human-task/jbpm-human-task-workitems/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-human-task - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-human-task-workitems diff --git a/jbpm-human-task/pom.xml b/jbpm-human-task/pom.xml index 7e8fd4d979..35b0e71251 100644 --- a/jbpm-human-task/pom.xml +++ b/jbpm-human-task/pom.xml @@ -5,7 +5,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-human-task diff --git a/jbpm-installer/pom.xml b/jbpm-installer/pom.xml index 7e08456e18..ca409b551f 100644 --- a/jbpm-installer/pom.xml +++ b/jbpm-installer/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-installer diff --git a/jbpm-installer/src/main/resources/build.properties b/jbpm-installer/src/main/resources/build.properties index 73ba652e7b..f02109deae 100644 --- a/jbpm-installer/src/main/resources/build.properties +++ b/jbpm-installer/src/main/resources/build.properties @@ -4,8 +4,8 @@ # - set ${release.version} to the current release version. install.home=./ -snapshot.version=7.74.0-SNAPSHOT -release.version=7.74.0-SNAPSHOT +snapshot.version=7.75.0-SNAPSHOT +release.version=7.75.0-SNAPSHOT # the version of jBPM you want to use # and the associated URL you want to get the dependencies from diff --git a/jbpm-persistence/jbpm-persistence-api/pom.xml b/jbpm-persistence/jbpm-persistence-api/pom.xml index 26faed165a..3b3a5d516f 100644 --- a/jbpm-persistence/jbpm-persistence-api/pom.xml +++ b/jbpm-persistence/jbpm-persistence-api/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-persistence - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-persistence-api diff --git a/jbpm-persistence/jbpm-persistence-jpa/pom.xml b/jbpm-persistence/jbpm-persistence-jpa/pom.xml index f978bde463..00064c1627 100644 --- a/jbpm-persistence/jbpm-persistence-jpa/pom.xml +++ b/jbpm-persistence/jbpm-persistence-jpa/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm-persistence - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-persistence-jpa diff --git a/jbpm-persistence/pom.xml b/jbpm-persistence/pom.xml index 5f93726b7c..1a1a734ee1 100644 --- a/jbpm-persistence/pom.xml +++ b/jbpm-persistence/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-persistence diff --git a/jbpm-query-jpa/pom.xml b/jbpm-query-jpa/pom.xml index 98f91822e1..a1160615e3 100644 --- a/jbpm-query-jpa/pom.xml +++ b/jbpm-query-jpa/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-query-jpa diff --git a/jbpm-runtime-manager/pom.xml b/jbpm-runtime-manager/pom.xml index 193e189d02..8c2e15cac8 100644 --- a/jbpm-runtime-manager/pom.xml +++ b/jbpm-runtime-manager/pom.xml @@ -3,7 +3,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-runtime-manager diff --git a/jbpm-services/jbpm-executor-cdi/pom.xml b/jbpm-services/jbpm-executor-cdi/pom.xml index e66efcfd64..7711c47710 100644 --- a/jbpm-services/jbpm-executor-cdi/pom.xml +++ b/jbpm-services/jbpm-executor-cdi/pom.xml @@ -4,7 +4,7 @@ org.jbpm jbpm-services - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-executor-cdi jBPM :: Executor Service CDI add-ons diff --git a/jbpm-services/jbpm-executor/pom.xml b/jbpm-services/jbpm-executor/pom.xml index 09aba03c9c..07a31ab25b 100644 --- a/jbpm-services/jbpm-executor/pom.xml +++ b/jbpm-services/jbpm-executor/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-services - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-executor diff --git a/jbpm-services/jbpm-kie-services/pom.xml b/jbpm-services/jbpm-kie-services/pom.xml index e8942cbb50..8f172785a5 100644 --- a/jbpm-services/jbpm-kie-services/pom.xml +++ b/jbpm-services/jbpm-kie-services/pom.xml @@ -5,7 +5,7 @@ org.jbpm jbpm-services - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-kie-services bundle diff --git a/jbpm-services/jbpm-services-api/pom.xml b/jbpm-services/jbpm-services-api/pom.xml index 3e3aaa1cd7..35cdbab123 100644 --- a/jbpm-services/jbpm-services-api/pom.xml +++ b/jbpm-services/jbpm-services-api/pom.xml @@ -3,7 +3,7 @@ org.jbpm jbpm-services - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-services-api bundle diff --git a/jbpm-services/jbpm-services-cdi/pom.xml b/jbpm-services/jbpm-services-cdi/pom.xml index e48d0565ed..993651d9ba 100644 --- a/jbpm-services/jbpm-services-cdi/pom.xml +++ b/jbpm-services/jbpm-services-cdi/pom.xml @@ -3,7 +3,7 @@ org.jbpm jbpm-services - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-services-cdi jBPM :: CDI Services diff --git a/jbpm-services/jbpm-services-ejb/jbpm-executor-ejb/pom.xml b/jbpm-services/jbpm-services-ejb/jbpm-executor-ejb/pom.xml index bba860c446..d890a2e162 100644 --- a/jbpm-services/jbpm-services-ejb/jbpm-executor-ejb/pom.xml +++ b/jbpm-services/jbpm-services-ejb/jbpm-executor-ejb/pom.xml @@ -4,7 +4,7 @@ org.jbpm jbpm-services-ejb - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-executor-ejb jBPM :: Executor Service EJB add-ons diff --git a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-api/pom.xml b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-api/pom.xml index 3505711d53..efcfe48b2f 100644 --- a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-api/pom.xml +++ b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-api/pom.xml @@ -3,7 +3,7 @@ org.jbpm jbpm-services-ejb - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-services-ejb-api jBPM :: EJB Services API diff --git a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-client/pom.xml b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-client/pom.xml index 90054105c2..7cdbf982f2 100644 --- a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-client/pom.xml +++ b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-client/pom.xml @@ -4,7 +4,7 @@ org.jbpm jbpm-services-ejb - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-services-ejb-client jBPM :: EJB Services Client diff --git a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-impl/pom.xml b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-impl/pom.xml index 195423f10b..d74a3efc7c 100644 --- a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-impl/pom.xml +++ b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-impl/pom.xml @@ -4,7 +4,7 @@ org.jbpm jbpm-services-ejb - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-services-ejb-impl jBPM :: EJB Services Implementation diff --git a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/pom.xml b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/pom.xml index 2c67611f26..08971253d6 100644 --- a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/pom.xml +++ b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/pom.xml @@ -4,7 +4,7 @@ org.jbpm jbpm-services-ejb - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-services-ejb-timer jBPM :: EJB Timer diff --git a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EjbSchedulerService.java b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EjbSchedulerService.java index a6bc947c2b..2ad481713a 100644 --- a/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EjbSchedulerService.java +++ b/jbpm-services/jbpm-services-ejb/jbpm-services-ejb-timer/src/main/java/org/jbpm/services/ejb/timer/EjbSchedulerService.java @@ -48,7 +48,6 @@ import org.jbpm.process.core.timer.impl.DelegateSchedulerServiceInterceptor; import org.jbpm.process.core.timer.impl.GlobalTimerService; import org.jbpm.process.core.timer.impl.GlobalTimerService.GlobalJobHandle; -import org.jbpm.process.instance.timer.TimerManager.ProcessJobContext; import org.jbpm.runtime.manager.impl.jpa.EntityManagerFactoryManager; import org.jbpm.runtime.manager.impl.jpa.TimerMappingInfo; import org.kie.internal.runtime.manager.InternalRuntimeManager; @@ -77,7 +76,7 @@ public JobHandle scheduleJob(Job job, JobContext ctx, Trigger trigger) { TimerJobInstance jobInstance = null; // check if given timer job is marked as new timer meaning it was never scheduled before, // if so skip the check by timer name as it has no way to exist - if (!isNewTimer(ctx)) { + if (!ctx.isNew()) { jobInstance = getTimerJobInstance(jobName); if (jobInstance == null) { jobInstance = scheduler.getTimerByName(jobName); @@ -265,9 +264,4 @@ public boolean isValid(GlobalJobHandle jobHandle) { protected String getJobName(JobContext ctx, long id) { return JobNameHelper.getJobName(ctx, id); } - - private boolean isNewTimer(JobContext ctx) { - return ctx instanceof ProcessJobContext && ((ProcessJobContext) ctx).isNewTimer(); - } - } diff --git a/jbpm-services/jbpm-services-ejb/pom.xml b/jbpm-services/jbpm-services-ejb/pom.xml index cf3778b914..5ed7efd9bb 100644 --- a/jbpm-services/jbpm-services-ejb/pom.xml +++ b/jbpm-services/jbpm-services-ejb/pom.xml @@ -3,7 +3,7 @@ org.jbpm jbpm-services - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-services-ejb pom diff --git a/jbpm-services/jbpm-shared-services/pom.xml b/jbpm-services/jbpm-shared-services/pom.xml index d3f9421961..782b323dbb 100644 --- a/jbpm-services/jbpm-shared-services/pom.xml +++ b/jbpm-services/jbpm-shared-services/pom.xml @@ -5,7 +5,7 @@ org.jbpm jbpm-services - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-shared-services bundle diff --git a/jbpm-services/pom.xml b/jbpm-services/pom.xml index fd18480ac0..d5791c426a 100644 --- a/jbpm-services/pom.xml +++ b/jbpm-services/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-services diff --git a/jbpm-test-coverage/pom.xml b/jbpm-test-coverage/pom.xml index f9d45c4974..b9d1811136 100644 --- a/jbpm-test-coverage/pom.xml +++ b/jbpm-test-coverage/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-test-coverage diff --git a/jbpm-test-util/pom.xml b/jbpm-test-util/pom.xml index d999e10757..842f9d4e64 100644 --- a/jbpm-test-util/pom.xml +++ b/jbpm-test-util/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-test-util diff --git a/jbpm-test/pom.xml b/jbpm-test/pom.xml index c7a70bd563..f1bd4a2a7c 100644 --- a/jbpm-test/pom.xml +++ b/jbpm-test/pom.xml @@ -7,7 +7,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-test diff --git a/jbpm-workitems/jbpm-workitems-archetype/README.md b/jbpm-workitems/jbpm-workitems-archetype/README.md index 0653bb33ae..8cc2ad8e78 100644 --- a/jbpm-workitems/jbpm-workitems-archetype/README.md +++ b/jbpm-workitems/jbpm-workitems-archetype/README.md @@ -16,8 +16,8 @@ base workitem handler from this archetype. mvn archetype:generate -DarchetypeGroupId=org.jbpm -DarchetypeArtifactId=jbpm-workitems-archetype - -DarchetypeVersion=7.74.0-SNAPSHOT - -Dversion=7.74.0-SNAPSHOT + -DarchetypeVersion=7.75.0-SNAPSHOT + -Dversion=7.75.0-SNAPSHOT -DgroupId=org.jbpm.contrib -DartifactId=myworkitem -DclassPrefix=MyWorkItem @@ -26,7 +26,7 @@ mvn archetype:generate or use this one-liner ``` -mvn archetype:generate -DarchetypeGroupId=org.jbpm -DarchetypeArtifactId=jbpm-workitems-archetype -DarchetypeVersion=7.74.0-SNAPSHOT -Dversion=7.74.0-SNAPSHOT -DgroupId=org.jbpm.contrib -DartifactId=myworkitem -DclassPrefix=MyWorkItem -DarchetypeCatalog=local +mvn archetype:generate -DarchetypeGroupId=org.jbpm -DarchetypeArtifactId=jbpm-workitems-archetype -DarchetypeVersion=7.75.0-SNAPSHOT -Dversion=7.75.0-SNAPSHOT -DgroupId=org.jbpm.contrib -DartifactId=myworkitem -DclassPrefix=MyWorkItem -DarchetypeCatalog=local ``` 4. Change the prompted values during the generation as needed (or leave the defaults) 5. Compile and test your generated workitem handler with diff --git a/jbpm-workitems/jbpm-workitems-archetype/pom.xml b/jbpm-workitems/jbpm-workitems-archetype/pom.xml index dd9dc706f4..e29af67157 100644 --- a/jbpm-workitems/jbpm-workitems-archetype/pom.xml +++ b/jbpm-workitems/jbpm-workitems-archetype/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-workitems - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems-archetype diff --git a/jbpm-workitems/jbpm-workitems-bpmn2/pom.xml b/jbpm-workitems/jbpm-workitems-bpmn2/pom.xml index 93c98fcd51..540fc4a532 100644 --- a/jbpm-workitems/jbpm-workitems-bpmn2/pom.xml +++ b/jbpm-workitems/jbpm-workitems-bpmn2/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-workitems - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems-bpmn2 diff --git a/jbpm-workitems/jbpm-workitems-core/pom.xml b/jbpm-workitems/jbpm-workitems-core/pom.xml index ae1b602c4e..1b9a6e7798 100644 --- a/jbpm-workitems/jbpm-workitems-core/pom.xml +++ b/jbpm-workitems/jbpm-workitems-core/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-workitems - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems-core diff --git a/jbpm-workitems/jbpm-workitems-email/pom.xml b/jbpm-workitems/jbpm-workitems-email/pom.xml index 880579da05..4691a3922c 100644 --- a/jbpm-workitems/jbpm-workitems-email/pom.xml +++ b/jbpm-workitems/jbpm-workitems-email/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-workitems - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems-email diff --git a/jbpm-workitems/jbpm-workitems-jms/pom.xml b/jbpm-workitems/jbpm-workitems-jms/pom.xml index 6c583b5811..453c88d32e 100644 --- a/jbpm-workitems/jbpm-workitems-jms/pom.xml +++ b/jbpm-workitems/jbpm-workitems-jms/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-workitems - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems-jms diff --git a/jbpm-workitems/jbpm-workitems-repository-archetype/README.md b/jbpm-workitems/jbpm-workitems-repository-archetype/README.md index 63f83109a6..fbed791168 100644 --- a/jbpm-workitems/jbpm-workitems-repository-archetype/README.md +++ b/jbpm-workitems/jbpm-workitems-repository-archetype/README.md @@ -16,8 +16,8 @@ base workitem handler from this archetype. mvn archetype:generate -DarchetypeGroupId=org.jbpm -DarchetypeArtifactId=jbpm-workitems-repository-archetype - -DarchetypeVersion=7.74.0-SNAPSHOT - -Dversion=7.74.0-SNAPSHOT + -DarchetypeVersion=7.75.0-SNAPSHOT + -Dversion=7.75.0-SNAPSHOT -DgroupId=org.jbpm.contrib -DartifactId=myworkitem -DclassPrefix=MyWorkItem @@ -26,7 +26,7 @@ mvn archetype:generate or use this one-liner ``` -mvn archetype:generate -DarchetypeGroupId=org.jbpm -DarchetypeArtifactId=jbpm-workitems-repository-archetype -DarchetypeVersion=7.74.0-SNAPSHOT -Dversion=7.74.0-SNAPSHOT -DgroupId=org.jbpm.contrib -DartifactId=myworkitem -DclassPrefix=MyWorkItem -DarchetypeCatalog=local +mvn archetype:generate -DarchetypeGroupId=org.jbpm -DarchetypeArtifactId=jbpm-workitems-repository-archetype -DarchetypeVersion=7.75.0-SNAPSHOT -Dversion=7.75.0-SNAPSHOT -DgroupId=org.jbpm.contrib -DartifactId=myworkitem -DclassPrefix=MyWorkItem -DarchetypeCatalog=local ``` 4. Change the prompted values during the generation as needed (or leave the defaults) 5. Compile and test your generated workitem handler with diff --git a/jbpm-workitems/jbpm-workitems-repository-archetype/pom.xml b/jbpm-workitems/jbpm-workitems-repository-archetype/pom.xml index a827fceed7..38f9646b69 100644 --- a/jbpm-workitems/jbpm-workitems-repository-archetype/pom.xml +++ b/jbpm-workitems/jbpm-workitems-repository-archetype/pom.xml @@ -5,7 +5,7 @@ jbpm-workitems org.jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT 4.0.0 diff --git a/jbpm-workitems/jbpm-workitems-rest/pom.xml b/jbpm-workitems/jbpm-workitems-rest/pom.xml index e6dea13dd1..ee550a8fd9 100644 --- a/jbpm-workitems/jbpm-workitems-rest/pom.xml +++ b/jbpm-workitems/jbpm-workitems-rest/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-workitems - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems-rest diff --git a/jbpm-workitems/jbpm-workitems-template-resources/pom.xml b/jbpm-workitems/jbpm-workitems-template-resources/pom.xml index 05ecf3b5a7..4d1bffd0f7 100644 --- a/jbpm-workitems/jbpm-workitems-template-resources/pom.xml +++ b/jbpm-workitems/jbpm-workitems-template-resources/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-workitems - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems-template-resources diff --git a/jbpm-workitems/jbpm-workitems-webservice/pom.xml b/jbpm-workitems/jbpm-workitems-webservice/pom.xml index 5ffbff5a58..aca5978526 100644 --- a/jbpm-workitems/jbpm-workitems-webservice/pom.xml +++ b/jbpm-workitems/jbpm-workitems-webservice/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm-workitems - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems-webservice diff --git a/jbpm-workitems/pom.xml b/jbpm-workitems/pom.xml index 1505194dfe..f0fc331954 100644 --- a/jbpm-workitems/pom.xml +++ b/jbpm-workitems/pom.xml @@ -6,7 +6,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jbpm-workitems diff --git a/jbpm-xes/pom.xml b/jbpm-xes/pom.xml index d408b1c1fe..01b8aba4c3 100644 --- a/jbpm-xes/pom.xml +++ b/jbpm-xes/pom.xml @@ -21,7 +21,7 @@ org.jbpm jbpm - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT jBPM :: XES Exporter diff --git a/pom.xml b/pom.xml index ec376df3b5..9ab6ea065d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.kie kie-parent - 7.74.0-SNAPSHOT + 7.75.0-SNAPSHOT org.jbpm