From 17060493ada22d75584157cd30b0394e297c8ab7 Mon Sep 17 00:00:00 2001 From: shootsoft Date: Tue, 23 Apr 2024 18:28:36 +1000 Subject: [PATCH 01/11] chor: add copyright information, the same one used in incubator-kie-kogito-apps (#3457) --- NOTICE | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 NOTICE diff --git a/NOTICE b/NOTICE new file mode 100644 index 00000000000..6a7d335aa36 --- /dev/null +++ b/NOTICE @@ -0,0 +1,9 @@ +Apache KIE +Copyright 2023 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +The Initial Developer of some parts of the framework, which are copied from, derived from, or +inspired by KIE (Knowledge Is Everthing) group, is Red Hat, Inc (https://www.redhat.com/). +Copyright Red Hat, Inc. and/or its affiliates.. All Rights Reserved. From 0527fcdb8824ff869900ae7892f5efb74e774f87 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Wed, 24 Apr 2024 15:02:44 +0200 Subject: [PATCH 02/11] [Fix apache/incubator_kie_issues#1101] Adding error counter (#3481) * [Fix apache/incubator-kie-issues#1101] Adding error counter * [Fix apache/incubator-kie-issues#1101] Changing integration test This is needed because node_name changed to process_state * [Fix apache/incubator-kie-issues#1101] Additional refactor To allow easier inheritance --- .../process/MetricsProcessEventListener.java | 133 +++++++++++------- .../quarkus/MonitoringIT.java | 4 +- .../springboot/MonitoringTest.java | 2 +- 3 files changed, 86 insertions(+), 53 deletions(-) diff --git a/addons/common/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/common/process/MetricsProcessEventListener.java b/addons/common/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/common/process/MetricsProcessEventListener.java index 7a741047741..a2fbebf6e1b 100644 --- a/addons/common/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/common/process/MetricsProcessEventListener.java +++ b/addons/common/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/common/process/MetricsProcessEventListener.java @@ -18,11 +18,12 @@ */ package org.kie.kogito.monitoring.core.common.process; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import org.kie.api.event.process.ErrorEvent; import org.kie.api.event.process.ProcessCompletedEvent; import org.kie.api.event.process.ProcessNodeLeftEvent; import org.kie.api.event.process.ProcessStartedEvent; @@ -31,12 +32,14 @@ import org.kie.kogito.KogitoGAV; import org.kie.kogito.internal.process.event.DefaultKogitoProcessEventListener; import org.kie.kogito.internal.process.runtime.KogitoNodeInstance; +import org.kie.kogito.internal.process.runtime.KogitoProcessInstance; import org.kie.kogito.internal.process.runtime.KogitoWorkItemNodeInstance; import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcessInstance; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.micrometer.core.instrument.Counter; +import io.micrometer.core.instrument.Counter.Builder; import io.micrometer.core.instrument.DistributionSummary; import io.micrometer.core.instrument.Gauge; import io.micrometer.core.instrument.MeterRegistry; @@ -56,90 +59,105 @@ public MetricsProcessEventListener(String identifier, KogitoGAV gav, MeterRegist this.meterRegistry = meterRegistry; } - private Counter getNumberOfProcessInstancesStartedCounter(String appId, String processId) { - return Counter - .builder("kogito_process_instance_started_total") - .description("Started Process Instances") - .tags(Arrays.asList(Tag.of("app_id", appId), Tag.of("process_id", processId), Tag.of("artifactId", gav.getArtifactId()), Tag.of("version", gav.getVersion()))) - .register(meterRegistry); + protected Counter buildCounter(String name, String description, String processId, Tag... tags) { + Builder builder = Counter.builder(name) + .description(description) + .tag("app_id", identifier).tag("process_id", processId).tag("artifactId", gav.getArtifactId()).tag("version", gav.getVersion()); + for (Tag tag : tags) { + builder.tag(tag.getKey(), tag.getValue()); + } + return builder.register(meterRegistry); } - private Counter getNumberOfSLAsViolatedCounter(String appId, String processId, String nodeName) { - return Counter - .builder("kogito_process_instance_sla_violated_total") - .description("Process Instances SLA Violated") - .tags(Arrays.asList(Tag.of("app_id", appId), Tag.of("process_id", processId), Tag.of("node_name", nodeName), Tag.of("artifactId", gav.getArtifactId()), - Tag.of("version", gav.getVersion()))) - .register(meterRegistry); + protected AtomicInteger buildGauge(String name, String description, String processId, Tag... tags) { + AtomicInteger atomicInteger = new AtomicInteger(0); + io.micrometer.core.instrument.Gauge.Builder builder = Gauge.builder(name, atomicInteger, AtomicInteger::doubleValue) + .description(description) + .tag("app_id", identifier).tag("process_id", processId).tag("artifactId", gav.getArtifactId()).tag("version", gav.getVersion()); + for (Tag tag : tags) { + builder.tag(tag.getKey(), tag.getValue()); + } + builder.register(meterRegistry); + return atomicInteger; } - private Counter getNumberOfProcessInstancesCompletedCounter(String appId, String processId, String nodeName) { - return Counter - .builder("kogito_process_instance_completed_total") - .description("Completed Process Instances") - .tags(Arrays.asList(Tag.of("app_id", appId), Tag.of("process_id", processId), Tag.of("node_name", nodeName), Tag.of("artifactId", gav.getArtifactId()), - Tag.of("version", gav.getVersion()))) - .register(meterRegistry); + protected DistributionSummary buildDistributionSummary(String name, String description, Tag... tags) { + io.micrometer.core.instrument.DistributionSummary.Builder builder = DistributionSummary.builder(name) + .description(description).tag("artifactId", gav.getArtifactId()).tag("version", gav.getVersion()); + for (Tag tag : tags) { + builder.tag(tag.getKey(), tag.getValue()); + } + return builder.register(meterRegistry); } - private AtomicInteger getRunningProcessInstancesGauge(String appId, String processId) { - if (gaugeMap.containsKey(appId + processId)) { - return gaugeMap.get(appId + processId); - } - AtomicInteger atomicInteger = new AtomicInteger(0); - Gauge.builder("kogito_process_instance_running_total", atomicInteger, AtomicInteger::doubleValue) - .description("Running Process Instances") - .tags(Arrays.asList(Tag.of("app_id", appId), Tag.of("process_id", processId), Tag.of("artifactId", gav.getArtifactId()), Tag.of("version", gav.getVersion()))) - .register(meterRegistry); - gaugeMap.put(appId + processId, atomicInteger); - return atomicInteger; + private Counter getNumberOfProcessInstancesStartedCounter(String processId) { + return buildCounter("kogito_process_instance_started_total", "Started Process Instances", processId); + } + + private Counter getErrorCounter(String processId, String errorMessage) { + return buildCounter("kogito_process_instance_error", "Number of errors that has occurred", processId, Tag.of("error_message", errorMessage)); + } + + private Counter getNumberOfSLAsViolatedCounter(String processId, String nodeName) { + return buildCounter("kogito_process_instance_sla_violated_total", "Number of SLA violations that has ocurred", processId, Tag.of("node_name", nodeName)); } - private DistributionSummary getProcessInstancesDurationSummary(String appId, String processId) { - return DistributionSummary.builder("kogito_process_instance_duration_seconds") - .description("Process Instances Duration") - .tags(Arrays.asList(Tag.of("app_id", appId), Tag.of("process_id", processId), Tag.of("artifactId", gav.getArtifactId()), Tag.of("version", gav.getVersion()))) - .register(meterRegistry); + private Counter getNumberOfProcessInstancesCompletedCounter(String processId, String state) { + return buildCounter("kogito_process_instance_completed_total", "Completed Process Instances", processId, Tag.of("process_state", state)); + } + + private AtomicInteger getRunningProcessInstancesGauge(String processId) { + return gaugeMap.computeIfAbsent(identifier + processId, k -> buildGauge("kogito_process_instance_running_total", "Running Process Instances", processId)); + } + + private DistributionSummary getProcessInstancesDurationSummary(String processId) { + return buildDistributionSummary("kogito_process_instance_duration_seconds", + "Process Instances Duration", Tag.of("process_id", processId), Tag.of("app_id", identifier)); } private DistributionSummary getWorkItemsDurationSummary(String name) { - return DistributionSummary.builder("kogito_work_item_duration_seconds") - .description("Work Items Duration") - .tags(Arrays.asList(Tag.of("name", name), Tag.of("artifactId", gav.getArtifactId()), Tag.of("version", gav.getVersion()))) - .register(meterRegistry); + return buildDistributionSummary("kogito_work_item_duration_seconds", + "Work Items Duration", Tag.of("name", name)); } - protected void recordRunningProcessInstance(String containerId, String processId) { - getRunningProcessInstancesGauge(containerId, processId).incrementAndGet(); + protected void recordRunningProcessInstance(String processId) { + getRunningProcessInstancesGauge(processId).incrementAndGet(); } protected static double millisToSeconds(long millis) { - return millis / 1000.0; + return TimeUnit.MILLISECONDS.toSeconds(millis); } @Override public void afterProcessStarted(ProcessStartedEvent event) { LOGGER.debug("After process started event: {}", event); final ProcessInstance processInstance = event.getProcessInstance(); - getNumberOfProcessInstancesStartedCounter(identifier, processInstance.getProcessId()).increment(); - recordRunningProcessInstance(identifier, processInstance.getProcessId()); + getNumberOfProcessInstancesStartedCounter(processInstance.getProcessId()).increment(); + recordRunningProcessInstance(processInstance.getProcessId()); } @Override public void afterProcessCompleted(ProcessCompletedEvent event) { LOGGER.debug("After process completed event: {}", event); final KogitoWorkflowProcessInstance processInstance = (KogitoWorkflowProcessInstance) event.getProcessInstance(); - getRunningProcessInstancesGauge(identifier, processInstance.getProcessId()).decrementAndGet(); + getRunningProcessInstancesGauge(processInstance.getProcessId()).decrementAndGet(); - getNumberOfProcessInstancesCompletedCounter(identifier, processInstance.getProcessId(), String.valueOf(processInstance.getState())).increment(); + getNumberOfProcessInstancesCompletedCounter(processInstance.getProcessId(), fromState(processInstance.getState())).increment(); if (processInstance.getStartDate() != null) { final double duration = millisToSeconds(processInstance.getEndDate().getTime() - processInstance.getStartDate().getTime()); - getProcessInstancesDurationSummary(identifier, processInstance.getProcessId()).record(duration); + getProcessInstancesDurationSummary(processInstance.getProcessId()).record(duration); LOGGER.debug("Process Instance duration: {}s", duration); } } + @Override + public void onError(ErrorEvent event) { + LOGGER.debug("After Error event: {}", event); + final KogitoWorkflowProcessInstance processInstance = (KogitoWorkflowProcessInstance) event.getProcessInstance(); + getErrorCounter(processInstance.getProcessId(), processInstance.getErrorMessage()).increment(); + } + @Override public void beforeNodeLeft(ProcessNodeLeftEvent event) { LOGGER.debug("Before Node left event: {}", event); @@ -160,7 +178,22 @@ public void afterSLAViolated(SLAViolatedEvent event) { LOGGER.debug("After SLA violated event: {}", event); final ProcessInstance processInstance = event.getProcessInstance(); if (processInstance != null && event.getNodeInstance() != null) { - getNumberOfSLAsViolatedCounter(identifier, processInstance.getProcessId(), event.getNodeInstance().getNodeName()).increment(); + getNumberOfSLAsViolatedCounter(processInstance.getProcessId(), event.getNodeInstance().getNodeName()).increment(); + } + } + + private static String fromState(int state) { + switch (state) { + case KogitoProcessInstance.STATE_ABORTED: + return "Aborted"; + case KogitoProcessInstance.STATE_COMPLETED: + return "Completed"; + case KogitoProcessInstance.STATE_ERROR: + return "Error"; + default: + case KogitoProcessInstance.STATE_ACTIVE: + return "Active"; } } + } diff --git a/quarkus/integration-tests/integration-tests-quarkus-processes/src/test/java/org/kie/kogito/integrationtests/quarkus/MonitoringIT.java b/quarkus/integration-tests/integration-tests-quarkus-processes/src/test/java/org/kie/kogito/integrationtests/quarkus/MonitoringIT.java index 2fff402092e..c4c8da8e2fb 100644 --- a/quarkus/integration-tests/integration-tests-quarkus-processes/src/test/java/org/kie/kogito/integrationtests/quarkus/MonitoringIT.java +++ b/quarkus/integration-tests/integration-tests-quarkus-processes/src/test/java/org/kie/kogito/integrationtests/quarkus/MonitoringIT.java @@ -34,7 +34,7 @@ public class MonitoringIT { private static final String ARTIFACT_ID = "integration-tests-quarkus-processes"; - private static final String VERSION = System.getProperty("kogito.version"); + private static final String VERSION = System.getProperty("kogito.version", "999-SNAPSHOT"); static { RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); @@ -96,7 +96,7 @@ public void test() { .contains(format("kogito_work_item_duration_seconds_count{artifactId=\"%s\",name=\"MonitoringTask\",version=\"%s\"} 1.0", ARTIFACT_ID, VERSION)) .contains(format("kogito_work_item_duration_seconds_sum{artifactId=\"%s\",name=\"MonitoringTask\",version=\"%s\"}", ARTIFACT_ID, VERSION)) .contains(format( - "kogito_process_instance_completed_total{app_id=\"default-process-monitoring-listener\",artifactId=\"%s\",node_name=\"2\",process_id=\"monitoring\",version=\"%s\"} 1.0", + "kogito_process_instance_completed_total{app_id=\"default-process-monitoring-listener\",artifactId=\"%s\",process_id=\"monitoring\",process_state=\"Completed\",version=\"%s\"} 1.0", ARTIFACT_ID, VERSION)) .contains(format("kogito_process_instance_running_total{app_id=\"default-process-monitoring-listener\",artifactId=\"%s\",process_id=\"monitoring\",version=\"%s\"} 0.0", ARTIFACT_ID, VERSION)) diff --git a/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/src/test/java/org/kie/kogito/integrationtests/springboot/MonitoringTest.java b/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/src/test/java/org/kie/kogito/integrationtests/springboot/MonitoringTest.java index c055fc55f41..a0c088fd95b 100644 --- a/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/src/test/java/org/kie/kogito/integrationtests/springboot/MonitoringTest.java +++ b/springboot/integration-tests/src/it/integration-tests-springboot-processes-it/src/test/java/org/kie/kogito/integrationtests/springboot/MonitoringTest.java @@ -106,7 +106,7 @@ public void test() { assertThat(response).contains(format("kogito_work_item_duration_seconds_sum{artifactId=\"%s\",name=\"MonitoringTask\",version=\"%s\",}", kogitoGAV.getArtifactId(), kogitoGAV.getVersion())); assertThat(response) - .contains(format("kogito_process_instance_completed_total{app_id=\"default-process-monitoring-listener\",artifactId=\"%s\",node_name=\"2\",process_id=\"monitoring\",version=\"%s\",} 1.0", + .contains(format("kogito_process_instance_completed_total{app_id=\"default-process-monitoring-listener\",artifactId=\"%s\",process_id=\"monitoring\",process_state=\"Completed\",version=\"%s\",} 1.0", kogitoGAV.getArtifactId(), kogitoGAV.getVersion())); assertThat(response).contains(format("kogito_process_instance_running_total{app_id=\"default-process-monitoring-listener\",artifactId=\"%s\",process_id=\"monitoring\",version=\"%s\",} 0.0", kogitoGAV.getArtifactId(), kogitoGAV.getVersion())); From 111c75ffdcaedcd25fd49d5a8180f26473291e3d Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:13:55 +0200 Subject: [PATCH 03/11] [Fix #3483] Adding state duration summary (#3485) --- .../process/MetricsProcessEventListener.java | 25 ++++++++++++++----- .../kie/kogito/internal/utils/KogitoTags.java | 2 ++ .../parser/handlers/StateHandler.java | 4 +-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/addons/common/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/common/process/MetricsProcessEventListener.java b/addons/common/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/common/process/MetricsProcessEventListener.java index a2fbebf6e1b..92ddf1241e8 100644 --- a/addons/common/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/common/process/MetricsProcessEventListener.java +++ b/addons/common/monitoring/core/src/main/java/org/kie/kogito/monitoring/core/common/process/MetricsProcessEventListener.java @@ -35,6 +35,7 @@ import org.kie.kogito.internal.process.runtime.KogitoProcessInstance; import org.kie.kogito.internal.process.runtime.KogitoWorkItemNodeInstance; import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcessInstance; +import org.kie.kogito.internal.utils.KogitoTags; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -120,6 +121,11 @@ private DistributionSummary getWorkItemsDurationSummary(String name) { "Work Items Duration", Tag.of("name", name)); } + private DistributionSummary getNodeInstancesDurationSummary(String processId, String nodeName) { + return buildDistributionSummary("kogito_node_instance_duration_milliseconds", "Relevant nodes duration in milliseconds", Tag.of("process_id", processId), + Tag.of("node_name", nodeName)); + } + protected void recordRunningProcessInstance(String processId) { getRunningProcessInstancesGauge(processId).incrementAndGet(); } @@ -164,12 +170,19 @@ public void beforeNodeLeft(ProcessNodeLeftEvent event) { final KogitoNodeInstance nodeInstance = (KogitoNodeInstance) event.getNodeInstance(); if (nodeInstance instanceof KogitoWorkItemNodeInstance) { KogitoWorkItemNodeInstance wi = (KogitoWorkItemNodeInstance) nodeInstance; - if (wi.getTriggerTime() != null) { - final String name = (String) wi.getWorkItem().getParameters().getOrDefault("TaskName", wi.getWorkItem().getName()); - final double duration = millisToSeconds(wi.getLeaveTime().getTime() - wi.getTriggerTime().getTime()); - getWorkItemsDurationSummary(name).record(duration); - LOGGER.debug("Work Item {}, duration: {}s", name, duration); - } + recordNodeDuration(getWorkItemsDurationSummary((String) wi.getWorkItem().getParameters().getOrDefault("TaskName", wi.getWorkItem().getName())), nodeInstance, TimeUnit.SECONDS); + } + String nodeName = (String) nodeInstance.getNode().getMetaData().get(KogitoTags.METRIC_NAME_METADATA); + if (nodeName != null) { + recordNodeDuration(getNodeInstancesDurationSummary(event.getProcessInstance().getProcessId(), nodeName), nodeInstance, TimeUnit.MILLISECONDS); + } + } + + private void recordNodeDuration(DistributionSummary summary, KogitoNodeInstance instance, TimeUnit target) { + if (instance.getTriggerTime() != null) { + double duration = target.convert(instance.getLeaveTime().getTime() - instance.getTriggerTime().getTime(), TimeUnit.MILLISECONDS); + summary.record(duration); + LOGGER.debug("Recorded {} {} because of node {} for summary {}", duration, target, instance.getNode().getName(), summary.getId().getName()); } } diff --git a/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/KogitoTags.java b/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/KogitoTags.java index a514146fb3f..431feba23bc 100644 --- a/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/KogitoTags.java +++ b/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/KogitoTags.java @@ -27,4 +27,6 @@ public class KogitoTags { public static final String INPUT_TAG = "input"; public static final String OUTPUT_TAG = "output"; + public static final String METRIC_NAME_METADATA = "MetricName"; + } diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java index 0c1781d6041..599ea4a3dd2 100644 --- a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java +++ b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java @@ -189,7 +189,7 @@ public void handleState() { protected void handleState(RuleFlowNodeContainerFactory factory) { MakeNodeResult result = makeNode(factory); - node = result.getIncomingNode().metaData(SWFConstants.STATE_NAME, state.getName()); + node = result.getIncomingNode().metaData(SWFConstants.STATE_NAME, state.getName()).metaData(KogitoTags.METRIC_NAME_METADATA, state.getName()); outgoingNode = result.getOutgoingNode().metaData(SWFConstants.STATE_NAME, state.getName()); if (state.getCompensatedBy() != null) { handleCompensation(factory); @@ -208,7 +208,7 @@ protected void handleState(RuleFlowNodeContainerFactory factory) { if (output != null) { ActionNodeFactory actionNode = handleStateFilter(factory, output); factory.connection(outgoingNode.getNode().getId(), actionNode.getNode().getId()); - outgoingNode = actionNode.metaData(SWFConstants.STATE_NAME, state.getName()); + outgoingNode = actionNode.metaData(SWFConstants.STATE_NAME, state.getName()).metaData(KogitoTags.METRIC_NAME_METADATA, state.getName()); } } connectStart(factory); From 92c33c554a431c54435b4ce80dc19682493359dc Mon Sep 17 00:00:00 2001 From: Enrique Date: Fri, 26 Apr 2024 11:17:49 +0200 Subject: [PATCH 04/11] [incubator-kie-issues-1108] Add capability to create node instances (node states) from the nodes (#3482) --- .../CodegenNodeInstanceFactoryRegistry.java | 3 +- .../instance/impl/NodeInstanceFactory.java | 2 + .../impl/NodeInstanceFactoryProvider.java | 27 +++ .../impl/NodeInstanceFactoryRegistry.java | 178 +++--------------- .../factory/AbstractNodeInstanceFactory.java | 44 +++++ .../factory/DefaultNodeInstanceFactory.java | 50 +++++ .../DefaultNodeInstanceFactoryProvider.java | 104 ++++++++++ .../factory/SingletonNodeInstanceFactory.java | 60 ++++++ ....instance.impl.NodeInstanceFactoryProvider | 1 + .../node/MockNodeInstanceFactory.java | 5 + 10 files changed, 317 insertions(+), 157 deletions(-) create mode 100644 jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactoryProvider.java create mode 100644 jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/AbstractNodeInstanceFactory.java create mode 100644 jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/DefaultNodeInstanceFactory.java create mode 100644 jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/DefaultNodeInstanceFactoryProvider.java create mode 100644 jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/SingletonNodeInstanceFactory.java create mode 100644 jbpm/jbpm-flow/src/main/resources/META-INF/services/org.jbpm.workflow.instance.impl.NodeInstanceFactoryProvider diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/CodegenNodeInstanceFactoryRegistry.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/CodegenNodeInstanceFactoryRegistry.java index 0854d82ac02..e7c89eda05c 100644 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/CodegenNodeInstanceFactoryRegistry.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/CodegenNodeInstanceFactoryRegistry.java @@ -19,6 +19,7 @@ package org.jbpm.workflow.instance.impl; import org.jbpm.workflow.core.node.SubProcessNode; +import org.jbpm.workflow.instance.impl.factory.DefaultNodeInstanceFactory; import org.jbpm.workflow.instance.node.LambdaSubProcessNodeInstance; public class CodegenNodeInstanceFactoryRegistry extends NodeInstanceFactoryRegistry { @@ -26,7 +27,7 @@ public class CodegenNodeInstanceFactoryRegistry extends NodeInstanceFactoryRegis @Override protected NodeInstanceFactory get(Class clazz) { if (SubProcessNode.class == clazz) { - return factory(LambdaSubProcessNodeInstance::new); + return new DefaultNodeInstanceFactory(SubProcessNode.class, LambdaSubProcessNodeInstance::new); } return super.get(clazz); } diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactory.java index eb2e267924a..8ab35b38f5f 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactory.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactory.java @@ -25,6 +25,8 @@ public interface NodeInstanceFactory { + Class forClass(); + NodeInstance getNodeInstance(Node node, WorkflowProcessInstance processInstance, NodeInstanceContainer nodeInstanceContainer); } diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactoryProvider.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactoryProvider.java new file mode 100644 index 00000000000..e7dbce64761 --- /dev/null +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactoryProvider.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.workflow.instance.impl; + +import java.util.List; + +public interface NodeInstanceFactoryProvider { + + List provide(); + +} diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactoryRegistry.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactoryRegistry.java index 991932f3f1e..7fc1f2038ac 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactoryRegistry.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/NodeInstanceFactoryRegistry.java @@ -18,67 +18,17 @@ */ package org.jbpm.workflow.instance.impl; +import java.util.Collection; import java.util.HashMap; import java.util.Map; -import java.util.function.Supplier; +import java.util.ServiceLoader; -import org.jbpm.workflow.core.node.ActionNode; -import org.jbpm.workflow.core.node.AsyncEventNode; -import org.jbpm.workflow.core.node.AsyncEventNodeInstance; -import org.jbpm.workflow.core.node.BoundaryEventNode; -import org.jbpm.workflow.core.node.CatchLinkNode; -import org.jbpm.workflow.core.node.CompositeContextNode; -import org.jbpm.workflow.core.node.CompositeNode; -import org.jbpm.workflow.core.node.DynamicNode; -import org.jbpm.workflow.core.node.EndNode; -import org.jbpm.workflow.core.node.EventNode; -import org.jbpm.workflow.core.node.EventSubProcessNode; -import org.jbpm.workflow.core.node.FaultNode; -import org.jbpm.workflow.core.node.ForEachNode; -import org.jbpm.workflow.core.node.HumanTaskNode; -import org.jbpm.workflow.core.node.Join; -import org.jbpm.workflow.core.node.MilestoneNode; -import org.jbpm.workflow.core.node.RuleSetNode; -import org.jbpm.workflow.core.node.Split; -import org.jbpm.workflow.core.node.StartNode; -import org.jbpm.workflow.core.node.StateNode; -import org.jbpm.workflow.core.node.SubProcessNode; -import org.jbpm.workflow.core.node.ThrowLinkNode; -import org.jbpm.workflow.core.node.TimerNode; -import org.jbpm.workflow.core.node.WorkItemNode; -import org.jbpm.workflow.instance.WorkflowProcessInstance; -import org.jbpm.workflow.instance.node.ActionNodeInstance; -import org.jbpm.workflow.instance.node.BoundaryEventNodeInstance; -import org.jbpm.workflow.instance.node.CatchLinkNodeInstance; -import org.jbpm.workflow.instance.node.CompositeContextNodeInstance; -import org.jbpm.workflow.instance.node.CompositeNodeInstance; -import org.jbpm.workflow.instance.node.DynamicNodeInstance; -import org.jbpm.workflow.instance.node.EndNodeInstance; -import org.jbpm.workflow.instance.node.EventNodeInstance; -import org.jbpm.workflow.instance.node.EventSubProcessNodeInstance; -import org.jbpm.workflow.instance.node.FaultNodeInstance; -import org.jbpm.workflow.instance.node.ForEachNodeInstance; -import org.jbpm.workflow.instance.node.HumanTaskNodeInstance; -import org.jbpm.workflow.instance.node.JoinInstance; -import org.jbpm.workflow.instance.node.MilestoneNodeInstance; -import org.jbpm.workflow.instance.node.RuleSetNodeInstance; -import org.jbpm.workflow.instance.node.SplitInstance; -import org.jbpm.workflow.instance.node.StartNodeInstance; -import org.jbpm.workflow.instance.node.StateNodeInstance; -import org.jbpm.workflow.instance.node.SubProcessNodeInstance; -import org.jbpm.workflow.instance.node.ThrowLinkNodeInstance; -import org.jbpm.workflow.instance.node.TimerNodeInstance; -import org.jbpm.workflow.instance.node.WorkItemNodeInstance; +import org.jbpm.util.JbpmClassLoaderUtil; import org.kie.api.definition.process.Node; import org.kie.api.runtime.Environment; -import org.kie.api.runtime.process.NodeInstance; -import org.kie.api.runtime.process.NodeInstanceContainer; -import org.kie.kogito.internal.process.runtime.KogitoNodeInstanceContainer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.jbpm.ruleflow.core.Metadata.CUSTOM_ASYNC; - public class NodeInstanceFactoryRegistry { private static final Logger LOGGER = LoggerFactory.getLogger(NodeInstanceFactoryRegistry.class); private static final NodeInstanceFactoryRegistry INSTANCE = new NodeInstanceFactoryRegistry(); @@ -96,11 +46,26 @@ public static NodeInstanceFactoryRegistry getInstance(Environment environment) { protected NodeInstanceFactoryRegistry() { this.registry = new HashMap<>(); + initRegistry(); + } + + private void initRegistry() { + ServiceLoader.load(NodeInstanceFactoryProvider.class, JbpmClassLoaderUtil.findClassLoader()) + .stream() + .map(ServiceLoader.Provider::get) + .map(NodeInstanceFactoryProvider::provide) + .flatMap(Collection::stream) + .forEach(this::register); + } + + private void register(NodeInstanceFactory nodeInstanceFactory) { + LOGGER.debug("registering new node instance factory for {} set by {}", nodeInstanceFactory.forClass(), nodeInstanceFactory.getClass().getCanonicalName()); + this.registry.put(nodeInstanceFactory.forClass(), nodeInstanceFactory); } - public void register(Class cls, - NodeInstanceFactory factory) { - this.registry.put(cls, factory); + public void register(Class forClass, NodeInstanceFactory nodeInstanceFactory) { + LOGGER.debug("override new node instance factory for {} set by {}", forClass, nodeInstanceFactory.getClass().getCanonicalName()); + this.registry.put(forClass, nodeInstanceFactory); } public NodeInstanceFactory getProcessNodeInstanceFactory(Node node) { @@ -112,111 +77,12 @@ public NodeInstanceFactory getProcessNodeInstanceFactory(Node node) { } clazz = clazz.getSuperclass(); } + LOGGER.debug("node instance factory not found for node {}", node.getClass().getName()); return null; } protected NodeInstanceFactory get(Class clazz) { - // hard wired nodes: - if (RuleSetNode.class == clazz) { - return factory(RuleSetNodeInstance::new); - } - if (Split.class == clazz) { - return factory(SplitInstance::new); - } - if (Join.class == clazz) { - return factoryOnce(JoinInstance::new); - } - if (StartNode.class == clazz) { - return factory(StartNodeInstance::new); - } - if (EndNode.class == clazz) { - return factory(EndNodeInstance::new); - } - if (MilestoneNode.class == clazz) { - return factory(MilestoneNodeInstance::new); - } - if (SubProcessNode.class == clazz) { - return factory(SubProcessNodeInstance::new); - } - if (ActionNode.class == clazz) { - return factory(ActionNodeInstance::new); - } - if (WorkItemNode.class == clazz) { - return factory(WorkItemNodeInstance::new); - } - if (TimerNode.class == clazz) { - return factory(TimerNodeInstance::new); - } - if (FaultNode.class == clazz) { - return factory(FaultNodeInstance::new); - } - if (EventSubProcessNode.class == clazz) { - return factory(EventSubProcessNodeInstance::new); - } - if (CompositeNode.class == clazz) { - return factory(CompositeNodeInstance::new); - } - if (CompositeContextNode.class == clazz) { - return factory(CompositeContextNodeInstance::new); - } - if (HumanTaskNode.class == clazz) { - return factory(HumanTaskNodeInstance::new); - } - if (ForEachNode.class == clazz) { - return factory(ForEachNodeInstance::new); - } - if (EventNode.class == clazz) { - return factory(EventNodeInstance::new); - } - if (StateNode.class == clazz) { - return factory(StateNodeInstance::new); - } - if (DynamicNode.class == clazz) { - return factory(DynamicNodeInstance::new); - } - if (BoundaryEventNode.class == clazz) { - return factory(BoundaryEventNodeInstance::new); - } - if (CatchLinkNode.class == clazz) { - return factory( - CatchLinkNodeInstance::new); - } - if (ThrowLinkNode.class == clazz) { - return factory( - ThrowLinkNodeInstance::new); - } - if (AsyncEventNode.class == clazz) { - return factory( - AsyncEventNodeInstance::new); - } - return this.registry.get(clazz); } - protected NodeInstanceFactory factoryOnce(Supplier supplier) { - return (node, processInstance, nodeInstanceContainer) -> { - NodeInstance result = ((org.jbpm.workflow.instance.NodeInstanceContainer) nodeInstanceContainer).getFirstNodeInstance(node.getId()); - if (result != null) { - return result; - } else { - LOGGER.debug("creating node {} with identifier {}", node, node.getId()); - return createInstance(supplier.get(), node, processInstance, nodeInstanceContainer); - } - }; - } - - protected NodeInstanceFactory factory(Supplier supplier) { - return (node, processInstance, nodeInstanceContainer) -> createInstance(supplier.get(), node, processInstance, nodeInstanceContainer); - } - - private static NodeInstance createInstance(NodeInstanceImpl nodeInstance, Node node, WorkflowProcessInstance processInstance, NodeInstanceContainer nodeInstanceContainer) { - nodeInstance.setNodeId(node.getId()); - nodeInstance.setNodeInstanceContainer((KogitoNodeInstanceContainer) nodeInstanceContainer); - nodeInstance.setProcessInstance(processInstance); - nodeInstance.setMetaData(CUSTOM_ASYNC, node.getMetaData().get(CUSTOM_ASYNC)); - - int level = ((org.jbpm.workflow.instance.NodeInstanceContainer) nodeInstanceContainer).getLevelForNode(node.getUniqueId()); - nodeInstance.setLevel(level); - return nodeInstance; - } } diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/AbstractNodeInstanceFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/AbstractNodeInstanceFactory.java new file mode 100644 index 00000000000..6816197ed9d --- /dev/null +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/AbstractNodeInstanceFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.workflow.instance.impl.factory; + +import org.jbpm.workflow.instance.WorkflowProcessInstance; +import org.jbpm.workflow.instance.impl.NodeInstanceFactory; +import org.jbpm.workflow.instance.impl.NodeInstanceImpl; +import org.kie.api.definition.process.Node; +import org.kie.api.runtime.process.NodeInstance; +import org.kie.api.runtime.process.NodeInstanceContainer; +import org.kie.kogito.internal.process.runtime.KogitoNodeInstanceContainer; + +import static org.jbpm.ruleflow.core.Metadata.CUSTOM_ASYNC; + +public abstract class AbstractNodeInstanceFactory implements NodeInstanceFactory { + + protected NodeInstance createInstance(NodeInstanceImpl nodeInstance, Node node, WorkflowProcessInstance processInstance, NodeInstanceContainer nodeInstanceContainer) { + nodeInstance.setNodeId(node.getId()); + nodeInstance.setNodeInstanceContainer((KogitoNodeInstanceContainer) nodeInstanceContainer); + nodeInstance.setProcessInstance(processInstance); + nodeInstance.setMetaData(CUSTOM_ASYNC, node.getMetaData().get(CUSTOM_ASYNC)); + + int level = ((org.jbpm.workflow.instance.NodeInstanceContainer) nodeInstanceContainer).getLevelForNode(node.getUniqueId()); + nodeInstance.setLevel(level); + return nodeInstance; + } +} diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/DefaultNodeInstanceFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/DefaultNodeInstanceFactory.java new file mode 100644 index 00000000000..9dfb1e41de2 --- /dev/null +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/DefaultNodeInstanceFactory.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.workflow.instance.impl.factory; + +import java.util.function.Supplier; + +import org.jbpm.workflow.core.impl.NodeImpl; +import org.jbpm.workflow.instance.WorkflowProcessInstance; +import org.jbpm.workflow.instance.impl.NodeInstanceImpl; +import org.kie.api.definition.process.Node; +import org.kie.api.runtime.process.NodeInstance; +import org.kie.api.runtime.process.NodeInstanceContainer; + +public class DefaultNodeInstanceFactory extends AbstractNodeInstanceFactory { + + private Class nodeDefinition; + private Supplier nodeInstanceSupplier; + + @Override + public Class forClass() { + return nodeDefinition; + } + + public DefaultNodeInstanceFactory(Class nodeDefinition, Supplier supplier) { + this.nodeDefinition = nodeDefinition; + this.nodeInstanceSupplier = supplier; + } + + @Override + public NodeInstance getNodeInstance(Node node, WorkflowProcessInstance processInstance, NodeInstanceContainer nodeInstanceContainer) { + return createInstance(nodeInstanceSupplier.get(), node, processInstance, nodeInstanceContainer); + } + +} diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/DefaultNodeInstanceFactoryProvider.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/DefaultNodeInstanceFactoryProvider.java new file mode 100644 index 00000000000..f2b345fa264 --- /dev/null +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/DefaultNodeInstanceFactoryProvider.java @@ -0,0 +1,104 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.workflow.instance.impl.factory; + +import java.util.ArrayList; +import java.util.List; + +import org.jbpm.workflow.core.node.ActionNode; +import org.jbpm.workflow.core.node.AsyncEventNode; +import org.jbpm.workflow.core.node.AsyncEventNodeInstance; +import org.jbpm.workflow.core.node.BoundaryEventNode; +import org.jbpm.workflow.core.node.CatchLinkNode; +import org.jbpm.workflow.core.node.CompositeContextNode; +import org.jbpm.workflow.core.node.CompositeNode; +import org.jbpm.workflow.core.node.DynamicNode; +import org.jbpm.workflow.core.node.EndNode; +import org.jbpm.workflow.core.node.EventNode; +import org.jbpm.workflow.core.node.EventSubProcessNode; +import org.jbpm.workflow.core.node.FaultNode; +import org.jbpm.workflow.core.node.ForEachNode; +import org.jbpm.workflow.core.node.HumanTaskNode; +import org.jbpm.workflow.core.node.Join; +import org.jbpm.workflow.core.node.MilestoneNode; +import org.jbpm.workflow.core.node.RuleSetNode; +import org.jbpm.workflow.core.node.Split; +import org.jbpm.workflow.core.node.StartNode; +import org.jbpm.workflow.core.node.StateNode; +import org.jbpm.workflow.core.node.SubProcessNode; +import org.jbpm.workflow.core.node.ThrowLinkNode; +import org.jbpm.workflow.core.node.TimerNode; +import org.jbpm.workflow.core.node.WorkItemNode; +import org.jbpm.workflow.instance.impl.NodeInstanceFactory; +import org.jbpm.workflow.instance.impl.NodeInstanceFactoryProvider; +import org.jbpm.workflow.instance.node.ActionNodeInstance; +import org.jbpm.workflow.instance.node.BoundaryEventNodeInstance; +import org.jbpm.workflow.instance.node.CatchLinkNodeInstance; +import org.jbpm.workflow.instance.node.CompositeContextNodeInstance; +import org.jbpm.workflow.instance.node.CompositeNodeInstance; +import org.jbpm.workflow.instance.node.DynamicNodeInstance; +import org.jbpm.workflow.instance.node.EndNodeInstance; +import org.jbpm.workflow.instance.node.EventNodeInstance; +import org.jbpm.workflow.instance.node.EventSubProcessNodeInstance; +import org.jbpm.workflow.instance.node.FaultNodeInstance; +import org.jbpm.workflow.instance.node.ForEachNodeInstance; +import org.jbpm.workflow.instance.node.HumanTaskNodeInstance; +import org.jbpm.workflow.instance.node.JoinInstance; +import org.jbpm.workflow.instance.node.MilestoneNodeInstance; +import org.jbpm.workflow.instance.node.RuleSetNodeInstance; +import org.jbpm.workflow.instance.node.SplitInstance; +import org.jbpm.workflow.instance.node.StartNodeInstance; +import org.jbpm.workflow.instance.node.StateNodeInstance; +import org.jbpm.workflow.instance.node.SubProcessNodeInstance; +import org.jbpm.workflow.instance.node.ThrowLinkNodeInstance; +import org.jbpm.workflow.instance.node.TimerNodeInstance; +import org.jbpm.workflow.instance.node.WorkItemNodeInstance; + +public class DefaultNodeInstanceFactoryProvider implements NodeInstanceFactoryProvider { + + @Override + public List provide() { + List nodeInstanceFactoryList = new ArrayList<>(); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(RuleSetNode.class, RuleSetNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(Split.class, SplitInstance::new)); + nodeInstanceFactoryList.add(new SingletonNodeInstanceFactory(Join.class, JoinInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(StartNode.class, StartNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(EndNode.class, EndNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(MilestoneNode.class, MilestoneNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(SubProcessNode.class, SubProcessNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(ActionNode.class, ActionNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(WorkItemNode.class, WorkItemNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(TimerNode.class, TimerNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(FaultNode.class, FaultNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(EventSubProcessNode.class, EventSubProcessNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(CompositeNode.class, CompositeNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(CompositeContextNode.class, CompositeContextNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(HumanTaskNode.class, HumanTaskNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(ForEachNode.class, ForEachNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(EventNode.class, EventNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(StateNode.class, StateNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(DynamicNode.class, DynamicNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(BoundaryEventNode.class, BoundaryEventNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(CatchLinkNode.class, CatchLinkNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(ThrowLinkNode.class, ThrowLinkNodeInstance::new)); + nodeInstanceFactoryList.add(new DefaultNodeInstanceFactory(AsyncEventNode.class, AsyncEventNodeInstance::new)); + return nodeInstanceFactoryList; + } + +} diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/SingletonNodeInstanceFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/SingletonNodeInstanceFactory.java new file mode 100644 index 00000000000..57b1878a453 --- /dev/null +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/factory/SingletonNodeInstanceFactory.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.workflow.instance.impl.factory; + +import java.util.function.Supplier; + +import org.jbpm.workflow.core.impl.NodeImpl; +import org.jbpm.workflow.instance.WorkflowProcessInstance; +import org.jbpm.workflow.instance.impl.NodeInstanceImpl; +import org.kie.api.definition.process.Node; +import org.kie.api.runtime.process.NodeInstance; +import org.kie.api.runtime.process.NodeInstanceContainer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SingletonNodeInstanceFactory extends AbstractNodeInstanceFactory { + + private static final Logger LOGGER = LoggerFactory.getLogger(SingletonNodeInstanceFactory.class); + + private Class nodeDefinition; + private Supplier nodeInstanceSupplier; + + @Override + public Class forClass() { + return nodeDefinition; + } + + public SingletonNodeInstanceFactory(Class nodeDefinition, Supplier nodeInstanceSupplier) { + this.nodeDefinition = nodeDefinition; + this.nodeInstanceSupplier = nodeInstanceSupplier; + } + + @Override + public NodeInstance getNodeInstance(Node node, WorkflowProcessInstance processInstance, NodeInstanceContainer nodeInstanceContainer) { + NodeInstance result = ((org.jbpm.workflow.instance.NodeInstanceContainer) nodeInstanceContainer).getFirstNodeInstance(node.getId()); + if (result != null) { + return result; + } else { + LOGGER.debug("creating node {} with identifier {}", node, node.getId()); + return createInstance(nodeInstanceSupplier.get(), node, processInstance, nodeInstanceContainer); + } + } + +} diff --git a/jbpm/jbpm-flow/src/main/resources/META-INF/services/org.jbpm.workflow.instance.impl.NodeInstanceFactoryProvider b/jbpm/jbpm-flow/src/main/resources/META-INF/services/org.jbpm.workflow.instance.impl.NodeInstanceFactoryProvider new file mode 100644 index 00000000000..236f07a277a --- /dev/null +++ b/jbpm/jbpm-flow/src/main/resources/META-INF/services/org.jbpm.workflow.instance.impl.NodeInstanceFactoryProvider @@ -0,0 +1 @@ +org.jbpm.workflow.instance.impl.factory.DefaultNodeInstanceFactoryProvider \ No newline at end of file diff --git a/jbpm/jbpm-flow/src/test/java/org/jbpm/workflow/instance/node/MockNodeInstanceFactory.java b/jbpm/jbpm-flow/src/test/java/org/jbpm/workflow/instance/node/MockNodeInstanceFactory.java index 19611f70bfa..6b65cb9e8da 100755 --- a/jbpm/jbpm-flow/src/test/java/org/jbpm/workflow/instance/node/MockNodeInstanceFactory.java +++ b/jbpm/jbpm-flow/src/test/java/org/jbpm/workflow/instance/node/MockNodeInstanceFactory.java @@ -32,6 +32,11 @@ public class MockNodeInstanceFactory implements NodeInstanceFactory { private MockNodeInstance instance; + @Override + public Class forClass() { + return this.instance.getNode().getClass(); + } + public MockNodeInstanceFactory(MockNodeInstance instance) { this.instance = instance; } From 0ac6c2ece9cf25e56029100c87ec3c64e18823ad Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:19:46 +0200 Subject: [PATCH 05/11] [Fix #3480] Changing jsonb to varchar (#3484) * [Fix #3469 Fix #3480] Changing jsonb to varchar * [Fix #3480] Change blob to varbinary for ansi --- ...itory.java => JDBCCorrelationRepository.java} | 6 +++--- ...nService.java => JDBCCorrelationService.java} | 8 ++++---- .../db/ansi/V1.35.0__create_runtime_ansi.sql | 10 +++++----- .../db/ansi/V10.0.1__create_correlation_ansi.sql | 9 +++++++++ .../V10.0.1__alter_correlation_PostgreSQL.sql | 2 ++ .../correlation/JDBCCorrelationServiceIT.java | 6 +++--- .../quarkus/JDBCorrelationServiceProducer.java | 16 ++-------------- 7 files changed, 28 insertions(+), 29 deletions(-) rename addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/{PostgreSQLCorrelationRepository.java => JDBCCorrelationRepository.java} (97%) rename addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/{PostgreSQLCorrelationService.java => JDBCCorrelationService.java} (89%) create mode 100644 addons/common/persistence/jdbc/src/main/resources/db/ansi/V10.0.1__create_correlation_ansi.sql create mode 100644 addons/common/persistence/jdbc/src/main/resources/db/postgresql/V10.0.1__alter_correlation_PostgreSQL.sql diff --git a/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationRepository.java b/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationRepository.java similarity index 97% rename from addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationRepository.java rename to addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationRepository.java index 1d540705b7d..eeebcda9016 100644 --- a/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationRepository.java +++ b/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationRepository.java @@ -34,9 +34,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; -public class PostgreSQLCorrelationRepository { +public class JDBCCorrelationRepository { - static final String INSERT = "INSERT INTO correlation_instances (id, encoded_correlation_id, correlated_id, correlation) VALUES (?, ?, ?, ?::json)"; + static final String INSERT = "INSERT INTO correlation_instances (id, encoded_correlation_id, correlated_id, correlation) VALUES (?, ?, ?, ?)"; static final String DELETE = "DELETE FROM correlation_instances WHERE encoded_correlation_id = ?"; private static final String FIND_BY_ENCODED_ID = "SELECT correlated_id, correlation FROM correlation_instances WHERE encoded_correlation_id = ?"; private static final String FIND_BY_CORRELATED_ID = "SELECT encoded_correlation_id, correlation FROM correlation_instances WHERE correlated_id = ?"; @@ -44,7 +44,7 @@ public class PostgreSQLCorrelationRepository { private DataSource dataSource; private ObjectMapper objectMapper; - public PostgreSQLCorrelationRepository(DataSource dataSource) { + public JDBCCorrelationRepository(DataSource dataSource) { this.dataSource = dataSource; this.objectMapper = ObjectMapperFactory.get().copy(); diff --git a/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationService.java b/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationService.java similarity index 89% rename from addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationService.java rename to addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationService.java index d4eba667200..d3624064f8a 100644 --- a/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/PostgreSQLCorrelationService.java +++ b/addons/common/persistence/jdbc/src/main/java/org/kie/kogito/persistence/jdbc/correlation/JDBCCorrelationService.java @@ -28,13 +28,13 @@ import org.kie.kogito.correlation.CorrelationService; import org.kie.kogito.event.correlation.MD5CorrelationEncoder; -public class PostgreSQLCorrelationService implements CorrelationService { +public class JDBCCorrelationService implements CorrelationService { - private PostgreSQLCorrelationRepository repository; + private JDBCCorrelationRepository repository; private CorrelationEncoder correlationEncoder; - public PostgreSQLCorrelationService(DataSource dataSource) { - this.repository = new PostgreSQLCorrelationRepository(dataSource); + public JDBCCorrelationService(DataSource dataSource) { + this.repository = new JDBCCorrelationRepository(dataSource); this.correlationEncoder = new MD5CorrelationEncoder(); } diff --git a/addons/common/persistence/jdbc/src/main/resources/db/ansi/V1.35.0__create_runtime_ansi.sql b/addons/common/persistence/jdbc/src/main/resources/db/ansi/V1.35.0__create_runtime_ansi.sql index c8c2f02afd2..2868565c5ea 100644 --- a/addons/common/persistence/jdbc/src/main/resources/db/ansi/V1.35.0__create_runtime_ansi.sql +++ b/addons/common/persistence/jdbc/src/main/resources/db/ansi/V1.35.0__create_runtime_ansi.sql @@ -1,10 +1,10 @@ CREATE TABLE process_instances ( - id CHAR(36) NOT NULL, - payload BLOB NOT NULL, - process_id VARCHAR(4000) NOT NULL, - version BIGINT(19), - process_version VARCHAR(4000), + id character(36) NOT NULL, + payload varbinary(1000000) NOT NULL, + process_id character varying(4000) NOT NULL, + version bigint, + process_version character varying(4000), CONSTRAINT process_instances_pkey PRIMARY KEY (id) ); CREATE INDEX idx_process_instances_process_id ON process_instances (process_id, id, process_version); diff --git a/addons/common/persistence/jdbc/src/main/resources/db/ansi/V10.0.1__create_correlation_ansi.sql b/addons/common/persistence/jdbc/src/main/resources/db/ansi/V10.0.1__create_correlation_ansi.sql new file mode 100644 index 00000000000..14adf0fab3a --- /dev/null +++ b/addons/common/persistence/jdbc/src/main/resources/db/ansi/V10.0.1__create_correlation_ansi.sql @@ -0,0 +1,9 @@ +CREATE TABLE correlation_instances +( + id character(36) NOT NULL, + encoded_correlation_id character varying(36) NOT NULL UNIQUE, + correlated_id character varying(36) NOT NULL, + correlation character varying(8000) NOT NULL, + version bigint, + CONSTRAINT correlation_instances_pkey PRIMARY KEY (id) +); \ No newline at end of file diff --git a/addons/common/persistence/jdbc/src/main/resources/db/postgresql/V10.0.1__alter_correlation_PostgreSQL.sql b/addons/common/persistence/jdbc/src/main/resources/db/postgresql/V10.0.1__alter_correlation_PostgreSQL.sql new file mode 100644 index 00000000000..e7b60997a17 --- /dev/null +++ b/addons/common/persistence/jdbc/src/main/resources/db/postgresql/V10.0.1__alter_correlation_PostgreSQL.sql @@ -0,0 +1,2 @@ +ALTER TABLE correlation_instances +ALTER COLUMN correlation TYPE character varying; diff --git a/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/correlation/JDBCCorrelationServiceIT.java b/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/correlation/JDBCCorrelationServiceIT.java index f374bf8dad1..62212ac0eb0 100644 --- a/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/correlation/JDBCCorrelationServiceIT.java +++ b/addons/common/persistence/jdbc/src/test/java/org/kie/persistence/jdbc/correlation/JDBCCorrelationServiceIT.java @@ -27,7 +27,7 @@ import org.kie.kogito.correlation.CompositeCorrelation; import org.kie.kogito.correlation.CorrelationInstance; import org.kie.kogito.correlation.SimpleCorrelation; -import org.kie.kogito.persistence.jdbc.correlation.PostgreSQLCorrelationService; +import org.kie.kogito.persistence.jdbc.correlation.JDBCCorrelationService; import org.kie.kogito.testcontainers.KogitoPostgreSqlContainer; import org.postgresql.ds.PGSimpleDataSource; import org.testcontainers.containers.JdbcDatabaseContainer; @@ -42,7 +42,7 @@ public class JDBCCorrelationServiceIT { @Container private static final KogitoPostgreSqlContainer PG_CONTAINER = new KogitoPostgreSqlContainer(); private static PGSimpleDataSource dataSource; - private static PostgreSQLCorrelationService correlationService; + private static JDBCCorrelationService correlationService; @BeforeAll public static void setUp() { @@ -50,7 +50,7 @@ public static void setUp() { dataSource.setUrl(PG_CONTAINER.getJdbcUrl()); dataSource.setUser(PG_CONTAINER.getUsername()); dataSource.setPassword(PG_CONTAINER.getPassword()); - correlationService = new PostgreSQLCorrelationService(dataSource); + correlationService = new JDBCCorrelationService(dataSource); //create table // DDLRunner.init(new GenericRepository(dataSource), true); initMigration(PG_CONTAINER, "postgresql"); diff --git a/quarkus/addons/persistence/jdbc/runtime/src/main/java/org/kie/kogito/persistence/quarkus/JDBCorrelationServiceProducer.java b/quarkus/addons/persistence/jdbc/runtime/src/main/java/org/kie/kogito/persistence/quarkus/JDBCorrelationServiceProducer.java index a2bbcbf0a55..f60c26c3911 100644 --- a/quarkus/addons/persistence/jdbc/runtime/src/main/java/org/kie/kogito/persistence/quarkus/JDBCorrelationServiceProducer.java +++ b/quarkus/addons/persistence/jdbc/runtime/src/main/java/org/kie/kogito/persistence/quarkus/JDBCorrelationServiceProducer.java @@ -18,29 +18,17 @@ */ package org.kie.kogito.persistence.quarkus; -import java.util.Optional; - import javax.sql.DataSource; -import org.eclipse.microprofile.config.inject.ConfigProperty; import org.kie.kogito.correlation.CorrelationService; -import org.kie.kogito.event.correlation.DefaultCorrelationService; -import org.kie.kogito.persistence.jdbc.correlation.PostgreSQLCorrelationService; +import org.kie.kogito.persistence.jdbc.correlation.JDBCCorrelationService; import jakarta.enterprise.inject.Produces; -import jakarta.inject.Inject; - -import static org.kie.kogito.persistence.quarkus.KogitoAddOnPersistenceJDBCConfigSourceFactory.DATASOURCE_DB_KIND; -import static org.kie.kogito.persistence.quarkus.KogitoAddOnPersistenceJDBCConfigSourceFactory.POSTGRESQL; public class JDBCorrelationServiceProducer { - @Inject - @ConfigProperty(name = DATASOURCE_DB_KIND) - Optional dbKind; - @Produces public CorrelationService jdbcCorrelationService(DataSource dataSource) { - return dbKind.filter(POSTGRESQL::equals).isPresent() ? new PostgreSQLCorrelationService(dataSource) : new DefaultCorrelationService(); + return new JDBCCorrelationService(dataSource); } } From effe2cbd1f78ad134bec64f856ea868c57640b13 Mon Sep 17 00:00:00 2001 From: Enrique Date: Sat, 27 Apr 2024 12:22:41 +0200 Subject: [PATCH 06/11] [incubator-kie-issues-1103] Move tests and create infrastructure to move old legacy v7 tests to kogito. (#3478) * [incubator-kie-issues-1103] Move tests and create infrastructure to move old legacy v7 tests to kogito. --- .../internal/utils/ConversionUtils.java | 4 + jbpm/jbpm-bpmn2/pom.xml | 67 +- .../ActivityGenerationModelTest.java | 613 ------------------ .../compiler/canonical/AbstractVisitor.java | 5 +- .../compiler/canonical/ActionNodeVisitor.java | 26 +- .../LambdaSubProcessNodeVisitor.java | 22 +- .../compiler/canonical/ModelMetaData.java | 10 +- .../ProcessToExecModelGenerator.java | 12 +- .../compiler/canonical/SplitNodeVisitor.java | 3 +- .../compiler/canonical/TemplateHelper.java | 48 ++ .../compiler/canonical/TriggerMetaData.java | 3 +- jbpm/jbpm-tests/pom.xml | 163 +++++ ...OutputAssignmentCustomExpressionLang.bpmn2 | 2 +- .../bpmn2/activity}/BPMN2-ScriptTask.bpmn2 | 2 +- .../activity}/BPMN2-ScriptTaskFEEL.bpmn2 | 2 +- .../activity}/BPMN2-ScriptTaskWithIO.bpmn2 | 2 +- .../jbpm/bpmn2/activity}/BPMN2-UserTask.bpmn2 | 12 +- .../BPMN2-UserTaskWithBooleanOutput.bpmn2 | 2 +- .../BPMN2-UserTaskWithDataStore.bpmn2 | 6 +- .../BPMN2-UserTaskWithIOexpression.bpmn2 | 2 +- .../BPMN2-UserTaskWithParametrizedInput.bpmn2 | 2 +- ...BPMN2-UserTaskWithSimulationMetaData.bpmn2 | 2 +- .../BPMN2-SubProcessInAdHocProcess.bpmn2 | 2 +- .../BPMN2-CollaborationBoundaryMessage.bpmn2} | 4 +- ...N2-CollaborationIntermediateMessage.bpmn2} | 4 +- .../BPMN2-CollaborationStartMessage.bpmn2} | 4 +- .../compensation/BPMN2-BookResource.bpmn2 | 11 +- .../bpmn2}/compensation/BPMN2-Booking.bpmn2 | 2 +- .../compensation/BPMN2-CancelResource.bpmn2 | 4 +- .../compensation/BPMN2-InSubSubProcess.bpmn2} | 2 +- .../BPMN2-IntermediateThrowEvent.bpmn2} | 2 +- ...dCompensationIntermediateThrowEvent.bpmn2} | 2 +- .../BPMN2-ThrowSpecificForSubProcess.bpmn2} | 4 +- ...N2-UserTaskBeforeAssociatedActivity.bpmn2} | 2 +- .../BPMN2-UserTaskCompensation.bpmn2 | 2 +- .../jbpm/bpmn2/data}/BPMN2-Association.bpmn2 | 4 +- .../bpmn2/data}/BPMN2-CorrelationKey.bpmn2 | 4 +- .../data}/BPMN2-DataInputAssociations.bpmn2 | 2 +- ...2-DataInputAssociationsLazyCreating.bpmn2} | 4 +- .../BPMN2-DataInputAssociationsString.bpmn2} | 2 +- ...DataInputAssociationsStringNoQuotes.bpmn2} | 2 +- ...2-DataInputAssociationsStringObject.bpmn2} | 2 +- ...MN2-DataInputAssociationsXmlLiteral.bpmn2} | 2 +- .../jbpm/bpmn2/data}/BPMN2-DataObject.bpmn2 | 2 +- .../data}/BPMN2-DataOutputAssociations.bpmn2 | 2 +- ...BPMN2-DataOutputAssociationsXmlNode.bpmn2} | 2 +- .../jbpm/bpmn2/data}/BPMN2-DataStore.bpmn2 | 4 +- .../jbpm/bpmn2/data/BPMN2-Evaluation.bpmn2} | 2 +- .../jbpm/bpmn2/data/BPMN2-Evaluation2.bpmn2} | 2 +- .../jbpm/bpmn2/data/BPMN2-Evaluation3.bpmn2} | 4 +- .../org/jbpm/bpmn2/data}/BPMN2-Import.bpmn2 | 2 +- ...ryErrorEventCatchingOnEntryException.bpmn2 | 2 +- ...aryErrorEventCatchingOnExitException.bpmn2 | 2 +- ...yErrorEventDefaultHandlerByErrorCode.bpmn2 | 2 +- ...HandlerWithErrorCodeWithStructureRef.bpmn2 | 2 +- ...dlerWithErrorCodeWithoutStructureRef.bpmn2 | 2 +- ...BPMN2-BoundaryErrorEventStructureRef.bpmn2 | 2 +- .../BPMN2-EndErrorWithEventSubprocess.bpmn2} | 2 +- ...BPMN2-ErrorBoundaryEventInterrupting.bpmn2 | 2 +- .../BPMN2-ErrorBoundaryEventOnTask.bpmn2 | 2 +- ...BPMN2-EventSubProcessErrorWithScript.bpmn2 | 2 +- .../error}/BPMN2-EventSubprocessError.bpmn2 | 2 +- ...ubprocessErrorHandlingWithErrorCode.bpmn2} | 2 +- .../BPMN2-EscalationBoundaryEvent.bpmn2 | 2 +- ...-EscalationBoundaryEventInterrupting.bpmn2 | 2 +- .../BPMN2-EscalationBoundaryEventOnTask.bpmn2 | 2 +- ...ationBoundaryEventOnTaskInterrupting.bpmn2 | 2 +- .../escalation/BPMN2-EscalationEndEvent.bpmn2 | 2 +- .../BPMN2-EscalationEndEventHandling.bpmn2 | 2 +- .../BPMN2-EscalationWithDataMapping.bpmn2 | 2 +- ...MN2-IntermediateThrowEventEscalation.bpmn2 | 2 +- .../event}/BPMN2-EndEventSignalWithData.bpmn2 | 2 +- .../bpmn2/event}/BPMN2-ErrorEndEvent.bpmn2 | 2 +- ...MN2-OnEntryExitDesignerScriptProcess.bpmn2 | 2 +- ...ntryExitMixedNamespacedScriptProcess.bpmn2 | 2 +- ...2-OnEntryExitNamespacedScriptProcess.bpmn2 | 2 +- .../BPMN2-OnEntryExitScriptProcess.bpmn2 | 2 +- .../bpmn2/event}/BPMN2-ParallelSplit.bpmn2 | 2 +- .../event/BPMN2-ParallelSplitTerminate.bpmn2} | 2 +- .../bpmn2/event}/BPMN2-SignalEndEvent.bpmn2 | 2 +- ...ubprocessWithParallelSplitTerminate.bpmn2} | 2 +- .../jbpm/bpmn2/feel}/BPMN2-GatewayFEEL.bpmn2 | 2 +- ...PMN2-CompositeProcessWithDIGraphical.bpmn2 | 4 +- .../bpmn2/flow}/BPMN2-ExclusiveSplit.bpmn2 | 2 +- .../flow}/BPMN2-ExclusiveSplitPriority.bpmn2 | 2 +- .../flow}/BPMN2-InclusiveGatewayNested.bpmn2 | 2 +- .../BPMN2-InclusiveGatewayWithDefault.bpmn2 | 2 +- ...nclusiveGatewayWithHumanTasksProcess.bpmn2 | 2 +- ...BPMN2-InclusiveGatewayWithLoopInside.bpmn2 | 2 +- ...usiveGatewayWithLoopInsideSubprocess.bpmn2 | 2 +- ...iveNestedInParallelNestedInExclusive.bpmn2 | 2 +- .../bpmn2/flow}/BPMN2-InclusiveSplit.bpmn2 | 2 +- .../flow}/BPMN2-InclusiveSplitAndJoin.bpmn2 | 2 +- .../BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2 | 2 +- ...BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2 | 2 +- .../BPMN2-InclusiveSplitAndJoinLoop.bpmn2 | 2 +- .../BPMN2-InclusiveSplitAndJoinLoop2.bpmn2 | 2 +- .../BPMN2-InclusiveSplitAndJoinNested.bpmn2 | 2 +- .../BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2 | 2 +- ...N2-InclusiveSplitAndJoinWithParallel.bpmn2 | 2 +- ...BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2 | 2 +- .../org/jbpm/bpmn2/flow}/BPMN2-Lane.bpmn2 | 2 +- .../bpmn2/flow}/BPMN2-MinimalProcess.bpmn2 | 2 +- .../flow}/BPMN2-MinimalProcessImplicit.bpmn2 | 2 +- .../flow}/BPMN2-MinimalProcessMetaData.bpmn2 | 2 +- .../BPMN2-MinimalProcessWithDIGraphical.bpmn2 | 2 +- .../BPMN2-MinimalProcessWithGraphical.bpmn2 | 4 +- .../bpmn2/flow}/BPMN2-MultiConnEnabled.bpmn2 | 2 +- ...tiInstanceLoopCharacteristicsProcess.bpmn2 | 2 +- ...pCharacteristicsProcessWithORgateway.bpmn2 | 2 +- ...LoopCharacteristicsProcessWithOutput.bpmn2 | 2 +- ...racteristicsProcessWithOutputCmpCond.bpmn2 | 2 +- ...nceLoopCharacteristicsTaskWithOutput.bpmn2 | 3 +- ...CharacteristicsTaskWithOutputCmpCond.bpmn2 | 3 +- ...haracteristicsTaskWithOutputCmpCond2.bpmn2 | 3 +- .../BPMN2-MultiInstanceLoopNumbering.bpmn2} | 6 +- ...MultiInstanceProcessWithOutputOnTask.bpmn2 | 3 +- .../flow}/BPMN2-MultipleGatewaysProcess.bpmn2 | 2 +- .../BPMN2-MultipleProcessInOneFile.bpmn2 | 6 +- ...MN2-ProcessCustomDescriptionMetaData.bpmn2 | 2 +- ...essVariableCustomDescriptionMetaData.bpmn2 | 2 +- .../flow}/BPMN2-ProcessWithVariableName.bpmn2 | 2 +- .../bpmn2/flow/BPMN2-XORSameTarget.bpmn2} | 2 +- ...BPMN2-BoundaryConditionalEventOnTask.bpmn2 | 2 +- ...-BoundaryEventWithNonEffectiveSignal.bpmn2 | 2 +- .../BPMN2-BoundaryEventWithSignals.bpmn2 | 2 +- .../BPMN2-BoundaryMessageEventOnTask.bpmn2 | 2 +- .../BPMN2-BoundarySignalEventOnTask.bpmn} | 2 +- ...ConditionalBoundaryEventInterrupting.bpmn2 | 2 +- .../BPMN2-EndThrowEventScope.bpmn2} | 2 +- .../intermediate}/BPMN2-EventBasedSplit.bpmn2 | 2 +- .../BPMN2-EventBasedSplit2.bpmn2 | 2 +- .../BPMN2-EventBasedSplit3.bpmn2 | 2 +- .../BPMN2-EventBasedSplit4.bpmn2 | 2 +- .../BPMN2-EventBasedSplit5.bpmn2 | 2 +- ...N2-EventSubProcessWithLocalVariables.bpmn2 | 2 +- ...2-EventSubprocessErrorSignalEmbedded.bpmn2 | 2 +- .../BPMN2-EventSubprocessSignal.bpmn2 | 2 +- ...PMN2-EventSubprocessSignalExpression.bpmn2 | 2 +- ...N2-EventSubprocessSignalInterrupting.bpmn2 | 2 +- .../BPMN2-EventSubprocessSignalNested.bpmn2} | 2 +- ...2-EventSubprocessSignalWithStateNode.bpmn2 | 2 +- .../BPMN2-EventSubprocessTimer.bpmn2 | 2 +- .../BPMN2-EventSubprocessTimerCycle.bpmn2 | 2 +- ...clusiveEventBasedGatewayInSubprocess.bpmn2 | 2 +- ...PMN2-IntermediateCatchEventCondition.bpmn2 | 2 +- ...ventConditionFilterByProcessInstance.bpmn2 | 2 +- ...N2-IntermediateCatchEventConditionPI.bpmn2 | 2 +- ...eCatchEventConditionSetVariableAfter.bpmn2 | 2 +- .../BPMN2-IntermediateCatchEventMessage.bpmn2 | 2 +- ...IntermediateCatchEventMessageWithRef.bpmn2 | 2 +- .../BPMN2-IntermediateCatchEventSignal.bpmn2 | 2 +- ...-IntermediateCatchEventSignalWithRef.bpmn2 | 2 +- ...rmediateCatchEventSignalWithVariable.bpmn2 | 2 +- ...N2-IntermediateCatchEventTimerCycle1.bpmn2 | 2 +- ...N2-IntermediateCatchEventTimerCycle2.bpmn2 | 2 +- ...-IntermediateCatchEventTimerCycleISO.bpmn2 | 2 +- ...mediateCatchEventTimerCycleWithError.bpmn2 | 2 +- ...2-IntermediateCatchEventTimerDateISO.bpmn2 | 2 +- ...-IntermediateCatchEventTimerDuration.bpmn2 | 2 +- ...termediateCatchEventTimerDurationISO.bpmn2 | 2 +- .../BPMN2-IntermediateCatchSignalSingle.bpmn2 | 2 +- .../BPMN2-IntermediateLinkEvent.bpmn2 | 2 +- ...-IntermediateThrowEventExternalScope.bpmn2 | 2 +- .../BPMN2-IntermediateThrowEventNone.bpmn2 | 2 +- .../BPMN2-IntermediateThrowEventScope.bpmn2} | 2 +- .../BPMN2-IntermediateThrowEventSignal.bpmn2 | 65 ++ ...IntermediateThrowEventSignalWithData.bpmn2 | 3 +- ...rmediateThrowEventSignalWithVariable.bpmn2 | 4 +- .../BPMN2-LinkEventCompositeProcess.bpmn2 | 4 +- ...iInstanceSubprocessWithBoundaryError.bpmn2 | 2 +- ...InstanceSubprocessWithBoundarySignal.bpmn2 | 2 +- ...ocessWithBoundarySignalNoInterupting.bpmn2 | 2 +- ...PMN2-MultipleMessageSignalSubprocess.bpmn2 | 2 +- ...PMN2-SignalBoundaryEventInterrupting.bpmn2 | 2 +- .../BPMN2-SignalBoundaryOnSubProcess.bpmn | 2 +- ...SignalEndEventAndSignalBoundaryEvent.bpmn2 | 2 +- ...ediateCatchEventSignalWithSLAOnEvent.bpmn2 | 2 +- .../bpmn2/sla}/BPMN2-UserTaskWithSLA.bpmn2 | 2 +- .../sla}/BPMN2-UserTaskWithSLAExpr.bpmn2 | 2 +- .../sla}/BPMN2-UserTaskWithSLAOnTask.bpmn2 | 2 +- .../BPMN2-IntermediateThrowEventSignal.bpmn2 | 3 +- .../bpmn2/start}/BPMN2-MessageStart.bpmn2 | 2 +- ...-MultipleEventBasedStartEventProcess.bpmn2 | 2 +- .../BPMN2-MultipleStartEventProcess.bpmn2 | 2 +- ...ultipleStartEventProcessLongInterval.bpmn2 | 2 +- .../jbpm/bpmn2/start}/BPMN2-SignalStart.bpmn2 | 2 +- .../bpmn2/start}/BPMN2-StartTimerCycle.bpmn2 | 2 +- .../start}/BPMN2-StartTimerDuration.bpmn2 | 2 +- .../jbpm/bpmn2/start}/BPMN2-TimerStart.bpmn2 | 2 +- .../start}/BPMN2-TimerStartCycleLegacy.bpmn2 | 2 +- .../bpmn2/start}/BPMN2-TimerStartDate.bpmn2 | 2 +- .../start}/BPMN2-TimerStartDuration.bpmn2 | 2 +- .../bpmn2/start}/BPMN2-TimerStartISO.bpmn2 | 2 +- .../subprocess/BPMN2-AssignmentProcess.bpmn2} | 4 +- .../BPMN2-AssignmentSubProcess.bpmn2} | 2 +- .../subprocess}/BPMN2-CallActivity.bpmn2 | 4 +- .../subprocess}/BPMN2-CallActivity2.bpmn2 | 4 +- .../subprocess/BPMN2-CallActivity3.bpmn2 | 77 +++ .../subprocess}/BPMN2-CallActivityMI.bpmn2 | 4 +- ...MN2-CallActivityProcessBoundaryError.bpmn2 | 4 +- ...CallActivityProcessWithBoundaryEvent.bpmn2 | 70 ++ .../BPMN2-CallActivitySubProcess.bpmn2 | 2 +- ...-CallActivitySubProcessBoundaryError.bpmn2 | 2 +- ...lActivitySubProcessWithBoundaryEvent.bpmn2 | 2 +- .../BPMN2-CallActivityWithBoundaryEvent.bpmn2 | 4 +- .../BPMN2-CallActivityWithIOexpression.bpmn2 | 4 +- .../BPMN2-DynamicSignalChild.bpmn2} | 2 +- .../BPMN2-DynamicSignalParent.bpmn2} | 4 +- .../BPMN2-ErrorsBetweenProcess.bpmn2} | 4 +- .../BPMN2-ErrorsBetweenSubProcess.bpmn2} | 2 +- .../BPMN2-InputMappingUsingValue.bpmn2} | 4 +- .../BPMN2-MainGroupAssignment.bpmn2 | 4 +- .../BPMN2-SingleTaskWithVarDef.bpmn2} | 2 +- .../bpmn2/subprocess}/BPMN2-SubProcess.bpmn2 | 2 +- ...BPMN2-SubProcessWithEntryExitScripts.bpmn2 | 2 +- ...PMN2-SubProcessWithTerminateEndEvent.bpmn2 | 2 +- ...essWithTerminateEndEventProcessScope.bpmn2 | 2 +- .../BPMN2-SubProcessWithTypeVariable.bpmn2 | 2 +- .../BPMN2-SubprocessGroupAssignment.bpmn2 | 2 +- ...PMN2-ApprovalWithCustomVariableTags.bpmn2} | 2 +- ...N2-ApprovalWithReadonlyVariableTags.bpmn2} | 2 +- ...N2-ApprovalWithRequiredVariableTags.bpmn2} | 2 +- .../jbpm/bpmn2/task}/BPMN2-ReceiveTask.bpmn2 | 2 +- .../org/jbpm/bpmn2/task}/BPMN2-SendTask.bpmn2 | 2 +- .../BPMN2-IntermediateTimerEventMI.bpmn2 | 2 +- ...MN2-IntermediateTimerParallelGateway.bpmn2 | 2 +- .../BPMN2-ParallelSplitWithTimerProcess.bpmn2 | 2 +- .../BPMN2-TimerBoundaryEventCycle1.bpmn2 | 2 +- .../BPMN2-TimerBoundaryEventCycle2.bpmn2 | 2 +- .../BPMN2-TimerBoundaryEventCycleISO.bpmn2 | 2 +- .../BPMN2-TimerBoundaryEventDateISO.bpmn2 | 2 +- .../BPMN2-TimerBoundaryEventDuration.bpmn2 | 2 +- .../BPMN2-TimerBoundaryEventDurationISO.bpmn2 | 3 +- ...BPMN2-TimerBoundaryEventInterrupting.bpmn2 | 4 +- ...TimerBoundaryEventInterruptingOnTask.bpmn2 | 3 +- ...ryEventInterruptingOnTaskCancelTimer.bpmn2 | 3 +- .../java/org/jbpm/bpmn2/ActivityTest.java | 180 ++--- .../java/org/jbpm/bpmn2/AgendaFilterTest.java | 0 .../jbpm/bpmn2/BrokenStructureRefTest.java | 0 .../org/jbpm/bpmn2/CollaborationTest.java | 20 +- .../java/org/jbpm/bpmn2/CompensationTest.java | 34 +- .../java/org/jbpm/bpmn2/CompilationTest.java | 0 .../test/java/org/jbpm/bpmn2/DataTest.java | 70 +- ...eclaredTypeSequenceFlowExpressionTest.java | 0 .../java/org/jbpm/bpmn2/EndEventTest.java | 22 +- .../java/org/jbpm/bpmn2/ErrorEventTest.java | 46 +- .../org/jbpm/bpmn2/EscalationEventTest.java | 24 +- .../test/java/org/jbpm/bpmn2/FEELTest.java | 6 +- .../test/java/org/jbpm/bpmn2/FlowTest.java | 114 ++-- .../java/org/jbpm/bpmn2/ImportClassTest.java | 0 .../bpmn2/IncrementalCompilationTest.java | 0 .../org/jbpm/bpmn2/IntermediateEventTest.java | 341 +++++----- .../org/jbpm/bpmn2/JbpmBpmn2TestCase.java | 0 ...itoSetProcessInstanceVariablesCommand.java | 0 .../src/test/java/org/jbpm/bpmn2/Message.java | 0 .../org/jbpm/bpmn2/ProcessFactoryTest.java | 0 .../java/org/jbpm/bpmn2/ResourceTest.java | 62 ++ .../org/jbpm/bpmn2/SLAComplianceTest.java | 40 +- .../jbpm/bpmn2/StandaloneBPMNProcessTest.java | 140 ++-- .../java/org/jbpm/bpmn2/StartEventTest.java | 72 +- .../java/org/jbpm/bpmn2/VariableTagsTest.java | 18 +- .../KogitoWorkingMemoryInMemoryLogger.java | 0 .../MultipleProcessesPerThreadTest.java | 0 .../concurrency/OneProcessPerThreadTest.java | 0 .../handler/ErrornousWorkItemHandler.java | 0 .../LoggingTaskHandlerWrapperTest.java | 0 .../WorkItemHandlerExceptionHandlingTest.java | 0 .../java/org/jbpm/bpmn2/objects/Account.java | 0 .../java/org/jbpm/bpmn2/objects/Address.java | 0 .../objects/ExceptionOnPurposeHandler.java | 0 .../jbpm/bpmn2/objects/ExceptionService.java | 0 .../org/jbpm/bpmn2/objects/HelloService.java | 0 .../java/org/jbpm/bpmn2/objects/MyError.java | 0 .../objects/NotAvailableGoodsReport.java | 0 .../java/org/jbpm/bpmn2/objects/Order.java | 0 .../java/org/jbpm/bpmn2/objects/Person.java | 0 .../java/org/jbpm/bpmn2/objects/Status.java | 0 .../bpmn2/objects/TestWorkItemHandler.java | 0 .../bpmn2/structureref/StructureRefTest.java | 0 .../org/jbpm/bpmn2/test/RequireLocking.java | 0 .../jbpm/bpmn2/test/RequirePersistence.java | 0 .../test/TestWorkItemManagerFactory.java | 0 .../org/jbpm/memory/SerializableResult.java | 0 .../jbpm/test/utils/ProcessTestHelper.java | 79 +++ .../test/utils/ReceiveTaskTestHandler.java | 56 ++ .../jbpm/test/utils/SendTaskTestHandler.java | 54 ++ .../test/resources/BPMN2-AdHocProcess.bpmn2 | 0 .../src/test/resources/BPMN2-AdHocRules.drl | 0 .../resources/BPMN2-AdHocSubProcess.bpmn2 | 0 .../test/resources/BPMN2-AdHocSubProcess.drl | 0 .../BPMN2-AdHocSubProcessAutoComplete.bpmn2 | 0 ...dHocSubProcessAutoCompleteExpression.bpmn2 | 0 ...HocSubProcessEmptyCompleteExpression.bpmn2 | 0 .../BPMN2-AdHocTerminateEndEvent.bpmn2 | 0 .../test/resources/BPMN2-AgendaFilter.bpmn2 | 0 .../src/test/resources/BPMN2-AgendaFilter.drl | 0 .../resources/BPMN2-BooleanStructureRef.bpmn2 | 0 ...dlerWithoutErrorCodeWithStructureRef.bpmn2 | 0 ...rWithoutErrorCodeWithoutStructureRef.bpmn2 | 0 ...ErrorEventSubProcessExceptionMapping.bpmn2 | 0 ...rySignalEventOnTaskWithTransformation.bpmn | 0 ...oundarySignalWithNameEventOnTaskbpmn2.bpmn | 0 .../BPMN2-BoundaryTimerCycleCron.bpmn2 | 0 ...BPMN2-BoundaryTimerCycleCronVariable.bpmn2 | 0 .../resources/BPMN2-BrokenStructureRef.bpmn2 | 0 .../resources/BPMN2-BusinessRuleTask.bpmn2 | 0 .../test/resources/BPMN2-BusinessRuleTask.drl | 0 .../BPMN2-BusinessRuleTaskDynamic.bpmn2 | 0 .../BPMN2-BusinessRuleTaskInfiniteLoop.drl | 0 .../BPMN2-BusinessRuleTaskLoop.bpmn2 | 0 .../BPMN2-BusinessRuleTaskWithDataInput.bpmn2 | 0 .../BPMN2-BusinessRuleTaskWithDataInput.drl | 0 ...essRuleTaskWithDataInputIOExpression.bpmn2 | 0 ...N2-BusinessRuleTaskWithDataInputLoop.bpmn2 | 0 ...BPMN2-BusinessRuleTaskWithDataInputs.bpmn2 | 0 .../BPMN2-BusinessRuleTaskWithException.drl | 0 .../test/resources/BPMN2-BuyerProcess.bpmn2 | 0 .../resources/BPMN2-CallActivityByName.bpmn2 | 0 .../BPMN2-CallActivityMISequential.bpmn2 | 0 .../BPMN2-CallActivitySkipAbortParent.bpmn2 | 0 .../BPMN2-CallActivitySubProcessV2.bpmn2 | 0 ...BPMN2-CallActivityWithTransformation.bpmn2 | 0 .../BPMN2-ConditionalEventRuleTask.bpmn2 | 0 .../BPMN2-ConditionalEventRuleTask.drl | 0 .../BPMN2-ConditionalFlowWithoutGateway.bpmn2 | 0 .../resources/BPMN2-ConditionalStart.bpmn2 | 0 ...N2-DataInputAssociations-two-assigns.bpmn2 | 0 ...MN2-DataOutputAssociations-HumanTask.bpmn2 | 0 .../BPMN2-DefaultObjectStructureRef.bpmn2 | 0 ...claredTypeSequenceFlowExpressionTest.bpmn2 | 0 ...ErrorBoundaryEventOnBusinessRuleTask.bpmn2 | 0 ...2-ErrorBoundaryEventOnBusinessRuleTask.drl | 0 ...PMN2-ErrorBoundaryEventOnServiceTask.bpmn2 | 0 .../BPMN2-EventSubprocessConditional.bpmn2 | 0 .../BPMN2-EventSubprocessMessage.bpmn2 | 0 ...ntSubprocessSignalWithTransformation.bpmn2 | 0 ...eptionServiceProcess-ErrorSignalling.bpmn2 | 0 ...2-ExceptionServiceProcess-Signalling.bpmn2 | 0 ...PMN2-ExceptionThrowingServiceProcess.bpmn2 | 0 ...lusiveGatewayWithNoConditionsDefined.bpmn2 | 0 .../BPMN2-ExclusiveSplitDefault.bpmn2 | 2 +- ...MN2-ExclusiveSplitDefaultNoCondition.bpmn2 | 0 ...plitXPath-advanced-vars-not-signaled.bpmn2 | 0 ...clusiveSplitXPath-advanced-with-vars.bpmn2 | 0 .../BPMN2-ExclusiveSplitXPath-advanced.bpmn2 | 0 .../resources/BPMN2-ExclusiveSplitXPath.bpmn2 | 0 .../resources/BPMN2-FloatStructureRef.bpmn2 | 0 .../resources/BPMN2-GatewayFEEL-wrong.bpmn2 | 0 ...PMN2-GatewaySplit-SequenceConditions.bpmn2 | 0 .../BPMN2-GlobalTimerInterrupted.bpmn2 | 0 .../BPMN2-InclusiveSplitDefault.bpmn2 | 2 +- .../BPMN2-Incremental-Build-Invalid.bpmn2 | 0 .../BPMN2-Incremental-Build-Valid.bpmn2 | 0 .../resources/BPMN2-IntegerStructureRef.bpmn2 | 0 ...eCatchEventMessageWithTransformation.bpmn2 | 0 ...diateCatchEventNoIncommingConnection.bpmn2 | 0 .../BPMN2-IntermediateCatchEventSignal2.bpmn2 | 2 +- ...teCatchEventSignalWithTransformation.bpmn2 | 0 ...N2-IntermediateCatchEventTimerCycle3.bpmn2 | 0 ...IntermediateCatchEventTimerCycleCron.bpmn2 | 0 ...iateCatchEventTimerDurationWithError.bpmn2 | 0 ...ermediateCatchSignalBetweenUserTasks.bpmn2 | 0 .../BPMN2-IntermediateThrowEventMessage.bpmn2 | 2 +- ...eThrowEventMessageWithTransformation.bpmn2 | 0 ...teThrowEventSignalWithTransformation.bpmn2 | 0 .../BPMN2-InvalidServiceProcess.bpmn2 | 0 .../resources/BPMN2-MessageEndEvent.bpmn2 | 2 +- ...rrorBoundaryEventsOnBusinessRuleTask.bpmn2 | 0 ...iErrorBoundaryEventsOnBusinessRuleTask.drl | 0 ...BPMN2-MultiInstanceLoopBoundaryTimer.bpmn2 | 3 +- ...LoopCharacteristicsProcessSequential.bpmn2 | 0 ...teristicsProcessWithOutputAndScripts.bpmn2 | 2 +- ...MultiInstanceLoopCharacteristicsTask.bpmn2 | 0 ...nceLoopCharacteristicsTaskSequential.bpmn2 | 0 ...sticsTaskWithOutputCmpCondSequential.bpmn2 | 0 .../BPMN2-MultiThreadServiceProcess-Task.bpmn | 0 ...BPMN2-MultiThreadServiceProcess-Timer.bpmn | 0 .../BPMN2-MultiThreadServiceProcess.bpmn | 0 ...ltipleBoundaryTimerCycleCronVariable.bpmn2 | 0 .../resources/BPMN2-MultipleFlowEndNode.bpmn2 | 0 ...PMN2-MultipleInOutgoingSequenceFlows.bpmn2 | 0 .../resources/BPMN2-MultipleRuleTasks.drl | 0 ...BPMN2-MultipleRuleTasksWithDataInput.bpmn2 | 0 ...tipleStartEventProcessDifferentPaths.bpmn2 | 0 ...PMN2-NullVariableInScriptTaskProcess.bpmn2 | 0 .../resources/BPMN2-ObjectStructureRef.bpmn2 | 0 .../test/resources/BPMN2-ParentProcess.bpmn2 | 0 .../resources/BPMN2-ProcessEmptyScript.bpmn2 | 0 .../src/test/resources/BPMN2-RuleTask.bpmn2 | 0 .../src/test/resources/BPMN2-RuleTask.drl | 0 .../src/test/resources/BPMN2-RuleTask2.bpmn2 | 0 .../src/test/resources/BPMN2-RuleTask2.drl | 0 .../src/test/resources/BPMN2-RuleTask3.drl | 0 .../resources/BPMN2-RuleTaskSetVariable.drl | 0 .../BPMN2-RuleTaskSetVariableReconnect.drl | 0 .../resources/BPMN2-RuleTaskWithFact.bpmn2 | 0 .../BPMN2-RuleTaskWithTransformation.bpmn2 | 0 .../BPMN2-RuleTaskWithTransformation.drl | 0 .../resources/BPMN2-ScannerChangeSet.bpmn | 0 .../resources/BPMN2-ScannerChangeSet2.bpmn | 0 .../test/resources/BPMN2-ServiceProcess.bpmn2 | 0 ...rviceProcessWithCustomTransformation.bpmn2 | 0 ...cessWithMvelCollectionTransformation.bpmn2 | 0 ...iceProcessWithMvelJaxbTransformation.bpmn2 | 2 +- ...ServiceProcessWithMvelTransformation.bpmn2 | 2 +- .../BPMN2-ServiceTask-web-service.bpmn2 | 0 .../test/resources/BPMN2-ServiceTask.bpmn2 | 0 .../BPMN2-SignalStartWithTransformation.bpmn2 | 0 .../resources/BPMN2-SimpleXMLProcess.bpmn2 | 0 .../BPMN2-SingalStartWithCustomEvent.bpmn2 | 0 ...-StartEventWithMultipleOutgoingFlows.bpmn2 | 0 .../resources/BPMN2-StartTimerCycle.bpmn2 | 0 .../resources/BPMN2-StringStructureRef.bpmn2 | 0 .../resources/BPMN2-SubProcessInvalid.bpmn2 | 0 .../resources/BPMN2-SubProcessUserTask.bpmn2 | 0 .../resources/BPMN2-SubProcessWithTimer.bpmn2 | 0 .../BPMN2-SubProcessWrongStartEvent.bpmn2 | 0 .../resources/BPMN2-TimerInterrupted.bpmn2 | 0 .../test/resources/BPMN2-TimerStart2.bpmn2 | 0 .../test/resources/BPMN2-TimerStartCron.bpmn2 | 0 .../resources/BPMN2-WorkingMessageModel.bpmn2 | 0 .../resources/BPMN2-XMLProcessWithError.bpmn2 | 0 ...2-XMLProcessWithErrorInCompositeNode.bpmn2 | 0 .../resources/BPMN2-XpathExpression.bpmn2 | 0 .../test/resources/BPMN2-gatewayTest.bpmn2 | 0 .../META-INF/BPMN2WorkDefinitions.conf | 0 .../resources/META-INF/kie.properties.conf | 0 ...ltipleSubprocessWithSignalStartEvent.bpmn2 | 0 .../PrefixesProcessIdCallActivity.bpmn2 | 0 .../test/resources/SubprocessWithTimer.bpmn2 | 0 .../test/resources/async/AsyncProcess.bpmn | 0 .../src/test/resources/build/sample.bpmn | 0 .../src/test/resources/build/sample2.bpmn | 0 .../BPMN2-Compensation-EventSubProcess.bpmn2 | 0 ...on-EventSubProcess-OnlyIn-SubProcess.bpmn2 | 0 ...nsation-StartEvent-OnlyIn-SubProcess.bpmn2 | 0 .../BPMN2-Compensation-Transaction.bpmn2 | 0 .../BPMN2-TravelBookingExample.bpmn2 | 0 .../resources/correlationkey/Process1.bpmn2 | 0 .../resources/correlationkey/Process2.bpmn2 | 0 .../resources/correlationkey/Process3.bpmn2 | 0 .../resources/correlationkey/Process4.bpmn2 | 0 .../resources/correlationkey/Process5.bpmn2 | 0 .../test/resources/dmn/0020-vacation-days.dmn | 0 .../dmn/BPMN2-BusinessRuleTaskDMN.bpmn2 | 0 ...N2-BusinessRuleTaskDMNByDecisionName.bpmn2 | 0 .../BPMN2-BusinessRuleTaskDMNModelById.bpmn2 | 0 ...ssRuleTaskDMNMultipleDecisionsOutput.bpmn2 | 0 .../src/test/resources/error/EndError.bpmn2 | 0 .../test/resources/error/ErrorVariable.bpmn2 | 0 ...PMN2-EscalationBoundaryEventWithTask.bpmn2 | 0 .../BPMN2-EventSubprocessEscalation.bpmn2 | 0 .../resources/handler/BPMN2-ReceiveTask.bpmn2 | 0 .../resources/handler/BPMN2-ScriptTask.bpmn2 | 0 .../BPMN2-UserTaskWithBooleanOutput.bpmn2 | 0 .../test/resources/handler/onboarding.bpmn | 0 .../src/test/resources/jndi.properties | 0 .../src/test/resources/logback-debug.xml | 0 .../src/test/resources/logback-test.xml | 0 ...N2-RuleTaskWithInsertProcessInstance.bpmn2 | 0 .../resources/memory/ProcessInstanceRule.drl | 0 .../src/test/resources/rules-timer.drl | 0 .../BPMN2-InvalidEmdeddedSubProcess.bpmn2 | 0 ...processErrorHandlingWithOutErrorCode.bpmn2 | 0 ...BPMN2-CronTimerWithEventBasedGateway.bpmn2 | 0 .../timer/BPMN2-StartTimerCycleInvalid.bpmn2 | 0 .../timer/BPMN2-StartTimerDateInvalid.bpmn2 | 0 .../BPMN2-StartTimerDurationInvalid.bpmn2 | 0 ...BPMN2-TimerBoundaryEventCycleInvalid.bpmn2 | 0 .../BPMN2-TimerBoundaryEventDateInvalid.bpmn2 | 0 ...N2-TimerBoundaryEventDurationInvalid.bpmn2 | 0 .../xxe-protection/BPMN2-XXE-Process.bpmn2 | 0 .../test/resources/xxe-protection/Text1.txt | 0 .../test/resources/xxe-protection/Text2.txt | 0 .../resources/xxe-protection/external.dtd | 0 .../jbpm-tools-maven-plugin/pom.xml | 92 +++ .../maven/ProcessCodeGenerationSupport.java | 232 +++++++ .../jbpm/tools/maven/ProcessCodegenMojo.java | 50 ++ .../tools/maven/ProcessCodegenTestMojo.java | 51 ++ .../class-templates/ModelProcessInstance.java | 62 ++ .../StaticProcessTemplate.java | 106 +++ .../maven/ProcessCodegenMojoProjectStub.java | 83 +++ .../tools/maven/ProcessCodegenMojoTest.java} | 28 +- .../src/test/resources/unit/project/pom.xml | 29 + jbpm/jbpm-tools/pom.xml | 26 + jbpm/pom.xml | 58 +- kogito-build/kogito-dependencies-bom/pom.xml | 19 +- 488 files changed, 2390 insertions(+), 1567 deletions(-) delete mode 100644 jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/canonical/ActivityGenerationModelTest.java create mode 100644 jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/TemplateHelper.java create mode 100644 jbpm/jbpm-tests/pom.xml rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2 (93%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-ScriptTask.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-ScriptTaskFEEL.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-ScriptTaskWithIO.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-UserTask.bpmn2 (90%) rename jbpm/{jbpm-bpmn2/src/test/resources/handler => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-UserTaskWithBooleanOutput.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-UserTaskWithDataStore.bpmn2 (88%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-UserTaskWithIOexpression.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-UserTaskWithParametrizedInput.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity}/BPMN2-UserTaskWithSimulationMetaData.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/adhoc}/BPMN2-SubProcessInAdHocProcess.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources/collaboration/Collaboration-BoundaryMessage.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationBoundaryMessage.bpmn2} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/collaboration/Collaboration-IntermediateMessage.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationIntermediateMessage.bpmn2} (96%) rename jbpm/{jbpm-bpmn2/src/test/resources/collaboration/Collaboration-StartMessage.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationStartMessage.bpmn2} (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/compensation/BPMN2-BookResource.bpmn2 (75%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/compensation/BPMN2-Booking.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/compensation/BPMN2-CancelResource.bpmn2 (75%) rename jbpm/{jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-InSubSubProcess.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-InSubSubProcess.bpmn2} (99%) rename jbpm/{jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-IntermediateThrowEvent.bpmn2} (97%) rename jbpm/{jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-ParallelOrderedCompensationIntermediateThrowEvent.bpmn2} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-ThrowSpecificForSubProcess.bpmn2} (90%) rename jbpm/{jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-UserTaskBeforeAssociatedActivity.bpmn2} (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/compensation/BPMN2-UserTaskCompensation.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data}/BPMN2-Association.bpmn2 (87%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data}/BPMN2-CorrelationKey.bpmn2 (90%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data}/BPMN2-DataInputAssociations.bpmn2 (92%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-lazy-creating.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsLazyCreating.bpmn2} (91%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsString.bpmn2} (92%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string-no-quotes.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringNoQuotes.bpmn2} (91%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string-object.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringObject.bpmn2} (92%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-xml-literal.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsXmlLiteral.bpmn2} (92%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data}/BPMN2-DataObject.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data}/BPMN2-DataOutputAssociations.bpmn2 (92%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations-xml-node.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataOutputAssociationsXmlNode.bpmn2} (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data}/BPMN2-DataStore.bpmn2 (88%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation.bpmn2} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess2.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation2.bpmn2} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess3.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation3.bpmn2} (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data}/BPMN2-Import.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-BoundaryErrorEventCatchingOnEntryException.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-BoundaryErrorEventCatchingOnExitException.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-BoundaryErrorEventStructureRef.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/error/EndErrorWithEventSubprocess.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EndErrorWithEventSubprocess.bpmn2} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-ErrorBoundaryEventInterrupting.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-ErrorBoundaryEventOnTask.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-EventSubProcessErrorWithScript.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error}/BPMN2-EventSubprocessError.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/EventSubprocessErrorHandlingWithErrorCode.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubprocessErrorHandlingWithErrorCode.bpmn2} (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/escalation/BPMN2-EscalationBoundaryEvent.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/escalation/BPMN2-EscalationBoundaryEventOnTask.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/escalation/BPMN2-EscalationEndEvent.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/escalation/BPMN2-EscalationEndEventHandling.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/escalation/BPMN2-EscalationWithDataMapping.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2 (91%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event}/BPMN2-EndEventSignalWithData.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event}/BPMN2-ErrorEndEvent.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event}/BPMN2-OnEntryExitDesignerScriptProcess.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event}/BPMN2-OnEntryExitMixedNamespacedScriptProcess.bpmn2 (93%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event}/BPMN2-OnEntryExitNamespacedScriptProcess.bpmn2 (93%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event}/BPMN2-OnEntryExitScriptProcess.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event}/BPMN2-ParallelSplit.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-ParallelSpitTerminate.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ParallelSplitTerminate.bpmn2} (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event}/BPMN2-SignalEndEvent.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubprocessWithParallelSpitTerminate.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-SubprocessWithParallelSplitTerminate.bpmn2} (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/feel}/BPMN2-GatewayFEEL.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-CompositeProcessWithDIGraphical.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-ExclusiveSplit.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-ExclusiveSplitPriority.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveGatewayNested.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveGatewayWithDefault.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveGatewayWithLoopInside.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveGatewayWithLoopInsideSubprocess.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplit.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoin.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoinLoop.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoinLoop2.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoinNested.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-Lane.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MinimalProcess.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MinimalProcessImplicit.bpmn2 (90%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MinimalProcessMetaData.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MinimalProcessWithDIGraphical.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MinimalProcessWithGraphical.bpmn2 (87%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiConnEnabled.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutput.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond2.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoop-Numbering.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopNumbering.bpmn2} (92%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultipleGatewaysProcess.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-MultipleProcessInOneFile.bpmn2 (84%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-ProcessCustomDescriptionMetaData.bpmn2 (91%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2 (90%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow}/BPMN2-ProcessWithVariableName.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources/build/XORSameTarget.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-XORSameTarget.bpmn2} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-BoundaryConditionalEventOnTask.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-BoundaryEventWithSignals.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-BoundaryMessageEventOnTask.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-ConditionalBoundaryEventInterrupting.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2EndThrowEventScope.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EndThrowEventScope.bpmn2} (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventBasedSplit.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventBasedSplit2.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventBasedSplit3.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventBasedSplit4.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventBasedSplit5.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventSubProcessWithLocalVariables.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventSubprocessSignal.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventSubprocessSignalExpression.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventSubprocessSignalInterrupting.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignal-Nested.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalNested.bpmn2} (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventSubprocessSignalWithStateNode.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventSubprocessTimer.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-EventSubprocessTimerCycle.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventCondition.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventConditionPI.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventMessage.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventMessageWithRef.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventSignal.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventSignalWithRef.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventTimerDateISO.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventTimerDuration.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateCatchSignalSingle.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateLinkEvent.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateThrowEventExternalScope.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateThrowEventNone.bpmn2 (91%) rename jbpm/{jbpm-bpmn2/src/test/resources/BPMN2IntermediateThrowEventScope.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventScope.bpmn2} (97%) create mode 100755 jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignal.bpmn2 rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateThrowEventSignalWithData.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2 (92%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-LinkEventCompositeProcess.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-MultipleMessageSignalSubprocess.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-SignalBoundaryEventInterrupting.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-SignalBoundaryOnSubProcess.bpmn (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate}/BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla}/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla}/BPMN2-UserTaskWithSLA.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla}/BPMN2-UserTaskWithSLAExpr.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla}/BPMN2-UserTaskWithSLAOnTask.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-IntermediateThrowEventSignal.bpmn2 (92%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-MessageStart.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-MultipleEventBasedStartEventProcess.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-MultipleStartEventProcess.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-MultipleStartEventProcessLongInterval.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-SignalStart.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources/timer => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-StartTimerCycle.bpmn2 (89%) rename jbpm/{jbpm-bpmn2/src/test/resources/timer => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-StartTimerDuration.bpmn2 (89%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-TimerStart.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-TimerStartCycleLegacy.bpmn2 (93%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-TimerStartDate.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-TimerStartDuration.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start}/BPMN2-TimerStartISO.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/AssignmentProcess.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-AssignmentProcess.bpmn2} (97%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/AssignmentSubProcess.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-AssignmentSubProcess.bpmn2} (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivity.bpmn2 (92%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivity2.bpmn2 (96%) create mode 100755 jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity3.bpmn2 rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivityMI.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivityProcessBoundaryError.bpmn2 (95%) create mode 100755 jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessWithBoundaryEvent.bpmn2 rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivitySubProcess.bpmn2 (94%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivitySubProcessBoundaryError.bpmn2 (93%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2 (93%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivityWithBoundaryEvent.bpmn2 (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-CallActivityWithIOexpression.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/dynamic-signal-child.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-DynamicSignalChild.bpmn2} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/dynamic-signal-parent.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-DynamicSignalParent.bpmn2} (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/ErrorsBetweenProcess-Process.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenProcess.bpmn2} (97%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/ErrorsBetweenProcess-SubProcess.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenSubProcess.bpmn2} (97%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/InputMappingUsingValue.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-InputMappingUsingValue.bpmn2} (93%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/subprocess/BPMN2-MainGroupAssignment.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/subprocess/SingleTaskWithVarDef.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SingleTaskWithVarDef.bpmn2} (95%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-SubProcess.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/subprocess/BPMN2-SubProcessWithEntryExitScripts.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-SubProcessWithTerminateEndEvent.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess}/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/subprocess/BPMN2-SubprocessGroupAssignment.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources/variable-tags/approval-with-custom-variable-tags.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithCustomVariableTags.bpmn2} (99%) rename jbpm/{jbpm-bpmn2/src/test/resources/variable-tags/approval-with-readonly-variable-tags.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithReadonlyVariableTags.bpmn2} (99%) rename jbpm/{jbpm-bpmn2/src/test/resources/variable-tags/approval-with-required-variable-tags.bpmn2 => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithRequiredVariableTags.bpmn2} (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/task}/BPMN2-ReceiveTask.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/task}/BPMN2-SendTask.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/timer/BPMN2-IntermediateTimerEventMI.bpmn2 (98%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/timer/BPMN2-IntermediateTimerParallelGateway.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2}/timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2 (99%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventCycle1.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventCycle2.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventCycleISO.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventDateISO.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventDuration.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventDurationISO.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventInterrupting.bpmn2 (97%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2 (96%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer}/BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2 (97%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/ActivityTest.java (91%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/AgendaFilterTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/BrokenStructureRefTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/CollaborationTest.java (70%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/CompensationTest.java (88%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/CompilationTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/DataTest.java (88%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/DroolsDeclaredTypeSequenceFlowExpressionTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/EndEventTest.java (90%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java (91%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java (90%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/FEELTest.java (93%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/FlowTest.java (93%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/ImportClassTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/IncrementalCompilationTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java (88%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/KogitoSetProcessInstanceVariablesCommand.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/Message.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/ProcessFactoryTest.java (100%) create mode 100755 jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ResourceTest.java rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java (93%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java (89%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/StartEventTest.java (88%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/VariableTagsTest.java (88%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/audit/KogitoWorkingMemoryInMemoryLogger.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/concurrency/MultipleProcessesPerThreadTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/concurrency/OneProcessPerThreadTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/handler/ErrornousWorkItemHandler.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/handler/WorkItemHandlerExceptionHandlingTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/Account.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/Address.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/ExceptionOnPurposeHandler.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/ExceptionService.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/HelloService.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/MyError.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/NotAvailableGoodsReport.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/Order.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/Person.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/Status.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/objects/TestWorkItemHandler.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/structureref/StructureRefTest.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/test/RequireLocking.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/test/RequirePersistence.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/bpmn2/test/TestWorkItemManagerFactory.java (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/java/org/jbpm/memory/SerializableResult.java (100%) create mode 100644 jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ProcessTestHelper.java create mode 100644 jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ReceiveTaskTestHandler.java create mode 100644 jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/SendTaskTestHandler.java rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AdHocProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AdHocRules.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AdHocSubProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AdHocSubProcess.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AdHocSubProcessAutoComplete.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AdHocSubProcessAutoCompleteExpression.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AdHocSubProcessEmptyCompleteExpression.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AdHocTerminateEndEvent.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AgendaFilter.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-AgendaFilter.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BooleanStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithoutStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BoundaryErrorEventSubProcessExceptionMapping.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BoundarySignalEventOnTaskWithTransformation.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BoundarySignalWithNameEventOnTaskbpmn2.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BoundaryTimerCycleCron.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BoundaryTimerCycleCronVariable.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BrokenStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTask.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskDynamic.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskInfiniteLoop.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskLoop.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputIOExpression.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputLoop.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputs.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BusinessRuleTaskWithException.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-BuyerProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-CallActivityByName.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-CallActivityMISequential.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-CallActivitySkipAbortParent.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-CallActivitySubProcessV2.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-CallActivityWithTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ConditionalEventRuleTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ConditionalEventRuleTask.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ConditionalStart.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-DataInputAssociations-two-assigns.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-DataOutputAssociations-HumanTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-DefaultObjectStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-DroolsDeclaredTypeSequenceFlowExpressionTest.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ErrorBoundaryEventOnServiceTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-EventSubprocessConditional.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-EventSubprocessMessage.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-EventSubprocessSignalWithTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExceptionServiceProcess-ErrorSignalling.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExceptionServiceProcess-Signalling.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExceptionThrowingServiceProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExclusiveGatewayWithNoConditionsDefined.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExclusiveSplitDefault.bpmn2 (97%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExclusiveSplitDefaultNoCondition.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-vars-not-signaled.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-with-vars.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ExclusiveSplitXPath.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-FloatStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-GatewayFEEL-wrong.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-GatewaySplit-SequenceConditions.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-GlobalTimerInterrupted.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-InclusiveSplitDefault.bpmn2 (97%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-Incremental-Build-Invalid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-Incremental-Build-Valid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntegerStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateCatchEventMessageWithTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateCatchEventNoIncommingConnection.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateCatchEventSignal2.bpmn2 (98%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateCatchEventSignalWithTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle3.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleCron.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateCatchEventTimerDurationWithError.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateCatchSignalBetweenUserTasks.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateThrowEventMessage.bpmn2 (93%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateThrowEventMessageWithTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-IntermediateThrowEventSignalWithTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-InvalidServiceProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MessageEndEvent.bpmn2 (96%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiInstanceLoopBoundaryTimer.bpmn2 (97%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessSequential.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputAndScripts.bpmn2 (98%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskSequential.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCondSequential.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiThreadServiceProcess-Task.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiThreadServiceProcess-Timer.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultiThreadServiceProcess.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultipleBoundaryTimerCycleCronVariable.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultipleFlowEndNode.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultipleInOutgoingSequenceFlows.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultipleRuleTasks.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultipleRuleTasksWithDataInput.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-MultipleStartEventProcessDifferentPaths.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-NullVariableInScriptTaskProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ObjectStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ParentProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ProcessEmptyScript.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTask.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTask2.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTask2.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTask3.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTaskSetVariable.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTaskSetVariableReconnect.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTaskWithFact.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTaskWithTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-RuleTaskWithTransformation.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ScannerChangeSet.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ScannerChangeSet2.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ServiceProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ServiceProcessWithCustomTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ServiceProcessWithMvelCollectionTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ServiceProcessWithMvelJaxbTransformation.bpmn2 (98%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ServiceProcessWithMvelTransformation.bpmn2 (98%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ServiceTask-web-service.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-ServiceTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-SignalStartWithTransformation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-SimpleXMLProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-SingalStartWithCustomEvent.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-StartEventWithMultipleOutgoingFlows.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-StartTimerCycle.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-StringStructureRef.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-SubProcessInvalid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-SubProcessUserTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-SubProcessWithTimer.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-SubProcessWrongStartEvent.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-TimerInterrupted.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-TimerStart2.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-TimerStartCron.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-WorkingMessageModel.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-XMLProcessWithError.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-XMLProcessWithErrorInCompositeNode.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-XpathExpression.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/BPMN2-gatewayTest.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/META-INF/BPMN2WorkDefinitions.conf (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/META-INF/kie.properties.conf (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/MultipleSubprocessWithSignalStartEvent.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/PrefixesProcessIdCallActivity.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/SubprocessWithTimer.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/async/AsyncProcess.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/build/sample.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/build/sample2.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/compensation/BPMN2-Compensation-EventSubProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-EventSubProcess-OnlyIn-SubProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-StartEvent-OnlyIn-SubProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/compensation/unimplemented/BPMN2-Compensation-Transaction.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/compensation/unimplemented/BPMN2-TravelBookingExample.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/correlationkey/Process1.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/correlationkey/Process2.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/correlationkey/Process3.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/correlationkey/Process4.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/correlationkey/Process5.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/dmn/0020-vacation-days.dmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMN.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNByDecisionName.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNModelById.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNMultipleDecisionsOutput.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/error/EndError.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/error/ErrorVariable.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/escalation/BPMN2-EscalationBoundaryEventWithTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/escalation/BPMN2-EventSubprocessEscalation.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/handler/BPMN2-ReceiveTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/handler/BPMN2-ScriptTask.bpmn2 (100%) rename jbpm/{jbpm-bpmn2/src/test/resources => jbpm-tests/src/test/resources/handler}/BPMN2-UserTaskWithBooleanOutput.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/handler/onboarding.bpmn (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/jndi.properties (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/logback-debug.xml (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/logback-test.xml (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/memory/BPMN2-RuleTaskWithInsertProcessInstance.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/memory/ProcessInstanceRule.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/rules-timer.drl (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/subprocess/BPMN2-InvalidEmdeddedSubProcess.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/subprocess/EventSubprocessErrorHandlingWithOutErrorCode.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/timer/BPMN2-CronTimerWithEventBasedGateway.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/timer/BPMN2-StartTimerCycleInvalid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/timer/BPMN2-StartTimerDateInvalid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/timer/BPMN2-StartTimerDurationInvalid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/timer/BPMN2-TimerBoundaryEventCycleInvalid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/timer/BPMN2-TimerBoundaryEventDateInvalid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/timer/BPMN2-TimerBoundaryEventDurationInvalid.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/xxe-protection/BPMN2-XXE-Process.bpmn2 (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/xxe-protection/Text1.txt (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/xxe-protection/Text2.txt (100%) rename jbpm/{jbpm-bpmn2 => jbpm-tests}/src/test/resources/xxe-protection/external.dtd (100%) create mode 100644 jbpm/jbpm-tools/jbpm-tools-maven-plugin/pom.xml create mode 100644 jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodeGenerationSupport.java create mode 100644 jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodegenMojo.java create mode 100644 jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodegenTestMojo.java create mode 100644 jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/resources/class-templates/ModelProcessInstance.java create mode 100644 jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/resources/class-templates/StaticProcessTemplate.java create mode 100644 jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/java/org/jbpm/tools/maven/ProcessCodegenMojoProjectStub.java rename jbpm/{jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ResourceTest.java => jbpm-tools/jbpm-tools-maven-plugin/src/test/java/org/jbpm/tools/maven/ProcessCodegenMojoTest.java} (52%) mode change 100755 => 100644 create mode 100644 jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/resources/unit/project/pom.xml create mode 100644 jbpm/jbpm-tools/pom.xml diff --git a/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/ConversionUtils.java b/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/ConversionUtils.java index ee0a4a64234..def8ee02b97 100644 --- a/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/ConversionUtils.java +++ b/api/kogito-api/src/main/java/org/kie/kogito/internal/utils/ConversionUtils.java @@ -241,6 +241,10 @@ public static boolean isNotEmpty(String value) { return !isEmpty(value); } + public static String sanitizeString(String string) { + return string.replaceAll("\"", "\\\\\""); + } + public static String sanitizeClassName(String className) { return sanitizeJavaName(className, true); } diff --git a/jbpm/jbpm-bpmn2/pom.xml b/jbpm/jbpm-bpmn2/pom.xml index a801e38ba57..34bed255681 100755 --- a/jbpm/jbpm-bpmn2/pom.xml +++ b/jbpm/jbpm-bpmn2/pom.xml @@ -77,7 +77,6 @@ jakarta.xml.bind jakarta.xml.bind-api provided - 4.0.1 com.sun.xml.bind @@ -88,62 +87,13 @@ org.glassfish.jaxb jaxb-runtime provided - 4.0.4 - + + org.eclipse.angus angus-activation provided - - - - org.drools - drools-core - test-jar - test - - - org.kie.kogito - jbpm-flow-builder - test-jar - test - - - org.drools - drools-wiring-dynamic - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.junit.jupiter - junit-jupiter-params - test - - - ch.qos.logback - logback-classic - test - - - org.assertj - assertj-core - test - - - org.mockito - mockito-core - test - - - org.jboss.resteasy - resteasy-client - test - @@ -168,19 +118,6 @@ - - - maven-surefire-plugin - - - - true - - 2 - all - - - diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/canonical/ActivityGenerationModelTest.java b/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/canonical/ActivityGenerationModelTest.java deleted file mode 100644 index 964b44c17dd..00000000000 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/canonical/ActivityGenerationModelTest.java +++ /dev/null @@ -1,613 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.bpmn2.canonical; - -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; - -import org.drools.compiler.compiler.io.memory.MemoryFileSystem; -import org.drools.io.ClassPathResource; -import org.drools.util.PortablePath; -import org.jbpm.bpmn2.JbpmBpmn2TestCase; -import org.jbpm.bpmn2.objects.TestWorkItemHandler; -import org.jbpm.compiler.canonical.ProcessMetaData; -import org.jbpm.compiler.canonical.ProcessToExecModelGenerator; -import org.jbpm.compiler.canonical.UserTaskModelMetaData; -import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler; -import org.junit.jupiter.api.Test; -import org.kie.api.definition.process.Process; -import org.kie.api.definition.process.WorkflowProcess; -import org.kie.kogito.StaticApplication; -import org.kie.kogito.StaticConfig; -import org.kie.kogito.auth.SecurityPolicy; -import org.kie.kogito.internal.process.runtime.KogitoProcessInstance; -import org.kie.kogito.internal.process.runtime.KogitoWorkItem; -import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler; -import org.kie.kogito.internal.process.runtime.KogitoWorkItemManager; -import org.kie.kogito.process.ProcessConfig; -import org.kie.kogito.process.ProcessError; -import org.kie.kogito.process.ProcessInstance; -import org.kie.kogito.process.bpmn2.BpmnProcess; -import org.kie.kogito.process.bpmn2.BpmnProcesses; -import org.kie.kogito.process.bpmn2.BpmnVariables; -import org.kie.kogito.process.impl.CachedWorkItemHandlerConfig; -import org.kie.kogito.process.impl.DefaultProcessEventListenerConfig; -import org.kie.kogito.process.impl.StaticProcessConfig; -import org.kie.kogito.services.identity.StaticIdentityProvider; -import org.kie.kogito.services.uow.CollectingUnitOfWorkFactory; -import org.kie.kogito.services.uow.DefaultUnitOfWorkManager; -import org.kie.kogito.services.uow.UnitOfWorkExecutor; -import org.kie.memorycompiler.CompilationResult; -import org.kie.memorycompiler.JavaCompiler; -import org.kie.memorycompiler.JavaCompilerFactory; -import org.kie.memorycompiler.JavaConfiguration; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.kie.kogito.internal.process.runtime.KogitoProcessInstance.STATE_ABORTED; -import static org.kie.kogito.internal.process.runtime.KogitoProcessInstance.STATE_ACTIVE; -import static org.kie.kogito.internal.process.runtime.KogitoProcessInstance.STATE_COMPLETED; - -public class ActivityGenerationModelTest extends JbpmBpmn2TestCase { - - private static final JavaCompiler JAVA_COMPILER = JavaCompilerFactory.loadCompiler(JavaConfiguration.CompilerType.NATIVE, "1.8"); - - @Test - public void testMinimalProcess() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-MinimalProcess.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("com.sample.MinimalProcess", content); - - Map processes = createProcesses(classData, Collections.emptyMap()); - ProcessInstance processInstance = processes.get("Minimal").createInstance(); - - processInstance.start(); - - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - } - - @Test - public void testProcessEmptyScript() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-ProcessEmptyScript.bpmn2")).get(0); - - WorkflowProcess workflowProcess = (WorkflowProcess) process.get(); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> { - ProcessToExecModelGenerator.INSTANCE.generate(workflowProcess); - }); - - } - - @Test - public void testUserTaskProcessWithTaskModels() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-UserTask.bpmn2")).get(0); - - List models = ProcessToExecModelGenerator.INSTANCE.generateUserTaskModel((WorkflowProcess) process.get()); - - for (UserTaskModelMetaData metaData : models) { - String content = metaData.generateInput(); - assertThat(content).isNotNull(); - log(content); - - content = metaData.generateOutput(); - assertThat(content).isNotNull(); - log(content); - } - } - - @Test - public void testUserTaskProcess() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-UserTask.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.UserTaskProcess", content); - TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); - - Map processes = createProcesses(classData, Collections.singletonMap("Human Task", workItemHandler)); - ProcessInstance processInstance = processes.get("UserTask").createInstance(); - - processInstance.start(); - assertThat(processInstance.status()).isEqualTo(STATE_ACTIVE); - - KogitoWorkItem workItem = workItemHandler.getWorkItem(); - assertThat(workItem).isNotNull(); - assertThat(workItem.getParameter("ActorId")).isEqualTo("john"); - assertThat(workItem.getParameter("fixedValue")).isEqualTo("pepe"); - processInstance.completeWorkItem(workItem.getStringId(), null, SecurityPolicy.of(new StaticIdentityProvider("john"))); - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - } - - @Test - public void testUserTaskWithParamProcess() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-UserTaskWithParametrizedInput.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.UserTaskProcess", content); - - TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); - - Map processes = createProcesses(classData, Collections.singletonMap("Human Task", workItemHandler)); - ProcessInstance processInstance = processes.get("UserTask").createInstance(); - - processInstance.start(); - assertThat(processInstance.status()).isEqualTo(STATE_ACTIVE); - KogitoWorkItem workItem = workItemHandler.getWorkItem(); - assertThat(workItem).isNotNull(); - assertThat(workItem.getParameter("Description").toString().trim()).isEqualTo("Executing task of process instance " + processInstance.id() + " as work item with Hello"); - processInstance.completeWorkItem(workItem.getStringId(), null, SecurityPolicy.of(new StaticIdentityProvider("john"))); - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - } - - @Test - public void testScriptMultilineExprProcess() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-CallActivitySubProcess.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.SubProcessProcess", content); - - Map processes = createProcesses(classData, Collections.emptyMap()); - ProcessInstance processInstance = processes.get("SubProcess").createInstance(); - - processInstance.start(); - - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - } - - @Test - public void testExclusiveSplit() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-ExclusiveSplit.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.TestProcess", content); - - SystemOutWorkItemHandler workItemHandler = new SystemOutWorkItemHandler(); - - Map processes = createProcesses(classData, Collections.singletonMap("Email", workItemHandler)); - Map params = new HashMap(); - params.put("x", "First"); - params.put("y", "Second"); - ProcessInstance processInstance = processes.get("com.sample.test").createInstance(BpmnVariables.create(params)); - - processInstance.start(); - - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - - } - - @Test - public void testExclusiveSplitRetriggerAfterError() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-ExclusiveSplit.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.TestProcess", content); - - SystemOutWorkItemHandler workItemHandler = new SystemOutWorkItemHandler(); - - Map processes = createProcesses(classData, Collections.singletonMap("Email", workItemHandler)); - Map params = new HashMap(); - params.put("x", "First1"); - params.put("y", "Second1"); - ProcessInstance processInstance = processes.get("com.sample.test").createInstance(BpmnVariables.create(params)); - - processInstance.start(); - - assertThat(processInstance.status()).isEqualTo(KogitoProcessInstance.STATE_ERROR); - - Optional errorOptional = processInstance.error(); - assertThat(errorOptional).isPresent(); - - ProcessError error = errorOptional.get(); - assertThat(error.failedNodeId()).isEqualTo("_2"); - assertThat(error.errorMessage()).contains("XOR split could not find at least one valid outgoing connection for split Split"); - - params.put("x", "First"); - processInstance.updateVariables(BpmnVariables.create(params)); - - error.retrigger(); - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - } - - @Test - public void testInclusiveSplit() throws Exception { - - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-InclusiveSplit.bpmn2")).get(0); - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.TestProcess", content); - - Map processes = createProcesses(classData, Collections.emptyMap()); - Map params = new HashMap(); - params.put("x", 15); - ProcessInstance processInstance = processes.get("com.sample.test").createInstance(BpmnVariables.create(params)); - - processInstance.start(); - - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - - } - - @Test - public void testInclusiveSplitDefaultConnection() throws Exception { - - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-InclusiveGatewayWithDefault.bpmn2")).get(0); - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.InclusiveGatewayWithDefaultProcess", content); - - Map processes = createProcesses(classData, Collections.emptyMap()); - Map params = new HashMap(); - params.put("test", "c"); - ProcessInstance processInstance = processes.get("InclusiveGatewayWithDefault").createInstance(BpmnVariables.create(params)); - - processInstance.start(); - - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - - } - - @Test - public void testParallelGateway() throws Exception { - - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-ParallelSplit.bpmn2")).get(0); - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.TestProcess", content); - - Map processes = createProcesses(classData, Collections.emptyMap()); - Map params = new HashMap(); - ProcessInstance processInstance = processes.get("com.sample.test").createInstance(BpmnVariables.create(params)); - - processInstance.start(); - - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - - } - - @Test - public void testInclusiveSplitAndJoinNested() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-InclusiveSplitAndJoinNested.bpmn2")).get(0); - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.TestProcess", content); - - TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); - Map params = new HashMap(); - params.put("x", 15); - Map processes = createProcesses(classData, Collections.singletonMap("Human Task", workItemHandler)); - ProcessInstance processInstance = processes.get("com.sample.test").createInstance(BpmnVariables.create(params)); - - processInstance.start(); - assertThat(processInstance.status()).isEqualTo(STATE_ACTIVE); - - List activeWorkItems = workItemHandler.getWorkItems(); - - assertThat(activeWorkItems).hasSize(2); - - for (KogitoWorkItem wi : activeWorkItems) { - processInstance.completeWorkItem(wi.getStringId(), null); - } - - activeWorkItems = workItemHandler.getWorkItems(); - assertThat(activeWorkItems).hasSize(2); - - for (KogitoWorkItem wi : activeWorkItems) { - processInstance.completeWorkItem(wi.getStringId(), null); - } - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - - } - - @Test - public void testInclusiveSplitAndJoinNestedWithBusinessKey() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-InclusiveSplitAndJoinNested.bpmn2")).get(0); - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.TestProcess", content); - - String businessKey = "custom"; - - TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); - Map params = new HashMap(); - params.put("x", 15); - Map processes = createProcesses(classData, Collections.singletonMap("Human Task", workItemHandler)); - ProcessInstance processInstance = processes.get("com.sample.test").createInstance(businessKey, BpmnVariables.create(params)); - - processInstance.start(); - assertThat(processInstance.status()).isEqualTo(STATE_ACTIVE); - - ProcessInstance loadedProcessInstance = processes.get("com.sample.test").instances().findById(processInstance.id()).orElse(null); - assertThat(loadedProcessInstance).isNotNull(); - assertThat(loadedProcessInstance.businessKey()).isEqualTo(businessKey); - - loadedProcessInstance.abort(); - - assertThat(processInstance.status()).isEqualTo(STATE_ABORTED); - - } - - @Test - public void testWorkItemProcessWithVariableMapping() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-ServiceProcess.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = new HashMap<>(); - classData.put("org.drools.bpmn2.ServiceProcessProcess", content); - - TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); - Map params = new HashMap(); - params.put("s", "john"); - Map processes = createProcesses(classData, Collections.singletonMap("org.jbpm.bpmn2.objects.HelloService_hello__2_Handler", workItemHandler)); - ProcessInstance processInstance = processes.get("ServiceProcess").createInstance(BpmnVariables.create(params)); - - processInstance.start(); - assertThat(processInstance.status()).isEqualTo(STATE_ACTIVE); - - KogitoWorkItem workItem = workItemHandler.getWorkItem(); - assertThat(workItem).isNotNull(); - - assertThat(workItem.getParameter("Parameter")).isEqualTo("john"); - - processInstance.completeWorkItem(workItem.getStringId(), Collections.singletonMap("Result", "john doe")); - - assertThat(processInstance.status()).isEqualTo(STATE_COMPLETED); - } - - @Test - public void testBusinessRuleTaskProcess() throws Exception { - // This is a workaround to make it compile. A process that includes rules will never execute without a full Kogito context - MockClassLoader classLoader = new MockClassLoader("org.kie.api.runtime.KieRuntimeBuilder"); - - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-BusinessRuleTask.bpmn2")).get(0); - - ProcessMetaData metaData = new ProcessToExecModelGenerator(classLoader).generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - } - - @Test - public void testServiceTaskProcess() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("BPMN2-ServiceProcess.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - assertThat(metaData.getWorkItems()) - .hasSize(1) - .contains("org.jbpm.bpmn2.objects.HelloService_hello__2_Handler"); - } - - @Test - public void testCallActivityProcess() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("PrefixesProcessIdCallActivity.bpmn2")).get(0); - - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - assertThat(metaData.getSubProcesses()) - .hasSize(1) - .containsKey("SubProcess") - .containsValue("test.SubProcess"); - } - - @Test - public void testAsyncExecution() throws Exception { - BpmnProcess process = BpmnProcess.from(new ClassPathResource("async/AsyncProcess.bpmn")).get(0); - ProcessMetaData metaData = ProcessToExecModelGenerator.INSTANCE.generate((WorkflowProcess) process.get()); - String content = metaData.getGeneratedClassModel().toString(); - assertThat(content).isNotNull(); - log(content); - - Map classData = Collections.singletonMap("com.example.AsyncProcessProcess", content); - CountDownLatch latch = new CountDownLatch(1); - String mainThread = Thread.currentThread().getName(); - AtomicReference workItemThread = new AtomicReference<>(); - KogitoWorkItemHandler workItemHandler = new KogitoWorkItemHandler() { - @Override - public void executeWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) { - workItemThread.set(Thread.currentThread().getName()); - manager.completeWorkItem(workItem.getStringId(), Collections.singletonMap("response", "hello " + workItem.getParameter("name"))); - latch.countDown(); - } - - @Override - public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) { - latch.countDown(); - } - }; - - Map processes = - createProcesses(classData, Collections.singletonMap("org.jbpm.bpmn2.objects.HelloService_hello__F387A14A_BC7C_49AC_BAED_0CCFE1E114C6_Handler", workItemHandler)); - ProcessInstance i = UnitOfWorkExecutor.executeInUnitOfWork(process.getApplication().unitOfWorkManager(), () -> { - ProcessInstance processInstance = processes.get("AsyncProcess").createInstance(BpmnVariables.create(Collections.singletonMap("name", "Tiago"))); - processInstance.start(); - assertThat(processInstance.status()).isEqualTo(STATE_ACTIVE); - return processInstance; - }); - - //since the tasks as async, possibly executed in different threads. - latch.await(5, TimeUnit.SECONDS); - - assertThat(i.status()).isEqualTo(STATE_COMPLETED); - BpmnVariables variables = (BpmnVariables) i.variables(); - assertThat(variables.get("greeting")).isEqualTo("hello Tiago"); - assertThat(workItemThread.get()).isNotEqualTo(mainThread); - } - - /* - * Helper methods - */ - - protected void log(String content) { - logger.debug(content); - } - - protected Map createProcesses(Map classData, Map handlers) throws Exception { - MemoryFileSystem srcMfs = new MemoryFileSystem(); - MemoryFileSystem trgMfs = new MemoryFileSystem(); - - String[] sources = new String[classData.size()]; - int index = 0; - for (Entry entry : classData.entrySet()) { - String fileName = entry.getKey().replaceAll("\\.", "/") + ".java"; - sources[index++] = fileName; - - srcMfs.write(fileName, entry.getValue().getBytes()); - } - - CompilationResult result = JAVA_COMPILER.compile(sources, srcMfs, trgMfs, this.getClass().getClassLoader()); - assertThat(result).isNotNull(); - assertThat(result.getErrors()).isEmpty(); - - CachedWorkItemHandlerConfig wiConfig = new CachedWorkItemHandlerConfig(); - for (Entry entry : handlers.entrySet()) { - wiConfig.register(entry.getKey(), entry.getValue()); - } - - ProcessConfig config = new StaticProcessConfig(wiConfig, new DefaultProcessEventListenerConfig(), new DefaultUnitOfWorkManager(new CollectingUnitOfWorkFactory())); - - TestClassLoader cl = new TestClassLoader(this.getClass().getClassLoader(), trgMfs.getMap()); - Map processes = new HashMap<>(); - BpmnProcesses bpmnProcesses = new BpmnProcesses(); - StaticApplication application = new StaticApplication(new StaticConfig(null, config), bpmnProcesses); - - for (String className : classData.keySet()) { - Class processClass = Class.forName(className, true, cl); - - Method processMethod = processClass.getMethod("process"); - Process process = (Process) processMethod.invoke(null); - assertThat(process).isNotNull(); - - processes.put(process.getId(), new BpmnProcess(process, config, application)); - } - - return processes; - } - - private static class TestClassLoader extends URLClassLoader { - private final Map extraClassDefs; - - public TestClassLoader(ClassLoader parent, Map extraClassDefs) { - super(new URL[0], parent); - this.extraClassDefs = new HashMap<>(); - - for (Entry entry : extraClassDefs.entrySet()) { - this.extraClassDefs.put(entry.getKey().asString().replace('/', '.').replaceFirst("\\.class", ""), entry.getValue()); - } - } - - @Override - protected Class findClass(final String name) throws ClassNotFoundException { - byte[] classBytes = this.extraClassDefs.remove(name); - if (classBytes != null) { - return defineClass(name, classBytes, 0, classBytes.length); - } - return super.findClass(name); - } - - } - - private static class MockClassLoader extends ClassLoader { - - private final Collection mockedClass = new ArrayList<>(); - - private MockClassLoader(String... mockedClass) { - this.mockedClass.addAll(Arrays.asList(mockedClass)); - } - - @Override - public Class loadClass(String name) throws ClassNotFoundException { - if (mockedClass.contains(name)) { - return Object.class; - } - return super.loadClass(name); - } - } -} diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractVisitor.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractVisitor.java index 5c59c3eb93b..ce0168cfe0e 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractVisitor.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractVisitor.java @@ -50,6 +50,7 @@ import static org.jbpm.ruleflow.core.RuleFlowProcessFactory.METHOD_ADD_COMPENSATION_CONTEXT; import static org.jbpm.ruleflow.core.RuleFlowProcessFactory.METHOD_VARIABLE; import static org.jbpm.ruleflow.core.factory.NodeFactory.METHOD_METADATA; +import static org.kie.kogito.internal.utils.ConversionUtils.sanitizeString; public abstract class AbstractVisitor { @@ -73,9 +74,9 @@ protected MethodCallExpr getFactoryMethod(String object, String methodName, Expr protected String getOrDefault(String value, String defaultValue) { if (value == null) { - return defaultValue; + return sanitizeString(defaultValue); } - return value; + return sanitizeString(value); } protected Expression getOrNullExpr(String value) { diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ActionNodeVisitor.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ActionNodeVisitor.java index ef04ad0a735..e77502776e4 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ActionNodeVisitor.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ActionNodeVisitor.java @@ -30,6 +30,8 @@ import org.jbpm.workflow.core.DroolsAction; import org.jbpm.workflow.core.impl.DroolsConsequenceAction; import org.jbpm.workflow.core.node.ActionNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.github.javaparser.StaticJavaParser; import com.github.javaparser.ast.body.Parameter; @@ -48,6 +50,8 @@ public class ActionNodeVisitor extends AbstractNodeVisitor { + private static final Logger LOGGER = LoggerFactory.getLogger(ActionNodeVisitor.class); + private static final String INTERMEDIATE_COMPENSATION_TYPE = "IntermediateThrowEvent-None"; @Override @@ -77,20 +81,20 @@ public void visitNode(String factoryField, ActionNode node, BlockStmt body, Vari body.addStatement(getFactoryMethod(getNodeId(node), METHOD_ACTION, buildAction((String) node.getMetaData(REF), (String) node.getMetaData(VARIABLE), (String) node.getMetaData(MAPPING_VARIABLE_INPUT), (String) node.getMetaData(CUSTOM_SCOPE)))); } else if (node.getAction() instanceof DroolsConsequenceAction) { + BlockStmt actionBody = new BlockStmt(); String consequence = getActionConsequence(node.getAction()); if (consequence == null || consequence.trim().isEmpty()) { - throw new IllegalStateException("Action node " + node.getId().toExternalFormat() + " name " + node.getName() + " has no action defined"); - } - BlockStmt actionBody = new BlockStmt(); - List variables = variableScope.getVariables(); - variables.stream() - .filter(v -> consequence.contains(v.getName())) - .map(ActionNodeVisitor::makeAssignment) - .forEach(actionBody::addStatement); - - BlockStmt blockStmt = StaticJavaParser.parseBlock("{" + consequence + "}"); - blockStmt.getStatements().forEach(actionBody::addStatement); + LOGGER.warn("Action node {} name {} has no action defined!", node.getId().toExternalFormat(), node.getName()); + } else { + List variables = variableScope.getVariables(); + variables.stream() + .filter(v -> consequence.contains(v.getName())) + .map(ActionNodeVisitor::makeAssignment) + .forEach(actionBody::addStatement); + BlockStmt blockStmt = StaticJavaParser.parseBlock("{" + consequence + "}"); + blockStmt.getStatements().forEach(actionBody::addStatement); + } LambdaExpr lambda = new LambdaExpr( new Parameter(new UnknownType(), KCONTEXT_VAR), // (kcontext) -> actionBody); diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/LambdaSubProcessNodeVisitor.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/LambdaSubProcessNodeVisitor.java index 2142580b417..01722cf0e65 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/LambdaSubProcessNodeVisitor.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/LambdaSubProcessNodeVisitor.java @@ -30,12 +30,16 @@ import org.jbpm.workflow.core.node.SubProcessNode; import org.jbpm.workflow.instance.impl.NodeInstanceImpl; import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcess; +import org.kie.kogito.process.ProcessInstance; +import org.kie.kogito.process.Processes; +import com.github.javaparser.ast.NodeList; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.body.Parameter; import com.github.javaparser.ast.expr.AssignExpr; import com.github.javaparser.ast.expr.BooleanLiteralExpr; import com.github.javaparser.ast.expr.CastExpr; +import com.github.javaparser.ast.expr.ClassExpr; import com.github.javaparser.ast.expr.Expression; import com.github.javaparser.ast.expr.LambdaExpr; import com.github.javaparser.ast.expr.MethodCallExpr; @@ -96,6 +100,7 @@ public void visitNode(String factoryField, SubProcessNode node, BlockStmt body, false); retValue.ifPresentOrElse(retValueExpression -> { + retValueExpression.findAll(ClassOrInterfaceType.class) .stream() .filter(t -> t.getNameAsString().equals("$Type$")) @@ -108,6 +113,7 @@ public void visitNode(String factoryField, SubProcessNode node, BlockStmt body, retValueExpression.findFirst(MethodDeclaration.class, m -> m.getNameAsString().equals("unbind")) .ifPresent(m -> m.setBody(unbind(node))); body.addStatement(getFactoryMethod(getNodeId(node), getNodeKey(), retValueExpression)); + }, () -> body.addStatement(getFactoryMethod(getNodeId(node), getNodeKey()))); addNodeMappings(node, body, getNodeId(node)); @@ -143,15 +149,21 @@ private BlockStmt bind(ModelMetaData subProcessModel) { } private BlockStmt createInstance(SubProcessNode subProcessNode, ProcessMetaData metadata) { - String processId = ProcessToExecModelGenerator.extractProcessId(subProcessNode.getProcessId()); - String processFieldName = "process" + processId; - - MethodCallExpr processInstanceSupplier = new MethodCallExpr(new NameExpr(processFieldName), "createInstance").addArgument("model"); + String subProcessModelClassName = metadata.getModelClassName() != null ? metadata.getModelClassName() : ProcessToExecModelGenerator.extractModelClassName(processId); + String processFieldName = "app"; + Expression expr = new NameExpr(processFieldName); + ClassOrInterfaceType processesType = new ClassOrInterfaceType(null, Processes.class.getCanonicalName()); + expr = new MethodCallExpr(expr, "get", NodeList.nodeList(new ClassExpr(processesType))); + expr = new MethodCallExpr(expr, "processById", NodeList.nodeList(new StringLiteralExpr(subProcessNode.getProcessId()))); + expr = new MethodCallExpr(expr, "createInstance").addArgument("model"); + ClassOrInterfaceType subProcessType = new ClassOrInterfaceType(null, ProcessInstance.class.getCanonicalName()); + subProcessType.setTypeArguments(new ClassOrInterfaceType(null, subProcessModelClassName)); + expr = new CastExpr(subProcessType, expr); metadata.addSubProcess(processId, subProcessNode.getProcessId()); - return new BlockStmt().addStatement(new ReturnStmt(processInstanceSupplier)); + return new BlockStmt().addStatement(new ReturnStmt(expr)); } private BlockStmt unbind(SubProcessNode subProcessNode) { diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ModelMetaData.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ModelMetaData.java index c374c7a0316..62f35f59cdb 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ModelMetaData.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ModelMetaData.java @@ -104,10 +104,14 @@ public ModelMetaData(String processId, String packageName, String modelClassSimp this.customGenerator = customGenerator; } - public String generate() { + public CompilationUnit generateUnit() { CompilationUnit modelClass = compilationUnit(); Arrays.stream(customGenerator).forEach(generator -> generator.accept(modelClass)); - return modelClass.toString(); + return modelClass; + } + + public String generate() { + return generateUnit().toString(); } public AssignExpr newInstance(String assignVarName) { @@ -169,7 +173,7 @@ public MethodCallExpr callGetter(String targetVar, String field) { } private CompilationUnit compilationUnit() { - CompilationUnit compilationUnit = parse(this.getClass().getResourceAsStream(templateName)); + CompilationUnit compilationUnit = parse(TemplateHelper.findTemplate(templateName)); compilationUnit.setPackageDeclaration(packageName); Optional processMethod = compilationUnit.findFirst(ClassOrInterfaceDeclaration.class, sl1 -> true); diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ProcessToExecModelGenerator.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ProcessToExecModelGenerator.java index 8643f48ed94..253d24a7f0a 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ProcessToExecModelGenerator.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/ProcessToExecModelGenerator.java @@ -62,17 +62,25 @@ public class ProcessToExecModelGenerator { private static final String PROCESS_CLASS_SUFFIX = "Process"; private static final String MODEL_CLASS_SUFFIX = "Model"; - private static final String PROCESS_TEMPLATE_FILE = "/class-templates/ProcessTemplate.java"; + private static final String PROCESS_TEMPLATE_FILE = "ProcessTemplate.java"; private static final String PROCESS_NAME_PARAM = "processName"; private final ProcessVisitor processVisitor; + private ClassLoader contextClassLoader; + private String classTemplate; public ProcessToExecModelGenerator(ClassLoader contextClassLoader) { + this(PROCESS_TEMPLATE_FILE, contextClassLoader); + } + + public ProcessToExecModelGenerator(String classTemplate, ClassLoader contextClassLoader) { + this.classTemplate = classTemplate; + this.contextClassLoader = contextClassLoader; this.processVisitor = new ProcessVisitor(contextClassLoader); } public ProcessMetaData generate(WorkflowProcess process) { - CompilationUnit parsedClazzFile = parse(this.getClass().getResourceAsStream(PROCESS_TEMPLATE_FILE)); + CompilationUnit parsedClazzFile = parse(TemplateHelper.findTemplate(contextClassLoader, this.classTemplate)); parsedClazzFile.setPackageDeclaration(process.getPackageName()); Optional processClazzOptional = parsedClazzFile.findFirst( ClassOrInterfaceDeclaration.class, diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/SplitNodeVisitor.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/SplitNodeVisitor.java index 2fcdad5cdff..a4f0039fc1d 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/SplitNodeVisitor.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/SplitNodeVisitor.java @@ -29,6 +29,7 @@ import org.jbpm.workflow.core.Constraint; import org.jbpm.workflow.core.impl.ConnectionRef; import org.jbpm.workflow.core.node.Split; +import org.kie.kogito.internal.utils.ConversionUtils; import com.github.javaparser.StaticJavaParser; import com.github.javaparser.ast.NodeList; @@ -104,6 +105,6 @@ public void visitNode(String factoryField, Split node, BlockStmt body, VariableS private static ObjectCreationExpr buildFEELReturnValueEvaluator(Constraint constraint) { return new ObjectCreationExpr(null, StaticJavaParser.parseClassOrInterfaceType("org.jbpm.bpmn2.feel.FeelReturnValueEvaluator"), - new NodeList<>(new StringLiteralExpr(constraint.getConstraint()))); + new NodeList<>(new StringLiteralExpr(ConversionUtils.sanitizeString(constraint.getConstraint())))); } } diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/TemplateHelper.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/TemplateHelper.java new file mode 100644 index 00000000000..4d80f2b6831 --- /dev/null +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/TemplateHelper.java @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.compiler.canonical; + +import java.io.InputStream; + +import org.jbpm.util.JbpmClassLoaderUtil; + +public class TemplateHelper { + + public static InputStream findTemplate(String template) { + return findTemplate(JbpmClassLoaderUtil.findClassLoader(), template); + } + + public static InputStream findTemplate(ClassLoader contextClassLoader, String template) { + InputStream is = contextClassLoader.getResourceAsStream(template); + if (is != null) { + return is; + } + + is = contextClassLoader.getResourceAsStream(template.substring(1)); + if (is != null) { + return is; + } + + is = contextClassLoader.getResourceAsStream(String.format("class-templates/%s", template)); + if (is != null) { + return is; + } + return is = contextClassLoader.getResourceAsStream(String.format("/class-templates/%s", template)); + } +} diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/TriggerMetaData.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/TriggerMetaData.java index 4dddd44d5e4..202117ab0c9 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/TriggerMetaData.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/TriggerMetaData.java @@ -124,8 +124,7 @@ private TriggerMetaData validate() { if (TriggerType.ConsumeMessage.equals(type) || TriggerType.ProduceMessage.equals(type)) { if (StringUtils.isEmpty(name) || - StringUtils.isEmpty(dataType) || - StringUtils.isEmpty(modelRef)) { + StringUtils.isEmpty(dataType)) { throw new IllegalArgumentException("Message Trigger information is not complete " + this); } } else if (TriggerType.Signal.equals(type) && StringUtils.isEmpty(name)) { diff --git a/jbpm/jbpm-tests/pom.xml b/jbpm/jbpm-tests/pom.xml new file mode 100644 index 00000000000..489f28b2877 --- /dev/null +++ b/jbpm/jbpm-tests/pom.xml @@ -0,0 +1,163 @@ + + + 4.0.0 + + jbpm + org.kie.kogito + 999-SNAPSHOT + + + jbpm-tests + + Kogito :: jBPM :: Tests + jBPM Tests + + + + UTF-8 + org.kie.kogito.jbpm.flow.core + + + + + + org.kie.kogito + jbpm-bpmn2 + + + org.kie.kogito + jbpm-flow + + + + + org.glassfish.jaxb + jaxb-runtime + test + + + org.drools + drools-core + test-jar + test + + + org.kie.kogito + jbpm-flow-builder + test-jar + test + + + org.drools + drools-wiring-dynamic + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + ch.qos.logback + logback-classic + test + + + org.assertj + assertj-core + test + + + org.mockito + mockito-core + test + + + org.jboss.resteasy + resteasy-client + test + + + + + + + org.kie.kogito + kogito-kie-bom + ${project.version} + pom + import + + + + + + + + org.kie.kogito + jbpm-tools-maven-plugin + ${project.version} + + + generate-test-resources + generate-test-sources + + jbpm-process-test-generation + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-test-source + generate-test-sources + + add-test-source + + + + target/generated-test-sources/jbpm + + + + + add-test-resource + generate-test-sources + + add-test-resource + + + + + src/test/bpmn + + + + + + + + maven-surefire-plugin + + + + true + + 2 + all + + + + + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2 similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2 index 0fc076a4eda..7fc9cc24828 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTask.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTask.bpmn2 index 7e10a93034b..ee4dff3f665 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTask.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTaskFEEL.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTaskFEEL.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTaskFEEL.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTaskFEEL.bpmn2 index dcc65fb9f18..bb215860f82 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTaskFEEL.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTaskFEEL.bpmn2 @@ -16,7 +16,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTaskWithIO.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTaskWithIO.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTaskWithIO.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTaskWithIO.bpmn2 index 96b728cdaa1..019af1d8910 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScriptTaskWithIO.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-ScriptTaskWithIO.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTask.bpmn2 similarity index 90% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTask.bpmn2 index 8ec23a6c65f..7bdef70bd87 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTask.bpmn2 @@ -1,5 +1,13 @@ - + @@ -17,7 +25,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/handler/BPMN2-UserTaskWithBooleanOutput.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithBooleanOutput.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/handler/BPMN2-UserTaskWithBooleanOutput.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithBooleanOutput.bpmn2 index 411acdf4067..b891310a725 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/handler/BPMN2-UserTaskWithBooleanOutput.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithBooleanOutput.bpmn2 @@ -2,7 +2,7 @@ - + _DFE3E214-3CF2-4B4D-88E0-F8B10861D257 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithDataStore.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithDataStore.bpmn2 similarity index 88% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithDataStore.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithDataStore.bpmn2 index 4e06e2ff147..518141dc457 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithDataStore.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithDataStore.bpmn2 @@ -1,13 +1,15 @@ + xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" + xmlns:data="http://www.example.com/proxydata" + xmlns:tns="http://www.jboss.org/drools" > - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithIOexpression.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithIOexpression.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithIOexpression.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithIOexpression.bpmn2 index 8ba9547dc6b..89f817e66c0 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithIOexpression.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithIOexpression.bpmn2 @@ -21,7 +21,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithParametrizedInput.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithParametrizedInput.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithParametrizedInput.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithParametrizedInput.bpmn2 index 065d7347a58..8d2fd1a6704 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithParametrizedInput.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithParametrizedInput.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSimulationMetaData.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithSimulationMetaData.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSimulationMetaData.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithSimulationMetaData.bpmn2 index 59a650188c4..1486bcef7d8 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSimulationMetaData.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/activity/BPMN2-UserTaskWithSimulationMetaData.bpmn2 @@ -10,7 +10,7 @@ expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.omg.org/bpmn20" typeLanguage="http://www.java.com/javaTypes"> - + _D9988BD7-9459-49E4-9C20-7201B47127B9 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessInAdHocProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/adhoc/BPMN2-SubProcessInAdHocProcess.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessInAdHocProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/adhoc/BPMN2-SubProcessInAdHocProcess.bpmn2 index a537b02889b..e9ab80f700e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessInAdHocProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/adhoc/BPMN2-SubProcessInAdHocProcess.bpmn2 @@ -4,7 +4,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-BoundaryMessage.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationBoundaryMessage.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-BoundaryMessage.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationBoundaryMessage.bpmn2 index 7aac768885a..9edd3b54e65 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-BoundaryMessage.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationBoundaryMessage.bpmn2 @@ -24,13 +24,13 @@ - + CorrelationPropertyId - + MessageId diff --git a/jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-IntermediateMessage.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationIntermediateMessage.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-IntermediateMessage.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationIntermediateMessage.bpmn2 index e9d86627d83..186e9549b38 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-IntermediateMessage.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationIntermediateMessage.bpmn2 @@ -13,13 +13,13 @@ - + CorrelationPropertyId - + MessageId diff --git a/jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-StartMessage.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationStartMessage.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-StartMessage.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationStartMessage.bpmn2 index 53e9ccdf968..035cad49367 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/collaboration/Collaboration-StartMessage.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/collaboration/BPMN2-CollaborationStartMessage.bpmn2 @@ -14,13 +14,13 @@ - + CorrelationPropertyId - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-BookResource.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-BookResource.bpmn2 similarity index 75% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-BookResource.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-BookResource.bpmn2 index 250c5db5280..1ada5ecec0d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-BookResource.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-BookResource.bpmn2 @@ -1,7 +1,14 @@ - - + + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Booking.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-Booking.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Booking.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-Booking.bpmn2 index 7f1ca178e2b..0ff1cf03c76 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Booking.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-Booking.bpmn2 @@ -1,7 +1,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-CancelResource.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-CancelResource.bpmn2 similarity index 75% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-CancelResource.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-CancelResource.bpmn2 index c0b0b811e10..e6e6ac451ba 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-CancelResource.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-CancelResource.bpmn2 @@ -1,7 +1,7 @@ - - + + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-InSubSubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-InSubSubProcess.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-InSubSubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-InSubSubProcess.bpmn2 index f29eb4c0013..4dd2cc95987 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-InSubSubProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-InSubSubProcess.bpmn2 @@ -18,7 +18,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-IntermediateThrowEvent.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-IntermediateThrowEvent.bpmn2 index 35913f96be5..300ce7fc67f 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-IntermediateThrowEvent.bpmn2 @@ -2,7 +2,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-ParallelOrderedCompensationIntermediateThrowEvent.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-ParallelOrderedCompensationIntermediateThrowEvent.bpmn2 index 2628fd6215d..3b7ba2a16cb 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-ParallelOrderedCompensationIntermediateThrowEvent.bpmn2 @@ -2,7 +2,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-ThrowSpecificForSubProcess.bpmn2 similarity index 90% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-ThrowSpecificForSubProcess.bpmn2 index 7e99ff40bf2..87ac749dba4 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-ThrowSpecificForSubProcess.bpmn2 @@ -1,8 +1,8 @@ - + - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-UserTaskBeforeAssociatedActivity.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-UserTaskBeforeAssociatedActivity.bpmn2 index 8e09beec9ed..6dd31ccd6f5 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-UserTaskBeforeAssociatedActivity.bpmn2 @@ -2,7 +2,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-UserTaskCompensation.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-UserTaskCompensation.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-UserTaskCompensation.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-UserTaskCompensation.bpmn2 index 6e34d662e71..8120d3e398f 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-UserTaskCompensation.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/compensation/BPMN2-UserTaskCompensation.bpmn2 @@ -4,7 +4,7 @@ - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Association.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Association.bpmn2 similarity index 87% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Association.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Association.bpmn2 index d0febc3236d..d7da3a8c8ab 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Association.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Association.bpmn2 @@ -6,9 +6,9 @@ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" - xmlns:tns="http://www.example.org/EvaluationExample"> + xmlns:tns="http://www.jboss.org/drools" > - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CorrelationKey.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-CorrelationKey.bpmn2 similarity index 90% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CorrelationKey.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-CorrelationKey.bpmn2 index 37ff4885fe8..01f7fa65885 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CorrelationKey.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-CorrelationKey.bpmn2 @@ -1,9 +1,9 @@ - + - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociations.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociations.bpmn2 index 03f1cf3b03a..cdca32020aa 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociations.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-lazy-creating.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsLazyCreating.bpmn2 similarity index 91% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-lazy-creating.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsLazyCreating.bpmn2 index bc93959b8a4..ee594b4a5b1 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-lazy-creating.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsLazyCreating.bpmn2 @@ -12,9 +12,9 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsString.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsString.bpmn2 index 90e0b0016aa..d57746e4111 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsString.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string-no-quotes.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringNoQuotes.bpmn2 similarity index 91% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string-no-quotes.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringNoQuotes.bpmn2 index 3fca25d62ee..172a9a252df 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string-no-quotes.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringNoQuotes.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string-object.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringObject.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string-object.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringObject.bpmn2 index f2f165fd69e..e638a691ace 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-string-object.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringObject.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-xml-literal.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsXmlLiteral.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-xml-literal.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsXmlLiteral.bpmn2 index b234e8eeba4..7a8493b300d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-xml-literal.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsXmlLiteral.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataObject.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataObject.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataObject.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataObject.bpmn2 index 6041f12ab52..83ed9496def 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataObject.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataObject.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataOutputAssociations.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataOutputAssociations.bpmn2 index fe08678c540..b0aeba31f0e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataOutputAssociations.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations-xml-node.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataOutputAssociationsXmlNode.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations-xml-node.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataOutputAssociationsXmlNode.bpmn2 index 38d1be25697..2bec6913729 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations-xml-node.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataOutputAssociationsXmlNode.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataStore.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataStore.bpmn2 similarity index 88% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataStore.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataStore.bpmn2 index bb2e9c1c732..b1e5115b57e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataStore.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-DataStore.bpmn2 @@ -6,7 +6,7 @@ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" - xmlns:tns="http://www.example.org/EvaluationExample"> + xmlns:tns="http://www.jboss.org/drools"> @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation.bpmn2 index 628601b93bc..b77ac2e6a4a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess2.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation2.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess2.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation2.bpmn2 index 399b2914fc9..385dbe781f8 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess2.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation2.bpmn2 @@ -12,7 +12,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess3.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation3.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess3.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation3.bpmn2 index 35d47f2be85..744321bf9c7 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EvaluationProcess3.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Evaluation3.bpmn2 @@ -13,7 +13,7 @@ - + @@ -67,7 +67,7 @@ return employee == "john"; - eval(true); + return true; diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Import.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Import.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Import.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Import.bpmn2 index ba8b9e0ac33..ed12683bf43 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Import.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/data/BPMN2-Import.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventCatchingOnEntryException.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventCatchingOnEntryException.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventCatchingOnEntryException.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventCatchingOnEntryException.bpmn2 index e0ede65c4b6..54fa4538a28 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventCatchingOnEntryException.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventCatchingOnEntryException.bpmn2 @@ -1,7 +1,7 @@ - + _5A8DFA01-0589-4ADE-A6D5-D0F0491AFD8C diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventCatchingOnExitException.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventCatchingOnExitException.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventCatchingOnExitException.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventCatchingOnExitException.bpmn2 index 48c04cd98cd..f11ebf9a70d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventCatchingOnExitException.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventCatchingOnExitException.bpmn2 @@ -1,7 +1,7 @@ - + _5A8DFA01-0589-4ADE-A6D5-D0F0491AFD8C diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2 index a8fc3934abb..6419f85d8b9 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2 @@ -7,7 +7,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2 index 8a1c7073101..838c2990492 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2 @@ -7,7 +7,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2 index ff942281cba..45432e3077d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2 @@ -7,7 +7,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventStructureRef.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventStructureRef.bpmn2 index d2ee26fc22c..0a70fda1ee0 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventStructureRef.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventStructureRef.bpmn2 @@ -8,7 +8,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/error/EndErrorWithEventSubprocess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EndErrorWithEventSubprocess.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/error/EndErrorWithEventSubprocess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EndErrorWithEventSubprocess.bpmn2 index 26e0bb3b6e8..533e79df39b 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/error/EndErrorWithEventSubprocess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EndErrorWithEventSubprocess.bpmn2 @@ -1,7 +1,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventInterrupting.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventInterrupting.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventInterrupting.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventInterrupting.bpmn2 index b02593370a3..2a4d4938e00 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventInterrupting.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventInterrupting.bpmn2 @@ -13,7 +13,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventOnTask.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventOnTask.bpmn2 index 2eea9ca6f10..6225705cfa3 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventOnTask.bpmn2 @@ -1,7 +1,7 @@ - + SequenceFlow_4 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubProcessErrorWithScript.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubProcessErrorWithScript.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubProcessErrorWithScript.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubProcessErrorWithScript.bpmn2 index 5b01582f1f1..40440cb3c72 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubProcessErrorWithScript.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubProcessErrorWithScript.bpmn2 @@ -1,7 +1,7 @@ - + _76D86D65-D2AF-4559-9874-EF19AA775D47 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessError.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubprocessError.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessError.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubprocessError.bpmn2 index 7a4a304f846..32df6441e0d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessError.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubprocessError.bpmn2 @@ -1,7 +1,7 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/EventSubprocessErrorHandlingWithErrorCode.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubprocessErrorHandlingWithErrorCode.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/EventSubprocessErrorHandlingWithErrorCode.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubprocessErrorHandlingWithErrorCode.bpmn2 index 13df79e351c..2a3877bd58a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/EventSubprocessErrorHandlingWithErrorCode.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/error/BPMN2-EventSubprocessErrorHandlingWithErrorCode.bpmn2 @@ -2,7 +2,7 @@ - + _1478615A-F236-4F37-9A03-125607B8B380 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEvent.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEvent.bpmn2 index e26aa112a97..3d8a4e33d0a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEvent.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2 index e0c4086f18d..afa54b22027 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventOnTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventOnTask.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventOnTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventOnTask.bpmn2 index 6edc6d0a228..6c4b02543c2 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventOnTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventOnTask.bpmn2 @@ -3,7 +3,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2 index 4491efcd319..17b5c557fb8 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2 @@ -1,7 +1,7 @@ - + SequenceFlow_3 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationEndEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEvent.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationEndEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEvent.bpmn2 index 7019f9636be..5b609216e10 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationEndEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEvent.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationEndEventHandling.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEventHandling.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationEndEventHandling.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEventHandling.bpmn2 index 97f05c97398..8a9aec0b70e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationEndEventHandling.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEventHandling.bpmn2 @@ -2,7 +2,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationWithDataMapping.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationWithDataMapping.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationWithDataMapping.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationWithDataMapping.bpmn2 index 809f56c2f36..69c60d342b0 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationWithDataMapping.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-EscalationWithDataMapping.bpmn2 @@ -6,7 +6,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2 similarity index 91% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2 index 9b5add0f05f..19d49a85a7e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EndEventSignalWithData.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-EndEventSignalWithData.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EndEventSignalWithData.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-EndEventSignalWithData.bpmn2 index 3879b4a23db..0cb0a3c3e30 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EndEventSignalWithData.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-EndEventSignalWithData.bpmn2 @@ -1,7 +1,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorEndEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ErrorEndEvent.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorEndEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ErrorEndEvent.bpmn2 index 133bcb92528..737283c9b57 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorEndEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ErrorEndEvent.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitDesignerScriptProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitDesignerScriptProcess.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitDesignerScriptProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitDesignerScriptProcess.bpmn2 index 1c281cf86cc..f277a82bc13 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitDesignerScriptProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitDesignerScriptProcess.bpmn2 @@ -1,6 +1,6 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitMixedNamespacedScriptProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitMixedNamespacedScriptProcess.bpmn2 similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitMixedNamespacedScriptProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitMixedNamespacedScriptProcess.bpmn2 index 22907124267..4e258e2af0a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitMixedNamespacedScriptProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitMixedNamespacedScriptProcess.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitNamespacedScriptProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitNamespacedScriptProcess.bpmn2 similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitNamespacedScriptProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitNamespacedScriptProcess.bpmn2 index 22907124267..a57bf6cd334 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitNamespacedScriptProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitNamespacedScriptProcess.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitScriptProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitScriptProcess.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitScriptProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitScriptProcess.bpmn2 index 22907124267..5ff4bd179af 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-OnEntryExitScriptProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-OnEntryExitScriptProcess.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ParallelSplit.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ParallelSplit.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ParallelSplit.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ParallelSplit.bpmn2 index 7ee25b3f691..5607d04b8a8 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ParallelSplit.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ParallelSplit.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ParallelSpitTerminate.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ParallelSplitTerminate.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ParallelSpitTerminate.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ParallelSplitTerminate.bpmn2 index c24755b924d..7d2087da6a8 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ParallelSpitTerminate.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-ParallelSplitTerminate.bpmn2 @@ -2,7 +2,7 @@ - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalEndEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-SignalEndEvent.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalEndEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-SignalEndEvent.bpmn2 index d5bb85f22ce..99acb443490 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalEndEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-SignalEndEvent.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubprocessWithParallelSpitTerminate.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-SubprocessWithParallelSplitTerminate.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubprocessWithParallelSpitTerminate.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-SubprocessWithParallelSplitTerminate.bpmn2 index ce37dd891b8..1e67454e195 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubprocessWithParallelSpitTerminate.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/event/BPMN2-SubprocessWithParallelSplitTerminate.bpmn2 @@ -1,6 +1,6 @@ - + _F3ABD822-9714-417F-BDB2-4D7AFC260AFB diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GatewayFEEL.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/feel/BPMN2-GatewayFEEL.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GatewayFEEL.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/feel/BPMN2-GatewayFEEL.bpmn2 index ab5e0b72ec7..102d26e67b6 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GatewayFEEL.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/feel/BPMN2-GatewayFEEL.bpmn2 @@ -1,7 +1,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CompositeProcessWithDIGraphical.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-CompositeProcessWithDIGraphical.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CompositeProcessWithDIGraphical.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-CompositeProcessWithDIGraphical.bpmn2 index afdcf1f25a3..e97e89a2ab5 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CompositeProcessWithDIGraphical.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-CompositeProcessWithDIGraphical.bpmn2 @@ -10,9 +10,9 @@ xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" - xmlns:tns="http://www.example.org/MinimalExample"> + xmlns:tns="http://www.jboss.org/drools" > - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplit.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplit.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplit.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplit.bpmn2 index 2871431b789..b32c704d078 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplit.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplit.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitPriority.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplitPriority.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitPriority.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplitPriority.bpmn2 index 3a4ace926df..46b9b95d552 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitPriority.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplitPriority.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayNested.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayNested.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayNested.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayNested.bpmn2 index 1e1b3e79560..3655d635831 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayNested.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayNested.bpmn2 @@ -1,6 +1,6 @@ - + _1-_3 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithDefault.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithDefault.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithDefault.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithDefault.bpmn2 index 33974079e16..3ba5bf60e63 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithDefault.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithDefault.bpmn2 @@ -15,7 +15,7 @@ + isExecutable="true" tns:packageName="org.jbpm.bpmn2.flow"> diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2 index d5637c3daed..4ba59084ad4 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2 @@ -3,7 +3,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithLoopInside.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithLoopInside.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithLoopInside.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithLoopInside.bpmn2 index c03c5c73f3e..d019cf190a4 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithLoopInside.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithLoopInside.bpmn2 @@ -1,7 +1,7 @@ - + _1-_3 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithLoopInsideSubprocess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithLoopInsideSubprocess.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithLoopInsideSubprocess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithLoopInsideSubprocess.bpmn2 index 4480417a68d..d6e11f02448 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveGatewayWithLoopInsideSubprocess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithLoopInsideSubprocess.bpmn2 @@ -1,7 +1,7 @@ - + _1-_3 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2 index d8e7d5b0ee6..44485920fa2 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2 @@ -1,7 +1,7 @@ - + _1-_14 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplit.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplit.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplit.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplit.bpmn2 index 9e1c573c780..530492e499f 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplit.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplit.bpmn2 @@ -12,7 +12,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoin.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoin.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoin.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoin.bpmn2 index 575530e6370..9d3b0cbdd88 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoin.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoin.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2 index 6a0b381cbcd..64039cccaf6 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2 @@ -1,7 +1,7 @@ - + SequenceFlow_5 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2 index d6b2309c284..7a42cf393d0 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinLoop.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinLoop.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinLoop.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinLoop.bpmn2 index 7e5bbac84b1..76ceaa57af8 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinLoop.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinLoop.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinLoop2.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinLoop2.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinLoop2.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinLoop2.bpmn2 index 03cc4f8c9a4..b1e4a7f83a0 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinLoop2.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinLoop2.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinNested.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinNested.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinNested.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinNested.bpmn2 index db988ba23ef..e895b779919 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinNested.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinNested.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2 index d33d798995d..6e751ecc79c 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2 index 72c875dfce8..e524fd860d5 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2 index d6304853a91..484ca579bda 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Lane.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-Lane.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Lane.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-Lane.bpmn2 index 094e48b0d59..c75e658e2da 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Lane.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-Lane.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcess.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcess.bpmn2 index 604772d26a0..fe8ee957896 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcess.bpmn2 @@ -8,7 +8,7 @@ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessImplicit.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessImplicit.bpmn2 similarity index 90% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessImplicit.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessImplicit.bpmn2 index 976b17fb32e..e0b54176dfd 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessImplicit.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessImplicit.bpmn2 @@ -8,7 +8,7 @@ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessMetaData.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessMetaData.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessMetaData.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessMetaData.bpmn2 index 5db7402a63a..7cf0e8a2083 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessMetaData.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessMetaData.bpmn2 @@ -9,7 +9,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + process diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessWithDIGraphical.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithDIGraphical.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessWithDIGraphical.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithDIGraphical.bpmn2 index 830dfd0a96e..121bbaf4d8d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessWithDIGraphical.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithDIGraphical.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessWithGraphical.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithGraphical.bpmn2 similarity index 87% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessWithGraphical.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithGraphical.bpmn2 index 7b6b8677b60..9823ffc72e7 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MinimalProcessWithGraphical.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithGraphical.bpmn2 @@ -8,9 +8,9 @@ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" xmlns:di="http://www.omg.com/di/1.0.0" xmlns:g="http://www.jboss.org/drools/flow/gpd" - xmlns:tns="http://www.example.org/MinimalExample"> + xmlns:tns="http://www.jboss.org/drools" > - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiConnEnabled.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiConnEnabled.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiConnEnabled.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiConnEnabled.bpmn2 index 2dbb7601852..0ac5fda9dbc 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiConnEnabled.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiConnEnabled.bpmn2 @@ -1,7 +1,7 @@ - + _BEB47A69-0E1A-4101-85CB-9329771624A2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2 index ac0f5e03440..90a28f02aa6 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2 @@ -15,7 +15,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2 index 17571e87e2d..f249b98bf15 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2 @@ -2,7 +2,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2 index 61aece482f3..0c8c8f00284 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2 @@ -4,7 +4,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2 index 72d9c48dc64..02c3149ccd6 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2 @@ -4,7 +4,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutput.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutput.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutput.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutput.bpmn2 index 0ec43c0250b..a7422177b8a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutput.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutput.bpmn2 @@ -16,7 +16,8 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond.bpmn2 index 41a4ffabdea..ddbddb350a9 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond.bpmn2 @@ -16,7 +16,8 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond2.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond2.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond2.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond2.bpmn2 index 9fdb2513a92..df7b97b4e4a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond2.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCond2.bpmn2 @@ -16,7 +16,8 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoop-Numbering.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopNumbering.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoop-Numbering.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopNumbering.bpmn2 index 319bb58e8a3..4449291a0f0 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoop-Numbering.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopNumbering.bpmn2 @@ -8,12 +8,14 @@ xmlns:drools="http://www.jboss.org/drools" id="_HD_q0GyEEeK9dplxPIET6Q" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" - targetNamespace="http://www.omg.org/bpmn20"> + targetNamespace="http://www.omg.org/bpmn20" + xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2 index b6787e0bfe6..a837cfef69b 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2 @@ -6,7 +6,8 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleGatewaysProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultipleGatewaysProcess.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleGatewaysProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultipleGatewaysProcess.bpmn2 index 41a287a8e86..3c092da8c04 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleGatewaysProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultipleGatewaysProcess.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleProcessInOneFile.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultipleProcessInOneFile.bpmn2 similarity index 84% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleProcessInOneFile.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultipleProcessInOneFile.bpmn2 index 45d534ea1d2..1bb07aa2d6e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleProcessInOneFile.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-MultipleProcessInOneFile.bpmn2 @@ -6,9 +6,9 @@ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" - xmlns:tns="http://www.example.org/EvaluationExample"> + xmlns:tns="http://www.jboss.org/drools"> - + @@ -25,7 +25,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessCustomDescriptionMetaData.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessCustomDescriptionMetaData.bpmn2 similarity index 91% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessCustomDescriptionMetaData.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessCustomDescriptionMetaData.bpmn2 index febd274da27..7a0096a6808 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessCustomDescriptionMetaData.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessCustomDescriptionMetaData.bpmn2 @@ -9,7 +9,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + my process with description diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2 similarity index 90% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2 index ad7df6038e2..6756b3ec29a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2 @@ -9,7 +9,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + #{x} diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessWithVariableName.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessWithVariableName.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessWithVariableName.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessWithVariableName.bpmn2 index feffb6b02eb..d8dfcae5144 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessWithVariableName.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-ProcessWithVariableName.bpmn2 @@ -1,7 +1,7 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/build/XORSameTarget.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-XORSameTarget.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/build/XORSameTarget.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-XORSameTarget.bpmn2 index 5244fe6eeaa..fb23c173093 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/build/XORSameTarget.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/flow/BPMN2-XORSameTarget.bpmn2 @@ -2,7 +2,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryConditionalEventOnTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryConditionalEventOnTask.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryConditionalEventOnTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryConditionalEventOnTask.bpmn2 index 709d4cf081b..302bf0c5024 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryConditionalEventOnTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryConditionalEventOnTask.bpmn2 @@ -1,7 +1,7 @@ - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2 index edfc2d5ed98..23466955b1b 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2 @@ -1,7 +1,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryEventWithSignals.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryEventWithSignals.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryEventWithSignals.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryEventWithSignals.bpmn2 index 61c0fdff959..c02d2bf3b51 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryEventWithSignals.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryEventWithSignals.bpmn2 @@ -1,7 +1,7 @@ - + _39E5DC92-2DA0-4DE5-85DF-4F9693091C41 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryMessageEventOnTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryMessageEventOnTask.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryMessageEventOnTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryMessageEventOnTask.bpmn2 index 9f2eae5691e..9b9acaa766a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryMessageEventOnTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundaryMessageEventOnTask.bpmn2 @@ -3,7 +3,7 @@ - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn index 78ed6db735c..c65cc091042 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn @@ -1,7 +1,7 @@ - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalBoundaryEventInterrupting.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-ConditionalBoundaryEventInterrupting.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalBoundaryEventInterrupting.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-ConditionalBoundaryEventInterrupting.bpmn2 index 4594909acc7..e310fcc85f8 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalBoundaryEventInterrupting.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-ConditionalBoundaryEventInterrupting.bpmn2 @@ -1,6 +1,6 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2EndThrowEventScope.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EndThrowEventScope.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2EndThrowEventScope.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EndThrowEventScope.bpmn2 index a86c5f0dda6..526c8862504 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2EndThrowEventScope.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EndThrowEventScope.bpmn2 @@ -6,7 +6,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2 index 861108b43c3..5ef909ec3eb 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2 @@ -12,7 +12,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit2.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit2.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit2.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit2.bpmn2 index 145f4e38e0c..71bea29e79b 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit2.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit2.bpmn2 @@ -12,7 +12,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit3.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit3.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit3.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit3.bpmn2 index bc4dac29f6b..11b4d63e05f 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit3.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit3.bpmn2 @@ -12,7 +12,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit4.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit4.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit4.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit4.bpmn2 index 713748d0697..21c4d1a0f13 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit4.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit4.bpmn2 @@ -18,7 +18,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit5.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit5.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit5.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit5.bpmn2 index 1be4270ef11..46c0205ea56 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventBasedSplit5.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit5.bpmn2 @@ -18,7 +18,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-EventSubProcessWithLocalVariables.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubProcessWithLocalVariables.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-EventSubProcessWithLocalVariables.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubProcessWithLocalVariables.bpmn2 index 4450b4c2a69..a6cc295c5d1 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-EventSubProcessWithLocalVariables.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubProcessWithLocalVariables.bpmn2 @@ -16,7 +16,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2 index d9dee3e3cdc..48cef20c736 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2 @@ -4,7 +4,7 @@ - + _39010054-5D46-4E8C-A9FA-64E46B4E293A diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignal.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignal.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignal.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignal.bpmn2 index ae6fe7e559a..dab041b37e2 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignal.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignal.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalExpression.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalExpression.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalExpression.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalExpression.bpmn2 index 866051ba3de..54f8ce46c13 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalExpression.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalExpression.bpmn2 @@ -2,7 +2,7 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalInterrupting.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalInterrupting.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalInterrupting.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalInterrupting.bpmn2 index 0de0171ce7a..3d7c0bcee01 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalInterrupting.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalInterrupting.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignal-Nested.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalNested.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignal-Nested.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalNested.bpmn2 index a6cbbff4bbf..7146a23425c 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignal-Nested.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalNested.bpmn2 @@ -7,7 +7,7 @@ expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalWithStateNode.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalWithStateNode.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalWithStateNode.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalWithStateNode.bpmn2 index 69808198886..ec7f4f3ff38 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalWithStateNode.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalWithStateNode.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessTimer.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessTimer.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessTimer.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessTimer.bpmn2 index ab3cf31d0f1..058b4e72d54 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessTimer.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessTimer.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessTimerCycle.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessTimerCycle.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessTimerCycle.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessTimerCycle.bpmn2 index 80225d3e776..3db30f02dc2 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessTimerCycle.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessTimerCycle.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2 index 0807e9f3750..b2377dc11e2 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2 @@ -3,7 +3,7 @@ - + _59B8C87F-4385-4CB4-992C-153CA66C5D19 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventCondition.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventCondition.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventCondition.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventCondition.bpmn2 index 1b5246579d8..87e3b1871b9 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventCondition.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventCondition.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2 index 40d63271a84..311bc925222 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2 @@ -2,7 +2,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionPI.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionPI.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionPI.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionPI.bpmn2 index 3cbc2eec48d..ffe59c6d01e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionPI.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionPI.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2 index 348858b8b77..fe204be71ac 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2 @@ -1,7 +1,7 @@ - + _1-_3 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventMessage.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessage.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventMessage.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessage.bpmn2 index 3e721652007..2893c64e804 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventMessage.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessage.bpmn2 @@ -17,7 +17,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventMessageWithRef.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessageWithRef.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventMessageWithRef.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessageWithRef.bpmn2 index 637358cf67a..057d0648d8a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventMessageWithRef.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessageWithRef.bpmn2 @@ -17,7 +17,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignal.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignal.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignal.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignal.bpmn2 index 25b4f1f4f13..ede31212a34 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignal.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignal.bpmn2 @@ -15,7 +15,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithRef.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithRef.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithRef.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithRef.bpmn2 index 0682291983f..808ffa6bd66 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithRef.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithRef.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2 index 574a3515a64..66e2e8222ff 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2 index 326ca1bd8ea..31bba79096d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2 index f196d0bca9a..702e611c2f7 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2 index c502f35f5d3..dbdd78c4c7e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2 index 20b8093b0b8..f88b4986fce 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDateISO.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDateISO.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDateISO.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDateISO.bpmn2 index 5aff7327ae4..b9bf7478714 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDateISO.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDateISO.bpmn2 @@ -15,7 +15,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDuration.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDuration.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDuration.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDuration.bpmn2 index 4603a18fa72..d2215b14f67 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDuration.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDuration.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2 index c234d8fb7cd..49fee1b9d3b 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchSignalSingle.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchSignalSingle.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchSignalSingle.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchSignalSingle.bpmn2 index bc3343c4b72..85288769301 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchSignalSingle.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchSignalSingle.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateLinkEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateLinkEvent.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateLinkEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateLinkEvent.bpmn2 index 85537e57cf3..033c6c4c58e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateLinkEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateLinkEvent.bpmn2 @@ -8,7 +8,7 @@ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventExternalScope.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventExternalScope.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventExternalScope.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventExternalScope.bpmn2 index 18e3adb9801..7f997b7b89c 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventExternalScope.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventExternalScope.bpmn2 @@ -6,7 +6,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventNone.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventNone.bpmn2 similarity index 91% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventNone.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventNone.bpmn2 index 95f54641f60..9c8d630ca98 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventNone.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventNone.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2IntermediateThrowEventScope.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventScope.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2IntermediateThrowEventScope.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventScope.bpmn2 index bfc4128f144..55350daea62 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2IntermediateThrowEventScope.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventScope.bpmn2 @@ -6,7 +6,7 @@ - + diff --git a/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignal.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignal.bpmn2 new file mode 100755 index 00000000000..f4ccb7e9b1e --- /dev/null +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignal.bpmn2 @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + x + _2_Input + + + _2_Input + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignalWithData.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignalWithData.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignalWithData.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignalWithData.bpmn2 index c4c4079e59d..6a6ca66f4b4 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignalWithData.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignalWithData.bpmn2 @@ -5,7 +5,8 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2 index 7d18c4fca07..509458751dd 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2 @@ -14,7 +14,9 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-LinkEventCompositeProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-LinkEventCompositeProcess.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-LinkEventCompositeProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-LinkEventCompositeProcess.bpmn2 index 80d7861a683..16c05a19a89 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-LinkEventCompositeProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-LinkEventCompositeProcess.bpmn2 @@ -10,9 +10,9 @@ xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" - xmlns:tns="http://www.example.org/MinimalExample"> + xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2 index 2d8c55d65e8..3ebc6b74221 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2 @@ -3,7 +3,7 @@ - + _9CED8767-9712-40C3-AE44-253ED21D4067 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2 index 4a9ca93e2a9..4e61fd40cab 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2 @@ -2,7 +2,7 @@ - + _9CED8767-9712-40C3-AE44-253ED21D4067 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2 index 6488e2f0317..696edd1cea2 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2 @@ -2,7 +2,7 @@ - + _9CED8767-9712-40C3-AE44-253ED21D4067 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleMessageSignalSubprocess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultipleMessageSignalSubprocess.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleMessageSignalSubprocess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultipleMessageSignalSubprocess.bpmn2 index 2f267d7313b..5d123fa3fe5 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleMessageSignalSubprocess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-MultipleMessageSignalSubprocess.bpmn2 @@ -2,7 +2,7 @@ - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalBoundaryEventInterrupting.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SignalBoundaryEventInterrupting.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalBoundaryEventInterrupting.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SignalBoundaryEventInterrupting.bpmn2 index 5192fe522c8..aa711e844ee 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalBoundaryEventInterrupting.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SignalBoundaryEventInterrupting.bpmn2 @@ -12,7 +12,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalBoundaryOnSubProcess.bpmn b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SignalBoundaryOnSubProcess.bpmn similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalBoundaryOnSubProcess.bpmn rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SignalBoundaryOnSubProcess.bpmn index 3282f88b9b4..04581b5d985 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalBoundaryOnSubProcess.bpmn +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SignalBoundaryOnSubProcess.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_11 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2 index f845650f495..d1532888d2e 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/intermediate/BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2 @@ -3,7 +3,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2 index fd9a0a14a0d..ae48a4f1556 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2 @@ -15,7 +15,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLA.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLA.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLA.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLA.bpmn2 index 3a79a2ec3c0..e7d0860c654 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLA.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLA.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + 2s diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLAExpr.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAExpr.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLAExpr.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAExpr.bpmn2 index 99306796735..0c137dd383d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLAExpr.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAExpr.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + #{s} diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLAOnTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAOnTask.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLAOnTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAOnTask.bpmn2 index bc127d49aa8..b3e2adfb48a 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithSLAOnTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAOnTask.bpmn2 @@ -12,7 +12,7 @@ xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignal.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-IntermediateThrowEventSignal.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignal.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-IntermediateThrowEventSignal.bpmn2 index 76a7c1ed53d..8bbad47bfbd 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignal.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-IntermediateThrowEventSignal.bpmn2 @@ -13,7 +13,8 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MessageStart.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MessageStart.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MessageStart.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MessageStart.bpmn2 index fd55c954bc8..57b70d23c28 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MessageStart.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MessageStart.bpmn2 @@ -16,7 +16,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleEventBasedStartEventProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleEventBasedStartEventProcess.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleEventBasedStartEventProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleEventBasedStartEventProcess.bpmn2 index 696488780a1..0b59b2cf03c 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleEventBasedStartEventProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleEventBasedStartEventProcess.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleStartEventProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleStartEventProcess.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleStartEventProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleStartEventProcess.bpmn2 index adc3c757d23..7f745354aba 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleStartEventProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleStartEventProcess.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleStartEventProcessLongInterval.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleStartEventProcessLongInterval.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleStartEventProcessLongInterval.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleStartEventProcessLongInterval.bpmn2 index 160927a55ed..83e0aa6e7e3 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleStartEventProcessLongInterval.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-MultipleStartEventProcessLongInterval.bpmn2 @@ -1,6 +1,6 @@ - + SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalStart.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-SignalStart.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalStart.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-SignalStart.bpmn2 index 31a46d11ffa..caca24640f0 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalStart.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-SignalStart.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerCycle.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-StartTimerCycle.bpmn2 similarity index 89% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerCycle.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-StartTimerCycle.bpmn2 index a4e7f402b02..40712e25ac9 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerCycle.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-StartTimerCycle.bpmn2 @@ -4,7 +4,7 @@ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerDuration.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-StartTimerDuration.bpmn2 similarity index 89% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerDuration.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-StartTimerDuration.bpmn2 index 1b193b95122..42c8450ab6b 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerDuration.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-StartTimerDuration.bpmn2 @@ -4,7 +4,7 @@ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStart.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStart.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStart.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStart.bpmn2 index 3102605c292..ba866e916c1 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStart.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStart.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartCycleLegacy.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartCycleLegacy.bpmn2 similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartCycleLegacy.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartCycleLegacy.bpmn2 index 0219b0511ba..b0c36ad88be 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartCycleLegacy.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartCycleLegacy.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartDate.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartDate.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartDate.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartDate.bpmn2 index 43d11f89ce1..609905487a2 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartDate.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartDate.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartDuration.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartDuration.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartDuration.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartDuration.bpmn2 index a15cd674166..28f6d85feaf 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartDuration.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartDuration.bpmn2 @@ -1,6 +1,6 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartISO.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartISO.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartISO.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartISO.bpmn2 index bce40adee19..fcc97ab3050 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartISO.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/start/BPMN2-TimerStartISO.bpmn2 @@ -1,6 +1,6 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/AssignmentProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-AssignmentProcess.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/AssignmentProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-AssignmentProcess.bpmn2 index b61a567ce80..46de8ad94b0 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/AssignmentProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-AssignmentProcess.bpmn2 @@ -4,7 +4,7 @@ - + @@ -48,7 +48,7 @@ kcontext.setVariable("name", name); - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/AssignmentSubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-AssignmentSubProcess.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/AssignmentSubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-AssignmentSubProcess.bpmn2 index 7d7ed3764b5..e2235bed267 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/AssignmentSubProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-AssignmentSubProcess.bpmn2 @@ -3,7 +3,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivity.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity.bpmn2 similarity index 92% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivity.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity.bpmn2 index 859bd039e61..1d903ca1a35 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivity.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity.bpmn2 @@ -11,7 +11,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + @@ -19,7 +19,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivity2.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity2.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivity2.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity2.bpmn2 index 1f4485b1bd2..0c5eb9d7553 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivity2.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity2.bpmn2 @@ -15,7 +15,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity3.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity3.bpmn2 new file mode 100755 index 00000000000..652c0704799 --- /dev/null +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivity3.bpmn2 @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + _2_subXInput + + + _2_subYOutput + + + + x + _2_subXInput + + + _2_subYOutput + y + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityMI.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityMI.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityMI.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityMI.bpmn2 index 6bbdda5f4b2..6471ac6c256 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityMI.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityMI.bpmn2 @@ -14,7 +14,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityProcessBoundaryError.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessBoundaryError.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityProcessBoundaryError.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessBoundaryError.bpmn2 index 167234a744d..7a311467ab2 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityProcessBoundaryError.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessBoundaryError.bpmn2 @@ -1,11 +1,11 @@ - + SequenceFlow_1 - + SequenceFlow_1 SequenceFlow_2 diff --git a/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessWithBoundaryEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessWithBoundaryEvent.bpmn2 new file mode 100755 index 00000000000..1383cd2f510 --- /dev/null +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessWithBoundaryEvent.bpmn2 @@ -0,0 +1,70 @@ + + + + + + SequenceFlow_1 + + + SequenceFlow_1 + SequenceFlow_2 + + + + SequenceFlow_2 + + + + SequenceFlow_4 + + + + + SequenceFlow_5 + + + + + SequenceFlow_5 + SequenceFlow_4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2 similarity index 94% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2 index ad883495495..73ef99b1575 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcessBoundaryError.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessBoundaryError.bpmn2 similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcessBoundaryError.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessBoundaryError.bpmn2 index 1c857e6f460..381d31aec7b 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcessBoundaryError.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessBoundaryError.bpmn2 @@ -1,7 +1,7 @@ - + SequenceFlow_1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2 similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2 index 5b172f9e218..564228283be 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2 @@ -2,7 +2,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityWithBoundaryEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityWithBoundaryEvent.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityWithBoundaryEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityWithBoundaryEvent.bpmn2 index 18a4c54a64d..e11e65c9be4 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityWithBoundaryEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityWithBoundaryEvent.bpmn2 @@ -2,13 +2,13 @@ - + _1-_2 - + _1-_2 _2-_3 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityWithIOexpression.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityWithIOexpression.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityWithIOexpression.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityWithIOexpression.bpmn2 index c33eeb67d7e..5f6a84da77d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityWithIOexpression.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-CallActivityWithIOexpression.bpmn2 @@ -6,7 +6,7 @@ - + @@ -19,7 +19,7 @@ _1-_2 - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/dynamic-signal-child.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-DynamicSignalChild.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/dynamic-signal-child.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-DynamicSignalChild.bpmn2 index 6cdd878fa8e..dd127b48f39 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/dynamic-signal-child.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-DynamicSignalChild.bpmn2 @@ -4,7 +4,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/dynamic-signal-parent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-DynamicSignalParent.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/dynamic-signal-parent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-DynamicSignalParent.bpmn2 index 735ae825a52..826ad4a1194 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/dynamic-signal-parent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-DynamicSignalParent.bpmn2 @@ -5,7 +5,7 @@ - + @@ -44,7 +44,7 @@ kcontext.setVariable("fatherId",kcontext.getProcessInstance().getStringId()); _5A8FEA7B-2888-4ECE-B6FD-119A3EB5C708_input - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/ErrorsBetweenProcess-Process.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenProcess.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/ErrorsBetweenProcess-Process.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenProcess.bpmn2 index 3824eb09572..ab140b29456 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/ErrorsBetweenProcess-Process.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenProcess.bpmn2 @@ -4,14 +4,14 @@ - + SequenceFlow_1 - + SequenceFlow_1 SequenceFlow_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/ErrorsBetweenProcess-SubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenSubProcess.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/ErrorsBetweenProcess-SubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenSubProcess.bpmn2 index b8c36cf970e..8dc20663065 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/ErrorsBetweenProcess-SubProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenSubProcess.bpmn2 @@ -5,7 +5,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/InputMappingUsingValue.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-InputMappingUsingValue.bpmn2 similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/InputMappingUsingValue.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-InputMappingUsingValue.bpmn2 index 88c4c311a00..448b5a3a8fb 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/InputMappingUsingValue.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-InputMappingUsingValue.bpmn2 @@ -1,7 +1,7 @@ - + _04DB7D4B-4F5B-42AC-B632-F1B8F14E0579 @@ -10,7 +10,7 @@ _20D16871-BC07-4728-848C-E5DF9D4E39C0 - + _04DB7D4B-4F5B-42AC-B632-F1B8F14E0579 _20D16871-BC07-4728-848C-E5DF9D4E39C0 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MainGroupAssignment.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-MainGroupAssignment.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MainGroupAssignment.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-MainGroupAssignment.bpmn2 index 2511a0922b7..d23a64e5eaa 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-MainGroupAssignment.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-MainGroupAssignment.bpmn2 @@ -3,7 +3,7 @@ - + @@ -46,7 +46,7 @@ inp.add("one"); inp.add("two"); outputList = new java.util.ArrayList(); - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/SingleTaskWithVarDef.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SingleTaskWithVarDef.bpmn2 similarity index 95% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/SingleTaskWithVarDef.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SingleTaskWithVarDef.bpmn2 index 0a730eac39b..59497219fc5 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/SingleTaskWithVarDef.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SingleTaskWithVarDef.bpmn2 @@ -1,7 +1,7 @@ - + _D17293DA-6E54-432C-AE28-A7BD2CE9B241 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcess.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcess.bpmn2 index 5b54092ae36..ccdc2aa0d41 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcess.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubProcessWithEntryExitScripts.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithEntryExitScripts.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubProcessWithEntryExitScripts.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithEntryExitScripts.bpmn2 index 3ea68ce73ba..3dce9dac8c6 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubProcessWithEntryExitScripts.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithEntryExitScripts.bpmn2 @@ -2,7 +2,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWithTerminateEndEvent.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWithTerminateEndEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2 index 5568f35e732..410283af98b 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWithTerminateEndEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2 @@ -1,7 +1,7 @@ - + _1-_10 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2 index 868ddceb6de..23add5acbca 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2 @@ -1,7 +1,7 @@ - + _1-_10 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2 index b21b51d4dec..173e8ae1486 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2 @@ -3,7 +3,7 @@ - + _386FCFB5-0699-449B-996D-596F61D0D840 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubprocessGroupAssignment.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubprocessGroupAssignment.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubprocessGroupAssignment.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubprocessGroupAssignment.bpmn2 index 0df68b8ce98..c545f138241 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-SubprocessGroupAssignment.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/subprocess/BPMN2-SubprocessGroupAssignment.bpmn2 @@ -16,7 +16,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-custom-variable-tags.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithCustomVariableTags.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-custom-variable-tags.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithCustomVariableTags.bpmn2 index 03b22247277..08df468f252 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-custom-variable-tags.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithCustomVariableTags.bpmn2 @@ -4,7 +4,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-readonly-variable-tags.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithReadonlyVariableTags.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-readonly-variable-tags.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithReadonlyVariableTags.bpmn2 index 6236497d802..586130982f4 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-readonly-variable-tags.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithReadonlyVariableTags.bpmn2 @@ -4,7 +4,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-required-variable-tags.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithRequiredVariableTags.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-required-variable-tags.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithRequiredVariableTags.bpmn2 index 64272d1cc9d..fa427ec8b63 100644 --- a/jbpm/jbpm-bpmn2/src/test/resources/variable-tags/approval-with-required-variable-tags.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/tags/BPMN2-ApprovalWithRequiredVariableTags.bpmn2 @@ -4,7 +4,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ReceiveTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/task/BPMN2-ReceiveTask.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ReceiveTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/task/BPMN2-ReceiveTask.bpmn2 index 5468d8566c5..a1e8a24c842 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ReceiveTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/task/BPMN2-ReceiveTask.bpmn2 @@ -16,7 +16,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SendTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/task/BPMN2-SendTask.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SendTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/task/BPMN2-SendTask.bpmn2 index 7fc6d30018c..9e511d495c8 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SendTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/task/BPMN2-SendTask.bpmn2 @@ -16,7 +16,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-IntermediateTimerEventMI.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-IntermediateTimerEventMI.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-IntermediateTimerEventMI.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-IntermediateTimerEventMI.bpmn2 index 04f4513a61e..ec3f087fa95 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-IntermediateTimerEventMI.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-IntermediateTimerEventMI.bpmn2 @@ -2,7 +2,7 @@ - + _CC344817-963E-4C8B-8ADC-3677A6914E34 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-IntermediateTimerParallelGateway.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-IntermediateTimerParallelGateway.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-IntermediateTimerParallelGateway.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-IntermediateTimerParallelGateway.bpmn2 index 3e88411fc5d..786302b01c1 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-IntermediateTimerParallelGateway.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-IntermediateTimerParallelGateway.bpmn2 @@ -1,6 +1,6 @@ - + _2FF60882-EC65-489A-B697-C345F7369ED1 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2 similarity index 99% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2 index 8c451392590..493163c9536 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2 @@ -1,6 +1,6 @@ - + _1FF14BDA-1B75-413E-93C5-500512295251 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycle1.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycle1.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycle1.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycle1.bpmn2 index 257c25449e5..571991dd6b5 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycle1.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycle1.bpmn2 @@ -12,7 +12,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycle2.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycle2.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycle2.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycle2.bpmn2 index 351da2842d4..7519f892f5d 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycle2.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycle2.bpmn2 @@ -12,7 +12,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycleISO.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycleISO.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycleISO.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycleISO.bpmn2 index e18b50f2c0c..61ae1a36480 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventCycleISO.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycleISO.bpmn2 @@ -1,6 +1,6 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDateISO.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDateISO.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDateISO.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDateISO.bpmn2 index 640be4d6995..2e6a1f28d89 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDateISO.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDateISO.bpmn2 @@ -1,7 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDuration.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDuration.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDuration.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDuration.bpmn2 index 4e148ea9de9..6434a46304f 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDuration.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDuration.bpmn2 @@ -12,7 +12,7 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDurationISO.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDurationISO.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDurationISO.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDurationISO.bpmn2 index e07b45b0bb6..e5f2d6f3d9c 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventDurationISO.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDurationISO.bpmn2 @@ -1,6 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterrupting.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterrupting.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterrupting.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterrupting.bpmn2 index fc793c57e63..6c637cc32eb 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterrupting.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterrupting.bpmn2 @@ -12,7 +12,9 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2 index d5f9de56e5c..7946126a516 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2 @@ -12,7 +12,8 @@ xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2 index c8acc7fb564..ea47b4d8ab3 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2 +++ b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2 @@ -1,6 +1,7 @@ - + _1-_2 diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java similarity index 91% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java index 047dd059306..9af1206fb28 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java @@ -93,35 +93,35 @@ public class ActivityTest extends JbpmBpmn2TestCase { @Test public void testMinimalProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MinimalProcess.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("Minimal"); assertProcessInstanceCompleted(processInstance); } @Test public void testMinimalProcessImplicit() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcessImplicit.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Minimal"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MinimalProcessImplicit.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("MinimalImplicit"); assertProcessInstanceCompleted(processInstance); } @Test public void testMinimalProcessWithGraphical() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcessWithGraphical.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Minimal"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithGraphical.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("MinimalWithGraphical"); assertProcessInstanceCompleted(processInstance); } @Test public void testMinimalProcessWithDIGraphical() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcessWithDIGraphical.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Minimal"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithDIGraphical.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("MinimalWithDIGraphical"); assertProcessInstanceCompleted(processInstance); } @Test public void testMinimalProcessMetaData() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcessMetaData.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MinimalProcessMetaData.bpmn2"); final List list1 = new ArrayList<>(); final List list2 = new ArrayList<>(); @@ -179,7 +179,7 @@ public void afterProcessStarted(ProcessStartedEvent event) { }); Map params = new HashMap<>(); params.put("x", "krisv"); - KogitoProcessInstance processInstance = kruntime.startProcess("Minimal", params); + KogitoProcessInstance processInstance = kruntime.startProcess("MinimalMetadata", params); assertProcessInstanceCompleted(processInstance); assertThat(list1).hasSize(3); assertThat(list2).hasSize(2); @@ -189,23 +189,23 @@ public void afterProcessStarted(ProcessStartedEvent event) { @Test public void testCompositeProcessWithDIGraphical() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CompositeProcessWithDIGraphical.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Composite"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-CompositeProcessWithDIGraphical.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("CompositeWithDIGraphical"); assertProcessInstanceCompleted(processInstance); } @Test public void testScriptTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ScriptTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-ScriptTask.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("ScriptTask"); assertProcessInstanceCompleted(processInstance); } @Test public void testScriptTaskWithIO() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ScriptTaskWithIO.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-ScriptTaskWithIO.bpmn2"); - Process scriptProcess = kruntime.getKieBase().getProcess("ScriptTask"); + Process scriptProcess = kruntime.getKieBase().getProcess("ScriptTaskWithIO"); assertThat(scriptProcess).isNotNull(); Node[] nodes = ((NodeContainer) scriptProcess).getNodes(); assertThat(nodes).hasSize(3); @@ -213,7 +213,7 @@ public void testScriptTaskWithIO() throws Exception { Map params = new HashMap<>(); params.put("name", "John"); - KogitoProcessInstance processInstance = kruntime.startProcess("ScriptTask", params); + KogitoProcessInstance processInstance = kruntime.startProcess("ScriptTaskWithIO", params); assertProcessInstanceCompleted(processInstance); } @@ -343,16 +343,16 @@ public void testRuleTaskAcrossSessions() throws Exception { @Test public void testUserTaskWithDataStoreScenario() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithDataStore.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-UserTaskWithDataStore.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); - kruntime.startProcess("UserProcess"); + kruntime.startProcess("UserTaskWithDataStore"); // we can't test further as user tasks are asynchronous. } @Test public void testUserTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-UserTask.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", @@ -368,7 +368,7 @@ public void testUserTask() throws Exception { @Test public void testUserTaskVerifyParameters() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-UserTask.bpmn2"); kruntime.getKieSession().getEnvironment().set("deploymentId", "test-deployment-id"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); @@ -405,12 +405,14 @@ public void testUserTaskVerifyParameters() throws Exception { @Test public void testCallActivityWithContantsAssignment() throws Exception { - kruntime = createKogitoProcessRuntime("subprocess/SingleTaskWithVarDef.bpmn2", "subprocess/InputMappingUsingValue.bpmn2"); + kruntime = createKogitoProcessRuntime( + "org/jbpm/bpmn2/subprocess/BPMN2-SingleTaskWithVarDef.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-InputMappingUsingValue.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("CustomTask", handler); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("defaultPackage.InputMappingUsingValue", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InputMappingUsingValue", params); org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = handler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -461,26 +463,29 @@ public void testSubProcessWithEntryExitScripts() throws Exception { @Test public void testCallActivity() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CallActivity.bpmn2", "BPMN2-CallActivitySubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-CallActivity.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2"); Map params = new HashMap<>(); params.put("x", "oldValue"); KogitoProcessInstance processInstance = kruntime.startProcess( - "ParentProcess", params); + "CallActivity", params); assertProcessInstanceCompleted(processInstance); assertThat(((KogitoWorkflowProcessInstance) processInstance).getVariable("y")).isEqualTo("new value"); } @Test public void testCallActivityMI() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CallActivityMI.bpmn2", "BPMN2-CallActivitySubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime( + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivityMI.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2"); final List subprocessStarted = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @Override public void beforeProcessStarted(ProcessStartedEvent event) { - if (event.getProcessInstance().getProcessId().equals("SubProcess")) { + if (event.getProcessInstance().getProcessId().equals("CallActivitySubProcess")) { subprocessStarted.add(((KogitoProcessInstance) event.getProcessInstance()).getStringId()); } } @@ -497,7 +502,7 @@ public void beforeProcessStarted(ProcessStartedEvent event) { params.put("list", list); params.put("listOut", listOut); - KogitoProcessInstance processInstance = kruntime.startProcess("ParentProcess", params); + KogitoProcessInstance processInstance = kruntime.startProcess("CallActivityMI", params); assertProcessInstanceCompleted(processInstance); assertThat(subprocessStarted).hasSize(2); @@ -507,7 +512,8 @@ public void beforeProcessStarted(ProcessStartedEvent event) { @Test public void testCallActivity2() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CallActivity2.bpmn2", "BPMN2-CallActivitySubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-CallActivity2.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", @@ -515,7 +521,7 @@ public void testCallActivity2() throws Exception { Map params = new HashMap<>(); params.put("x", "oldValue"); KogitoProcessInstance processInstance = kruntime.startProcess( - "ParentProcess", params); + "CallActivity2", params); assertProcessInstanceActive(processInstance); assertThat(((KogitoWorkflowProcessInstance) processInstance).getVariable("y")).isEqualTo("new value"); @@ -530,7 +536,7 @@ public void testCallActivity2() throws Exception { @Test public void testCallActivityByName() throws Exception { kruntime = createKogitoProcessRuntime("BPMN2-CallActivityByName.bpmn2", - "BPMN2-CallActivitySubProcess.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2", "BPMN2-CallActivitySubProcessV2.bpmn2"); Map params = new HashMap<>(); @@ -543,7 +549,7 @@ public void testCallActivityByName() throws Exception { @Test public void testSubProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcess.bpmn2"); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -608,7 +614,7 @@ public void testMultiinstanceSubProcessWrongStartEvent() throws Exception { @Test public void testSubProcessWithTerminateEndEvent() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SubProcessWithTerminateEndEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEvent.bpmn2"); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -617,7 +623,7 @@ public void afterNodeTriggered(ProcessNodeTriggeredEvent event) { list.add(event.getNodeInstance().getNodeName()); } }); - KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessTerminate"); + KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEvent"); assertProcessInstanceCompleted(processInstance); assertThat(list).hasSize(7); } @@ -625,7 +631,7 @@ public void afterNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testSubProcessWithTerminateEndEventProcessScope() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTerminateEndEventProcessScope.bpmn2"); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -634,7 +640,7 @@ public void afterNodeTriggered(ProcessNodeTriggeredEvent event) { list.add(event.getNodeInstance().getNodeName()); } }); - KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessTerminate"); + KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTerminateEndEventProcessScope"); assertProcessInstanceCompleted(processInstance); assertThat(list).hasSize(5); } @@ -685,7 +691,8 @@ public void testAdHocProcessDynamicTask() throws Exception { @Test public void testAdHocProcessDynamicSubProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-AdHocProcess.bpmn2", "BPMN2-MinimalProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("BPMN2-AdHocProcess.bpmn2", + "org/jbpm/bpmn2/flow/BPMN2-MinimalProcess.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("AdHocProcess"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); @@ -751,7 +758,7 @@ public void testServiceTaskWithMvelTransformation() throws Exception { Map params = new HashMap<>(); params.put("s", "JoHn"); KogitoWorkflowProcessInstance processInstance = (KogitoWorkflowProcessInstance) kruntime - .startProcess("ServiceProcess", params); + .startProcess("ServiceProcessWithMvelTransformation", params); assertProcessInstanceFinished(processInstance, kruntime); assertThat(processInstance.getVariable("s")).isEqualTo("hello john!"); } @@ -827,7 +834,7 @@ public void executeWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manag @Test public void testSendTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SendTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/task/BPMN2-SendTask.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler()); @@ -840,7 +847,7 @@ public void testSendTask() throws Exception { @Test public void testReceiveTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ReceiveTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/task/BPMN2-ReceiveTask.bpmn2"); ReceiveTaskHandler receiveTaskHandler = new ReceiveTaskHandler(kruntime); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Receive Task", @@ -939,10 +946,10 @@ public void testBusinessRuleTaskWithContionalEvent() throws Exception { public void testScriptTaskWithVariableByName() throws Exception { Map params = new HashMap<>(); params.put("myVar", "test"); - kruntime = createKogitoProcessRuntime("BPMN2-ProcessWithVariableName.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-ProcessWithVariableName.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess( - "BPMN2-ProcessWithVariableName", params); + "ProcessWithVariableName", params); assertProcessInstanceCompleted(processInstance); } @@ -950,8 +957,8 @@ public void testScriptTaskWithVariableByName() throws Exception { public void testCallActivityWithBoundaryEvent() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); kruntime = createKogitoProcessRuntime( - "BPMN2-CallActivityWithBoundaryEvent.bpmn2", - "BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2"); + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivityWithBoundaryEvent.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); @@ -959,7 +966,7 @@ public void testCallActivityWithBoundaryEvent() throws Exception { workItemHandler); Map params = new HashMap<>(); params.put("x", "oldValue"); - KogitoProcessInstance processInstance = kruntime.startProcess("ParentProcess", params); + KogitoProcessInstance processInstance = kruntime.startProcess("CallActivityWithBoundaryEvent", params); countDownListener.waitTillCompleted(); @@ -977,14 +984,14 @@ public void testCallActivityWithBoundaryEvent() throws Exception { @Test public void testCallActivityWithSubProcessWaitState() throws Exception { kruntime = createKogitoProcessRuntime( - "BPMN2-CallActivity.bpmn2", - "BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2"); + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessWithBoundaryEvent.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessWithBoundaryEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("ParentProcess", params); + KogitoProcessInstance processInstance = kruntime.startProcess("CallActivityProcessWithBoundaryEvent", params); assertProcessInstanceActive(processInstance.getStringId(), kruntime); org.kie.kogito.internal.process.runtime.KogitoWorkItem wi = workItemHandler.getWorkItem(); @@ -994,20 +1001,20 @@ public void testCallActivityWithSubProcessWaitState() throws Exception { assertProcessInstanceFinished(processInstance, kruntime); // first check the parent process executed nodes - assertNodeTriggered(processInstance.getStringId(), "StartProcess", "CallActivity", "EndProcess"); + assertNodeTriggered(processInstance.getStringId(), "StartProcess", "Call Activity 1", "EndProcess"); // then check child process executed nodes - is there better way to get child process id than simply increment? assertNodeTriggered(processInstance.getStringId() + 1, "StartProcess2", "User Task", "EndProcess"); } @Test public void testUserTaskWithBooleanOutput() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithBooleanOutput.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-UserTaskWithBooleanOutput.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); KogitoProcessInstance processInstance = kruntime - .startProcess("com.sample.boolean"); + .startProcess("UserTaskWithBooleanOutput"); assertProcessInstanceActive(processInstance); org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -1021,12 +1028,12 @@ public void testUserTaskWithBooleanOutput() throws Exception { @Test public void testUserTaskWithSimData() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSimulationMetaData.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-UserTaskWithSimulationMetaData.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSimulationMetaData"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -1037,12 +1044,13 @@ public void testUserTaskWithSimData() throws Exception { @Test public void testCallActivityWithBoundaryErrorEvent() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CallActivityProcessBoundaryError.bpmn2", - "BPMN2-CallActivitySubProcessBoundaryError.bpmn2"); + kruntime = createKogitoProcessRuntime( + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessBoundaryError.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessBoundaryError.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("task1", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("ParentProcess"); + KogitoProcessInstance processInstance = kruntime.startProcess("CallActivityProcessBoundaryError"); assertProcessInstanceFinished(processInstance, kruntime); assertNodeTriggered(processInstance.getStringId(), "StartProcess", @@ -1054,12 +1062,12 @@ public void testCallActivityWithBoundaryErrorEvent() throws Exception { @Test public void testCallActivityWithBoundaryErrorEventWithWaitState() throws Exception { kruntime = createKogitoProcessRuntime( - "BPMN2-CallActivityProcessBoundaryError.bpmn2", - "BPMN2-CallActivitySubProcessBoundaryError.bpmn2"); + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivityProcessBoundaryError.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcessBoundaryError.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("task1", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("ParentProcess"); + KogitoProcessInstance processInstance = kruntime.startProcess("CallActivityProcessBoundaryError"); org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -1181,21 +1189,21 @@ public void testServiceTaskWithMvelJaxbTransformation() throws Exception { HelloService.VALIDATE_STRING = "123john"; KogitoWorkflowProcessInstance processInstance = (KogitoWorkflowProcessInstance) kruntime - .startProcess("ServiceProcess", params); + .startProcess("ServiceProcessWithMvelJaxbTransformation", params); assertProcessInstanceFinished(processInstance, kruntime); } @Test public void testErrorBetweenProcessesProcess() throws Exception { - kruntime = createKogitoProcessRuntime("subprocess/ErrorsBetweenProcess-Process.bpmn2", - "subprocess/ErrorsBetweenProcess-SubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenProcess.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenSubProcess.bpmn2"); Map variables = new HashMap<>(); variables.put("tipoEvento", "error"); variables.put("pasoVariable", 3); - KogitoProcessInstance processInstance = kruntime.startProcess("Principal", variables); + KogitoProcessInstance processInstance = kruntime.startProcess("ErrorsBetweenProcess", variables); assertProcessInstanceCompleted(processInstance.getStringId(), kruntime); assertProcessInstanceAborted(processInstance.getStringId() + 1, kruntime); @@ -1205,11 +1213,11 @@ public void testErrorBetweenProcessesProcess() throws Exception { @Test public void testProcessCustomDescriptionMetaData() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ProcessCustomDescriptionMetaData.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-ProcessCustomDescriptionMetaData.bpmn2"); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("Minimal", params); + KogitoProcessInstance processInstance = kruntime.startProcess("ProcessCustomDescriptionMetaData", params); assertProcessInstanceCompleted(processInstance); String description = processInstance.getDescription(); @@ -1218,11 +1226,11 @@ public void testProcessCustomDescriptionMetaData() throws Exception { @Test public void testProcessVariableCustomDescriptionMetaData() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-ProcessVariableCustomDescriptionMetaData.bpmn2"); Map params = new HashMap<>(); params.put("x", "variable name for process"); - KogitoProcessInstance processInstance = kruntime.startProcess("Minimal", params); + KogitoProcessInstance processInstance = kruntime.startProcess("ProcessVariableCustomDescriptionMetaData", params); assertProcessInstanceCompleted(processInstance); String description = processInstance.getDescription(); @@ -1251,7 +1259,7 @@ public void testAdHocSubProcessEmptyCompleteExpression() throws Exception { @Test public void testSubProcessWithTypeVariable() throws Exception { - kruntime = createKogitoProcessRuntime("subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcessWithTypeVariable.bpmn2"); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -1262,18 +1270,18 @@ public void afterNodeTriggered(ProcessNodeTriggeredEvent event) { } } }); - KogitoProcessInstance processInstance = kruntime.startProcess("sub_variable.sub_variables"); + KogitoProcessInstance processInstance = kruntime.startProcess("SubProcessWithTypeVariable"); assertProcessInstanceCompleted(processInstance); assertThat(list).hasSize(2); } @Test public void testUserTaskParametrizedInput() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithParametrizedInput.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-UserTaskWithParametrizedInput.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithParametrizedInput"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -1317,7 +1325,7 @@ public void testMultipleBusinessRuleTaskWithDataInputsWithPersistence() public void testSubProcessInAdHocProcess() throws Exception { // JBPM-5374 kruntime = createKogitoProcessRuntime( - "BPMN2-SubProcessInAdHocProcess.bpmn2"); + "org/jbpm/bpmn2/adhoc/BPMN2-SubProcessInAdHocProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -1336,11 +1344,12 @@ public void testSubProcessInAdHocProcess() throws Exception { @Test public void testCallActivityWithDataAssignment() throws Exception { - kruntime = createKogitoProcessRuntime("subprocess/AssignmentProcess.bpmn2", "subprocess/AssignmentSubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-AssignmentProcess.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-AssignmentSubProcess.bpmn2"); Map params = new HashMap<>(); params.put("name", "oldValue"); - KogitoProcessInstance processInstance = kruntime.startProcess("assignmentProcess", params); + KogitoProcessInstance processInstance = kruntime.startProcess("AssignmentProcess", params); assertProcessInstanceCompleted(processInstance); assertThat(((KogitoWorkflowProcessInstance) processInstance).getVariable("message")).isEqualTo("Hello Genworth welcome to jBPMS!"); } @@ -1535,29 +1544,29 @@ public void testBusinessRuleTaskException() throws Exception { @Test public void testXORWithSameTargetProcess() throws Exception { - kruntime = createKogitoProcessRuntime("build/XORSameTarget.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-XORSameTarget.bpmn2"); Map params = new HashMap<>(); params.put("choice", 1); - KogitoProcessInstance processInstance = kruntime.startProcess("XORTest.XOR2", params); + KogitoProcessInstance processInstance = kruntime.startProcess("XORSameTarget", params); assertProcessInstanceCompleted(processInstance); params = new HashMap<>(); params.put("choice", 2); - processInstance = kruntime.startProcess("XORTest.XOR2", params); + processInstance = kruntime.startProcess("XORSameTarget", params); assertProcessInstanceCompleted(processInstance); } @Test public void testUserTaskWithExpressionsForIO() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithIOexpression.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-UserTaskWithIOexpression.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map parameters = new HashMap<>(); parameters.put("person", new Person("john")); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask", parameters); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithIOexpression", parameters); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -1572,13 +1581,14 @@ public void testUserTaskWithExpressionsForIO() throws Exception { @Test public void testCallActivitykWithExpressionsForIO() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CallActivityWithIOexpression.bpmn2", "BPMN2-CallActivitySubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-CallActivityWithIOexpression.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("person", new Person("john")); - KogitoProcessInstance processInstance = kruntime.startProcess("ParentProcess", params); + KogitoProcessInstance processInstance = kruntime.startProcess("CallActivityWithIOexpression", params); assertProcessInstanceActive(processInstance); Person person = (Person) processInstance.getVariables().get("person"); @@ -1594,12 +1604,13 @@ public void testCallActivitykWithExpressionsForIO() throws Exception { @Test public void testCallSubprocessWithGroup() throws Exception { - kruntime = createKogitoProcessRuntime("subprocess/BPMN2-MainGroupAssignment.bpmn2", "subprocess/BPMN2-SubprocessGroupAssignment.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-MainGroupAssignment.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-SubprocessGroupAssignment.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("Main"); + KogitoProcessInstance processInstance = kruntime.startProcess("MainGroupAssignment"); assertProcessInstanceActive(processInstance); List workItems = workItemHandler.getWorkItems(); @@ -1633,6 +1644,7 @@ public void testBusinessRuleTaskWithExpressionsForIO() throws Exception { } @Test + @Disabled("this was not working") public void testUserTaskWithAssignment() throws Exception { ProcessDialectRegistry.setDialect("custom", new ProcessDialect() { @@ -1670,9 +1682,9 @@ public void addProcess(ProcessBuildContext context) { } }); - kruntime = createKogitoProcessRuntime("BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-DataOutputAssignmentCustomExpressionLang.bpmn2"); - Process scriptProcess = kruntime.getKieBase().getProcess("process"); + Process scriptProcess = kruntime.getKieBase().getProcess("DataOutputAssignmentCustomExpressionLang"); assertThat(scriptProcess).isNotNull(); Node[] nodes = ((NodeContainer) scriptProcess).getNodes(); assertThat(nodes).hasSize(3); @@ -1683,7 +1695,7 @@ public void addProcess(ProcessBuildContext context) { Map params = new HashMap<>(); params.put("name", "John"); - KogitoProcessInstance processInstance = kruntime.startProcess("process", params); + KogitoProcessInstance processInstance = kruntime.startProcess("DataOutputAssignmentCustomExpressionLang", params); kruntime.abortProcessInstance(processInstance.getStringId()); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/AgendaFilterTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/AgendaFilterTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/AgendaFilterTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/AgendaFilterTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/BrokenStructureRefTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/BrokenStructureRefTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/BrokenStructureRefTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/BrokenStructureRefTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CollaborationTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/CollaborationTest.java similarity index 70% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CollaborationTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/CollaborationTest.java index 5850234bee2..b924be42f14 100644 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CollaborationTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/CollaborationTest.java @@ -31,9 +31,9 @@ public class CollaborationTest extends JbpmBpmn2TestCase { @Test public void testBoundaryMessageCollaboration() throws Exception { - kruntime = createKogitoProcessRuntime("collaboration/Collaboration-BoundaryMessage.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/collaboration/BPMN2-CollaborationBoundaryMessage.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); - KogitoProcessInstance pid = kruntime.startProcess("collaboration.BoundaryMessage", Collections.singletonMap("MessageId", "2")); + KogitoProcessInstance pid = kruntime.startProcess("CollaborationBoundaryMessage", Collections.singletonMap("MessageId", "2")); kruntime.signalEvent("Message-collaboration", new Message("1", "example"), pid.getStringId()); assertProcessInstanceActive(pid); kruntime.signalEvent("Message-collaboration", new Message("2", "example"), pid.getStringId()); @@ -42,23 +42,23 @@ public void testBoundaryMessageCollaboration() throws Exception { @Test public void testStartMessageCollaboration() throws Exception { - kruntime = createKogitoProcessRuntime("collaboration/Collaboration-StartMessage.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/collaboration/BPMN2-CollaborationStartMessage.bpmn2"); kruntime.signalEvent("Message-collaboration", new Message("1", "example")); - assertThat(getNumberOfProcessInstances("collaboration.StartMessage")).isEqualTo(1); + assertThat(getNumberOfProcessInstances("CollaborationStartMessage")).isEqualTo(1); } @Test public void testStartMessageCollaborationNoMatch() throws Exception { - kruntime = createKogitoProcessRuntime("collaboration/Collaboration-StartMessage.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/collaboration/BPMN2-CollaborationStartMessage.bpmn2"); kruntime.signalEvent("Message-collaboration", new Message("2", "example")); - assertThat(getNumberOfProcessInstances("collaboration.StartMessage")).isZero(); + assertThat(getNumberOfProcessInstances("CollaborationStartMessage")).isZero(); } @Test public void testIntermediateMessageCollaboration() throws Exception { - kruntime = createKogitoProcessRuntime("collaboration/Collaboration-IntermediateMessage.bpmn2"); - KogitoProcessInstance pid = kruntime.startProcess("collaboration.IntermediateMessage", Collections.singletonMap("MessageId", "2")); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/collaboration/BPMN2-CollaborationIntermediateMessage.bpmn2"); + KogitoProcessInstance pid = kruntime.startProcess("CollaborationIntermediateMessage", Collections.singletonMap("MessageId", "2")); kruntime.signalEvent("Message-collaboration", new Message("1", "example"), pid.getStringId()); assertProcessInstanceActive(pid); kruntime.signalEvent("Message-collaboration", new Message("2", "example"), pid.getStringId()); @@ -67,9 +67,9 @@ public void testIntermediateMessageCollaboration() throws Exception { @Test public void testInvalidIntermediateMessageCollaboration() throws Exception { - kruntime = createKogitoProcessRuntime("collaboration/Collaboration-IntermediateMessage.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/collaboration/BPMN2-CollaborationIntermediateMessage.bpmn2"); - KogitoProcessInstance pid = kruntime.startProcess("collaboration.IntermediateMessage", Collections.singletonMap("MessageId", "2")); + KogitoProcessInstance pid = kruntime.startProcess("CollaborationIntermediateMessage", Collections.singletonMap("MessageId", "2")); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { kruntime.signalEvent("Message-collaboration", new Message(null, "example"), pid.getStringId()); }); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompensationTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/CompensationTest.java similarity index 88% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompensationTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/CompensationTest.java index 4dc0770c7c9..e379fd3166f 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompensationTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/CompensationTest.java @@ -74,12 +74,12 @@ public void prepare() { @Test public void compensationViaIntermediateThrowEventProcess() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-IntermediateThrowEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", "0"); - KogitoProcessInstance processInstance = kruntime.startProcess("CompensateIntermediateThrowEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEvent", params); kruntime.getKogitoWorkItemManager().completeWorkItem(workItemHandler.getWorkItem().getStringId(), null); @@ -90,12 +90,12 @@ public void compensationViaIntermediateThrowEventProcess() throws Exception { @Test public void compensationTwiceViaSignal() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-IntermediateThrowEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", "0"); - String processId = "CompensateIntermediateThrowEvent"; + String processId = "IntermediateThrowEvent"; KogitoProcessInstance processInstance = kruntime.startProcess(processId, params); // twice @@ -123,13 +123,13 @@ public void compensationViaEventSubProcess() throws Exception { @Test public void compensationOnlyAfterAssociatedActivityHasCompleted() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-UserTaskBeforeAssociatedActivity.bpmn2"); kruntime.getProcessEventManager().addEventListener(LOGGING_EVENT_LISTENER); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", "0"); - KogitoProcessInstance processInstance = kruntime.startProcess("CompensateIntermediateThrowEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskBeforeAssociatedActivity", params); // should NOT cause compensation since compensated activity has not yet completed (or started)! kruntime.signalEvent("Compensation", "_3", processInstance.getStringId()); @@ -143,12 +143,12 @@ public void compensationOnlyAfterAssociatedActivityHasCompleted() throws Excepti @Test public void orderedCompensation() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-ParallelOrderedCompensationIntermediateThrowEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", ""); - KogitoProcessInstance processInstance = kruntime.startProcess("CompensateParallelOrdered", params); + KogitoProcessInstance processInstance = kruntime.startProcess("ParallelOrderedCompensationIntermediateThrowEvent", params); List workItems = workItemHandler.getWorkItems(); List workItemIds = new ArrayList<>(); for (KogitoWorkItem workItem : workItems) { @@ -180,12 +180,12 @@ public void orderedCompensation() throws Exception { @Test public void compensationInSubSubProcesses() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-Compensation-InSubSubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-InSubSubProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", "0"); - KogitoProcessInstance processInstance = kruntime.startProcess("CompensateSubSubSub", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InSubSubProcess", params); kruntime.signalEvent("Compensation", "_C-2", processInstance.getStringId()); @@ -200,12 +200,12 @@ public void compensationInSubSubProcesses() throws Exception { @Test public void specificCompensationOfASubProcess() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-ThrowSpecificForSubProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", 1); - KogitoProcessInstance processInstance = kruntime.startProcess("CompensationSpecificSubProcess", params); + KogitoProcessInstance processInstance = kruntime.startProcess("ThrowSpecificForSubProcess", params); // compensation activity (assoc. with script task) signaled *after* to-compensate script task assertProcessInstanceCompleted(processInstance.getStringId(), kruntime); @@ -216,12 +216,12 @@ public void specificCompensationOfASubProcess() throws Exception { @Test @Disabled public void compensationViaCancellation() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-IntermediateThrowEvent.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", "0"); - KogitoProcessInstance processInstance = kruntime.startProcess("CompensateIntermediateThrowEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEvent", params); kruntime.signalEvent("Cancel", null, processInstance.getStringId()); kruntime.getKogitoWorkItemManager().completeWorkItem(workItemHandler.getWorkItem().getStringId(), null); @@ -233,7 +233,7 @@ public void compensationViaCancellation() throws Exception { @Test public void compensationInvokingSubProcess() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-UserTaskCompensation.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-UserTaskCompensation.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); params.put("compensation", "True"); @@ -251,8 +251,8 @@ public void compensationInvokingSubProcess() throws Exception { */ @Test public void compensationWithReusableSubprocess() throws Exception { - kruntime = createKogitoProcessRuntime("compensation/BPMN2-Booking.bpmn2", - "compensation/BPMN2-BookResource.bpmn2", "compensation/BPMN2-CancelResource.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/compensation/BPMN2-Booking.bpmn2", + "org/jbpm/bpmn2/compensation/BPMN2-BookResource.bpmn2", "org/jbpm/bpmn2/compensation/BPMN2-CancelResource.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("Booking"); assertProcessInstanceCompleted(processInstance.getStringId(), kruntime); } diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompilationTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/CompilationTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompilationTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/CompilationTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DataTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/DataTest.java similarity index 88% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DataTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/DataTest.java index e42d2e5a4b7..6390dbb499c 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DataTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/DataTest.java @@ -49,7 +49,7 @@ public class DataTest extends JbpmBpmn2TestCase { @Test public void testImport() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-Import.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-Import.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("Import"); assertProcessInstanceCompleted(processInstance); @@ -57,10 +57,10 @@ public void testImport() throws Exception { @Test public void testDataObject() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataObject.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataObject.bpmn2"); Map params = new HashMap<>(); params.put("employee", "UserId-12345"); - KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation", + KogitoProcessInstance processInstance = kruntime.startProcess("DataObject", params); assertProcessInstanceCompleted(processInstance); @@ -68,8 +68,8 @@ public void testDataObject() throws Exception { @Test public void testDataStore() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataStore.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataStore.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("DataStore"); Definitions def = (Definitions) processInstance.getProcess() .getMetaData().get("Definitions"); assertThat(def.getDataStores()).isNotNull().hasSize(1); @@ -83,8 +83,8 @@ public void testDataStore() throws Exception { @Test public void testAssociation() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-Association.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-Association.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("Association"); List associations = (List) processInstance.getProcess().getMetaData().get(ProcessHandler.ASSOCIATIONS); assertThat(associations).isNotNull().hasSize(1); @@ -97,7 +97,7 @@ public void testAssociation() throws Exception { @Test public void testEvaluationProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EvaluationProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-Evaluation.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler( @@ -112,27 +112,26 @@ public void testEvaluationProcess() throws Exception { @Test public void testEvaluationProcess2() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EvaluationProcess2.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-Evaluation2.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); params.put("employee", "UserId-12345"); - KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.evaluation", params); + KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation2", params); assertProcessInstanceCompleted(processInstance); } @Test public void testEvaluationProcess3() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EvaluationProcess3.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-Evaluation3.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler( "RegisterRequest", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); params.put("employee", "john2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation", + KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation3", params); assertProcessInstanceCompleted(processInstance); @@ -157,7 +156,7 @@ public void testXpathExpression() throws Exception { @Test public void testDataInputAssociations() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataInputAssociations.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataInputAssociations.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new KogitoWorkItemHandler() { @Override @@ -179,14 +178,13 @@ public void executeWorkItem(KogitoWorkItem workItem, .getBytes())); Map params = new HashMap<>(); params.put("instanceMetadata", document.getFirstChild()); - KogitoProcessInstance processInstance = kruntime.startProcess("process", - params); + KogitoProcessInstance processInstance = kruntime.startProcess("DataInputAssociations", params); } @Test public void testDataInputAssociationsWithStringObject() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataInputAssociations-string-object.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringObject.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new KogitoWorkItemHandler() { @@ -205,8 +203,7 @@ public void executeWorkItem(KogitoWorkItem workItem, }); Map params = new HashMap<>(); params.put("instanceMetadata", "hello"); - KogitoProcessInstance processInstance = kruntime.startProcess("process", - params); + KogitoProcessInstance processInstance = kruntime.startProcess("DataInputAssociationsStringObject", params); } @@ -217,7 +214,7 @@ public void executeWorkItem(KogitoWorkItem workItem, @Disabled public void testDataInputAssociationsWithLazyLoading() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataInputAssociations-lazy-creating.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsLazyCreating.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new KogitoWorkItemHandler() { @@ -243,14 +240,13 @@ public void executeWorkItem(KogitoWorkItem workItem, .getBytes())); Map params = new HashMap<>(); params.put("instanceMetadata", document.getFirstChild()); - KogitoProcessInstance processInstance = kruntime.startProcess("process", - params); + KogitoProcessInstance processInstance = kruntime.startProcess("DataInputAssociationsLazyCreating", params); } @Test public void testDataInputAssociationsWithString() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataInputAssociations-string.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsString.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new KogitoWorkItemHandler() { @@ -265,15 +261,14 @@ public void executeWorkItem(KogitoWorkItem workItem, } }); - KogitoProcessInstance processInstance = kruntime - .startProcess("process"); + KogitoProcessInstance processInstance = kruntime.startProcess("DataInputAssociationsString"); } @Test public void testDataInputAssociationsWithStringWithoutQuotes() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataInputAssociations-string-no-quotes.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsStringNoQuotes.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new KogitoWorkItemHandler() { @@ -288,14 +283,13 @@ public void executeWorkItem(KogitoWorkItem workItem, } }); - KogitoProcessInstance processInstance = kruntime - .startProcess("process"); + KogitoProcessInstance processInstance = kruntime.startProcess("DataInputAssociationsStringNoQuotes"); } @Test public void testDataInputAssociationsWithXMLLiteral() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataInputAssociations-xml-literal.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataInputAssociationsXmlLiteral.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new KogitoWorkItemHandler() { @@ -311,8 +305,7 @@ public void executeWorkItem(KogitoWorkItem workItem, } }); - KogitoProcessInstance processInstance = kruntime - .startProcess("process"); + KogitoProcessInstance processInstance = kruntime.startProcess("DataInputAssociationsXmlLiteral"); } @@ -403,7 +396,7 @@ public void executeWorkItem(KogitoWorkItem workItem, @Test public void testDataOutputAssociations() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataOutputAssociations.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataOutputAssociations.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new KogitoWorkItemHandler() { @@ -431,14 +424,13 @@ public void executeWorkItem(KogitoWorkItem workItem, } }); - KogitoProcessInstance processInstance = kruntime - .startProcess("process"); + KogitoProcessInstance processInstance = kruntime.startProcess("DataOutputAssociations"); } @Test public void testDataOutputAssociationsXmlNode() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataOutputAssociations-xml-node.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataOutputAssociationsXmlNode.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new KogitoWorkItemHandler() { @@ -466,20 +458,18 @@ public void executeWorkItem(KogitoWorkItem workItem, } }); - KogitoProcessInstance processInstance = kruntime - .startProcess("process"); + KogitoProcessInstance processInstance = kruntime.startProcess("DataOutputAssociationsXmlNode"); } @Test public void testDefaultProcessVariableValue() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CorrelationKey.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-CorrelationKey.bpmn2"); Map parameters = new HashMap(); - KogitoWorkflowProcessInstance processInstance = (KogitoWorkflowProcessInstance) kruntime.startProcess("org.jbpm.test.functional.CorrelationKey", - parameters); + KogitoWorkflowProcessInstance processInstance = (KogitoWorkflowProcessInstance) kruntime.startProcess("CorrelationKey", parameters); assertThat(processInstance.getVariable("procVar")).isEqualTo("defaultProc"); assertThat(processInstance.getVariable("intVar")).isEqualTo(1); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DroolsDeclaredTypeSequenceFlowExpressionTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/DroolsDeclaredTypeSequenceFlowExpressionTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DroolsDeclaredTypeSequenceFlowExpressionTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/DroolsDeclaredTypeSequenceFlowExpressionTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EndEventTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/EndEventTest.java similarity index 90% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EndEventTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/EndEventTest.java index e4d018cbbe7..389ba67b275 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EndEventTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/EndEventTest.java @@ -38,15 +38,15 @@ public class EndEventTest extends JbpmBpmn2TestCase { @Test public void testImplicitEndParallel() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ParallelSplit.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/event/BPMN2-ParallelSplit.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("ParallelSplit"); assertProcessInstanceCompleted(processInstance); } @Test public void testErrorEndEventProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ErrorEndEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/event/BPMN2-ErrorEndEvent.bpmn2"); KogitoProcessInstance processInstance = kruntime .startProcess("ErrorEndEvent"); assertProcessInstanceAborted(processInstance); @@ -56,7 +56,7 @@ public void testErrorEndEventProcess() throws Exception { @Test public void testEscalationEndEventProcess() throws Exception { - kruntime = createKogitoProcessRuntime("escalation/BPMN2-EscalationEndEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEvent.bpmn2"); KogitoProcessInstance processInstance = kruntime .startProcess("EscalationEndEvent"); assertProcessInstanceAborted(processInstance); @@ -65,7 +65,7 @@ public void testEscalationEndEventProcess() throws Exception { @Test public void testSignalEnd() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SignalEndEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/event/BPMN2-SignalEndEvent.bpmn2"); Map params = new HashMap<>(); params.put("x", "MyValue"); kruntime.startProcess("SignalEndEvent", params); @@ -186,8 +186,8 @@ public void testOnEntryExitScriptDesigner() throws Exception { @Test public void testTerminateWithinSubprocessEnd() throws Exception { - kruntime = createKogitoProcessRuntime("subprocess/BPMN2-SubprocessWithParallelSpitTerminate.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-SubprocessWithParallelSpitTerminate"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/event//BPMN2-SubprocessWithParallelSplitTerminate.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("SubprocessWithParallelSplitTerminate"); kruntime.signalEvent("signal1", null, processInstance.getStringId()); @@ -197,8 +197,8 @@ public void testTerminateWithinSubprocessEnd() throws Exception { @Test public void testTerminateEnd() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ParallelSpitTerminate.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-ParallelSpitTerminate"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/event/BPMN2-ParallelSplitTerminate.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("ParallelSplitTerminate"); kruntime.signalEvent("Signal 1", null, processInstance.getStringId()); @@ -208,9 +208,9 @@ public void testTerminateEnd() throws Exception { @Test public void testSignalEndWithData() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EndEventSignalWithData.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/event/BPMN2-EndEventSignalWithData.bpmn2"); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("src.simpleEndSignal", params); + KogitoProcessInstance processInstance = kruntime.startProcess("EndEventSignalWithData", params); assertProcessInstanceCompleted(processInstance); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java similarity index 91% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java index 3a64197543e..813cdee2b3d 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java @@ -51,7 +51,7 @@ public class ErrorEventTest extends JbpmBpmn2TestCase { @Test public void testEventSubprocessError() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventSubprocessError.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-EventSubprocessError.bpmn2"); final List executednodes = new ArrayList<>(); KogitoProcessEventListener listener = new DefaultKogitoProcessEventListener() { @@ -68,7 +68,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { kruntime.getProcessEventManager().addEventListener(listener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-EventSubprocessError"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubprocessError"); assertProcessInstanceActive(processInstance); kruntime.getProcessEventManager().addEventListener(listener); @@ -84,7 +84,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { @Test public void testEventSubprocessErrorThrowOnTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventSubprocessError.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-EventSubprocessError.bpmn2"); final List executednodes = new ArrayList<>(); KogitoProcessEventListener listener = new DefaultKogitoProcessEventListener() { @@ -113,7 +113,7 @@ public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager }); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-EventSubprocessError"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubprocessError"); assertProcessInstanceFinished(processInstance, kruntime); assertProcessInstanceAborted(processInstance); @@ -125,7 +125,7 @@ public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager @Test public void testEventSubprocessErrorWithErrorCode() throws Exception { - kruntime = createKogitoProcessRuntime("subprocess/EventSubprocessErrorHandlingWithErrorCode.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-EventSubprocessErrorHandlingWithErrorCode.bpmn2"); final List executednodes = new ArrayList<>(); KogitoProcessEventListener listener = new DefaultKogitoProcessEventListener() { @@ -140,7 +140,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { }; kruntime.getProcessEventManager().addEventListener(listener); - KogitoProcessInstance processInstance = kruntime.startProcess("order-fulfillment-bpm.ccc"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubprocessErrorHandlingWithErrorCode"); assertProcessInstanceFinished(processInstance, kruntime); assertNodeTriggered(processInstance.getStringId(), "start", "Script1", "starterror", "Script2", "end2", "eventsubprocess"); @@ -177,22 +177,22 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { @Test public void testErrorBoundaryEvent() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ErrorBoundaryEventInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventInterrupting.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); KogitoProcessInstance processInstance = kruntime - .startProcess("ErrorBoundaryEvent"); + .startProcess("ErrorBoundaryEventInterrupting"); assertProcessInstanceFinished(processInstance, kruntime); } @Test public void testErrorBoundaryEventOnTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ErrorBoundaryEventOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventOnTask.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-ErrorBoundaryEventOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("ErrorBoundaryEventOnTask"); List workItems = handler.getWorkItems(); assertThat(workItems).hasSize(2); @@ -274,7 +274,7 @@ public void testMultiErrorBoundaryEventsOnBusinessRuleTask() throws Exception { @Test public void testCatchErrorBoundaryEventOnTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ErrorBoundaryEventOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventOnTask.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new TestWorkItemHandler() { @Override @@ -291,7 +291,7 @@ public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager }); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-ErrorBoundaryEventOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("ErrorBoundaryEventOnTask"); assertProcessInstanceActive(processInstance); assertNodeTriggered(processInstance.getStringId(), "start", "split", "User Task", "User task error attached", @@ -315,10 +315,10 @@ public void testSignallingExceptionServiceTask() throws Exception { @Test public void testEventSubProcessErrorWithScript() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventSubProcessErrorWithScript.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-EventSubProcessErrorWithScript.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Request Handler", new SignallingTaskHandlerDecorator(ExceptionOnPurposeHandler.class, "Error-90277")); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Error Handler", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.process"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubProcessErrorWithScript"); assertProcessInstanceAborted(processInstance); assertThat(((WorkflowProcessInstance) processInstance).getOutcome()).isEqualTo("90277"); @@ -355,31 +355,31 @@ public void testErrorBoundaryEventOnExit() throws Exception { @Test public void testBoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef.bpmn2"); ExceptionWorkItemHandler handler = new ExceptionWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.bpmn.hello"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryErrorEventDefaultHandlerWithErrorCodeWithStructureRef"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testBoundaryErrorEventDefaultHandlerWithWorkItemExecutionError() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerByErrorCode.bpmn2"); WorkItemExecutionErrorWorkItemHandler handler = new WorkItemExecutionErrorWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.bpmn.hello"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryErrorEventDefaultHandlerByErrorCode"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testBoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef.bpmn2"); ExceptionWorkItemHandler handler = new ExceptionWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.bpmn.hello"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryErrorEventDefaultHandlerWithErrorCodeWithoutStructureRef"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ERROR); } @@ -418,18 +418,18 @@ public void testBoundaryErrorEventSubProcessExceptionMapping() throws Exception @Test public void testBoundaryErrorEventStructureRef() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryErrorEventStructureRef.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-BoundaryErrorEventStructureRef.bpmn2"); ExceptionWorkItemHandler handler = new ExceptionWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.bpmn.hello"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryErrorEventStructureRef"); assertNodeTriggered(processInstance.getStringId(), "Start", "User Task", "MyBoundaryErrorEvent"); } @Test public void testEndErrorWithSubprocess() throws Exception { - kruntime = createKogitoProcessRuntime("error/EndErrorWithEventSubprocess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-EndErrorWithEventSubprocess.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("EndErrorWithEventSubprocess"); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java similarity index 90% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java index 3040e5c7d3e..cb5420383c3 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/EscalationEventTest.java @@ -99,17 +99,17 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { @Test public void testEscalationBoundaryEvent() throws Exception { - kruntime = createKogitoProcessRuntime("escalation/BPMN2-EscalationBoundaryEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEvent.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("EscalationBoundaryEvent"); assertProcessInstanceCompleted(processInstance); } @Test public void testEscalationBoundaryEventInterrupting() throws Exception { - kruntime = createKogitoProcessRuntime("escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventInterrupting.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("EscalationBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("EscalationBoundaryEventInterrupting"); assertProcessInstanceCompleted(processInstance); } @@ -129,8 +129,8 @@ public void testEscalationBoundaryEventInterruptsTask() throws Exception { @Test public void testEscalationIntermediateThrowEventProcess() throws Exception { - kruntime = createKogitoProcessRuntime("escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("EscalationIntermediateThrowEvent"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-IntermediateThrowEventEscalation.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventEscalation"); assertProcessInstanceAborted(processInstance); } @@ -155,12 +155,12 @@ public void testGeneralEscalationBoundaryEventWithTask() throws Exception { @Test public void testInterruptingEscalationBoundaryEventOnTask() throws Exception { - kruntime = createKogitoProcessRuntime("escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-EscalationBoundaryEventOnTaskInterrupting.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); kruntime.getProcessEventManager().addEventListener(LOGGING_EVENT_LISTENER); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-EscalationBoundaryEventOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("EscalationBoundaryEventOnTaskInterrupting"); List workItems = handler.getWorkItems(); assertThat(workItems).hasSize(2); @@ -205,28 +205,28 @@ public void testNonInterruptingEscalationBoundaryEventOnTask() throws Exception @Test public void testEscalationEndEventProcess() throws Exception { - kruntime = createKogitoProcessRuntime("escalation/BPMN2-EscalationEndEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEvent.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("EscalationEndEvent"); assertProcessInstanceAborted(processInstance.getStringId(), kruntime); } @Test public void testEscalationBoundaryEventAndIntermediate() throws Exception { - kruntime = createKogitoProcessRuntime("escalation/BPMN2-EscalationWithDataMapping.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-EscalationWithDataMapping.bpmn2"); Map sessionArgs = new HashMap<>(); sessionArgs.put("Property_2", new java.lang.RuntimeException()); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2BoundaryEscalationEventOnTask", sessionArgs); + KogitoProcessInstance processInstance = kruntime.startProcess("EscalationWithDataMapping", sessionArgs); assertProcessInstanceCompleted(processInstance); assertProcessVarValue(processInstance, "Property_3", "java.lang.RuntimeException"); } @Test public void testHandledEscalationEndEventProcess() throws Exception { - kruntime = createKogitoProcessRuntime("escalation/BPMN2-EscalationEndEventHandling.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/escalation/BPMN2-EscalationEndEventHandling.bpmn2"); Map parameters = new HashMap<>(); parameters.put("hello", 70); - KogitoProcessInstance processInstance = kruntime.startProcess("helloWorld.Escalation", parameters); + KogitoProcessInstance processInstance = kruntime.startProcess("EscalationEndEventHandling", parameters); assertProcessInstanceFinished(processInstance, kruntime); } } diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FEELTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FEELTest.java similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FEELTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FEELTest.java index d5517650cbd..a62574b6326 100644 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FEELTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FEELTest.java @@ -30,12 +30,12 @@ public class FEELTest extends JbpmBpmn2TestCase { @Test public void testGatewayFEEL() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-GatewayFEEL.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/feel/BPMN2-GatewayFEEL.bpmn2"); Map params1 = new HashMap(); params1.put("VA", Boolean.TRUE); params1.put("VB", Boolean.FALSE); - org.jbpm.workflow.instance.WorkflowProcessInstance procInstance1 = (org.jbpm.workflow.instance.WorkflowProcessInstance) kruntime.startProcess("BPMN2-GatewayFEEL", params1); + org.jbpm.workflow.instance.WorkflowProcessInstance procInstance1 = (org.jbpm.workflow.instance.WorkflowProcessInstance) kruntime.startProcess("GatewayFEEL", params1); assertThat(procInstance1.getVariable("Task1")).isEqualTo("ok"); assertThat(procInstance1.getVariable("Task2")).isEqualTo("ok"); assertThat(procInstance1.getVariable("Task3")).isNull(); @@ -44,7 +44,7 @@ public void testGatewayFEEL() throws Exception { Map params2 = new HashMap(); params2.put("VA", Boolean.FALSE); params2.put("VB", Boolean.TRUE); - org.jbpm.workflow.instance.WorkflowProcessInstance procInstance2 = (org.jbpm.workflow.instance.WorkflowProcessInstance) kruntime.startProcess("BPMN2-GatewayFEEL", params2); + org.jbpm.workflow.instance.WorkflowProcessInstance procInstance2 = (org.jbpm.workflow.instance.WorkflowProcessInstance) kruntime.startProcess("GatewayFEEL", params2); assertThat(procInstance2.getVariable("Task1")).isEqualTo("ok"); assertThat(procInstance2.getVariable("Task2")).isNull(); assertThat(procInstance2.getVariable("Task3")).isEqualTo("ok"); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FlowTest.java similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FlowTest.java index 06eff6409b2..3e9e883feb1 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/FlowTest.java @@ -90,14 +90,14 @@ public void testExclusiveSplitWithNoConditions() throws Exception { @Test public void testExclusiveSplit() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ExclusiveSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplit.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); params.put("x", "First"); params.put("y", "Second"); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "ExclusiveSplit", params); assertProcessInstanceCompleted(processInstance); } @@ -170,14 +170,14 @@ public void testExclusiveSplitXPathAdvancedWithVars() throws Exception { @Test public void testExclusiveSplitPriority() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ExclusiveSplitPriority.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplitPriority.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); params.put("x", "First"); params.put("y", "Second"); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "ExclusiveSplitPriority", params); assertProcessInstanceCompleted(processInstance); } @@ -191,7 +191,7 @@ public void testExclusiveSplitDefault() throws Exception { params.put("x", "NotFirst"); params.put("y", "Second"); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "ExclusiveSplitDefault", params); assertProcessInstanceCompleted(processInstance); } @@ -223,18 +223,18 @@ public void testExclusiveXORGateway() throws Exception { @Test public void testInclusiveSplit() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplit.bpmn2"); Map params = new HashMap<>(); params.put("x", 15); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplit", params); assertProcessInstanceCompleted(processInstance); } @Test public void testInclusiveSplitDefaultConnection() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveGatewayWithDefault.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithDefault.bpmn2"); Map params = new HashMap<>(); params.put("test", "c"); KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveGatewayWithDefault", params); @@ -244,14 +244,14 @@ public void testInclusiveSplitDefaultConnection() throws Exception { @Test public void testInclusiveSplitAndJoin() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoin.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoin.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", 15); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoin", params); List activeWorkItems = workItemHandler.getWorkItems(); @@ -266,14 +266,14 @@ public void testInclusiveSplitAndJoin() throws Exception { @Test public void testInclusiveSplitAndJoinLoop() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoinLoop.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinLoop.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map params = new HashMap<>(); params.put("x", 21); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoinLoop", params); List activeWorkItems = workItemHandler.getWorkItems(); @@ -288,7 +288,7 @@ public void testInclusiveSplitAndJoinLoop() throws Exception { @Test public void testInclusiveSplitAndJoinLoop2() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoinLoop2.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinLoop2.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -296,7 +296,7 @@ public void testInclusiveSplitAndJoinLoop2() throws Exception { Map params = new HashMap<>(); params.put("x", 21); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoinLoop2", params); List activeWorkItems = workItemHandler.getWorkItems(); @@ -311,7 +311,7 @@ public void testInclusiveSplitAndJoinLoop2() throws Exception { @Test public void testInclusiveSplitAndJoinNested() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoinNested.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinNested.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -319,7 +319,7 @@ public void testInclusiveSplitAndJoinNested() throws Exception { Map params = new HashMap<>(); params.put("x", 15); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoinNested", params); List activeWorkItems = workItemHandler.getWorkItems(); @@ -345,7 +345,7 @@ public void testInclusiveSplitAndJoinNested() throws Exception { @Test public void testInclusiveSplitAndJoinEmbedded() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinEmbedded.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -353,7 +353,7 @@ public void testInclusiveSplitAndJoinEmbedded() throws Exception { Map params = new HashMap<>(); params.put("x", 15); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoinEmbedded", params); List activeWorkItems = workItemHandler.getWorkItems(); @@ -368,7 +368,7 @@ public void testInclusiveSplitAndJoinEmbedded() throws Exception { @Test public void testInclusiveSplitAndJoinWithParallel() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithParallel.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -376,7 +376,7 @@ public void testInclusiveSplitAndJoinWithParallel() throws Exception { Map params = new HashMap<>(); params.put("x", 25); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoinWithParallel", params); List activeWorkItems = workItemHandler.getWorkItems(); @@ -391,7 +391,7 @@ public void testInclusiveSplitAndJoinWithParallel() throws Exception { @Test public void testInclusiveSplitAndJoinWithEnd() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithEnd.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -399,7 +399,7 @@ public void testInclusiveSplitAndJoinWithEnd() throws Exception { Map params = new HashMap<>(); params.put("x", 25); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoinWithEnd", params); List activeWorkItems = workItemHandler.getWorkItems(); @@ -421,7 +421,7 @@ public void testInclusiveSplitAndJoinWithEnd() throws Exception { @Timeout(10) public void testInclusiveSplitAndJoinWithTimer() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 2); - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinWithTimer.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", @@ -430,7 +430,7 @@ public void testInclusiveSplitAndJoinWithTimer() throws Exception { Map params = new HashMap<>(); params.put("x", 15); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoinWithTimer", params); List activeWorkItems = workItemHandler.getWorkItems(); @@ -455,7 +455,7 @@ public void testInclusiveSplitAndJoinWithTimer() throws Exception { @Test public void testInclusiveSplitAndJoinExtraPath() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplitAndJoinExtraPath.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -463,7 +463,7 @@ public void testInclusiveSplitAndJoinExtraPath() throws Exception { Map params = new HashMap<>(); params.put("x", 25); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitAndJoinExtraPath", params); kruntime.signalEvent("signal", null); @@ -489,14 +489,14 @@ public void testInclusiveSplitDefault() throws Exception { Map params = new HashMap<>(); params.put("x", -5); KogitoProcessInstance processInstance = kruntime.startProcess( - "com.sample.test", params); + "InclusiveSplitDefault", params); assertProcessInstanceCompleted(processInstance); } @Test public void testInclusiveParallelExclusiveSplitNoLoop() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI2", new SystemOutWorkItemHandler() { @@ -529,7 +529,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { }); Map params = new HashMap<>(); params.put("x", 0); - KogitoProcessInstance processInstance = kruntime.startProcess("Process_1", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveNestedInParallelNestedInExclusive", params); assertProcessInstanceCompleted(processInstance); assertThat(nodeInstanceExecutionCounter).hasSize(12); @@ -549,7 +549,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testInclusiveParallelExclusiveSplitLoop() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI2", new SystemOutWorkItemHandler() { @@ -580,7 +580,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { }); Map params = new HashMap<>(); params.put("x", -1); - KogitoProcessInstance processInstance = kruntime.startProcess("Process_1", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveNestedInParallelNestedInExclusive", params); assertProcessInstanceCompleted(processInstance); assertThat(nodeInstanceExecutionCounter).hasSize(12); @@ -600,7 +600,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testInclusiveParallelExclusiveSplitNoLoopAsync() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI", handler); @@ -633,7 +633,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { }); Map params = new HashMap<>(); params.put("x", 0); - KogitoProcessInstance processInstance = kruntime.startProcess("Process_1", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveNestedInParallelNestedInExclusive", params); assertProcessInstanceActive(processInstance); List workItems = handler.getWorkItems(); @@ -669,7 +669,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testInclusiveParallelExclusiveSplitLoopAsync() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveNestedInParallelNestedInExclusive.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI", handler); @@ -702,7 +702,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { }); Map params = new HashMap<>(); params.put("x", -1); - KogitoProcessInstance processInstance = kruntime.startProcess("Process_1", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveNestedInParallelNestedInExclusive", params); assertProcessInstanceActive(processInstance); List workItems = handler.getWorkItems(); @@ -746,14 +746,14 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testInclusiveSplitNested() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveGatewayNested.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayNested.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); TestWorkItemHandler handler2 = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI", handler); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("testWI2", handler2); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("Process_1", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveGatewayNested", params); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(), null); @@ -894,7 +894,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testMultiInstanceLoopCharacteristicsProcessWithORGateway() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithORgateway.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", @@ -905,7 +905,7 @@ public void testMultiInstanceLoopCharacteristicsProcessWithORGateway() myList.add(15); params.put("list", myList); KogitoProcessInstance processInstance = kruntime.startProcess( - "MultiInstanceLoopCharacteristicsProcess", params); + "MultiInstanceLoopCharacteristicsProcessWithORgateway", params); List workItems = workItemHandler.getWorkItems(); assertThat(workItems).hasSize(4); @@ -959,7 +959,7 @@ public void testMultiInstanceLoopCharacteristicsProcessWithORGateway() @Test public void testInclusiveJoinWithLoopAndHumanTasks() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveGatewayWithHumanTasksProcess.bpmn2"); final Map nodeInstanceExecutionCounter = new HashMap<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -983,7 +983,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { params.put("firstXor", true); params.put("secondXor", true); params.put("thirdXor", true); - KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveWithAdvancedLoop", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveGatewayWithHumanTasksProcess", params); // simulate completion of first task assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().completeWorkItem(handler.getWorkItem().getStringId(), null); @@ -1025,7 +1025,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testMultiInstanceLoopCharacteristicsProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2"); Map params = new HashMap<>(); List myList = new ArrayList<>(); myList.add("First Item"); @@ -1038,7 +1038,7 @@ public void testMultiInstanceLoopCharacteristicsProcess() throws Exception { @Test public void testMultiInstanceLoopNumberTest() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultiInstanceLoop-Numbering.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopNumbering.bpmn2"); Map params = new HashMap<>(); final Map nodeIdNodeNameMap = new HashMap<>(); @@ -1060,7 +1060,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("Test.MultipleInstancesBug", params); + KogitoProcessInstance processInstance = kruntime.startProcess("MultiInstanceLoopNumbering", params); List workItems = handler.getWorkItems(); logger.debug("COMPLETING TASKS."); @@ -1072,7 +1072,7 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testMultiInstanceLoopCharacteristicsProcess2() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultiInstanceProcessWithOutputOnTask.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); @@ -1083,7 +1083,7 @@ public void testMultiInstanceLoopCharacteristicsProcess2() throws Exception { myList.add("Mary"); params.put("miinput", myList); - KogitoProcessInstance processInstance = kruntime.startProcess("miprocess", params); + KogitoProcessInstance processInstance = kruntime.startProcess("MultiInstanceProcessWithOutputOnTask", params); List workItems = handler.getWorkItems(); assertThat(workItems).isNotNull().hasSize(2); @@ -1111,7 +1111,7 @@ public void testMultiInstanceLoopCharacteristicsProcess2() throws Exception { @Test public void testMultiInstanceLoopCharacteristicsProcessWithOutput() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutput.bpmn2"); Map params = new HashMap<>(); List myList = new ArrayList<>(); List myListOut = new ArrayList<>(); @@ -1130,7 +1130,7 @@ public void testMultiInstanceLoopCharacteristicsProcessWithOutput() @Test public void testMultiInstanceLoopCharacteristicsProcessWithOutputCompletionCondition() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond.bpmn2"); Map params = new HashMap<>(); List myList = new ArrayList<>(); List myListOut = new ArrayList<>(); @@ -1140,7 +1140,7 @@ public void testMultiInstanceLoopCharacteristicsProcessWithOutputCompletionCondi params.put("listOut", myListOut); assertThat(myListOut).isEmpty(); KogitoProcessInstance processInstance = kruntime.startProcess( - "MultiInstanceLoopCharacteristicsProcessWithOutput", params); + "MultiInstanceLoopCharacteristicsProcessWithOutputCmpCond", params); assertProcessInstanceCompleted(processInstance); assertThat(myListOut).hasSize(1); @@ -1291,7 +1291,7 @@ public void testMultipleIncomingFlowToEndNode() throws Exception { @Test public void testMultipleEnabledOnSingleConditionalSequenceFlow() throws Exception { System.setProperty("jbpm.enable.multi.con", "true"); - kruntime = createKogitoProcessRuntime("BPMN2-MultiConnEnabled.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultiConnEnabled.bpmn2"); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -1303,7 +1303,7 @@ public void afterNodeTriggered(org.kie.api.event.process.ProcessNodeTriggeredEve }); assertThat(list).isEmpty(); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-MultiConnEnabled"); + KogitoProcessInstance processInstance = kruntime.startProcess("MultiConnEnabled"); assertProcessInstanceActive(processInstance); kruntime.signalEvent("signal", null, processInstance.getStringId()); assertProcessInstanceCompleted(processInstance); @@ -1340,12 +1340,12 @@ public void testConditionalFlow() throws Exception { @Test public void testLane() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-Lane.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-Lane.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("Lane"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -1374,7 +1374,7 @@ public void testExclusiveSplitDefaultNoCondition() throws Exception { @Test public void testMultipleGatewaysProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultipleGatewaysProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultipleGatewaysProcess.bpmn2"); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { KogitoProcessInstance pi; @@ -1398,7 +1398,7 @@ public void beforeProcessStarted(ProcessStartedEvent event) { }); Map params = new HashMap<>(); params.put("action", "CreateAgent"); - KogitoProcessInstance processInstance = kruntime.startProcess("multiplegateways", params); + KogitoProcessInstance processInstance = kruntime.startProcess("MultipleGatewaysProcess", params); assertProcessInstanceCompleted(processInstance); } @@ -1406,7 +1406,7 @@ public void beforeProcessStarted(ProcessStartedEvent event) { @Test public void testTimerAndGateway() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 1); - kruntime = createKogitoProcessRuntime("timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-ParallelSplitWithTimerProcess.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); @@ -1416,7 +1416,7 @@ public void testTimerAndGateway() throws Exception { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("task1", handler1); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("task2", handler2); - KogitoProcessInstance instance = kruntime.createProcessInstance("timer-process", new HashMap<>()); + KogitoProcessInstance instance = kruntime.createProcessInstance("ParallelSplitWithTimerProcess", new HashMap<>()); kruntime.startProcessInstance(instance.getStringId()); KogitoWorkItem workItem1 = handler1.getWorkItem(); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ImportClassTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ImportClassTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ImportClassTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ImportClassTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/IncrementalCompilationTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IncrementalCompilationTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/IncrementalCompilationTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IncrementalCompilationTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java similarity index 88% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java index a0a5cd1a33f..4d4a7242530 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java @@ -97,14 +97,14 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { @Test public void testSignalBoundaryEvent() throws Exception { kruntime = createKogitoProcessRuntime( - "BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn", - "BPMN2-IntermediateThrowEventSignal.bpmn2"); + "org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn", + "org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignal.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); KogitoProcessInstance processInstance = kruntime - .startProcess("BoundarySignalOnTask"); + .startProcess("BoundarySignalEventOnTask"); Set> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) @@ -120,7 +120,7 @@ public void testSignalBoundaryEvent() throws Exception { .extracting("properties", Map.class) .anyMatch(m -> m.containsKey("AttachedToID") && m.containsKey("AttachedToName")); - KogitoProcessInstance processInstance2 = kruntime.startProcess("SignalIntermediateEvent"); + KogitoProcessInstance processInstance2 = kruntime.startProcess("IntermediateThrowEventSignal"); assertProcessInstanceFinished(processInstance2, kruntime); assertProcessInstanceFinished(processInstance, kruntime); @@ -131,7 +131,7 @@ public void testSignalBoundaryNonEffectiveEvent() throws Exception { final String signal = "signalTest"; final AtomicBoolean eventAfterNodeLeftTriggered = new AtomicBoolean(false); kruntime = createKogitoProcessRuntime( - "BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2"); + "org/jbpm/bpmn2/intermediate/BPMN2-BoundaryEventWithNonEffectiveSignal.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", @@ -165,13 +165,13 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { @Test public void testSignalBoundaryEventOnTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new TestWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(LOGGING_EVENT_LISTENER); KogitoProcessInstance processInstance = kruntime - .startProcess("BoundarySignalOnTask"); + .startProcess("BoundarySignalEventOnTask"); Set> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) @@ -219,13 +219,13 @@ public void testSignalBoundaryEventOnTaskWithSignalName() throws Exception { @Test public void testSignalBoundaryEventOnTaskComplete() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundarySignalEventOnTaskbpmn2.bpmn"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundarySignalEventOnTask.bpmn"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); kruntime.getProcessEventManager().addEventListener(LOGGING_EVENT_LISTENER); - KogitoProcessInstance processInstance = kruntime.startProcess("BoundarySignalOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundarySignalEventOnTask"); kruntime.getKogitoWorkItemManager().completeWorkItem( handler.getWorkItem().getStringId(), null); kruntime.signalEvent("MySignal", "value"); @@ -237,12 +237,12 @@ public void testSignalBoundaryEventOnTaskComplete() throws Exception { @Test public void testSignalBoundaryEventInterrupting() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SignalBoundaryEventInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-SignalBoundaryEventInterrupting.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); KogitoProcessInstance processInstance = kruntime - .startProcess("SignalBoundaryEvent"); + .startProcess("SignalBoundaryEventInterrupting"); assertProcessInstanceActive(processInstance); Set> eventDescriptions = processInstance.getEventDescriptions(); @@ -266,12 +266,12 @@ public void testSignalBoundaryEventInterrupting() throws Exception { @Test public void testSignalIntermediateThrow() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateThrowEventSignal.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignal.bpmn2"); Map params = new HashMap<>(); params.put("x", "MyValue"); KogitoProcessInstance processInstance = kruntime.startProcess( - "SignalIntermediateEvent", params); + "IntermediateThrowEventSignal", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @@ -279,18 +279,18 @@ public void testSignalIntermediateThrow() throws Exception { @Test public void testSignalBetweenProcesses() throws Exception { kruntime = createKogitoProcessRuntime( - "BPMN2-IntermediateCatchSignalSingle.bpmn2", - "BPMN2-IntermediateThrowEventSignal.bpmn2"); + "org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchSignalSingle.bpmn2", + "org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignal.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-IntermediateCatchSignalSingle"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchSignalSingle"); kruntime.getKogitoWorkItemManager().completeWorkItem( handler.getWorkItem().getStringId(), null); - KogitoProcessInstance processInstance2 = kruntime.startProcess("SignalIntermediateEvent"); + KogitoProcessInstance processInstance2 = kruntime.startProcess("IntermediateThrowEventSignal"); assertProcessInstanceFinished(processInstance2, kruntime); assertProcessInstanceFinished(processInstance, kruntime); @@ -298,7 +298,7 @@ public void testSignalBetweenProcesses() throws Exception { @Test public void testEventBasedSplit() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -306,7 +306,7 @@ public void testEventBasedSplit() throws Exception { new SystemOutWorkItemHandler()); // Yes KogitoProcessInstance processInstance = kruntime - .startProcess("com.sample.test"); + .startProcess("EventBasedSplit"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -329,7 +329,7 @@ public void testEventBasedSplit() throws Exception { kruntime.signalEvent("Yes", "YesValue", processInstance.getStringId()); assertProcessInstanceFinished(processInstance, kruntime); // No - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -343,14 +343,14 @@ public void testEventBasedSplit() throws Exception { @Test public void testEventBasedSplitBefore() throws Exception { // signaling before the split is reached should have no effect - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler()); @@ -359,7 +359,7 @@ public void testEventBasedSplitBefore() throws Exception { kruntime.signalEvent("Yes", "YesValue", processInstance.getStringId()); assertProcessInstanceActive(processInstance); // No - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler()); @@ -374,14 +374,14 @@ public void testEventBasedSplitBefore() throws Exception { public void testEventBasedSplitAfter() throws Exception { // signaling the other alternative after one has been selected should // have no effect - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -401,7 +401,7 @@ public void testEventBasedSplitAfter() throws Exception { @Test public void testEventBasedSplit2() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(2); - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit2.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit2.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -410,7 +410,7 @@ public void testEventBasedSplit2() throws Exception { kruntime.getProcessEventManager().addEventListener(countDownListener); // Yes KogitoProcessInstance processInstance = kruntime - .startProcess("com.sample.test"); + .startProcess("EventBasedSplit2"); assertProcessInstanceActive(processInstance); Set> eventDescriptions = processInstance.getEventDescriptions(); @@ -433,7 +433,7 @@ public void testEventBasedSplit2() throws Exception { assertProcessInstanceFinished(processInstance, kruntime); // Timer - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit2"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -443,7 +443,7 @@ public void testEventBasedSplit2() throws Exception { @Test public void testEventBasedSplit3() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit3.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit3.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -453,7 +453,7 @@ public void testEventBasedSplit3() throws Exception { jack.setName("Jack"); // Yes KogitoProcessInstance processInstance = kruntime - .startProcess("com.sample.test"); + .startProcess("EventBasedSplit3"); assertProcessInstanceActive(processInstance); Set> eventDescriptions = processInstance.getEventDescriptions(); @@ -474,7 +474,7 @@ public void testEventBasedSplit3() throws Exception { kruntime.signalEvent("Yes", "YesValue", processInstance.getStringId()); assertProcessInstanceFinished(processInstance, kruntime); // Condition - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit3"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -488,7 +488,7 @@ public void testEventBasedSplit3() throws Exception { @Test public void testEventBasedSplit4() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit4.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit4.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -496,7 +496,7 @@ public void testEventBasedSplit4() throws Exception { new SystemOutWorkItemHandler()); // Yes KogitoProcessInstance processInstance = kruntime - .startProcess("com.sample.test"); + .startProcess("EventBasedSplit4"); assertProcessInstanceActive(processInstance); Set> eventDescriptions = processInstance.getEventDescriptions(); @@ -522,7 +522,7 @@ public void testEventBasedSplit4() throws Exception { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // No - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit4"); kruntime.signalEvent("Message-NoMessage", "NoValue", processInstance.getStringId()); assertProcessInstanceFinished(processInstance, kruntime); @@ -531,7 +531,7 @@ public void testEventBasedSplit4() throws Exception { @Test public void testEventBasedSplit5() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit5.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit5.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -541,7 +541,7 @@ public void testEventBasedSplit5() throws Exception { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Receive Task", receiveTaskHandler); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit5"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); @@ -561,7 +561,7 @@ public void testEventBasedSplit5() throws Exception { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Receive Task", receiveTaskHandler); // No - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit5"); receiveTaskHandler.messageReceived("NoMessage", "NoValue"); assertProcessInstanceFinished(processInstance, kruntime); receiveTaskHandler.messageReceived("YesMessage", "YesValue"); @@ -570,17 +570,17 @@ public void testEventBasedSplit5() throws Exception { @Test public void testEventBasedSplitWithSubprocess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-ExclusiveEventBasedGatewayInSubprocess.bpmn2"); // Stop - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.bpmn.testEBGInSubprocess"); + KogitoProcessInstance processInstance = kruntime.startProcess("ExclusiveEventBasedGatewayInSubprocess"); assertProcessInstanceActive(processInstance); kruntime.signalEvent("StopSignal", "", processInstance.getStringId()); assertProcessInstanceFinished(processInstance, kruntime); // Continue and Stop - processInstance = kruntime.startProcess("com.sample.bpmn.testEBGInSubprocess"); + processInstance = kruntime.startProcess("ExclusiveEventBasedGatewayInSubprocess"); assertProcessInstanceActive(processInstance); kruntime.signalEvent("ContinueSignal", "", processInstance.getStringId()); @@ -597,7 +597,7 @@ public void testEventSubprocessSignal() throws Exception { "start", "User Task 1", "end", "Sub Process 1", "start-sub", "sub-script", "end-sub" }; - runTestEventSubprocessSignal("BPMN2-EventSubprocessSignal.bpmn2", nodes); + runTestEventSubprocessSignal("org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignal.bpmn2", "EventSubprocessSignal", nodes); } @Test @@ -617,10 +617,14 @@ public void testEventSubprocessSignalNested() throws Exception { "Sub End", "End" }; - runTestEventSubprocessSignal("BPMN2-EventSubprocessSignal-Nested.bpmn2", nodes); + runTestEventSubprocessSignal("org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalNested.bpmn2", "EventSubprocessSignalNested", nodes); } public void runTestEventSubprocessSignal(String processFile, String[] completedNodes) throws Exception { + runTestEventSubprocessSignal(processFile, processFile, completedNodes); + } + + public void runTestEventSubprocessSignal(String processFile, String processId, String[] completedNodes) throws Exception { kruntime = createKogitoProcessRuntime(processFile); final List executednodes = new ArrayList<>(); KogitoProcessEventListener listener = new DefaultKogitoProcessEventListener() { @@ -640,7 +644,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); KogitoProcessInstance processInstance = kruntime - .startProcess("BPMN2-EventSubprocessSignal"); + .startProcess(processId); assertProcessInstanceActive(processInstance); kruntime.getProcessEventManager().addEventListener(listener); @@ -674,7 +678,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { @Test public void testEventSubprocessSignalWithStateNode() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventSubprocessSignalWithStateNode.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalWithStateNode.bpmn2"); final List executednodes = new ArrayList<>(); KogitoProcessEventListener listener = new DefaultKogitoProcessEventListener() { @@ -692,7 +696,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); KogitoProcessInstance processInstance = kruntime - .startProcess("BPMN2-EventSubprocessSignal"); + .startProcess("EventSubprocessSignalWithStateNode"); assertProcessInstanceActive(processInstance); kruntime.getProcessEventManager().addEventListener(listener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", @@ -736,7 +740,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { @Test public void testEventSubprocessSignalInterrupting() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventSubprocessSignalInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalInterrupting.bpmn2"); final List executednodes = new ArrayList<>(); KogitoProcessEventListener listener = new DefaultKogitoProcessEventListener() { @@ -754,8 +758,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime - .startProcess("BPMN2-EventSubprocessSignal"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubprocessSignalInterrupting"); assertProcessInstanceActive(processInstance); kruntime.getProcessEventManager().addEventListener(listener); @@ -822,14 +825,14 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { @Test public void testEventSubprocessTimer() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("Script Task 1", 1); - kruntime = createKogitoProcessRuntime("BPMN2-EventSubprocessTimer.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessTimer.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-EventSubprocessTimer"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubprocessTimer"); assertProcessInstanceActive(processInstance); Set> eventDescriptions = processInstance.getEventDescriptions(); @@ -870,12 +873,12 @@ public void testEventSubprocessTimer() throws Exception { public void testEventSubprocessTimerCycle() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("Script Task 1", 4); - kruntime = createKogitoProcessRuntime("BPMN2-EventSubprocessTimerCycle.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessTimerCycle.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-EventSubprocessTimer"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubprocessTimerCycle"); assertProcessInstanceActive(processInstance); Set> eventDescriptions = processInstance.getEventDescriptions(); @@ -945,7 +948,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { public void testEventSubprocessMessageWithLocalVars() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 1); - kruntime = createKogitoProcessRuntime("subprocess/BPMN2-EventSubProcessWithLocalVariables.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventSubProcessWithLocalVariables.bpmn2"); final Set variablevalues = new HashSet(); KogitoProcessEventListener listener = new DefaultKogitoProcessEventListener() { @@ -961,7 +964,7 @@ public void afterNodeLeft(ProcessNodeLeftEvent event) { }; kruntime.getProcessEventManager().addEventListener(listener); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("EventSPWithVars"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubProcessWithLocalVariables"); assertProcessInstanceActive(processInstance); Map data = new HashMap<>(); @@ -980,7 +983,7 @@ public void testMessageIntermediateThrow() throws Exception { Map params = new HashMap<>(); params.put("x", "MyValue"); KogitoProcessInstance processInstance = kruntime.startProcess( - "MessageIntermediateEvent", params); + "IntermediateThrowEventMessage", params); assertProcessInstanceCompleted(processInstance); } @@ -992,7 +995,7 @@ public void testMessageIntermediateThrowVerifyWorkItemData() throws Exception { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Send Task", handler); Map params = new HashMap<>(); params.put("x", "MyValue"); - KogitoProcessInstance processInstance = kruntime.startProcess("MessageIntermediateEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventMessage", params); assertProcessInstanceCompleted(processInstance); KogitoWorkItem workItem = handler.getWorkItem(); @@ -1012,7 +1015,7 @@ public void testMessageIntermediateThrowVerifyWorkItemDataDeploymentId() throws kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Send Task", handler); Map params = new HashMap<>(); params.put("x", "MyValue"); - KogitoProcessInstance processInstance = kruntime.startProcess("MessageIntermediateEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventMessage", params); assertProcessInstanceCompleted(processInstance); KogitoWorkItem workItem = handler.getWorkItem(); @@ -1029,10 +1032,10 @@ public void testMessageIntermediateThrowVerifyWorkItemDataDeploymentId() throws @Test public void testMessageBoundaryEventOnTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryMessageEventOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundaryMessageEventOnTask.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new TestWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryMessageOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryMessageEventOnTask"); kruntime.signalEvent("Message-HelloMessage", "message data"); assertProcessInstanceFinished(processInstance, kruntime); assertNodeTriggered(processInstance.getStringId(), "StartProcess", @@ -1042,12 +1045,12 @@ public void testMessageBoundaryEventOnTask() throws Exception { @Test public void testMessageBoundaryEventOnTaskComplete() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryMessageEventOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundaryMessageEventOnTask.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryMessageOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryMessageEventOnTask"); kruntime.getKogitoWorkItemManager().completeWorkItem( handler.getWorkItem().getStringId(), null); kruntime.signalEvent("Message-HelloMessage", "message data"); @@ -1062,10 +1065,10 @@ public void testMessageBoundaryEventOnTaskComplete() throws Exception { @Test public void testTimerBoundaryEventDuration() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventDuration.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDuration.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventDuration"); assertProcessInstanceActive(processInstance); Set> eventDescriptions = processInstance.getEventDescriptions(); @@ -1091,10 +1094,10 @@ public void testTimerBoundaryEventDuration() throws Exception { @Test public void testTimerBoundaryEventDurationISO() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventDurationISO.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDurationISO.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventDurationISO"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1106,13 +1109,13 @@ public void testTimerBoundaryEventDurationISO() throws Exception { public void testTimerBoundaryEventDateISO() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventDateISO.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDateISO.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); HashMap params = new HashMap<>(); OffsetDateTime plusTwoSeconds = OffsetDateTime.now().plusSeconds(2); params.put("date", plusTwoSeconds.toString()); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventDateISO", params); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1124,10 +1127,10 @@ public void testTimerBoundaryEventDateISO() throws Exception { public void testTimerBoundaryEventCycle1() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventCycle1.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycle1.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventCycle1"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1139,10 +1142,10 @@ public void testTimerBoundaryEventCycle1() throws Exception { public void testTimerBoundaryEventCycle2() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 3); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventCycle2.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycle2.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventCycle2"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1155,10 +1158,10 @@ public void testTimerBoundaryEventCycle2() throws Exception { @RequirePersistence(false) public void testTimerBoundaryEventCycleISO() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 2); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventCycleISO.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventCycleISO.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventCycleISO"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); assertProcessInstanceActive(processInstance); @@ -1169,10 +1172,10 @@ public void testTimerBoundaryEventCycleISO() throws Exception { public void testTimerBoundaryEventInterrupting() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterrupting.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventInterrupting"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1187,11 +1190,11 @@ public void testTimerBoundaryEventInterrupting() throws Exception { public void testTimerBoundaryEventInterruptingOnTask() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterruptingOnTask.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new TestWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventInterruptingOnTask"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1203,10 +1206,10 @@ public void testTimerBoundaryEventInterruptingOnTask() throws Exception { @Test public void testTimerBoundaryEventInterruptingOnTaskCancelTimer() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterruptingOnTaskCancelTimer.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventInterruptingOnTaskCancelTimer"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); @@ -1224,10 +1227,10 @@ public void testTimerBoundaryEventInterruptingOnTaskCancelTimer() throws Excepti @Test public void testIntermediateCatchEventSignal() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventSignal.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignal.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventSignal"); assertProcessInstanceActive(processInstance); // now signal process instance @@ -1239,10 +1242,10 @@ public void testIntermediateCatchEventSignal() throws Exception { @Test public void testIntermediateCatchEventMessage() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventMessage.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessage.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventMessage"); assertProcessInstanceActive(processInstance); // now signal process instance kruntime.signalEvent("Message-HelloMessage", "SomeValue", processInstance.getStringId()); @@ -1252,10 +1255,10 @@ public void testIntermediateCatchEventMessage() throws Exception { @Test public void testIntermediateCatchEventMessageWithRef() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventMessageWithRef.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessageWithRef.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventMessageWithRef"); assertProcessInstanceActive(processInstance); // now signal process instance @@ -1269,10 +1272,10 @@ public void testIntermediateCatchEventMessageWithRef() throws Exception { public void testIntermediateCatchEventTimerDuration() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerDuration.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDuration.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerDuration"); assertProcessInstanceActive(processInstance); // now wait for 1 second for timer to trigger @@ -1285,14 +1288,14 @@ public void testIntermediateCatchEventTimerDuration() throws Exception { public void testIntermediateCatchEventTimerDateISO() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerDateISO.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDateISO.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); HashMap params = new HashMap<>(); OffsetDateTime plusTwoSeconds = OffsetDateTime.now().plusSeconds(2); params.put("date", plusTwoSeconds.toString()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerDateISO", params); assertProcessInstanceActive(processInstance); // now wait for 1 second for timer to trigger countDownListener.waitTillCompleted(); @@ -1305,11 +1308,11 @@ public void testIntermediateCatchEventTimerDateISO() throws Exception { public void testIntermediateCatchEventTimerDurationISO() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDurationISO.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerDurationISO"); assertProcessInstanceActive(processInstance); // now wait for 1.5 second for timer to trigger countDownListener.waitTillCompleted(); @@ -1321,11 +1324,11 @@ public void testIntermediateCatchEventTimerDurationISO() throws Exception { public void testIntermediateCatchEventTimerCycle1() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerCycle1.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerCycle1"); assertProcessInstanceActive(processInstance); // now wait for 1 second for timer to trigger countDownListener.waitTillCompleted(); @@ -1337,11 +1340,11 @@ public void testIntermediateCatchEventTimerCycle1() throws Exception { public void testIntermediateCatchEventTimerCycleISO() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 5); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleISO.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerCycleISO"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1354,11 +1357,11 @@ public void testIntermediateCatchEventTimerCycleISO() throws Exception { public void testIntermediateCatchEventTimerCycle2() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 3); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerCycle2.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerCycle2"); assertProcessInstanceActive(processInstance); // now wait for 1 second for timer to trigger countDownListener.waitTillCompleted(); @@ -1369,8 +1372,8 @@ public void testIntermediateCatchEventTimerCycle2() throws Exception { @Test public void testIntermediateCatchEventCondition() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventCondition.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventCondition.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventCondition"); assertProcessInstanceActive(processInstance); // now activate condition @@ -1384,7 +1387,7 @@ public void testIntermediateCatchEventCondition() throws Exception { @Test public void testIntermediateCatchEventConditionFilterByProcessInstance() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionFilterByProcessInstance.bpmn2"); Map params1 = new HashMap<>(); params1.put("personId", Long.valueOf(1L)); @@ -1433,12 +1436,12 @@ public void testIntermediateCatchEventTimerCycleWithError() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 3); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); Map params = new HashMap<>(); params.put("x", 0); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerCycleWithError", params); assertProcessInstanceActive(processInstance); // now wait for 1 second for timer to trigger countDownListener.waitTillCompleted(); @@ -1458,10 +1461,10 @@ public void testIntermediateCatchEventTimerCycleWithError() public void testIntermediateCatchEventTimerCycleWithErrorWithPersistence() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 2); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerCycleWithError.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); kruntime.getProcessEventManager().addEventListener(countDownListener); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerCycleWithError"); assertProcessInstanceActive(processInstance); final String piId = processInstance.getStringId(); @@ -1487,35 +1490,35 @@ public void testIntermediateCatchEventTimerCycleWithErrorWithPersistence() throw @Test public void testNoneIntermediateThrow() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateThrowEventNone.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventNone.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess( - "NoneIntermediateEvent"); + "IntermediateThrowEventNone"); assertProcessInstanceCompleted(processInstance); } @Test public void testLinkIntermediateEvent() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateLinkEvent.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("linkEventProcessExample"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateLinkEvent.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateLinkEvent"); assertProcessInstanceCompleted(processInstance); } @Test public void testLinkEventCompositeProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-LinkEventCompositeProcess.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Composite"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-LinkEventCompositeProcess.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("LinkEventCompositeProcess"); assertProcessInstanceCompleted(processInstance); } @Test public void testConditionalBoundaryEventOnTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryConditionalEventOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundaryConditionalEventOnTask.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new TestWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("BoundarySignalOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryConditionalEventOnTask"); Person person = new Person(); person.setName("john"); @@ -1529,11 +1532,11 @@ public void testConditionalBoundaryEventOnTask() throws Exception { @Test public void testConditionalBoundaryEventOnTaskComplete() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryConditionalEventOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundaryConditionalEventOnTask.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("BoundarySignalOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryConditionalEventOnTask"); kruntime.getKogitoWorkItemManager().completeWorkItem( handler.getWorkItem().getStringId(), null); @@ -1552,11 +1555,11 @@ public void testConditionalBoundaryEventOnTaskComplete() throws Exception { @Test public void testConditionalBoundaryEventOnTaskActiveOnStartup() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryConditionalEventOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundaryConditionalEventOnTask.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new TestWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("BoundarySignalOnTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryConditionalEventOnTask"); Person person = new Person(); person.setName("john"); kruntime.getKieSession().insert(person); @@ -1569,10 +1572,10 @@ public void testConditionalBoundaryEventOnTaskActiveOnStartup() @Test public void testConditionalBoundaryEventInterrupting() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ConditionalBoundaryEventInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-ConditionalBoundaryEventInterrupting.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("ConditionalBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("ConditionalBoundaryEventInterrupting"); assertProcessInstanceActive(processInstance); Person person = new Person(); @@ -1595,15 +1598,15 @@ public void testSignallingExceptionServiceTask() throws Exception { @Test public void testSignalBoundaryEventOnSubprocessTakingDifferentPaths() throws Exception { kruntime = createKogitoProcessRuntime( - "BPMN2-SignalBoundaryOnSubProcess.bpmn"); + "org/jbpm/bpmn2/intermediate/BPMN2-SignalBoundaryOnSubProcess.bpmn"); - KogitoProcessInstance processInstance = kruntime.startProcess("jbpm.testing.signal"); + KogitoProcessInstance processInstance = kruntime.startProcess("SignalBoundaryOnSubProcess"); assertProcessInstanceActive(processInstance); kruntime.signalEvent("continue", null, processInstance.getStringId()); assertProcessInstanceFinished(processInstance, kruntime); - processInstance = kruntime.startProcess("jbpm.testing.signal"); + processInstance = kruntime.startProcess("SignalBoundaryOnSubProcess"); assertProcessInstanceActive(processInstance); kruntime.signalEvent("forward", null); @@ -1612,13 +1615,13 @@ public void testSignalBoundaryEventOnSubprocessTakingDifferentPaths() throws Exc @Test public void testIntermediateCatchEventSameSignalOnTwokruntimes() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventSignal.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignal.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventSignal"); KogitoProcessRuntime kruntime2 = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventSignal2.bpmn2"); kruntime2.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance2 = kruntime2.startProcess("IntermediateCatchEvent2"); + KogitoProcessInstance processInstance2 = kruntime2.startProcess("IntermediateCatchEventSignal2"); assertProcessInstanceActive(processInstance); assertProcessInstanceActive(processInstance2); @@ -1650,7 +1653,7 @@ public void testIntermediateCatchEventNoIncommingConnection() throws Exception { @Test public void testSignalBoundaryEventOnMultiInstanceSubprocess() throws Exception { kruntime = createKogitoProcessRuntime( - "subprocess/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2"); + "org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundarySignal.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); @@ -1662,7 +1665,7 @@ public void testSignalBoundaryEventOnMultiInstanceSubprocess() throws Exception params.put("approvers", approvers); - KogitoProcessInstance processInstance = kruntime.startProcess("boundary-catch-error-event", params); + KogitoProcessInstance processInstance = kruntime.startProcess("MultiInstanceSubprocessWithBoundarySignal", params); assertProcessInstanceActive(processInstance); List workItems = handler.getWorkItems(); @@ -1676,7 +1679,7 @@ public void testSignalBoundaryEventOnMultiInstanceSubprocess() throws Exception @Test public void testSignalBoundaryEventNoInteruptOnMultiInstanceSubprocess() throws Exception { kruntime = createKogitoProcessRuntime( - "subprocess/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2"); + "org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundarySignalNoInterupting.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); @@ -1688,7 +1691,7 @@ public void testSignalBoundaryEventNoInteruptOnMultiInstanceSubprocess() throws params.put("approvers", approvers); - KogitoProcessInstance processInstance = kruntime.startProcess("boundary-catch-error-event", params); + KogitoProcessInstance processInstance = kruntime.startProcess("MultiInstanceSubprocessWithBoundarySignalNoInterupting", params); assertProcessInstanceActive(processInstance); List workItems = handler.getWorkItems(); @@ -1708,7 +1711,7 @@ public void testSignalBoundaryEventNoInteruptOnMultiInstanceSubprocess() throws @Test public void testErrorBoundaryEventOnMultiInstanceSubprocess() throws Exception { kruntime = createKogitoProcessRuntime( - "subprocess/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2"); + "org/jbpm/bpmn2/intermediate/BPMN2-MultiInstanceSubprocessWithBoundaryError.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); @@ -1720,7 +1723,7 @@ public void testErrorBoundaryEventOnMultiInstanceSubprocess() throws Exception { params.put("approvers", approvers); - KogitoProcessInstance processInstance = kruntime.startProcess("boundary-catch-error-event", params); + KogitoProcessInstance processInstance = kruntime.startProcess("MultiInstanceSubprocessWithBoundaryError", params); assertProcessInstanceActive(processInstance); Set> eventDescriptions = processInstance.getEventDescriptions(); assertThat(eventDescriptions) @@ -1746,10 +1749,10 @@ public void testErrorBoundaryEventOnMultiInstanceSubprocess() throws Exception { @Test public void testIntermediateCatchEventSignalAndBoundarySignalEvent() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-BoundaryEventWithSignals.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-BoundaryEventWithSignals.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("boundaryeventtest"); + KogitoProcessInstance processInstance = kruntime.startProcess("BoundaryEventWithSignals"); assertProcessInstanceActive(processInstance); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); @@ -1895,8 +1898,8 @@ public void testEventSubprocessSignalWithTransformation() throws Exception { @Test public void testMultipleMessageSignalSubprocess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultipleMessageSignalSubprocess.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.bpmn.Multiple_MessageSignal_Subprocess"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-MultipleMessageSignalSubprocess.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("MultipleMessageSignalSubprocess"); logger.debug("Parent Process ID: " + processInstance.getStringId()); kruntime.signalEvent("Message-Message 1", "Test", processInstance.getStringId()); @@ -1908,9 +1911,9 @@ public void testMultipleMessageSignalSubprocess() throws Exception { @Test public void testIntermediateCatchEventSignalWithRef() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventSignalWithRef.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithRef.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventSignalWithRef"); assertProcessInstanceActive(processInstance); // now signal process instance @@ -1928,7 +1931,7 @@ public void testTimerMultipleInstances() throws Exception { TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("boundaryTimerMultipleInstances"); + KogitoProcessInstance processInstance = kruntime.startProcess("MultiInstanceLoopBoundaryTimer"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1949,7 +1952,7 @@ public void testIntermediateTimerParallelGateway() throws Exception { NodeLeftCountDownProcessEventListener countDownListener2 = new NodeLeftCountDownProcessEventListener("Timer2", 1); NodeLeftCountDownProcessEventListener countDownListener3 = new NodeLeftCountDownProcessEventListener("Timer3", 1); ProcessCompletedCountDownProcessEventListener countDownProcessEventListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("timer/BPMN2-IntermediateTimerParallelGateway.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-IntermediateTimerParallelGateway.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener1); kruntime.getProcessEventManager().addEventListener(countDownListener2); kruntime.getProcessEventManager().addEventListener(countDownListener3); @@ -1957,7 +1960,7 @@ public void testIntermediateTimerParallelGateway() throws Exception { TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation.timer-parallel"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateTimerParallelGateway"); assertProcessInstanceActive(processInstance); countDownListener1.waitTillCompleted(); @@ -1971,12 +1974,12 @@ public void testIntermediateTimerParallelGateway() throws Exception { @Test public void testIntermediateTimerEventMI() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("After timer", 3); - kruntime = createKogitoProcessRuntime("timer/BPMN2-IntermediateTimerEventMI.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-IntermediateTimerEventMI.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - KogitoProcessInstance processInstance = kruntime.startProcess("defaultprocessid"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateTimerEventMI"); assertProcessInstanceActive(processInstance); countDownListener.waitTillCompleted(); @@ -1989,14 +1992,14 @@ public void testIntermediateTimerEventMI() throws Exception { @Test public void testThrowIntermediateSignalWithScope() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2IntermediateThrowEventScope.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventScope.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("intermediate-event-scope", params); - KogitoProcessInstance processInstance2 = kruntime.startProcess("intermediate-event-scope", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventScope", params); + KogitoProcessInstance processInstance2 = kruntime.startProcess("IntermediateThrowEventScope", params); assertProcessInstanceActive(processInstance); assertProcessInstanceActive(processInstance2); @@ -2025,14 +2028,14 @@ public void testThrowIntermediateSignalWithScope() throws Exception { @Test public void testThrowEndSignalWithScope() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2EndThrowEventScope.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EndThrowEventScope.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("end-event-scope", params); - KogitoProcessInstance processInstance2 = kruntime.startProcess("end-event-scope", params); + KogitoProcessInstance processInstance = kruntime.startProcess("EndThrowEventScope", params); + KogitoProcessInstance processInstance2 = kruntime.startProcess("EndThrowEventScope", params); assertProcessInstanceActive(processInstance); assertProcessInstanceActive(processInstance2); @@ -2061,7 +2064,7 @@ public void testThrowEndSignalWithScope() throws Exception { @Test public void testThrowIntermediateSignalWithExternalScope() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateThrowEventExternalScope.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventExternalScope.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); KogitoWorkItemHandler externalHandler = new KogitoWorkItemHandler() { @@ -2083,7 +2086,7 @@ public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager kruntime.getKogitoWorkItemManager().registerWorkItemHandler("External Send Task", externalHandler); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("intermediate-event-scope", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventExternalScope", params); assertProcessInstanceActive(processInstance); @@ -2104,13 +2107,13 @@ public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager @Test public void testIntermediateCatchEventSignalWithVariable() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); String signalVar = "myVarSignal"; Map parameters = new HashMap<>(); parameters.put("signalName", signalVar); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent", parameters); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventSignalWithVariable", parameters); assertProcessInstanceActive(processInstance); // now signal process instance @@ -2122,19 +2125,21 @@ public void testIntermediateCatchEventSignalWithVariable() throws Exception { @Test public void testSignalIntermediateThrowWithVariable() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2", "BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2"); + kruntime = createKogitoProcessRuntime( + "org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignalWithVariable.bpmn2", + "org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignalWithVariable.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); // create catch process instance String signalVar = "myVarSignal"; Map parameters = new HashMap<>(); parameters.put("signalName", signalVar); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent", parameters); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventSignalWithVariable", parameters); assertProcessInstanceActive(processInstance); Map params = new HashMap<>(); params.put("x", "MyValue"); params.put("signalName", signalVar); - KogitoProcessInstance processInstanceThrow = kruntime.startProcess("SignalIntermediateEvent", params); + KogitoProcessInstance processInstanceThrow = kruntime.startProcess("IntermediateThrowEventSignalWithVariable", params); assertThat(processInstanceThrow.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); // catch process instance should now be completed @@ -2174,9 +2179,9 @@ public void testInvalidCycleTimerBoundary() throws Exception { @Test public void testIntermediateCatchEventConditionSetVariableAfter() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionSetVariableAfter.bpmn2"); kruntime.getProcessEventManager().addEventListener(new RuleAwareProcessEventListener()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventConditionSetVariableAfter"); assertProcessInstanceActive(processInstance); kruntime.getProcessEventManager().addEventListener(new RuleAwareProcessEventListener()); @@ -2206,9 +2211,9 @@ public void testIntermediateCatchEventConditionSetVariableAfter() throws Excepti @Test public void testIntermediateCatchEventConditionRemovePIAfter() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventCondition.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventCondition.bpmn2"); kruntime.getProcessEventManager().addEventListener(new RuleAwareProcessEventListener()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventCondition"); assertProcessInstanceActive(processInstance); kruntime.getProcessEventManager().addEventListener(new RuleAwareProcessEventListener()); @@ -2278,8 +2283,8 @@ public void testEventBasedSplitWithCronTimerAndSignal() throws Exception { @Test public void testEventSubprocessWithEmbeddedSignals() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("project2.myerrorprocess"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessErrorSignalEmbedded.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubprocessErrorSignalEmbedded"); assertProcessInstanceActive(processInstance.getStringId(), kruntime); assertProcessInstanceActive(processInstance); @@ -2296,12 +2301,12 @@ public void testEventSubprocessWithEmbeddedSignals() throws Exception { @Test public void testEventSubprocessWithExpression() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventSubprocessSignalExpression.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventSubprocessSignalExpression.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); Map params = new HashMap<>(); params.put("x", "signalling"); - KogitoProcessInstance processInstance = kruntime.startProcess("BPMN2-EventSubprocessSignalExpression", params); + KogitoProcessInstance processInstance = kruntime.startProcess("EventSubprocessSignalExpression", params); assertProcessInstanceActive(processInstance.getStringId(), kruntime); assertProcessInstanceActive(processInstance); @@ -2312,7 +2317,7 @@ public void testEventSubprocessWithExpression() throws Exception { @Test public void testConditionalProcessFactInsertedBefore() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventConditionPI.bpmn2", "BPMN2-IntermediateCatchEventSignal.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventConditionPI.bpmn2", "org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignal.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); Person person0 = new Person("john"); @@ -2320,7 +2325,7 @@ public void testConditionalProcessFactInsertedBefore() throws Exception { Map params0 = new HashMap<>(); params0.put("name", "john"); - KogitoProcessInstance pi0 = kruntime.startProcess("IntermediateCatchEvent", params0); + KogitoProcessInstance pi0 = kruntime.startProcess("IntermediateCatchEventSignal", params0); kruntime.getKieSession().insert(pi0); Person person = new Person("Jack"); @@ -2328,7 +2333,7 @@ public void testConditionalProcessFactInsertedBefore() throws Exception { Map params = new HashMap<>(); params.put("name", "Poul"); - KogitoProcessInstance pi = kruntime.startProcess("IntermediateCatchEventPI", params); + KogitoProcessInstance pi = kruntime.startProcess("IntermediateCatchEventConditionPI", params); kruntime.getKieSession().insert(pi); pi = kruntime.getProcessInstance(pi.getStringId()); assertThat(pi).isNotNull(); @@ -2343,7 +2348,7 @@ public void testConditionalProcessFactInsertedBefore() throws Exception { @Test public void testBoundarySignalEventOnSubprocessWithVariableResolution() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-SubprocessWithSignalEndEventAndSignalBoundaryEvent.bpmn2"); kruntime.getProcessEventManager().addEventListener(LOGGING_EVENT_LISTENER); Map params = new HashMap<>(); @@ -2359,12 +2364,12 @@ public void testBoundarySignalEventOnSubprocessWithVariableResolution() throws E @Test public void testSignalEndWithData() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateThrowEventSignalWithData.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignalWithData.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); - KogitoProcessInstance processInstance = kruntime.startProcess("testThrowingSignalEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventSignalWithData", params); assertProcessInstanceActive(processInstance); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/JbpmBpmn2TestCase.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/KogitoSetProcessInstanceVariablesCommand.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/KogitoSetProcessInstanceVariablesCommand.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/KogitoSetProcessInstanceVariablesCommand.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/KogitoSetProcessInstanceVariablesCommand.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/Message.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/Message.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/Message.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/Message.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ProcessFactoryTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ProcessFactoryTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ProcessFactoryTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ProcessFactoryTest.java diff --git a/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ResourceTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ResourceTest.java new file mode 100755 index 00000000000..2e931e831a2 --- /dev/null +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ResourceTest.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.bpmn2; + +import org.jbpm.bpmn2.flow.MinimalModel; +import org.jbpm.bpmn2.flow.MinimalProcess; +import org.jbpm.bpmn2.flow.MultipleProcessInOneFile1Model; +import org.jbpm.bpmn2.flow.MultipleProcessInOneFile1Process; +import org.jbpm.bpmn2.flow.MultipleProcessInOneFile2Model; +import org.jbpm.bpmn2.flow.MultipleProcessInOneFile2Process; +import org.jbpm.test.utils.ProcessTestHelper; +import org.junit.jupiter.api.Test; +import org.kie.kogito.Application; +import org.kie.kogito.process.ProcessInstance; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ResourceTest { + + @Test + public void testResourceType() throws Exception { + Application app = ProcessTestHelper.newApplication(); + org.kie.kogito.process.Process process = MinimalProcess.newProcess(app); + ProcessInstance processInstance = process.createInstance(process.createModel()); + processInstance.start(); + assertThat(processInstance).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED); + + } + + @Test + public void testMultipleProcessInOneFile() throws Exception { + Application app = ProcessTestHelper.newApplication(); + org.kie.kogito.process.Process process1 = MultipleProcessInOneFile1Process.newProcess(app); + org.kie.kogito.process.Process process2 = MultipleProcessInOneFile2Process.newProcess(app); + + ProcessInstance processInstance1 = process1.createInstance(process1.createModel()); + processInstance1.start(); + assertThat(processInstance1).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED); + + ProcessInstance processInstance2 = process2.createInstance(process2.createModel()); + processInstance2.start(); + assertThat(processInstance2).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED); + + } + +} diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java index 94282a71a02..3b47bb15203 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java @@ -50,13 +50,13 @@ public void afterSLAViolated(SLAViolatedEvent event) { } }; - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSLA.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLA.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); kruntime.getProcessEventManager().addEventListener(listener); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSLA"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -81,11 +81,11 @@ public void afterSLAViolated(SLAViolatedEvent event) { @Test public void testSLAonProcessMet() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSLA.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLA.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSLA"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -113,13 +113,13 @@ public void afterSLAViolated(SLAViolatedEvent event) { } }; - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSLAOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAOnTask.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); kruntime.getProcessEventManager().addEventListener(listener); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSLAOnTask"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -155,11 +155,11 @@ public void afterSLAViolated(SLAViolatedEvent event) { @Test public void testSLAonUserTaskMet() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSLAOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAOnTask.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSLAOnTask"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -200,14 +200,14 @@ public void afterSLAViolated(SLAViolatedEvent event) { } }; - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSLA.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLA.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); kruntime.getProcessEventManager().addEventListener(listener); kruntime.getKieRuntime().getEnvironment().set("SLATimerMode", "false"); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSLA"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -248,14 +248,14 @@ public void afterSLAViolated(SLAViolatedEvent event) { } }; - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSLAOnTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAOnTask.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); kruntime.getProcessEventManager().addEventListener(listener); kruntime.getKieRuntime().getEnvironment().set("SLATimerMode", "false"); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSLAOnTask"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -304,7 +304,7 @@ public void afterSLAViolated(SLAViolatedEvent event) { } }; - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSLAExpr.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLAExpr.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -313,7 +313,7 @@ public void afterSLAViolated(SLAViolatedEvent event) { Map parameters = new HashMap<>(); parameters.put("s", "3s"); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask", parameters); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSLAExpr", parameters); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -348,14 +348,14 @@ public void afterSLAViolated(SLAViolatedEvent event) { } }; - kruntime = createKogitoProcessRuntime("BPMN2-UserTaskWithSLA.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-UserTaskWithSLA.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); kruntime.getProcessEventManager().addEventListener(listener); kruntime.getKieRuntime().getEnvironment().set("SLATimerMode", "false"); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("UserTaskWithSLA"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -390,11 +390,11 @@ public void afterSLAViolated(SLAViolatedEvent event) { } }; - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2"); kruntime.getProcessEventManager().addEventListener(listener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventSignalWithSLAOnEvent"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); boolean slaViolated = latch.await(5, TimeUnit.SECONDS); @@ -434,11 +434,11 @@ public void afterSLAViolated(SLAViolatedEvent event) { } }; - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/sla/BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2"); kruntime.getProcessEventManager().addEventListener(listener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventSignalWithSLAOnEvent"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); Collection active = ((KogitoWorkflowProcessInstance) processInstance).getKogitoNodeInstances(); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java similarity index 89% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java index ab2759a265c..d83fe47a3a9 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java @@ -61,52 +61,52 @@ public class StandaloneBPMNProcessTest extends JbpmBpmn2TestCase { @Test public void testMinimalProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MinimalProcess.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("Minimal"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testMinimalProcessWithGraphical() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcessWithGraphical.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Minimal"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithGraphical.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("MinimalWithGraphical"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testMinimalProcessWithDIGraphical() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcessWithDIGraphical.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Minimal"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MinimalProcessWithDIGraphical.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("MinimalWithDIGraphical"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testCompositeProcessWithDIGraphical() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CompositeProcessWithDIGraphical.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Composite"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-CompositeProcessWithDIGraphical.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("CompositeWithDIGraphical"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testScriptTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ScriptTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-ScriptTask.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("ScriptTask"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testDataObject() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-DataObject.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-DataObject.bpmn2"); Map params = new HashMap<>(); params.put("employee", "UserId-12345"); - KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation", params); + KogitoProcessInstance processInstance = kruntime.startProcess("DataObject", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testEvaluationProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EvaluationProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-Evaluation.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("RegisterRequest", new SystemOutWorkItemHandler()); @@ -118,30 +118,30 @@ public void testEvaluationProcess() throws Exception { @Test public void testEvaluationProcess2() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EvaluationProcess2.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-Evaluation2.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); params.put("employee", "UserId-12345"); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.evaluation", params); + KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation2", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testEvaluationProcess3() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EvaluationProcess3.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/data/BPMN2-Evaluation3.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("RegisterRequest", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); params.put("employee", "john2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation", params); + KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation3", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testUserTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-UserTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/activity/BPMN2-UserTask.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); @@ -161,11 +161,11 @@ public void testUserTask() throws Exception { @Test public void testLane() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-Lane.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-Lane.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - KogitoProcessInstance processInstance = kruntime.startProcess("UserTask"); + KogitoProcessInstance processInstance = kruntime.startProcess("Lane"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); KogitoWorkItem workItem = workItemHandler.getWorkItem(); @@ -184,13 +184,13 @@ public void testLane() throws Exception { @Test public void testExclusiveSplit() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ExclusiveSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-ExclusiveSplit.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler()); Map params = new HashMap<>(); params.put("x", "First"); params.put("y", "Second"); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test", params); + KogitoProcessInstance processInstance = kruntime.startProcess("ExclusiveSplit", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @@ -202,17 +202,17 @@ public void testExclusiveSplitDefault() throws Exception { Map params = new HashMap<>(); params.put("x", "NotFirst"); params.put("y", "Second"); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test", params); + KogitoProcessInstance processInstance = kruntime.startProcess("ExclusiveSplitDefault", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testInclusiveSplit() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-InclusiveSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-InclusiveSplit.bpmn2"); Map params = new HashMap<>(); params.put("x", 15); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveSplit", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @@ -222,7 +222,7 @@ public void testInclusiveSplitDefault() throws Exception { Map params = new HashMap<>(); params.put("x", -5); - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test", params); + KogitoProcessInstance processInstance = kruntime.startProcess("InclusiveSplitDefault", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @@ -246,19 +246,19 @@ public void testExclusiveSplitXPath() throws Exception { @Test public void testEventBasedSplit() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); kruntime.signalEvent("Yes", "YesValue", processInstance.getStringId()); assertProcessInstanceCompleted(processInstance.getStringId(), kruntime); // No - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); @@ -269,19 +269,19 @@ public void testEventBasedSplit() throws Exception { @Test public void testEventBasedSplitBefore() throws Exception { // signaling before the split is reached should have no effect - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); kruntime.signalEvent("Yes", "YesValue", processInstance.getStringId()); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); // No - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new DoNothingWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); @@ -293,12 +293,12 @@ public void testEventBasedSplitBefore() throws Exception { public void testEventBasedSplitAfter() throws Exception { // signaling the other alternative after one has been selected should // have no effect - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new DoNothingWorkItemHandler()); @@ -314,19 +314,19 @@ public void testEventBasedSplitAfter() throws Exception { @Timeout(10) public void testEventBasedSplit2() throws Exception { ProcessCompletedCountDownProcessEventListener countDownListener = new ProcessCompletedCountDownProcessEventListener(2); - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit2.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit2.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit2"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.signalEvent("Yes", "YesValue", processInstance.getStringId()); assertProcessInstanceCompleted(processInstance.getStringId(), kruntime); // Timer - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit2"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); countDownListener.waitTillCompleted(); @@ -360,12 +360,12 @@ public void testEventBasedSplit3() throws Exception { @Test public void testEventBasedSplit4() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit4.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit4.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit4"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); @@ -374,21 +374,21 @@ public void testEventBasedSplit4() throws Exception { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); // No - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit4"); kruntime.signalEvent("Message-NoMessage", "NoValue", processInstance.getStringId()); assertProcessInstanceCompleted(processInstance.getStringId(), kruntime); } @Test public void testEventBasedSplit5() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-EventBasedSplit5.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-EventBasedSplit5.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); ReceiveTaskHandler receiveTaskHandler = new ReceiveTaskHandler(kruntime); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Receive Task", receiveTaskHandler); // Yes - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.test"); + KogitoProcessInstance processInstance = kruntime.startProcess("EventBasedSplit5"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler()); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler()); @@ -402,7 +402,7 @@ public void testEventBasedSplit5() throws Exception { receiveTaskHandler.setKnowledgeRuntime(kruntime); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Receive Task", receiveTaskHandler); // No - processInstance = kruntime.startProcess("com.sample.test"); + processInstance = kruntime.startProcess("EventBasedSplit5"); receiveTaskHandler.messageReceived("NoMessage", "NoValue"); assertProcessInstanceCompleted(processInstance.getStringId(), kruntime); receiveTaskHandler.messageReceived("YesMessage", "YesValue"); @@ -410,25 +410,27 @@ public void testEventBasedSplit5() throws Exception { @Test public void testCallActivity() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-CallActivity.bpmn2", "BPMN2-CallActivitySubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime( + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivity.bpmn2", + "org/jbpm/bpmn2/subprocess/BPMN2-CallActivitySubProcess.bpmn2"); Map params = new HashMap<>(); params.put("x", "oldValue"); - KogitoProcessInstance processInstance = kruntime.startProcess("ParentProcess", params); + KogitoProcessInstance processInstance = kruntime.startProcess("CallActivity", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); assertThat(((KogitoWorkflowProcessInstance) processInstance).getVariable("y")).isEqualTo("new value"); } @Test public void testSubProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SubProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-SubProcess.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("SubProcess"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testMultiInstanceLoopCharacteristicsProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/flow/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2"); Map params = new HashMap<>(); List myList = new ArrayList<>(); myList.add("First Item"); @@ -440,10 +442,10 @@ public void testMultiInstanceLoopCharacteristicsProcess() throws Exception { @Test public void testErrorBoundaryEvent() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ErrorBoundaryEventInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/error/BPMN2-ErrorBoundaryEventInterrupting.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("ErrorBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("ErrorBoundaryEventInterrupting"); assertProcessInstanceCompleted(processInstance.getStringId(), kruntime); } @@ -452,12 +454,12 @@ public void testErrorBoundaryEvent() throws Exception { public void testTimerBoundaryEvent() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 1); ProcessCompletedCountDownProcessEventListener processEventListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventDuration.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventDuration.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); kruntime.getProcessEventManager().addEventListener(processEventListener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventDuration"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); countDownListener.waitTillCompleted(); processEventListener.waitTillCompleted(); @@ -469,12 +471,12 @@ public void testTimerBoundaryEvent() throws Exception { public void testTimerBoundaryEventInterrupting() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("TimerEvent", 1); ProcessCompletedCountDownProcessEventListener processEventListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-TimerBoundaryEventInterrupting.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/timer/BPMN2-TimerBoundaryEventInterrupting.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); kruntime.getProcessEventManager().addEventListener(processEventListener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("MyTask", new DoNothingWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("TimerBoundaryEventInterrupting"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); countDownListener.waitTillCompleted(); processEventListener.waitTillCompleted(); @@ -526,10 +528,10 @@ public void testAdHocSubProcessAutoComplete() throws Exception { @Test public void testIntermediateCatchEventSignal() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventSignal.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventSignal.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventSignal"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); // now signal process instance kruntime.signalEvent("MyMessage", "SomeValue", processInstance.getStringId()); @@ -538,11 +540,11 @@ public void testIntermediateCatchEventSignal() throws Exception { @Test public void testIntermediateCatchEventMessage() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventMessage.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventMessage.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventMessage"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); // now signal process instance kruntime.signalEvent("Message-HelloMessage", "SomeValue", processInstance.getStringId()); @@ -554,12 +556,12 @@ public void testIntermediateCatchEventMessage() throws Exception { public void testIntermediateCatchEventTimer() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("timer", 1); ProcessCompletedCountDownProcessEventListener processEventListener = new ProcessCompletedCountDownProcessEventListener(); - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateCatchEventTimerDuration.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateCatchEventTimerDuration.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); kruntime.getProcessEventManager().addEventListener(processEventListener); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler()); - KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEvent"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateCatchEventTimerDuration"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_ACTIVE); // now wait for 1 second for timer to trigger countDownListener.waitTillCompleted(); @@ -583,7 +585,7 @@ public void testIntermediateCatchEventCondition() throws Exception { @Test public void testErrorEndEventProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ErrorEndEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/event/BPMN2-ErrorEndEvent.bpmn2"); KogitoProcessInstance processInstance = kruntime.startProcess("ErrorEndEvent"); assertProcessInstanceAborted(processInstance.getStringId(), kruntime); @@ -603,7 +605,7 @@ public void testServiceTask() throws Exception { @Test public void testSendTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SendTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/task/BPMN2-SendTask.bpmn2"); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler()); Map params = new HashMap<>(); @@ -614,7 +616,7 @@ public void testSendTask() throws Exception { @Test public void testReceiveTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-ReceiveTask.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/task/BPMN2-ReceiveTask.bpmn2"); ReceiveTaskHandler receiveTaskHandler = new ReceiveTaskHandler(kruntime); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Receive Task", receiveTaskHandler); @@ -643,7 +645,7 @@ public void testConditionalStart() throws Exception { @Timeout(1000) public void testTimerStart() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartProcess", 5); - kruntime = createKogitoProcessRuntime("BPMN2-TimerStart.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-TimerStart.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); final List list = new ArrayList<>(); @@ -662,7 +664,7 @@ public void beforeProcessStarted(ProcessStartedEvent event) { @Test public void testSignalStart() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SignalStart.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-SignalStart.bpmn2"); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { public void afterProcessStarted(ProcessStartedEvent event) { @@ -675,7 +677,7 @@ public void afterProcessStarted(ProcessStartedEvent event) { @Test public void testSignalEnd() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SignalEndEvent.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/event/BPMN2-SignalEndEvent.bpmn2"); Map params = new HashMap<>(); params.put("x", "MyValue"); kruntime.startProcess("SignalEndEvent", params); @@ -683,7 +685,7 @@ public void testSignalEnd() throws Exception { @Test public void testMessageStart() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MessageStart.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-MessageStart.bpmn2"); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { public void afterProcessStarted(ProcessStartedEvent event) { @@ -710,23 +712,23 @@ public void testMessageIntermediateThrow() throws Exception { kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler()); Map params = new HashMap<>(); params.put("x", "MyValue"); - KogitoProcessInstance processInstance = kruntime.startProcess("MessageIntermediateEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventMessage", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testSignalIntermediateThrow() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateThrowEventSignal.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventSignal.bpmn2"); Map params = new HashMap<>(); params.put("x", "MyValue"); - KogitoProcessInstance processInstance = kruntime.startProcess("SignalIntermediateEvent", params); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventSignal", params); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } @Test public void testNoneIntermediateThrow() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-IntermediateThrowEventNone.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("NoneIntermediateEvent"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/intermediate/BPMN2-IntermediateThrowEventNone.bpmn2"); + KogitoProcessInstance processInstance = kruntime.startProcess("IntermediateThrowEventNone"); assertThat(processInstance.getState()).isEqualTo(KogitoProcessInstance.STATE_COMPLETED); } diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StartEventTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/StartEventTest.java similarity index 88% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StartEventTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/StartEventTest.java index a26789a9dfb..3785a11a6d0 100755 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/StartEventTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/StartEventTest.java @@ -77,7 +77,7 @@ public void afterProcessStarted(ProcessStartedEvent event) { @Test public void testTimerStartCycleLegacy() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartProcess", 2); - kruntime = createKogitoProcessRuntime("BPMN2-TimerStartCycleLegacy.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-TimerStartCycleLegacy.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -91,14 +91,14 @@ public void beforeProcessStarted(ProcessStartedEvent event) { assertThat(list).isEmpty(); // then wait 5 times 5oo ms as that is period configured on the process countDownListener.waitTillCompleted(); - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(2); + assertThat(getNumberOfProcessInstances("TimerStartCycleLegacy")).isEqualTo(2); } @Test public void testTimerStart() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartProcess", 5); - kruntime = createKogitoProcessRuntime("BPMN2-TimerStart.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-TimerStart.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -109,22 +109,22 @@ public void beforeProcessStarted(ProcessStartedEvent event) { }); assertThat(list).isEmpty(); countDownListener.waitTillCompleted(); - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(5); + assertThat(getNumberOfProcessInstances("TimerStart")).isEqualTo(5); } @Test public void testTimerStartDateISO() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartProcess", 1); - byte[] content = Files.readAllBytes(Paths.get(this.getClass().getResource("/BPMN2-TimerStartDate.bpmn2").getPath())); + byte[] content = Files.readAllBytes(Paths.get(this.getClass().getResource("/org/jbpm/bpmn2/start/BPMN2-TimerStartDate.bpmn2").getPath())); String processContent = new String(content, "UTF-8"); OffsetDateTime plusTwoSeconds = OffsetDateTime.now().plusSeconds(2); processContent = processContent.replaceFirst("#\\{date\\}", plusTwoSeconds.toString()); Resource resource = ResourceFactory.newReaderResource(new StringReader(processContent)); - resource.setSourcePath("/BPMN2-TimerStartDate.bpmn2"); - resource.setTargetPath("/BPMN2-TimerStartDate.bpmn2"); + resource.setSourcePath("org/jbpm/bpmn2/start/BPMN2-TimerStartDate.bpmn2"); + resource.setTargetPath("org/jbpm/bpmn2/start/BPMN2-TimerStartDate.bpmn2"); kruntime = createKogitoProcessRuntime(resource); kruntime.getProcessEventManager().addEventListener(countDownListener); @@ -144,7 +144,7 @@ public void beforeProcessStarted(ProcessStartedEvent event) { @Test public void testTimerStartCycleISO() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartProcess", 6); - kruntime = createKogitoProcessRuntime("BPMN2-TimerStartISO.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-TimerStartISO.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -155,14 +155,14 @@ public void beforeProcessStarted(ProcessStartedEvent event) { }); assertThat(list).isEmpty(); countDownListener.waitTillCompleted(); - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(6); + assertThat(getNumberOfProcessInstances("TimerStartISO")).isEqualTo(6); } @Test public void testTimerStartDuration() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartProcess", 1); - kruntime = createKogitoProcessRuntime("BPMN2-TimerStartDuration.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-TimerStartDuration.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -176,14 +176,14 @@ public void beforeProcessStarted(ProcessStartedEvent event) { countDownListener.waitTillCompleted(); - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); + assertThat(getNumberOfProcessInstances("TimerStartDuration")).isEqualTo(1); } @Test public void testSignalToStartProcess() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SignalStart.bpmn2", - "BPMN2-IntermediateThrowEventSignal.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-SignalStart.bpmn2", + "org/jbpm/bpmn2/start/BPMN2-IntermediateThrowEventSignal.bpmn2"); TestWorkItemHandler handler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); @@ -197,15 +197,15 @@ public void beforeProcessStarted(ProcessStartedEvent event) { }); KogitoProcessInstance processInstance = kruntime - .startProcess("SignalIntermediateEvent"); + .startProcess("IntermediateThrowEventSignal"); assertProcessInstanceFinished(processInstance, kruntime); - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); - assertThat(getNumberOfProcessInstances("SignalIntermediateEvent")).isEqualTo(1); + assertThat(getNumberOfProcessInstances("SignalStart")).isEqualTo(1); + assertThat(getNumberOfProcessInstances("IntermediateThrowEventSignal")).isEqualTo(1); } @Test public void testSignalStart() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SignalStart.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-SignalStart.bpmn2"); final List list = new ArrayList<>(); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @Override @@ -215,14 +215,14 @@ public void beforeProcessStarted(ProcessStartedEvent event) { }); kruntime.signalEvent("MySignal", "NewValue"); - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); + assertThat(getNumberOfProcessInstances("SignalStart")).isEqualTo(1); } @Test public void testSignalStartDynamic() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-SignalStart.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-SignalStart.bpmn2"); // create KieContainer after session was created to make sure no runtime data // will be used during serialization (deep clone) KieServices ks = KieServices.Factory.get(); @@ -240,33 +240,33 @@ public void beforeProcessStarted(ProcessStartedEvent event) { }); kruntime.signalEvent("MySignal", "NewValue"); - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); + assertThat(getNumberOfProcessInstances("SignalStart")).isEqualTo(1); // now remove the process from kbase to make sure runtime based listeners are removed from signal manager - kruntime.getKieBase().removeProcess("Minimal"); + kruntime.getKieBase().removeProcess("SignalStart"); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { kruntime.signalEvent("MySignal", "NewValue"); }) - .withMessageContaining("Unknown process ID: Minimal"); + .withMessageContaining("Unknown process ID: SignalStart"); // must be still one as the process was removed - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); + assertThat(getNumberOfProcessInstances("SignalStart")).isEqualTo(1); } @Test public void testMessageStart() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MessageStart.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-MessageStart.bpmn2"); kruntime.signalEvent("Message-HelloMessage", "NewValue"); - assertThat(getNumberOfProcessInstances("Minimal")).isEqualTo(1); + assertThat(getNumberOfProcessInstances("MessageStart")).isEqualTo(1); } @Test public void testMultipleStartEventsRegularStart() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultipleStartEventProcessLongInterval.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-MultipleStartEventProcessLongInterval.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); KogitoProcessInstance processInstance = kruntime - .startProcess("MultipleStartEvents"); + .startProcess("MultipleStartEventProcessLongInterval"); assertProcessInstanceActive(processInstance); KogitoWorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -279,7 +279,7 @@ public void testMultipleStartEventsRegularStart() throws Exception { @Test public void testMultipleStartEventsStartOnTimer() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartTimer", 2); - kruntime = createKogitoProcessRuntime("BPMN2-MultipleStartEventProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-MultipleStartEventProcess.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); @@ -295,13 +295,13 @@ public void beforeProcessStarted(ProcessStartedEvent event) { assertThat(list).isEmpty(); // Timer in the process takes 500ms, so after 1 second, there should be 2 process IDs in the list. countDownListener.waitTillCompleted(); - assertThat(getNumberOfProcessInstances("MultipleStartEvents")).isEqualTo(2); + assertThat(getNumberOfProcessInstances("MultipleStartEventProcess")).isEqualTo(2); } @Test public void testMultipleEventBasedStartEventsSignalStart() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultipleEventBasedStartEventProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-MultipleEventBasedStartEventProcess.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", @@ -440,7 +440,7 @@ public void afterProcessStarted(ProcessStartedEvent event) { public void testMultipleEventBasedStartEventsStartOnTimer() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("StartTimer", 2); - kruntime = createKogitoProcessRuntime("BPMN2-MultipleEventBasedStartEventProcess.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-MultipleEventBasedStartEventProcess.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", @@ -455,21 +455,21 @@ public void beforeProcessStarted(ProcessStartedEvent event) { assertThat(list).isEmpty(); // Timer in the process takes 500ms, so after 1 second, there should be 2 process IDs in the list. countDownListener.waitTillCompleted(); - assertThat(getNumberOfProcessInstances("MultipleStartEvents")).isEqualTo(2); + assertThat(getNumberOfProcessInstances("MultipleEventBasedStartEventProcess")).isEqualTo(2); } @Test public void testTimerCycle() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("start", 5); - kruntime = createKogitoProcessRuntime("timer/BPMN2-StartTimerCycle.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-StartTimerCycle.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); StartCountingListener listener = new StartCountingListener(); kruntime.getProcessEventManager().addEventListener(listener); countDownListener.waitTillCompleted(); - assertThat(listener.getCount("start.cycle")).isEqualTo(5); + assertThat(listener.getCount("StartTimerCycle")).isEqualTo(5); } @Test @@ -498,13 +498,13 @@ public void beforeProcessStarted(ProcessStartedEvent event) { @Test public void testTimerDelay() throws Exception { NodeLeftCountDownProcessEventListener countDownListener = new NodeLeftCountDownProcessEventListener("start", 1); - kruntime = createKogitoProcessRuntime("timer/BPMN2-StartTimerDuration.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/start/BPMN2-StartTimerDuration.bpmn2"); kruntime.getProcessEventManager().addEventListener(countDownListener); StartCountingListener listener = new StartCountingListener(); kruntime.getProcessEventManager().addEventListener(listener); countDownListener.waitTillCompleted(); - assertThat(listener.getCount("start.delaying")).isEqualTo(1); + assertThat(listener.getCount("StartTimerDuration")).isEqualTo(1); } @Test diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/VariableTagsTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/VariableTagsTest.java similarity index 88% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/VariableTagsTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/VariableTagsTest.java index d749495fee9..20542c6671f 100644 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/VariableTagsTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/VariableTagsTest.java @@ -43,22 +43,22 @@ public class VariableTagsTest extends JbpmBpmn2TestCase { @Test public void testProcessWithMissingRequiredVariable() throws Exception { - kruntime = createKogitoProcessRuntime("variable-tags/approval-with-required-variable-tags.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/tags/BPMN2-ApprovalWithRequiredVariableTags.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); - assertThatExceptionOfType(VariableViolationException.class).isThrownBy(() -> kruntime.startProcess("approvals")); + assertThatExceptionOfType(VariableViolationException.class).isThrownBy(() -> kruntime.startProcess("ApprovalWithRequiredVariableTags")); } @Test public void testProcessWithRequiredVariable() throws Exception { - kruntime = createKogitoProcessRuntime("variable-tags/approval-with-required-variable-tags.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/tags/BPMN2-ApprovalWithRequiredVariableTags.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map parameters = new HashMap<>(); parameters.put("approver", "john"); - KogitoProcessInstance processInstance = kruntime.startProcess("approvals", parameters); + KogitoProcessInstance processInstance = kruntime.startProcess("ApprovalWithRequiredVariableTags", parameters); assertThat(processInstance.getState()).isEqualTo(STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -71,14 +71,14 @@ public void testProcessWithRequiredVariable() throws Exception { @Test public void testProcessWithReadonlyVariable() throws Exception { - kruntime = createKogitoProcessRuntime("variable-tags/approval-with-readonly-variable-tags.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/tags/BPMN2-ApprovalWithReadonlyVariableTags.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); Map parameters = new HashMap<>(); parameters.put("approver", "john"); - KogitoProcessInstance processInstance = kruntime.startProcess("approvals", parameters); + KogitoProcessInstance processInstance = kruntime.startProcess("ApprovalWithReadonlyVariableTags", parameters); assertThat(processInstance.getState()).isEqualTo(STATE_ACTIVE); KogitoWorkItem workItem = workItemHandler.getWorkItem(); assertThat(workItem).isNotNull(); @@ -93,7 +93,7 @@ public void testProcessWithReadonlyVariable() throws Exception { @Test public void testProcessWithCustomVariableTag() throws Exception { - kruntime = createKogitoProcessRuntime("variable-tags/approval-with-custom-variable-tags.bpmn2"); + kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/tags/BPMN2-ApprovalWithCustomVariableTags.bpmn2"); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); kruntime.getProcessEventManager().addEventListener(new DefaultKogitoProcessEventListener() { @@ -110,12 +110,12 @@ public void beforeVariableChanged(ProcessVariableChangedEvent event) { Map parameters = new HashMap<>(); parameters.put("approver", "john"); - assertThatExceptionOfType(VariableViolationException.class).isThrownBy(() -> kruntime.startProcess("approvals", parameters)); + assertThatExceptionOfType(VariableViolationException.class).isThrownBy(() -> kruntime.startProcess("ApprovalWithCustomVariableTags", parameters)); } @Test public void testRequiredVariableFiltering() { - List processes = BpmnProcess.from(new ClassPathResource("variable-tags/approval-with-custom-variable-tags.bpmn2")); + List processes = BpmnProcess.from(new ClassPathResource("org/jbpm/bpmn2/tags/BPMN2-ApprovalWithCustomVariableTags.bpmn2")); BpmnProcess process = processes.get(0); Map params = new HashMap<>(); params.put("approver", "john"); diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/audit/KogitoWorkingMemoryInMemoryLogger.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/audit/KogitoWorkingMemoryInMemoryLogger.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/audit/KogitoWorkingMemoryInMemoryLogger.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/audit/KogitoWorkingMemoryInMemoryLogger.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/concurrency/MultipleProcessesPerThreadTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/concurrency/MultipleProcessesPerThreadTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/concurrency/MultipleProcessesPerThreadTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/concurrency/MultipleProcessesPerThreadTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/concurrency/OneProcessPerThreadTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/concurrency/OneProcessPerThreadTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/concurrency/OneProcessPerThreadTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/concurrency/OneProcessPerThreadTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/ErrornousWorkItemHandler.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/handler/ErrornousWorkItemHandler.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/ErrornousWorkItemHandler.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/handler/ErrornousWorkItemHandler.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/handler/LoggingTaskHandlerWrapperTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/WorkItemHandlerExceptionHandlingTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/handler/WorkItemHandlerExceptionHandlingTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/handler/WorkItemHandlerExceptionHandlingTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/handler/WorkItemHandlerExceptionHandlingTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Account.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Account.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Account.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Account.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Address.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Address.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Address.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Address.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/ExceptionOnPurposeHandler.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/ExceptionOnPurposeHandler.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/ExceptionOnPurposeHandler.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/ExceptionOnPurposeHandler.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/ExceptionService.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/ExceptionService.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/ExceptionService.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/ExceptionService.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/HelloService.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/HelloService.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/HelloService.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/HelloService.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/MyError.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/MyError.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/MyError.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/MyError.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/NotAvailableGoodsReport.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/NotAvailableGoodsReport.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/NotAvailableGoodsReport.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/NotAvailableGoodsReport.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Order.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Order.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Order.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Order.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Person.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Person.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Person.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Person.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Status.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Status.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/Status.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/Status.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/TestWorkItemHandler.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/TestWorkItemHandler.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/objects/TestWorkItemHandler.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/objects/TestWorkItemHandler.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/structureref/StructureRefTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/structureref/StructureRefTest.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/structureref/StructureRefTest.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/structureref/StructureRefTest.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/test/RequireLocking.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/test/RequireLocking.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/test/RequireLocking.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/test/RequireLocking.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/test/RequirePersistence.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/test/RequirePersistence.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/test/RequirePersistence.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/test/RequirePersistence.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/test/TestWorkItemManagerFactory.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/test/TestWorkItemManagerFactory.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/test/TestWorkItemManagerFactory.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/test/TestWorkItemManagerFactory.java diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/memory/SerializableResult.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/memory/SerializableResult.java similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/memory/SerializableResult.java rename to jbpm/jbpm-tests/src/test/java/org/jbpm/memory/SerializableResult.java diff --git a/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ProcessTestHelper.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ProcessTestHelper.java new file mode 100644 index 00000000000..d191f061931 --- /dev/null +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ProcessTestHelper.java @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.test.utils; + +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import org.kie.kogito.Application; +import org.kie.kogito.Model; +import org.kie.kogito.StaticApplication; +import org.kie.kogito.StaticConfig; +import org.kie.kogito.auth.SecurityPolicy; +import org.kie.kogito.internal.process.event.KogitoProcessEventListener; +import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler; +import org.kie.kogito.process.ProcessConfig; +import org.kie.kogito.process.ProcessInstance; +import org.kie.kogito.process.WorkItem; +import org.kie.kogito.process.bpmn2.BpmnProcesses; +import org.kie.kogito.process.impl.DefaultProcessEventListenerConfig; +import org.kie.kogito.process.impl.DefaultWorkItemHandlerConfig; +import org.kie.kogito.process.impl.StaticProcessConfig; +import org.kie.kogito.services.uow.CollectingUnitOfWorkFactory; +import org.kie.kogito.services.uow.DefaultUnitOfWorkManager; + +import static java.util.Collections.emptyList; + +public class ProcessTestHelper { + + public static Application newApplication() { + BpmnProcesses bpmnProcesses = new BpmnProcesses(); + StaticProcessConfig staticConfig = + new StaticProcessConfig(new DefaultWorkItemHandlerConfig(), new DefaultProcessEventListenerConfig(), new DefaultUnitOfWorkManager(new CollectingUnitOfWorkFactory())); + return new StaticApplication(new StaticConfig(null, staticConfig), bpmnProcesses); + } + + public static void registerProcessEventListener(Application app, KogitoProcessEventListener kogitoProcessEventListener) { + ((DefaultProcessEventListenerConfig) app.config().get(ProcessConfig.class).processEventListeners()).register(kogitoProcessEventListener); + } + + public static void registerHandler(Application app, String handlerName, KogitoWorkItemHandler handler) { + ((DefaultWorkItemHandlerConfig) app.config().get(ProcessConfig.class).workItemHandlers()).register(handlerName, handler); + } + + public static void completeWorkItem(ProcessInstance processInstance, String userName, Map outputVars) { + completeWorkItem(processInstance, userName, outputVars, item -> { + }); + } + + public static void completeWorkItem(ProcessInstance processInstance, String userName, Map outputVars, Consumer workItem) { + List workItems = processInstance.workItems(SecurityPolicy.of(userName, emptyList())); + workItems.stream().findFirst().ifPresent(e -> { + workItem.accept(e); + processInstance.completeWorkItem(e.getId(), outputVars, SecurityPolicy.of(userName, emptyList())); + }); + } + + public static WorkItem findWorkItem(ProcessInstance processInstance, String userName) { + List workItems = processInstance.workItems(SecurityPolicy.of(userName, emptyList())); + return workItems.stream().findFirst().get(); + } + +} diff --git a/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ReceiveTaskTestHandler.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ReceiveTaskTestHandler.java new file mode 100644 index 00000000000..b05f6b16e62 --- /dev/null +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ReceiveTaskTestHandler.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.test.utils; + +import java.util.HashMap; +import java.util.Map; + +import org.kie.kogito.internal.process.runtime.KogitoWorkItem; +import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler; +import org.kie.kogito.internal.process.runtime.KogitoWorkItemManager; + +public class ReceiveTaskTestHandler implements KogitoWorkItemHandler { + + // TODO: use correlation instead of message id + private Map waiting = new HashMap<>(); + + private KogitoWorkItemManager manager; + + public void executeWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) { + this.manager = manager; + String messageId = (String) workItem.getParameter("MessageId"); + waiting.put(messageId, workItem.getStringId()); + } + + public void messageReceived(String messageId, Object message) { + String workItemId = waiting.get(messageId); + if (workItemId == null) { + return; + } + Map results = new HashMap<>(); + results.put("Message", message); + manager.completeWorkItem(workItemId, results); + } + + public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) { + String messageId = (String) workItem.getParameter("MessageId"); + waiting.remove(messageId); + } + +} diff --git a/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/SendTaskTestHandler.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/SendTaskTestHandler.java new file mode 100644 index 00000000000..d6b7b92eeed --- /dev/null +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/SendTaskTestHandler.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.test.utils; + +import org.kie.kogito.internal.process.runtime.KogitoWorkItem; +import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler; +import org.kie.kogito.internal.process.runtime.KogitoWorkItemManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SendTaskTestHandler implements KogitoWorkItemHandler { + + private static final Logger logger = LoggerFactory.getLogger(SendTaskTestHandler.class); + + private String lastMessage; + private boolean sent = false; + + public void executeWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) { + String message = (String) workItem.getParameter("Message"); + this.lastMessage = message; + this.sent = true; + logger.debug("Sending message: {}", message); + manager.completeWorkItem(workItem.getStringId(), null); + + } + + public void abortWorkItem(KogitoWorkItem workItem, KogitoWorkItemManager manager) { + // Do nothing, cannot be aborted + } + + public String lastMessage() { + return this.lastMessage; + } + + public boolean isSent() { + return sent; + } +} diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocRules.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocRules.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocRules.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocRules.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcess.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcess.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcess.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcess.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcessAutoComplete.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcessAutoComplete.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcessAutoComplete.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcessAutoComplete.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcessAutoCompleteExpression.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcessAutoCompleteExpression.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcessAutoCompleteExpression.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcessAutoCompleteExpression.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcessEmptyCompleteExpression.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcessEmptyCompleteExpression.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocSubProcessEmptyCompleteExpression.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocSubProcessEmptyCompleteExpression.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocTerminateEndEvent.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocTerminateEndEvent.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AdHocTerminateEndEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AdHocTerminateEndEvent.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AgendaFilter.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-AgendaFilter.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AgendaFilter.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AgendaFilter.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AgendaFilter.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-AgendaFilter.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-AgendaFilter.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-AgendaFilter.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BooleanStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BooleanStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BooleanStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BooleanStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithoutStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithoutStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithoutStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryErrorEventDefaultHandlerWithoutErrorCodeWithoutStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventSubProcessExceptionMapping.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryErrorEventSubProcessExceptionMapping.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryErrorEventSubProcessExceptionMapping.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryErrorEventSubProcessExceptionMapping.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundarySignalEventOnTaskWithTransformation.bpmn b/jbpm/jbpm-tests/src/test/resources/BPMN2-BoundarySignalEventOnTaskWithTransformation.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundarySignalEventOnTaskWithTransformation.bpmn rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BoundarySignalEventOnTaskWithTransformation.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundarySignalWithNameEventOnTaskbpmn2.bpmn b/jbpm/jbpm-tests/src/test/resources/BPMN2-BoundarySignalWithNameEventOnTaskbpmn2.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundarySignalWithNameEventOnTaskbpmn2.bpmn rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BoundarySignalWithNameEventOnTaskbpmn2.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryTimerCycleCron.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryTimerCycleCron.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryTimerCycleCron.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryTimerCycleCron.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryTimerCycleCronVariable.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryTimerCycleCronVariable.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BoundaryTimerCycleCronVariable.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BoundaryTimerCycleCronVariable.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BrokenStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BrokenStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BrokenStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BrokenStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTask.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTask.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTask.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTask.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskDynamic.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskDynamic.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskDynamic.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskDynamic.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskInfiniteLoop.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskInfiniteLoop.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskInfiniteLoop.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskInfiniteLoop.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskLoop.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskLoop.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskLoop.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskLoop.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInput.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputIOExpression.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputIOExpression.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputIOExpression.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputIOExpression.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputLoop.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputLoop.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputLoop.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputLoop.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputs.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputs.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputs.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDataInputs.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithException.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithException.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BusinessRuleTaskWithException.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithException.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BuyerProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-BuyerProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-BuyerProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-BuyerProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityByName.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivityByName.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityByName.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivityByName.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityMISequential.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivityMISequential.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityMISequential.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivityMISequential.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySkipAbortParent.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivitySkipAbortParent.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySkipAbortParent.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivitySkipAbortParent.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcessV2.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivitySubProcessV2.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivitySubProcessV2.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivitySubProcessV2.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityWithTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivityWithTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-CallActivityWithTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-CallActivityWithTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalEventRuleTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ConditionalEventRuleTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalEventRuleTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ConditionalEventRuleTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalEventRuleTask.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-ConditionalEventRuleTask.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalEventRuleTask.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ConditionalEventRuleTask.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ConditionalFlowWithoutGateway.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalStart.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ConditionalStart.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ConditionalStart.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ConditionalStart.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-two-assigns.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-DataInputAssociations-two-assigns.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataInputAssociations-two-assigns.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-DataInputAssociations-two-assigns.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations-HumanTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-DataOutputAssociations-HumanTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DataOutputAssociations-HumanTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-DataOutputAssociations-HumanTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DefaultObjectStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-DefaultObjectStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DefaultObjectStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-DefaultObjectStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DroolsDeclaredTypeSequenceFlowExpressionTest.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-DroolsDeclaredTypeSequenceFlowExpressionTest.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-DroolsDeclaredTypeSequenceFlowExpressionTest.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-DroolsDeclaredTypeSequenceFlowExpressionTest.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ErrorBoundaryEventOnBusinessRuleTask.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnServiceTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ErrorBoundaryEventOnServiceTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ErrorBoundaryEventOnServiceTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ErrorBoundaryEventOnServiceTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessConditional.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-EventSubprocessConditional.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessConditional.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-EventSubprocessConditional.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessMessage.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-EventSubprocessMessage.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessMessage.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-EventSubprocessMessage.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalWithTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-EventSubprocessSignalWithTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-EventSubprocessSignalWithTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-EventSubprocessSignalWithTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExceptionServiceProcess-ErrorSignalling.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExceptionServiceProcess-ErrorSignalling.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExceptionServiceProcess-ErrorSignalling.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExceptionServiceProcess-ErrorSignalling.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExceptionServiceProcess-Signalling.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExceptionServiceProcess-Signalling.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExceptionServiceProcess-Signalling.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExceptionServiceProcess-Signalling.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExceptionThrowingServiceProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExceptionThrowingServiceProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExceptionThrowingServiceProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExceptionThrowingServiceProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveGatewayWithNoConditionsDefined.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveGatewayWithNoConditionsDefined.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveGatewayWithNoConditionsDefined.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveGatewayWithNoConditionsDefined.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitDefault.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitDefault.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitDefault.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitDefault.bpmn2 index 567965e52d4..0300e7c10fb 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitDefault.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitDefault.bpmn2 @@ -13,7 +13,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitDefaultNoCondition.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitDefaultNoCondition.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitDefaultNoCondition.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitDefaultNoCondition.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-vars-not-signaled.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-vars-not-signaled.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-vars-not-signaled.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-vars-not-signaled.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-with-vars.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-with-vars.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-with-vars.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced-with-vars.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitXPath-advanced.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitXPath.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitXPath.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ExclusiveSplitXPath.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ExclusiveSplitXPath.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-FloatStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-FloatStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-FloatStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-FloatStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GatewayFEEL-wrong.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-GatewayFEEL-wrong.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GatewayFEEL-wrong.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-GatewayFEEL-wrong.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GatewaySplit-SequenceConditions.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-GatewaySplit-SequenceConditions.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GatewaySplit-SequenceConditions.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-GatewaySplit-SequenceConditions.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GlobalTimerInterrupted.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-GlobalTimerInterrupted.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-GlobalTimerInterrupted.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-GlobalTimerInterrupted.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitDefault.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-InclusiveSplitDefault.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitDefault.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-InclusiveSplitDefault.bpmn2 index 480b097eb1c..0042dd69a40 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InclusiveSplitDefault.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-InclusiveSplitDefault.bpmn2 @@ -12,7 +12,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Incremental-Build-Invalid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-Incremental-Build-Invalid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Incremental-Build-Invalid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-Incremental-Build-Invalid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Incremental-Build-Valid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-Incremental-Build-Valid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-Incremental-Build-Valid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-Incremental-Build-Valid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntegerStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntegerStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntegerStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntegerStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventMessageWithTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventMessageWithTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventMessageWithTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventMessageWithTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventNoIncommingConnection.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventNoIncommingConnection.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventNoIncommingConnection.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventNoIncommingConnection.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignal2.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventSignal2.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignal2.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventSignal2.bpmn2 index 42ade6ec52a..543a5d03f05 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignal2.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventSignal2.bpmn2 @@ -14,7 +14,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventSignalWithTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventSignalWithTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventSignalWithTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle3.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle3.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle3.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventTimerCycle3.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleCron.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleCron.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleCron.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventTimerCycleCron.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDurationWithError.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventTimerDurationWithError.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchEventTimerDurationWithError.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchEventTimerDurationWithError.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchSignalBetweenUserTasks.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchSignalBetweenUserTasks.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateCatchSignalBetweenUserTasks.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateCatchSignalBetweenUserTasks.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventMessage.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateThrowEventMessage.bpmn2 similarity index 93% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventMessage.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateThrowEventMessage.bpmn2 index 44b7c31198d..d8314d480b7 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventMessage.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateThrowEventMessage.bpmn2 @@ -16,7 +16,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventMessageWithTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateThrowEventMessageWithTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventMessageWithTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateThrowEventMessageWithTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignalWithTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateThrowEventSignalWithTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-IntermediateThrowEventSignalWithTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-IntermediateThrowEventSignalWithTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InvalidServiceProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-InvalidServiceProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-InvalidServiceProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-InvalidServiceProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MessageEndEvent.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MessageEndEvent.bpmn2 similarity index 96% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MessageEndEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MessageEndEvent.bpmn2 index 808b8c20712..d689a2f10fa 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MessageEndEvent.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-MessageEndEvent.bpmn2 @@ -16,7 +16,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiErrorBoundaryEventsOnBusinessRuleTask.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopBoundaryTimer.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopBoundaryTimer.bpmn2 similarity index 97% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopBoundaryTimer.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopBoundaryTimer.bpmn2 index 0226e3351d9..09d7e0304c1 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopBoundaryTimer.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopBoundaryTimer.bpmn2 @@ -16,7 +16,8 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessSequential.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessSequential.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessSequential.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessSequential.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputAndScripts.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputAndScripts.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputAndScripts.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputAndScripts.bpmn2 index 1740d38c907..8cd53c2a700 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputAndScripts.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsProcessWithOutputAndScripts.bpmn2 @@ -4,7 +4,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskSequential.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskSequential.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskSequential.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskSequential.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCondSequential.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCondSequential.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCondSequential.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutputCmpCondSequential.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiThreadServiceProcess-Task.bpmn b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiThreadServiceProcess-Task.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiThreadServiceProcess-Task.bpmn rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiThreadServiceProcess-Task.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiThreadServiceProcess-Timer.bpmn b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiThreadServiceProcess-Timer.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiThreadServiceProcess-Timer.bpmn rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiThreadServiceProcess-Timer.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiThreadServiceProcess.bpmn b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultiThreadServiceProcess.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultiThreadServiceProcess.bpmn rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultiThreadServiceProcess.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleBoundaryTimerCycleCronVariable.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleBoundaryTimerCycleCronVariable.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleBoundaryTimerCycleCronVariable.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleBoundaryTimerCycleCronVariable.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleFlowEndNode.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleFlowEndNode.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleFlowEndNode.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleFlowEndNode.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleInOutgoingSequenceFlows.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleInOutgoingSequenceFlows.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleInOutgoingSequenceFlows.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleInOutgoingSequenceFlows.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleRuleTasks.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleRuleTasks.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleRuleTasks.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleRuleTasks.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleRuleTasksWithDataInput.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleRuleTasksWithDataInput.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleRuleTasksWithDataInput.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleRuleTasksWithDataInput.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleStartEventProcessDifferentPaths.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleStartEventProcessDifferentPaths.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-MultipleStartEventProcessDifferentPaths.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-MultipleStartEventProcessDifferentPaths.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-NullVariableInScriptTaskProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-NullVariableInScriptTaskProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-NullVariableInScriptTaskProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-NullVariableInScriptTaskProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ObjectStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ObjectStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ObjectStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ObjectStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ParentProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ParentProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ParentProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ParentProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessEmptyScript.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ProcessEmptyScript.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ProcessEmptyScript.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ProcessEmptyScript.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask2.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask2.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask2.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask2.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask2.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask2.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask2.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask2.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask3.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask3.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTask3.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask3.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskSetVariable.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskSetVariable.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskSetVariable.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskSetVariable.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskSetVariableReconnect.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskSetVariableReconnect.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskSetVariableReconnect.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskSetVariableReconnect.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskWithFact.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskWithFact.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskWithFact.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskWithFact.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskWithTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskWithTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskWithTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskWithTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskWithTransformation.drl b/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskWithTransformation.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-RuleTaskWithTransformation.drl rename to jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTaskWithTransformation.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScannerChangeSet.bpmn b/jbpm/jbpm-tests/src/test/resources/BPMN2-ScannerChangeSet.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScannerChangeSet.bpmn rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ScannerChangeSet.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScannerChangeSet2.bpmn b/jbpm/jbpm-tests/src/test/resources/BPMN2-ScannerChangeSet2.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ScannerChangeSet2.bpmn rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ScannerChangeSet2.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithCustomTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithCustomTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithCustomTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithCustomTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithMvelCollectionTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithMvelCollectionTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithMvelCollectionTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithMvelCollectionTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithMvelJaxbTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithMvelJaxbTransformation.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithMvelJaxbTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithMvelJaxbTransformation.bpmn2 index f4d4503a87d..3a244f9bf44 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithMvelJaxbTransformation.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithMvelJaxbTransformation.bpmn2 @@ -21,7 +21,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithMvelTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithMvelTransformation.bpmn2 similarity index 98% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithMvelTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithMvelTransformation.bpmn2 index 79fddcf11e3..aa0102f1446 100755 --- a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceProcessWithMvelTransformation.bpmn2 +++ b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceProcessWithMvelTransformation.bpmn2 @@ -21,7 +21,7 @@ - + diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceTask-web-service.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceTask-web-service.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceTask-web-service.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceTask-web-service.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-ServiceTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-ServiceTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalStartWithTransformation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-SignalStartWithTransformation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SignalStartWithTransformation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-SignalStartWithTransformation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SimpleXMLProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-SimpleXMLProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SimpleXMLProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-SimpleXMLProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SingalStartWithCustomEvent.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-SingalStartWithCustomEvent.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SingalStartWithCustomEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-SingalStartWithCustomEvent.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-StartEventWithMultipleOutgoingFlows.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-StartEventWithMultipleOutgoingFlows.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-StartEventWithMultipleOutgoingFlows.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-StartEventWithMultipleOutgoingFlows.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-StartTimerCycle.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-StartTimerCycle.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-StartTimerCycle.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-StartTimerCycle.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-StringStructureRef.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-StringStructureRef.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-StringStructureRef.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-StringStructureRef.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessInvalid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-SubProcessInvalid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessInvalid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-SubProcessInvalid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessUserTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-SubProcessUserTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessUserTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-SubProcessUserTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWithTimer.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-SubProcessWithTimer.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWithTimer.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-SubProcessWithTimer.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWrongStartEvent.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-SubProcessWrongStartEvent.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-SubProcessWrongStartEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-SubProcessWrongStartEvent.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerInterrupted.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-TimerInterrupted.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerInterrupted.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-TimerInterrupted.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStart2.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-TimerStart2.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStart2.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-TimerStart2.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartCron.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-TimerStartCron.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-TimerStartCron.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-TimerStartCron.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-WorkingMessageModel.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-WorkingMessageModel.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-WorkingMessageModel.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-WorkingMessageModel.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-XMLProcessWithError.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-XMLProcessWithError.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-XMLProcessWithError.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-XMLProcessWithError.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-XMLProcessWithErrorInCompositeNode.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-XMLProcessWithErrorInCompositeNode.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-XMLProcessWithErrorInCompositeNode.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-XMLProcessWithErrorInCompositeNode.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-XpathExpression.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-XpathExpression.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-XpathExpression.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-XpathExpression.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-gatewayTest.bpmn2 b/jbpm/jbpm-tests/src/test/resources/BPMN2-gatewayTest.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-gatewayTest.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/BPMN2-gatewayTest.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/META-INF/BPMN2WorkDefinitions.conf b/jbpm/jbpm-tests/src/test/resources/META-INF/BPMN2WorkDefinitions.conf similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/META-INF/BPMN2WorkDefinitions.conf rename to jbpm/jbpm-tests/src/test/resources/META-INF/BPMN2WorkDefinitions.conf diff --git a/jbpm/jbpm-bpmn2/src/test/resources/META-INF/kie.properties.conf b/jbpm/jbpm-tests/src/test/resources/META-INF/kie.properties.conf similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/META-INF/kie.properties.conf rename to jbpm/jbpm-tests/src/test/resources/META-INF/kie.properties.conf diff --git a/jbpm/jbpm-bpmn2/src/test/resources/MultipleSubprocessWithSignalStartEvent.bpmn2 b/jbpm/jbpm-tests/src/test/resources/MultipleSubprocessWithSignalStartEvent.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/MultipleSubprocessWithSignalStartEvent.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/MultipleSubprocessWithSignalStartEvent.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/PrefixesProcessIdCallActivity.bpmn2 b/jbpm/jbpm-tests/src/test/resources/PrefixesProcessIdCallActivity.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/PrefixesProcessIdCallActivity.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/PrefixesProcessIdCallActivity.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/SubprocessWithTimer.bpmn2 b/jbpm/jbpm-tests/src/test/resources/SubprocessWithTimer.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/SubprocessWithTimer.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/SubprocessWithTimer.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/async/AsyncProcess.bpmn b/jbpm/jbpm-tests/src/test/resources/async/AsyncProcess.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/async/AsyncProcess.bpmn rename to jbpm/jbpm-tests/src/test/resources/async/AsyncProcess.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/build/sample.bpmn b/jbpm/jbpm-tests/src/test/resources/build/sample.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/build/sample.bpmn rename to jbpm/jbpm-tests/src/test/resources/build/sample.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/build/sample2.bpmn b/jbpm/jbpm-tests/src/test/resources/build/sample2.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/build/sample2.bpmn rename to jbpm/jbpm-tests/src/test/resources/build/sample2.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-EventSubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/compensation/BPMN2-Compensation-EventSubProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/BPMN2-Compensation-EventSubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/compensation/BPMN2-Compensation-EventSubProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-EventSubProcess-OnlyIn-SubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-EventSubProcess-OnlyIn-SubProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-EventSubProcess-OnlyIn-SubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-EventSubProcess-OnlyIn-SubProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-StartEvent-OnlyIn-SubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-StartEvent-OnlyIn-SubProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-StartEvent-OnlyIn-SubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/compensation/bad/BPMN2-Bad-Compensation-StartEvent-OnlyIn-SubProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/unimplemented/BPMN2-Compensation-Transaction.bpmn2 b/jbpm/jbpm-tests/src/test/resources/compensation/unimplemented/BPMN2-Compensation-Transaction.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/unimplemented/BPMN2-Compensation-Transaction.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/compensation/unimplemented/BPMN2-Compensation-Transaction.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/compensation/unimplemented/BPMN2-TravelBookingExample.bpmn2 b/jbpm/jbpm-tests/src/test/resources/compensation/unimplemented/BPMN2-TravelBookingExample.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/compensation/unimplemented/BPMN2-TravelBookingExample.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/compensation/unimplemented/BPMN2-TravelBookingExample.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process1.bpmn2 b/jbpm/jbpm-tests/src/test/resources/correlationkey/Process1.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process1.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/correlationkey/Process1.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process2.bpmn2 b/jbpm/jbpm-tests/src/test/resources/correlationkey/Process2.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process2.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/correlationkey/Process2.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process3.bpmn2 b/jbpm/jbpm-tests/src/test/resources/correlationkey/Process3.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process3.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/correlationkey/Process3.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process4.bpmn2 b/jbpm/jbpm-tests/src/test/resources/correlationkey/Process4.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process4.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/correlationkey/Process4.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process5.bpmn2 b/jbpm/jbpm-tests/src/test/resources/correlationkey/Process5.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/correlationkey/Process5.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/correlationkey/Process5.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/dmn/0020-vacation-days.dmn b/jbpm/jbpm-tests/src/test/resources/dmn/0020-vacation-days.dmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/dmn/0020-vacation-days.dmn rename to jbpm/jbpm-tests/src/test/resources/dmn/0020-vacation-days.dmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMN.bpmn2 b/jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMN.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMN.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMN.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNByDecisionName.bpmn2 b/jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNByDecisionName.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNByDecisionName.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNByDecisionName.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNModelById.bpmn2 b/jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNModelById.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNModelById.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNModelById.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNMultipleDecisionsOutput.bpmn2 b/jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNMultipleDecisionsOutput.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNMultipleDecisionsOutput.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNMultipleDecisionsOutput.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/error/EndError.bpmn2 b/jbpm/jbpm-tests/src/test/resources/error/EndError.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/error/EndError.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/error/EndError.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/error/ErrorVariable.bpmn2 b/jbpm/jbpm-tests/src/test/resources/error/ErrorVariable.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/error/ErrorVariable.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/error/ErrorVariable.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventWithTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/escalation/BPMN2-EscalationBoundaryEventWithTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EscalationBoundaryEventWithTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/escalation/BPMN2-EscalationBoundaryEventWithTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EventSubprocessEscalation.bpmn2 b/jbpm/jbpm-tests/src/test/resources/escalation/BPMN2-EventSubprocessEscalation.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/escalation/BPMN2-EventSubprocessEscalation.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/escalation/BPMN2-EventSubprocessEscalation.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/handler/BPMN2-ReceiveTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/handler/BPMN2-ReceiveTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/handler/BPMN2-ReceiveTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/handler/BPMN2-ReceiveTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/handler/BPMN2-ScriptTask.bpmn2 b/jbpm/jbpm-tests/src/test/resources/handler/BPMN2-ScriptTask.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/handler/BPMN2-ScriptTask.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/handler/BPMN2-ScriptTask.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithBooleanOutput.bpmn2 b/jbpm/jbpm-tests/src/test/resources/handler/BPMN2-UserTaskWithBooleanOutput.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/BPMN2-UserTaskWithBooleanOutput.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/handler/BPMN2-UserTaskWithBooleanOutput.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/handler/onboarding.bpmn b/jbpm/jbpm-tests/src/test/resources/handler/onboarding.bpmn similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/handler/onboarding.bpmn rename to jbpm/jbpm-tests/src/test/resources/handler/onboarding.bpmn diff --git a/jbpm/jbpm-bpmn2/src/test/resources/jndi.properties b/jbpm/jbpm-tests/src/test/resources/jndi.properties similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/jndi.properties rename to jbpm/jbpm-tests/src/test/resources/jndi.properties diff --git a/jbpm/jbpm-bpmn2/src/test/resources/logback-debug.xml b/jbpm/jbpm-tests/src/test/resources/logback-debug.xml similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/logback-debug.xml rename to jbpm/jbpm-tests/src/test/resources/logback-debug.xml diff --git a/jbpm/jbpm-bpmn2/src/test/resources/logback-test.xml b/jbpm/jbpm-tests/src/test/resources/logback-test.xml similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/logback-test.xml rename to jbpm/jbpm-tests/src/test/resources/logback-test.xml diff --git a/jbpm/jbpm-bpmn2/src/test/resources/memory/BPMN2-RuleTaskWithInsertProcessInstance.bpmn2 b/jbpm/jbpm-tests/src/test/resources/memory/BPMN2-RuleTaskWithInsertProcessInstance.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/memory/BPMN2-RuleTaskWithInsertProcessInstance.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/memory/BPMN2-RuleTaskWithInsertProcessInstance.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/memory/ProcessInstanceRule.drl b/jbpm/jbpm-tests/src/test/resources/memory/ProcessInstanceRule.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/memory/ProcessInstanceRule.drl rename to jbpm/jbpm-tests/src/test/resources/memory/ProcessInstanceRule.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/rules-timer.drl b/jbpm/jbpm-tests/src/test/resources/rules-timer.drl similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/rules-timer.drl rename to jbpm/jbpm-tests/src/test/resources/rules-timer.drl diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-InvalidEmdeddedSubProcess.bpmn2 b/jbpm/jbpm-tests/src/test/resources/subprocess/BPMN2-InvalidEmdeddedSubProcess.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/BPMN2-InvalidEmdeddedSubProcess.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/subprocess/BPMN2-InvalidEmdeddedSubProcess.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/subprocess/EventSubprocessErrorHandlingWithOutErrorCode.bpmn2 b/jbpm/jbpm-tests/src/test/resources/subprocess/EventSubprocessErrorHandlingWithOutErrorCode.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/subprocess/EventSubprocessErrorHandlingWithOutErrorCode.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/subprocess/EventSubprocessErrorHandlingWithOutErrorCode.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-CronTimerWithEventBasedGateway.bpmn2 b/jbpm/jbpm-tests/src/test/resources/timer/BPMN2-CronTimerWithEventBasedGateway.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-CronTimerWithEventBasedGateway.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/timer/BPMN2-CronTimerWithEventBasedGateway.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerCycleInvalid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/timer/BPMN2-StartTimerCycleInvalid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerCycleInvalid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/timer/BPMN2-StartTimerCycleInvalid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerDateInvalid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/timer/BPMN2-StartTimerDateInvalid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerDateInvalid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/timer/BPMN2-StartTimerDateInvalid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerDurationInvalid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/timer/BPMN2-StartTimerDurationInvalid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-StartTimerDurationInvalid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/timer/BPMN2-StartTimerDurationInvalid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-TimerBoundaryEventCycleInvalid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/timer/BPMN2-TimerBoundaryEventCycleInvalid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-TimerBoundaryEventCycleInvalid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/timer/BPMN2-TimerBoundaryEventCycleInvalid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-TimerBoundaryEventDateInvalid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/timer/BPMN2-TimerBoundaryEventDateInvalid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-TimerBoundaryEventDateInvalid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/timer/BPMN2-TimerBoundaryEventDateInvalid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-TimerBoundaryEventDurationInvalid.bpmn2 b/jbpm/jbpm-tests/src/test/resources/timer/BPMN2-TimerBoundaryEventDurationInvalid.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/timer/BPMN2-TimerBoundaryEventDurationInvalid.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/timer/BPMN2-TimerBoundaryEventDurationInvalid.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/xxe-protection/BPMN2-XXE-Process.bpmn2 b/jbpm/jbpm-tests/src/test/resources/xxe-protection/BPMN2-XXE-Process.bpmn2 similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/xxe-protection/BPMN2-XXE-Process.bpmn2 rename to jbpm/jbpm-tests/src/test/resources/xxe-protection/BPMN2-XXE-Process.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/test/resources/xxe-protection/Text1.txt b/jbpm/jbpm-tests/src/test/resources/xxe-protection/Text1.txt similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/xxe-protection/Text1.txt rename to jbpm/jbpm-tests/src/test/resources/xxe-protection/Text1.txt diff --git a/jbpm/jbpm-bpmn2/src/test/resources/xxe-protection/Text2.txt b/jbpm/jbpm-tests/src/test/resources/xxe-protection/Text2.txt similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/xxe-protection/Text2.txt rename to jbpm/jbpm-tests/src/test/resources/xxe-protection/Text2.txt diff --git a/jbpm/jbpm-bpmn2/src/test/resources/xxe-protection/external.dtd b/jbpm/jbpm-tests/src/test/resources/xxe-protection/external.dtd similarity index 100% rename from jbpm/jbpm-bpmn2/src/test/resources/xxe-protection/external.dtd rename to jbpm/jbpm-tests/src/test/resources/xxe-protection/external.dtd diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/pom.xml b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/pom.xml new file mode 100644 index 00000000000..41765f07c8b --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + + org.kie.kogito + jbpm-tools + 999-SNAPSHOT + + + jbpm-tools-maven-plugin + maven-plugin + + Kogito :: jBPM :: Tools :: Maven + jBPM Tools Maven + + + UTF-8 + org.kie.kogito.jbpm.tools.maven + + + + + org.kie.kogito + jbpm-bpmn2 + + + org.apache.maven + maven-plugin-api + provided + + + org.apache.maven.plugin-tools + maven-plugin-annotations + provided + + + org.apache.maven + maven-core + provided + + + org.apache.maven + maven-project + provided + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + org.apache.maven.plugin-testing + maven-plugin-testing-harness + test + + + com.google.collections + google-collections + test + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + + descriptor + + + true + jbpm-tools + + + + + diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodeGenerationSupport.java b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodeGenerationSupport.java new file mode 100644 index 00000000000..8fa641bf94f --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodeGenerationSupport.java @@ -0,0 +1,232 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.tools.maven; + +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; + +import org.apache.maven.plugin.MojoExecutionException; +import org.drools.io.FileSystemResource; +import org.jbpm.bpmn2.xml.BPMNDISemanticModule; +import org.jbpm.bpmn2.xml.BPMNExtensionsSemanticModule; +import org.jbpm.bpmn2.xml.BPMNSemanticModule; +import org.jbpm.compiler.canonical.ModelMetaData; +import org.jbpm.compiler.canonical.ProcessMetaData; +import org.jbpm.compiler.canonical.ProcessToExecModelGenerator; +import org.jbpm.compiler.canonical.TemplateHelper; +import org.jbpm.compiler.xml.XmlProcessReader; +import org.jbpm.compiler.xml.core.SemanticModules; +import org.jbpm.ruleflow.core.RuleFlowProcess; +import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcess; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.CompilationUnit; +import com.github.javaparser.ast.Node.TreeTraversal; +import com.github.javaparser.ast.PackageDeclaration; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.ConstructorDeclaration; +import com.github.javaparser.ast.body.MethodDeclaration; +import com.github.javaparser.ast.expr.ObjectCreationExpr; +import com.github.javaparser.ast.expr.VariableDeclarationExpr; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.printer.DefaultPrettyPrinter; +import com.github.javaparser.printer.Printer; + +public class ProcessCodeGenerationSupport { + private static final Logger LOG = LoggerFactory.getLogger(ProcessCodeGenerationSupport.class); + + private SemanticModules bpmnSemanticModules; + + private ProcessToExecModelGenerator processCodeGenerator; + + private Printer printer; + + private Path rootSourceFolder; + + private Path rootOutputFolder; + + public ProcessCodeGenerationSupport(Path sourceFolder, Path outputFolder) { + this.printer = new DefaultPrettyPrinter(); + this.bpmnSemanticModules = new SemanticModules(); + this.bpmnSemanticModules.addSemanticModule(new BPMNSemanticModule()); + this.bpmnSemanticModules.addSemanticModule(new BPMNExtensionsSemanticModule()); + this.bpmnSemanticModules.addSemanticModule(new BPMNDISemanticModule()); + this.processCodeGenerator = new ProcessToExecModelGenerator("StaticProcessTemplate.java", Thread.currentThread().getContextClassLoader()); + this.rootSourceFolder = sourceFolder; + this.rootOutputFolder = outputFolder; + } + + public void execute() throws MojoExecutionException { + + try { + if (!Files.exists(rootSourceFolder)) { + LOG.info("Workflow folder {} does not exists! Skipping", rootSourceFolder); + return; + } + + List sources = findWorkflowFiles(rootSourceFolder); + if (sources.isEmpty()) { + LOG.info("Workflow folder {} is empty! Skipping", rootSourceFolder); + return; + } + + File outputJavaDirectory = rootOutputFolder.toFile(); + outputJavaDirectory.mkdirs(); + if (!outputJavaDirectory.exists()) { + throw new MojoExecutionException("Could not create source directory! " + outputJavaDirectory); + } + + List outcome = sources.stream().map(this::generateJavaCode).toList(); + List errors = outcome.stream().filter(JavaCodeResult::notValid).toList(); + errors.forEach(e -> { + LOG.info("Error {}", e.path()); + }); + LOG.info("Number of compiled files: {}, Number of errors: {}", outcome.size() - errors.size(), errors.size()); + } catch (IOException e) { + throw new MojoExecutionException("Could not generate Java source code!", e); + } + } + + private List findWorkflowFiles(Path bpmnSources) throws IOException { + Predicate isBpmn2 = e -> e.getFileName().toString().endsWith(".bpmn2") || e.getFileName().toString().endsWith(".bpmn"); + return Files.walk(bpmnSources).filter(Files::isRegularFile).filter(isBpmn2).toList(); + } + + record JavaCodeResult(Path path, boolean valid) { + + boolean notValid() { + return !valid(); + } + } + + private JavaCodeResult generateJavaCode(Path workflow) { + FileSystemResource resource = new FileSystemResource(workflow.toFile()); + try (Reader reader = resource.getReader()) { + XmlProcessReader xmlReader = new XmlProcessReader(bpmnSemanticModules, Thread.currentThread().getContextClassLoader()); + List processes = xmlReader.read(reader).stream().map(KogitoWorkflowProcess.class::cast).toList(); + for (KogitoWorkflowProcess process : processes) { + this.generateJavaCode(process); + } + return new JavaCodeResult(workflow, true); + } catch (Exception e) { + LOG.error("problem found when trying to process {}", workflow, e); + return new JavaCodeResult(workflow, false); + } + + } + + private void generateJavaCode(KogitoWorkflowProcess process) throws IOException { + ProcessMetaData metadata = processCodeGenerator.generate(process); + ModelMetaData modelMetadata = processCodeGenerator.generateModel(process); + ModelMetaData inputMdelMetadata = processCodeGenerator.generateInputModel(process); + ModelMetaData outputModelMetadata = processCodeGenerator.generateOutputModel(process); + + // process + CompilationUnit processUnit = metadata.getGeneratedClassModel(); + + RuleFlowProcess ruleFlowProcess = (RuleFlowProcess) process; + for (String importClass : ruleFlowProcess.getImports()) { + processUnit.addImport(importClass); + } + + ClassOrInterfaceDeclaration processType = processUnit.findFirst(ClassOrInterfaceDeclaration.class).get(); + ClassOrInterfaceType modelType = StaticJavaParser.parseClassOrInterfaceType(modelMetadata.getModelClassName()); + processType.getExtendedTypes(0).setTypeArguments(modelType); + processType.findAll(ObjectCreationExpr.class, e -> "BpmnProcessInstance".equals(e.getType().getNameAsString())).forEach(e -> e.setType(processType.getNameAsString() + "Instance")); + processType.findAll(ObjectCreationExpr.class, e -> "ThisIsJustTemplate".equals(e.getType().getNameAsString())).forEach(e -> e.setType(processType.getNameAsString())); + processType.findAll(ObjectCreationExpr.class, e -> "BpmnVariables".equals(e.getType().getNameAsString())).forEach(e -> e.setType(modelType.getNameAsString())); + processType.findAll(VariableDeclarationExpr.class, e -> "BpmnVariables".equals(e.getVariable(0).getTypeAsString())).forEach(e -> { + if (e.getVariables().isNonEmpty()) { + e.getVariable(0).setType(modelType.getNameWithScope()); + } + }); + processType.findAll(MethodDeclaration.class, TreeTraversal.DIRECT_CHILDREN).forEach(e -> { + if ("BpmnVariables".equals(e.getTypeAsString())) { + e.setType(modelType); + } + e.getParameterByType("BpmnVariables").ifPresent(t -> t.setType(modelType)); + + if (!(e.getType() instanceof ClassOrInterfaceType)) { + return; + } + + ClassOrInterfaceType returnType = (ClassOrInterfaceType) e.getType(); + if ("org.kie.kogito.process.Process".equals(returnType.getNameWithScope())) { + returnType.setTypeArguments(modelType); + } else if ("ProcessInstance".equals(returnType.getNameAsString())) { + returnType.setTypeArguments(modelType); + } + + }); + processType.findAll(ConstructorDeclaration.class).forEach(e -> { + e.setName(processType.getNameAsString()); + }); + + // process instance + CompilationUnit instance = StaticJavaParser.parse(TemplateHelper.findTemplate("ModelProcessInstance.java")); + instance.setPackageDeclaration(processUnit.getPackageDeclaration().get()); + ClassOrInterfaceDeclaration instanceType = instance.findFirst(ClassOrInterfaceDeclaration.class).get(); + instanceType.getExtendedTypes(0).setTypeArguments(modelType); + instanceType.findAll(ClassOrInterfaceType.class, e -> "AbstractProcess".equals(e.getNameAsString())).forEach(e -> e.setTypeArguments(modelType)); + instanceType.setName(processType.getNameAsString() + "Instance"); + instanceType.findAll(ConstructorDeclaration.class).forEach(e -> { + e.setName(instanceType.getNameAsString()); + e.getParameterByType("BpmnVariables").ifPresent(t -> t.setType(modelType)); + + }); + instanceType.findAll(MethodDeclaration.class, TreeTraversal.DIRECT_CHILDREN).forEach(e -> { + if ("BpmnVariables".equals(e.getTypeAsString())) { + e.setType(modelType); + } + e.getParameterByType("BpmnVariables").ifPresent(t -> t.setType(modelType)); + }); + + // write to disk + writeCompilationUnit(processUnit); + writeCompilationUnit(instance); + writeCompilationUnit(modelMetadata.generateUnit()); + writeCompilationUnit(inputMdelMetadata.generateUnit()); + writeCompilationUnit(outputModelMetadata.generateUnit()); + } + + private void writeCompilationUnit(CompilationUnit unit) throws IOException { + Optional packageDeclaration = unit.getPackageDeclaration(); + String folder = ""; + if (packageDeclaration.isPresent()) { + folder = packageDeclaration.get().getNameAsString().replaceAll("\\.", "/"); + } + + Path outputFolder = Paths.get(rootOutputFolder.toString(), folder); + outputFolder.toFile().mkdirs(); + + String modelSource = printer.print(unit); + ClassOrInterfaceDeclaration modelType = unit.findFirst(ClassOrInterfaceDeclaration.class).get(); + LOG.debug("{} generated", modelType.getNameAsString()); + Files.write(Paths.get(outputFolder.toString(), modelType.getName().asString() + ".java"), modelSource.getBytes()); + } +} diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodegenMojo.java b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodegenMojo.java new file mode 100644 index 00000000000..e8aabcbe5c9 --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodegenMojo.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.tools.maven; + +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; + +@Mojo(name = ProcessCodegenMojo.GOAL, defaultPhase = LifecyclePhase.GENERATE_SOURCES) +public class ProcessCodegenMojo extends AbstractMojo { + + public static final String GOAL = "jbpm-process-generation"; + + @Parameter(defaultValue = "${project}", required = true, readonly = true) + MavenProject project; + + @Parameter(property = "jbpm-process-generation.resources", defaultValue = "src/main/bpmn") + String resources; + + public void execute() throws MojoExecutionException { + Path sourceFolder = Paths.get(project.getBasedir().toString(), resources); + Path outputFolder = Paths.get(project.getBuild().getDirectory(), "generated-sources", "jbpm"); + ProcessCodeGenerationSupport codeGenSupport = new ProcessCodeGenerationSupport(sourceFolder, outputFolder); + codeGenSupport.execute(); + } + +} diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodegenTestMojo.java b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodegenTestMojo.java new file mode 100644 index 00000000000..6a0ba150b7f --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/java/org/jbpm/tools/maven/ProcessCodegenTestMojo.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.tools.maven; + +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; + +@Mojo(name = ProcessCodegenTestMojo.GOAL, defaultPhase = LifecyclePhase.GENERATE_TEST_SOURCES) +public class ProcessCodegenTestMojo extends AbstractMojo { + + public static final String GOAL = "jbpm-process-test-generation"; + + @Parameter(defaultValue = "${project}", required = true, readonly = true) + MavenProject project; + + @Parameter(property = "jbpm-process-test-generation.resources", defaultValue = "src/test/bpmn") + String resources; + + public void execute() throws MojoExecutionException { + + Path sourceTestFolder = Paths.get(project.getBasedir().toString(), resources); + Path outputTestFolder = Paths.get(project.getBuild().getDirectory(), "generated-test-sources", "jbpm"); + ProcessCodeGenerationSupport codeGenSupport = new ProcessCodeGenerationSupport(sourceTestFolder, outputTestFolder); + codeGenSupport.execute(); + } + +} diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/resources/class-templates/ModelProcessInstance.java b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/resources/class-templates/ModelProcessInstance.java new file mode 100644 index 00000000000..10afab79c10 --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/resources/class-templates/ModelProcessInstance.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.kie.kogito.process.bpmn2; + +import java.util.Collections; +import java.util.Map; + +import org.jbpm.process.instance.InternalProcessRuntime; +import org.kie.api.runtime.process.WorkflowProcessInstance; +import org.kie.kogito.process.impl.AbstractProcess; +import org.kie.kogito.process.impl.AbstractProcessInstance; + +public class BpmnProcessInstance extends AbstractProcessInstance { + + public BpmnProcessInstance(AbstractProcess process, BpmnVariables variables, InternalProcessRuntime rt) { + super(process, variables, rt); + } + + public BpmnProcessInstance(AbstractProcess process, BpmnVariables variables, WorkflowProcessInstance wpi) { + super(process, variables, wpi); + } + + public BpmnProcessInstance(AbstractProcess process, BpmnVariables variables, InternalProcessRuntime rt, WorkflowProcessInstance wpi) { + super(process, variables, rt, wpi); + } + + public BpmnProcessInstance(AbstractProcess process, BpmnVariables variables, String businessKey, InternalProcessRuntime rt) { + super(process, variables, businessKey, rt); + } + + @Override + protected Map bind(BpmnVariables variables) { + if (variables == null) { + return Collections.emptyMap(); + } + return variables.toMap(); + } + + @Override + protected void unbind(BpmnVariables variables, Map vmap) { + if (variables == null || vmap == null) { + return; + } + variables.fromMap(vmap); + } +} diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/resources/class-templates/StaticProcessTemplate.java b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/resources/class-templates/StaticProcessTemplate.java new file mode 100644 index 00000000000..866389eb7b7 --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/main/resources/class-templates/StaticProcessTemplate.java @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.codegen; + +import java.util.HashMap; +import java.util.Map; + +import org.drools.core.util.KieFunctions; + +import org.jbpm.process.core.context.variable.Variable; +import org.jbpm.process.core.context.variable.VariableScope; +import org.jbpm.ruleflow.core.RuleFlowProcessFactory; +import org.jbpm.workflow.core.WorkflowProcess; +import org.kie.api.definition.process.Process; +import org.kie.api.runtime.process.WorkflowProcessInstance; +import org.kie.kogito.Application; +import org.kie.kogito.Model; +import org.kie.kogito.correlation.CompositeCorrelation; +import org.kie.kogito.process.ProcessConfig; +import org.kie.kogito.process.ProcessInstance; +import org.kie.kogito.process.bpmn2.BpmnProcess; +import org.kie.kogito.process.bpmn2.BpmnProcessInstance; +import org.kie.kogito.process.bpmn2.BpmnProcesses; +import org.kie.kogito.process.bpmn2.BpmnVariables; +import org.kie.kogito.process.impl.AbstractProcess; + +public class ThisIsJustTemplate extends AbstractProcess { + + + public static org.kie.kogito.process.Process newProcess(Application application) { + return new ThisIsJustTemplate(application.config().get(ProcessConfig.class), application); + } + + public ThisIsJustTemplate(ProcessConfig processConfig, Application application) { + super(processConfig, application); + application.get(BpmnProcesses.class).addProcess(this); + this.activate(); + } + + + public Process process() { + + } + + @Override + public ProcessInstance createInstance(String businessKey, CompositeCorrelation correlation, BpmnVariables workingMemory) { + return createInstance(businessKey, workingMemory); + } + + @Override + public ProcessInstance createInstance(Model m) { + BpmnVariables variables = createModel(); + variables.fromMap(m.toMap()); + return new BpmnProcessInstance(this, variables, this.createProcessRuntime()); + } + + public ProcessInstance createInstance() { + return new BpmnProcessInstance(this, createModel(), this.createProcessRuntime()); + } + + @Override + public ProcessInstance createInstance(String businessKey, BpmnVariables variables) { + BpmnVariables variablesModel = createModel(); + variablesModel.fromMap(variables.toMap()); + return new BpmnProcessInstance(this, variablesModel, businessKey, this.createProcessRuntime()); + } + + @Override + public ProcessInstance createInstance(BpmnVariables variables) { + BpmnVariables variablesModel = createModel(); + variablesModel.fromMap(variables.toMap()); + return new BpmnProcessInstance(this, variablesModel, this.createProcessRuntime()); + } + + @Override + public ProcessInstance createInstance(WorkflowProcessInstance wpi) { + return new BpmnProcessInstance(this, createModel(), this.createProcessRuntime(), wpi); + } + + @Override + public ProcessInstance createReadOnlyInstance(WorkflowProcessInstance wpi) { + return new BpmnProcessInstance(this, createModel(), wpi); + } + + + @Override + public BpmnVariables createModel() { + return new BpmnVariables(); + } +} diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/java/org/jbpm/tools/maven/ProcessCodegenMojoProjectStub.java b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/java/org/jbpm/tools/maven/ProcessCodegenMojoProjectStub.java new file mode 100644 index 00000000000..d02d38c8d61 --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/java/org/jbpm/tools/maven/ProcessCodegenMojoProjectStub.java @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.tools.maven; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.io.input.XmlStreamReader; +import org.apache.maven.model.Build; +import org.apache.maven.model.Model; +import org.apache.maven.model.Resource; +import org.apache.maven.model.io.xpp3.MavenXpp3Reader; +import org.apache.maven.project.MavenProject; + +public class ProcessCodegenMojoProjectStub extends MavenProject { + + public ProcessCodegenMojoProjectStub() { + try { + + MavenXpp3Reader pomReader = new MavenXpp3Reader(); + Model model = pomReader.read(XmlStreamReader.builder().setFile(new File(getBasedir(), "pom.xml")).get()); + setModel(model); + + setGroupId(model.getGroupId()); + setArtifactId(model.getArtifactId()); + setVersion(model.getVersion()); + setName(model.getName()); + setUrl(model.getUrl()); + setPackaging(model.getPackaging()); + + Build build = new Build(); + build.setFinalName(model.getArtifactId()); + build.setSourceDirectory(getBasedir() + "/src/main/java"); + build.setTestSourceDirectory(getBasedir() + "/src/test/java"); + + build.setDirectory(getTargetdir().toString()); + + build.setTestOutputDirectory(getTargetdir() + "/test-classes"); + build.setOutputDirectory(getTargetdir() + "/classes"); + + Resource resource = new Resource(); + resource.setDirectory(getBasedir() + "/src/main/resources"); + addResource(resource); + + setBuild(build); + + setCompileSourceRoots(new ArrayList<>(List.of(getBasedir() + "/src/main/java"))); + setTestCompileSourceRoots(new ArrayList<>(List.of(getBasedir() + "/src/test/java"))); + + getTargetdir().mkdirs(); + new File(build.getOutputDirectory()).mkdirs(); + new File(build.getTestOutputDirectory()).mkdirs(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public File getBasedir() { + return new File("src/test/resources/unit/project/").getAbsoluteFile(); + } + + public File getTargetdir() { + return new File("target/unit/project/target").getAbsoluteFile(); + } +} \ No newline at end of file diff --git a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ResourceTest.java b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/java/org/jbpm/tools/maven/ProcessCodegenMojoTest.java old mode 100755 new mode 100644 similarity index 52% rename from jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ResourceTest.java rename to jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/java/org/jbpm/tools/maven/ProcessCodegenMojoTest.java index 5bfbc41c284..c27f303bbd2 --- a/jbpm/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ResourceTest.java +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/java/org/jbpm/tools/maven/ProcessCodegenMojoTest.java @@ -16,28 +16,26 @@ * specific language governing permissions and limitations * under the License. */ -package org.jbpm.bpmn2; +package org.jbpm.tools.maven; +import org.apache.maven.plugin.testing.junit5.InjectMojo; +import org.apache.maven.plugin.testing.junit5.MojoTest; import org.junit.jupiter.api.Test; -import org.kie.kogito.internal.process.runtime.KogitoProcessInstance; -import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -public class ResourceTest extends JbpmBpmn2TestCase { +@MojoTest +public class ProcessCodegenMojoTest { @Test - public void testResourceType() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MinimalProcess.bpmn2"); - kruntime.startProcess("Minimal"); + @InjectMojo(goal = "jbpm-process-generation", pom = "src/test/resources/unit/project/pom.xml") + void simpleMojo(ProcessCodegenMojo mojo) { + assertDoesNotThrow(mojo::execute); } @Test - public void testMultipleProcessInOneFile() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-MultipleProcessInOneFile.bpmn2"); - KogitoProcessInstance processInstance = kruntime.startProcess("Evaluation"); - assertThat(processInstance).isNotNull(); - KogitoProcessInstance processInstance2 = kruntime.startProcess("Simple"); - assertThat(processInstance2).isNotNull(); + @InjectMojo(goal = "jbpm-process-test-generation", pom = "src/test/resources/unit/project/pom.xml") + void simpleMojo(ProcessCodegenTestMojo mojo) { + assertDoesNotThrow(mojo::execute); } - -} +} \ No newline at end of file diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/resources/unit/project/pom.xml b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/resources/unit/project/pom.xml new file mode 100644 index 00000000000..f31d3692f9e --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/resources/unit/project/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + com.javaxp + project-name + jar + 1.0-SNAPSHOT + project-name + http://maven.apache.org + + + + + + + + + org.kie.kogito + jbpm-tools-maven-plugin + + + + + + + + \ No newline at end of file diff --git a/jbpm/jbpm-tools/pom.xml b/jbpm/jbpm-tools/pom.xml new file mode 100644 index 00000000000..fe362d5b00b --- /dev/null +++ b/jbpm/jbpm-tools/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + jbpm + org.kie.kogito + 999-SNAPSHOT + + + jbpm-tools + pom + + Kogito :: jBPM :: Tools + jBPM Tools + + + + UTF-8 + + + + jbpm-tools-maven-plugin + + diff --git a/jbpm/pom.xml b/jbpm/pom.xml index 5925fbe239f..7aa8ccfca39 100755 --- a/jbpm/pom.xml +++ b/jbpm/pom.xml @@ -1,4 +1,4 @@ - + - - - 4.0.0 - - org.kie.kogito - kogito-build-parent - 999-SNAPSHOT - ../kogito-build/kogito-build-parent/pom.xml - - - jbpm - pom - - Kogito :: jBPM - jBPM: a Business Process Management - http://www.jbpm.org - - - jbpm-flow - jbpm-flow-builder - jbpm-bpmn2 - jbpm-flow-migration - process-serialization-protobuf - process-workitems - + + + 4.0.0 + + + org.kie.kogito + kogito-build-parent + 999-SNAPSHOT + ../kogito-build/kogito-build-parent/pom.xml + + + + jbpm + pom + Kogito :: jBPM + jBPM: a Business Process Management + http://www.jbpm.org + + + jbpm-flow + jbpm-flow-builder + jbpm-bpmn2 + jbpm-flow-migration + process-serialization-protobuf + process-workitems + jbpm-tools + jbpm-tests + diff --git a/kogito-build/kogito-dependencies-bom/pom.xml b/kogito-build/kogito-dependencies-bom/pom.xml index ecef33f4b03..908b525de32 100644 --- a/kogito-build/kogito-dependencies-bom/pom.xml +++ b/kogito-build/kogito-dependencies-bom/pom.xml @@ -122,15 +122,17 @@ 2.0.6 3.9.3 + 2.2.1 3.7.1 3.2.0 - + 4.0.0-alpha-2 2.1.0 2.6.0 1.0-1 4.2.0 + 1.0 32.0.0-jre 1.26.0 @@ -143,6 +145,11 @@ guava ${version.com.google.guava} + + com.google.collections + google-collections + ${version.com.google.collections} + org.apache.commons @@ -553,6 +560,11 @@ maven-plugin-api ${version.maven} + + org.apache.maven + maven-project + ${version.maven.project} + org.apache.maven maven-core @@ -563,6 +575,11 @@ maven-plugin-annotations ${version.maven.plugin} + + org.apache.maven.plugin-testing + maven-plugin-testing-harness + ${version.maven.plugin.testing.harness} + org.codehaus.plexus From 1b91529a9443ffecb244c72f88966d8d6e3a47f5 Mon Sep 17 00:00:00 2001 From: Alex Porcelli Date: Thu, 2 May 2024 17:29:43 +0200 Subject: [PATCH 07/11] Quarkus LTS Upgrade to 3.8.4 (#3477) * Upgrade to and align with Quarkus 3.8.2 LTS release. * Upgrade to and align with Quarkus 3.8.3 LTS release. * Upgrade to and align with Quarkus 3.8.4 LTS release. * Upgrade to and align with Quarkus 3.8.4 LTS release. * Improved test code to avoid duplication. * Remove unnecessary util class execution, as Quarkus 3.8.x does not have the issue anymore. * Upgrade tolatest embedded postgresql that is supposed to have the fix for test failures. --- api/kogito-api/pom.xml | 1 - .../kogito-build-no-bom-parent/pom.xml | 52 ---------- kogito-build/kogito-dependencies-bom/pom.xml | 97 ++++++++----------- kogito-test-utils/pom.xml | 9 +- quarkus/addons/messaging/common/pom.xml | 5 - .../common/QuarkusTopicDiscovery.java | 12 ++- .../common/QuarkusTopicDiscoveryTest.java | 78 +++++++++------ quarkus/bom/pom.xml | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../pom.xml | 5 - 10 files changed, 111 insertions(+), 152 deletions(-) diff --git a/api/kogito-api/pom.xml b/api/kogito-api/pom.xml index cec9ac55aab..d1b266a0ad6 100755 --- a/api/kogito-api/pom.xml +++ b/api/kogito-api/pom.xml @@ -61,7 +61,6 @@ jakarta.xml.bind jakarta.xml.bind-api provided - 4.0.1 diff --git a/kogito-build/kogito-build-no-bom-parent/pom.xml b/kogito-build/kogito-build-no-bom-parent/pom.xml index d13e70d16dd..ab2e6a2191e 100644 --- a/kogito-build/kogito-build-no-bom-parent/pom.xml +++ b/kogito-build/kogito-build-no-bom-parent/pom.xml @@ -699,58 +699,6 @@ org.apache.maven.plugins maven-checkstyle-plugin - - - - - org.codehaus.mojo - exec-maven-plugin - - - org.drools - drools-util - ${version.drools.util} - - - - - Remove comments from generated files - prepare-package - - java - - - false - true - - org.drools - drools-util - - org.drools.util.RemoveCommentsMain - - true - ${project.basedir}/target/classes/META-INF/quarkus-javadoc.properties - ${project.basedir}/target/classes/META-INF/quarkus-extension.properties - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/addons/quarkus/knative/eventing/deployment/EventingConfiguration.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/addons/quarkus/knative/eventing/deployment/SinkConfiguration.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/events/config/EventsRuntimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/config/KogitoBuildTimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/config/KogitoEventingRuntimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/config/KogitoRuntimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/serverless/workflow/config/KogitoBuildTimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/serverless/workflow/config/KogitoRPCRuntimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/serverless/workflow/config/KogitoServerlessWorkflowBuildTimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/serverless/workflow/config/KogitoServerlessWorkflowRuntimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/serverless/workflow/config/KogitoBuildTimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/workflow/deployment/config/KogitoWorkflowBuildTimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/quarkus/workflow/deployment/config/KogitoDevServicesBuildTimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/tracing/decision/quarkus/deployment/KogitoBuildTimeConfig.jdp - ${project.basedir}/target/generated-sources/annotations/org/kie/kogito/tracing/decision/quarkus/deployment/KogitoDevServicesBuildTimeConfig.jdp - - - - - diff --git a/kogito-build/kogito-dependencies-bom/pom.xml b/kogito-build/kogito-dependencies-bom/pom.xml index 908b525de32..6bd08cc5ed9 100644 --- a/kogito-build/kogito-dependencies-bom/pom.xml +++ b/kogito-build/kogito-dependencies-bom/pom.xml @@ -16,43 +16,40 @@ - 3.2.10.Final + 3.8.4 ${version.io.quarkus} 3.2.4 - 3.4.0 + 3.6.1 1.0.86 - 2.15.2 - 2.15.2 + 2.16.1 + 2.16.1 2.9.0 2.4.10 - 1.0.0-preview.20220705 + 1.0.0-preview.20240207 2.0.1 - 2.3.0 - 0.2.0 - 2.1.0 - 0.1.3 + 2.4.1 + 0.3.0 + 2.2.0 + 0.2.1 1.5.2 - 3.25.1 - 2.15.2 - 4.18.0 + 3.25.8 + 2.16.1 + 4.31.0 2.35.1 - 3.22.0 + 3.25.0 2.10.1 - 21.5.0.0 - 2.3.0.1 - 2.3.5 + 4.0.4 2.0.1 - 1.3.2 - 1.3.2 2.0.1 - 2.0.1.Final - 2.3.1 3.1.1 1.4.12 + 2.1.1 + 3.0.2 + 4.0.1 2.3.0 - 6.7.2 - 1.11.1 - 9.16.3 - 42.6.0 + 6.10.0 + 1.12.2 + 9.22.3 + 42.7.2 4.0.5.Final - 3.4.0 + 3.10.0 4.2.0 - 3.7.2 + 3.10.0 - 4.4.6 - 1.56.0 + 4.5.7 + 1.59.1 - 3.0.0-M1 + 3.9.0 2.1.19 2.2.19 - 3.12.0 + 3.14.0 - 23.0.1 + 23.1.2 - 14.0.7.Final - 4.6.2.Final + 14.0.25.Final + 4.6.5.Final 7.10.2 3.1.0 6.2.7.Final - 21.0.1 + 23.0.7 2.12-2.2.1 4.9.1 @@ -100,21 +97,20 @@ 13.4-alpine3.14 1.11.3 - 3.22.0 + 3.24.2 + 4.0.4 2.9.0 1.3 - 10.2 - 5.${version.org.junit.minor} + 5.10.2 5.10.2 5.10.2 1.10.2 - 1.5.0 - 4.11.0 - 1.17.6 + 5.2.0 + 1.19.6 2.9.1 5.3.2 - 1.14.7 + 1.14.11 2.5.0.Final 1.0.4 @@ -133,8 +129,8 @@ 1.0-1 4.2.0 1.0 - 32.0.0-jre - 1.26.0 + 32.0.1-jre + 1.26.1 @@ -448,13 +444,6 @@ test - - org.junit-pioneer - junit-pioneer - ${version.org.junit.pioneer} - test - - org.mockito mockito-core @@ -600,7 +589,7 @@ jakarta.xml.bind jakarta.xml.bind-api - 4.0.0 + ${version.jakarta.xml.bind-api} com.sun.xml.bind @@ -610,7 +599,7 @@ org.glassfish.jaxb jaxb-runtime - 4.0.3 + ${version.org.glassfish.jaxb} org.eclipse.angus @@ -620,7 +609,7 @@ jakarta.validation jakarta.validation-api - 3.0.2 + ${version.jakarta.validation-api} jakarta.inject @@ -630,7 +619,7 @@ jakarta.annotation jakarta.annotation-api - 2.1.1 + ${version.jakarta.annotation-api} org.eclipse.microprofile.openapi diff --git a/kogito-test-utils/pom.xml b/kogito-test-utils/pom.xml index a21e7b36a9d..e59f902ce8f 100644 --- a/kogito-test-utils/pom.xml +++ b/kogito-test-utils/pom.xml @@ -54,8 +54,13 @@ ${version.org.testcontainers} compile - - + + + org.junit.jupiter + junit-jupiter + compile + + org.kie.kogito kogito-api diff --git a/quarkus/addons/messaging/common/pom.xml b/quarkus/addons/messaging/common/pom.xml index 26b9f4c3d98..7df56e97ab0 100644 --- a/quarkus/addons/messaging/common/pom.xml +++ b/quarkus/addons/messaging/common/pom.xml @@ -96,11 +96,6 @@ quarkus-junit5 test - - org.junit-pioneer - junit-pioneer - test - org.assertj assertj-core diff --git a/quarkus/addons/messaging/common/src/main/java/org/kie/kogito/addon/quarkus/messaging/common/QuarkusTopicDiscovery.java b/quarkus/addons/messaging/common/src/main/java/org/kie/kogito/addon/quarkus/messaging/common/QuarkusTopicDiscovery.java index b4a65353103..ebd0f167544 100644 --- a/quarkus/addons/messaging/common/src/main/java/org/kie/kogito/addon/quarkus/messaging/common/QuarkusTopicDiscovery.java +++ b/quarkus/addons/messaging/common/src/main/java/org/kie/kogito/addon/quarkus/messaging/common/QuarkusTopicDiscovery.java @@ -41,7 +41,7 @@ public class QuarkusTopicDiscovery extends AbstractTopicDiscovery { @Override protected List getTopics() { final List topics = new ArrayList<>(); - ConfigProvider.getConfig().getPropertyNames().forEach(n -> { + getPropertyNames().forEach(n -> { if (n.startsWith(OUTGOING_PREFIX)) { final String topicName = this.extractChannelName(n, OUTGOING_PREFIX); if (topics.stream().noneMatch(t -> t.getName().equals(topicName) && t.getType() == ChannelType.OUTGOING)) { @@ -68,7 +68,15 @@ private String extractChannelName(String property, String prefix) { if (channelName.contains(".")) { channelName = channelName.substring(0, channelName.indexOf(".")); } - final Optional topicName = ConfigProvider.getConfig().getOptionalValue(prefix + channelName + TOPIC_SUFFIX, String.class); + final Optional topicName = getOptionalValue(prefix + channelName + TOPIC_SUFFIX); return topicName.orElse(channelName); } + + Iterable getPropertyNames() { + return ConfigProvider.getConfig().getPropertyNames(); + } + + Optional getOptionalValue(String key) { + return ConfigProvider.getConfig().getOptionalValue(key, String.class); + } } diff --git a/quarkus/addons/messaging/common/src/test/java/org/kie/kogito/addon/quarkus/messaging/common/QuarkusTopicDiscoveryTest.java b/quarkus/addons/messaging/common/src/test/java/org/kie/kogito/addon/quarkus/messaging/common/QuarkusTopicDiscoveryTest.java index 984f5fa3631..ad7ebdbb82a 100644 --- a/quarkus/addons/messaging/common/src/test/java/org/kie/kogito/addon/quarkus/messaging/common/QuarkusTopicDiscoveryTest.java +++ b/quarkus/addons/messaging/common/src/test/java/org/kie/kogito/addon/quarkus/messaging/common/QuarkusTopicDiscoveryTest.java @@ -18,13 +18,9 @@ */ package org.kie.kogito.addon.quarkus.messaging.common; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import java.util.*; -import org.junit.jupiter.api.Test; -import org.junitpioneer.jupiter.ClearSystemProperty; -import org.junitpioneer.jupiter.SetSystemProperty; +import org.junit.jupiter.api.*; import org.kie.kogito.addon.cloudevents.AbstractTopicDiscovery; import org.kie.kogito.event.ChannelType; import org.kie.kogito.event.EventKind; @@ -32,49 +28,45 @@ import org.kie.kogito.event.TopicDiscovery; import org.kie.kogito.event.cloudevents.CloudEventMeta; +import static java.util.Map.entry; import static org.assertj.core.api.Assertions.assertThat; class QuarkusTopicDiscoveryTest { @Test - @SetSystemProperty(key = "mp.messaging.outgoing.processedtravellers.connector", value = "quarkus-http") - @SetSystemProperty(key = "mp.messaging.outgoing.processedtravellers.url", value = "http://localhost:8080/") - @SetSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.connector", value = "smallrye-kafka") - @SetSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.topic", value = "mycooltopic") void verifyTopicsWithPropertiesSet() { final List expectedTopics = new ArrayList<>(); expectedTopics.add(new Topic("processedtravellers", ChannelType.OUTGOING)); expectedTopics.add(new Topic("mycooltopic", ChannelType.INCOMING)); - final TopicDiscovery discovery = new QuarkusTopicDiscovery(); + final TopicDiscovery discovery = getTopicDiscovery(entry("mp.messaging.outgoing.processedtravellers.connector", "quarkus-http"), + entry("mp.messaging.outgoing.processedtravellers.url", "http://localhost:8080/"), + entry("mp.messaging.incoming.kogito_incoming_stream.connector", "smallrye-kafka"), + entry("mp.messaging.incoming.kogito_incoming_stream.topic", "mycooltopic")); + final List topics = discovery.getTopics(Collections.emptyList()); assertThat(topics).hasSize(2); expectedTopics.forEach(e -> assertThat(topics.stream().anyMatch(t -> t.getName().equals(e.getName()) && t.getType() == e.getType())).isTrue()); } @Test - @SetSystemProperty(key = "mp.messaging.outgoing.processedtravellers.connector", value = "quarkus-http") - @SetSystemProperty(key = "mp.messaging.outgoing.processedtravellers.url", value = "http://localhost:8080/") - @SetSystemProperty(key = "mp.messaging.outgoing.processedtravellers.topic", value = "mycooltopic") - @SetSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.connector", value = "smallrye-kafka") - @SetSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.topic", value = "mycooltopic") void verifyTopicsWithPropertiesSameTopic() { final List expectedTopics = new ArrayList<>(); expectedTopics.add(new Topic("mycooltopic", ChannelType.OUTGOING)); expectedTopics.add(new Topic("mycooltopic", ChannelType.INCOMING)); - final TopicDiscovery discovery = new QuarkusTopicDiscovery(); + final TopicDiscovery discovery = getTopicDiscovery(entry("mp.messaging.outgoing.processedtravellers.connector", "quarkus-http"), + entry("mp.messaging.outgoing.processedtravellers.url", "http://localhost:8080/"), + entry("mp.messaging.outgoing.processedtravellers.topic", "mycooltopic"), + entry("mp.messaging.incoming.kogito_incoming_stream.connector", "smallrye-kafka"), + entry("mp.messaging.incoming.kogito_incoming_stream.topic", "mycooltopic")); + final List topics = discovery.getTopics(Collections.emptyList()); assertThat(topics).hasSize(2); expectedTopics.forEach(e -> assertThat(topics.stream().anyMatch(t -> t.getName().equals(e.getName()) && t.getType() == e.getType())).isTrue()); } @Test - @ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.connector") - @ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.url") - @ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.topic") - @ClearSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.connector") - @ClearSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.topic") void verifyTopicsWithNoPropertiesSet() { final List expectedTopics = new ArrayList<>(); expectedTopics.add(AbstractTopicDiscovery.DEFAULT_OUTGOING_CHANNEL); @@ -83,21 +75,49 @@ void verifyTopicsWithNoPropertiesSet() { eventsMeta.add(new CloudEventMeta("event1", "", EventKind.CONSUMED)); eventsMeta.add(new CloudEventMeta("event2", "", EventKind.PRODUCED)); - final TopicDiscovery discovery = new QuarkusTopicDiscovery(); + final TopicDiscovery discovery = new QuarkusTopicDiscovery() { + Iterable getPropertyNames() { + return new HashSet<>(); + } + + Optional getOptionalValue(String key) { + return Optional.empty(); + } + }; final List topics = discovery.getTopics(eventsMeta); assertThat(topics).hasSize(2); expectedTopics.forEach(e -> assertThat(topics.stream().anyMatch(t -> t.getName().equals(e.getName()) && t.getType() == e.getType())).isTrue()); } @Test - @ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.connector") - @ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.url") - @ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.topic") - @ClearSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.connector") - @ClearSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.topic") void verifyTopicsWithPropertiesAndChannels() { - final TopicDiscovery discovery = new QuarkusTopicDiscovery(); + final TopicDiscovery discovery = new QuarkusTopicDiscovery() { + Iterable getPropertyNames() { + return new HashSet<>(); + } + + Optional getOptionalValue(String key) { + return Optional.empty(); + } + }; final List topics = discovery.getTopics(Collections.emptyList()); assertThat(topics).isEmpty(); } + + private TopicDiscovery getTopicDiscovery(Map.Entry... entries) { + return new QuarkusTopicDiscovery() { + final Map properties = Map.ofEntries(entries); + + @Override + Iterable getPropertyNames() { + return properties.keySet(); + } + + @Override + Optional getOptionalValue(String key) { + return Optional.ofNullable(properties.get(key)); + } + }; + } + } diff --git a/quarkus/bom/pom.xml b/quarkus/bom/pom.xml index 10f5e98f237..2532c6a27ab 100755 --- a/quarkus/bom/pom.xml +++ b/quarkus/bom/pom.xml @@ -37,7 +37,7 @@ Internal BOM descriptor for Kogito modules targeting Quarkus use-cases. Specific dependencies targeting the Quarkus platform must be added here. - 6.7.2 + 6.10.0 diff --git a/quarkus/integration-tests/integration-tests-quarkus-gradle/integration-tests-quarkus-gradle-project/gradle/wrapper/gradle-wrapper.properties b/quarkus/integration-tests/integration-tests-quarkus-gradle/integration-tests-quarkus-gradle-project/gradle/wrapper/gradle-wrapper.properties index b9d53324a82..a6a3d0f4258 100644 --- a/quarkus/integration-tests/integration-tests-quarkus-gradle/integration-tests-quarkus-gradle-project/gradle/wrapper/gradle-wrapper.properties +++ b/quarkus/integration-tests/integration-tests-quarkus-gradle/integration-tests-quarkus-gradle-project/gradle/wrapper/gradle-wrapper.properties @@ -19,6 +19,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/quarkus/integration-tests/integration-tests-quarkus-processes-persistence/integration-tests-quarkus-processes-infinispan/pom.xml b/quarkus/integration-tests/integration-tests-quarkus-processes-persistence/integration-tests-quarkus-processes-infinispan/pom.xml index c89ca244180..cb98062e9f1 100644 --- a/quarkus/integration-tests/integration-tests-quarkus-processes-persistence/integration-tests-quarkus-processes-infinispan/pom.xml +++ b/quarkus/integration-tests/integration-tests-quarkus-processes-persistence/integration-tests-quarkus-processes-infinispan/pom.xml @@ -71,11 +71,6 @@ rest-assured test - - io.quarkus - quarkus-test-infinispan-client - test - org.assertj assertj-core From 54ad37c4855aba8a9cf105e28d670bdcca6bd453 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Fri, 3 May 2024 12:45:24 +0200 Subject: [PATCH 08/11] [Fix #3486] Add input param counter (#3489) * [Fix #3486] Add input param counter * [Fix #3486] Arrays --- kogito-bom/pom.xml | 23 +++ .../pom.xml | 40 ++++++ .../SonataFlowMetricProcessEventListener.java | 101 +++++++++++++ ...ataFlowMetricProcessEventListenerTest.java | 134 ++++++++++++++++++ kogito-serverless-workflow/pom.xml | 1 + quarkus/addons/monitoring/pom.xml | 1 + quarkus/addons/monitoring/sonataflow/pom.xml | 23 +++ .../SonataFlowMetricEventListenerFactory.java | 53 +++++++ .../src/main/resources/META-INF/beans.xml | 20 +++ .../src/main/resources/application.properties | 1 + 10 files changed, 397 insertions(+) create mode 100644 kogito-serverless-workflow/kogito-serverless-workflow-monitoring/pom.xml create mode 100644 kogito-serverless-workflow/kogito-serverless-workflow-monitoring/src/main/java/org/kie/kogito/serverless/workflow/monitoring/SonataFlowMetricProcessEventListener.java create mode 100644 kogito-serverless-workflow/kogito-serverless-workflow-monitoring/src/test/java/org/kie/kogito/serverless/workflow/monitoring/SonataFlowMetricProcessEventListenerTest.java create mode 100644 quarkus/addons/monitoring/sonataflow/pom.xml create mode 100644 quarkus/addons/monitoring/sonataflow/src/main/java/org/kie/sonataflow/monitoring/SonataFlowMetricEventListenerFactory.java create mode 100644 quarkus/addons/monitoring/sonataflow/src/main/resources/META-INF/beans.xml create mode 100644 quarkus/addons/monitoring/sonataflow/src/main/resources/application.properties diff --git a/kogito-bom/pom.xml b/kogito-bom/pom.xml index b07eec3f819..2a00e688bd8 100755 --- a/kogito-bom/pom.xml +++ b/kogito-bom/pom.xml @@ -695,6 +695,17 @@ ${project.version} sources + + org.kie + kie-addons-quarkus-monitoring-sonataflow + ${project.version} + + + org.kie + kie-addons-quarkus-monitoring-sonataflow + ${project.version} + sources + org.kie kie-addons-springboot-monitoring-core @@ -1886,6 +1897,18 @@ ${project.version} sources + + org.kie.kogito + kogito-serverless-workflow-monitoring + ${project.version} + + + org.kie.kogito + kogito-serverless-workflow-monitoring + ${project.version} + sources + + org.kie.kogito kogito-serverless-workflow-openapi-parser diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/pom.xml b/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/pom.xml new file mode 100644 index 00000000000..b18431472d9 --- /dev/null +++ b/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/pom.xml @@ -0,0 +1,40 @@ + + 4.0.0 + + org.kie.kogito + kogito-serverless-workflow + 999-SNAPSHOT + + kogito-serverless-workflow-monitoring + Kogito :: Serverless Workflow :: Monitoring + + org.kie.kogito.serverless.workflow.monitoring + + + + + org.kie + kie-addons-monitoring-core + + + org.kie.kogito + kogito-serverless-workflow-runtime + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.assertj + assertj-core + test + + + org.mockito + mockito-inline + test + + + + \ No newline at end of file diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/src/main/java/org/kie/kogito/serverless/workflow/monitoring/SonataFlowMetricProcessEventListener.java b/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/src/main/java/org/kie/kogito/serverless/workflow/monitoring/SonataFlowMetricProcessEventListener.java new file mode 100644 index 00000000000..951d0b6dbeb --- /dev/null +++ b/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/src/main/java/org/kie/kogito/serverless/workflow/monitoring/SonataFlowMetricProcessEventListener.java @@ -0,0 +1,101 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.kie.kogito.serverless.workflow.monitoring; + +import java.util.Iterator; + +import org.kie.api.event.process.ProcessStartedEvent; +import org.kie.kogito.KogitoGAV; +import org.kie.kogito.internal.process.runtime.KogitoProcessInstance; +import org.kie.kogito.jackson.utils.JsonObjectUtils; +import org.kie.kogito.monitoring.core.common.process.MetricsProcessEventListener; +import org.kie.kogito.serverless.workflow.SWFConstants; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import io.micrometer.core.instrument.MeterRegistry; +import io.micrometer.core.instrument.Tag; + +public class SonataFlowMetricProcessEventListener extends MetricsProcessEventListener { + + public enum ArrayStoreMode { + STRING, + JSON_STRING, + MULTI_PARAM + } + + static final String INPUT_PARAMS_COUNTER_NAME = "sonataflow_input_parameters_counter"; + + private ArrayStoreMode arrayStoreMode; + + public SonataFlowMetricProcessEventListener(KogitoGAV gav, MeterRegistry meterRegistry, ArrayStoreMode arrayStoreMode) { + super("sonataflow-process-monitoring-listener", gav, meterRegistry); + this.arrayStoreMode = arrayStoreMode; + } + + @Override + public void beforeProcessStarted(ProcessStartedEvent event) { + final KogitoProcessInstance processInstance = (KogitoProcessInstance) event.getProcessInstance(); + Object node = processInstance.getVariables().get(SWFConstants.DEFAULT_WORKFLOW_VAR); + if (node instanceof ObjectNode) { + registerObject(processInstance.getProcessId(), null, (ObjectNode) node); + } + } + + final void registerObject(String processId, String key, ObjectNode node) { + node.fields().forEachRemaining(e -> registerInputParam(processId, concat(key, e.getKey(), '.'), e.getValue())); + } + + private void registerInputParam(String processId, String key, JsonNode value) { + if (value instanceof ObjectNode) { + registerObject(processId, key, (ObjectNode) value); + } else if (value instanceof ArrayNode) { + registerArray(processId, key, (ArrayNode) value); + } else { + registerValue(processId, key, value.asText()); + } + } + + private void registerArray(String processId, String key, ArrayNode node) { + if (arrayStoreMode == ArrayStoreMode.MULTI_PARAM) { + Iterator iter = node.elements(); + for (int i = 0; iter.hasNext(); i++) { + registerInputParam(processId, concat(key, "[" + i + "]"), iter.next()); + } + } else if (arrayStoreMode == ArrayStoreMode.JSON_STRING) { + registerValue(processId, key, node.toString()); + } else if (arrayStoreMode == ArrayStoreMode.STRING) { + registerValue(processId, key, JsonObjectUtils.toJavaValue(node).toString()); + } + } + + private void registerValue(String processId, String key, String value) { + buildCounter(INPUT_PARAMS_COUNTER_NAME, "Input parameters", processId, Tag.of("param_name", key), Tag.of("param_value", value)).increment(); + } + + private String concat(String prefix, String key, char prefixChar) { + return prefix == null ? key : prefix + prefixChar + key; + } + + private String concat(String prefix, String key) { + return prefix == null ? key : prefix + key; + } +} diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/src/test/java/org/kie/kogito/serverless/workflow/monitoring/SonataFlowMetricProcessEventListenerTest.java b/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/src/test/java/org/kie/kogito/serverless/workflow/monitoring/SonataFlowMetricProcessEventListenerTest.java new file mode 100644 index 00000000000..a02db9a6802 --- /dev/null +++ b/kogito-serverless-workflow/kogito-serverless-workflow-monitoring/src/test/java/org/kie/kogito/serverless/workflow/monitoring/SonataFlowMetricProcessEventListenerTest.java @@ -0,0 +1,134 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.kie.kogito.serverless.workflow.monitoring; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.kie.kogito.KogitoGAV; +import org.kie.kogito.jackson.utils.ObjectMapperFactory; +import org.kie.kogito.serverless.workflow.monitoring.SonataFlowMetricProcessEventListener.ArrayStoreMode; +import org.mockito.MockedStatic; + +import com.fasterxml.jackson.databind.node.ArrayNode; + +import io.micrometer.core.instrument.Counter; +import io.micrometer.core.instrument.MeterRegistry; + +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +public class SonataFlowMetricProcessEventListenerTest { + + private static final String PROCESS_ID = "testMetric"; + + private Counter counter; + private MeterRegistry meterRegistry; + private KogitoGAV kogitoGAV; + private Counter.Builder builder; + private MockedStatic factory; + + @BeforeEach + void setup() { + counter = mock(Counter.class); + meterRegistry = mock(MeterRegistry.class); + builder = mock(Counter.Builder.class); + factory = mockStatic(Counter.class); + factory.when(() -> Counter.builder(SonataFlowMetricProcessEventListener.INPUT_PARAMS_COUNTER_NAME)).thenReturn(builder); + when(builder.register(meterRegistry)).thenReturn(counter); + when(builder.description(anyString())).thenReturn(builder); + when(builder.tag(anyString(), anyString())).thenReturn(builder); + kogitoGAV = new KogitoGAV("org.kogito", "test-artifact", "999-SNAPSHOT"); + } + + @AfterEach + void clean() { + factory.close(); + } + + @Test + void testSimpleCall() { + SonataFlowMetricProcessEventListener listener = new SonataFlowMetricProcessEventListener(kogitoGAV, meterRegistry, ArrayStoreMode.JSON_STRING); + listener.registerObject(PROCESS_ID, null, ObjectMapperFactory.get().createObjectNode().put("number", 1)); + listener.registerObject(PROCESS_ID, null, ObjectMapperFactory.get().createObjectNode().put("number", 2)); + verify(builder, times(2)).tag("process_id", PROCESS_ID); + verify(builder, times(2)).tag("param_name", "number"); + verify(builder).tag("param_value", "1"); + verify(builder).tag("param_value", "2"); + verify(counter, times(2)).increment(); + } + + @Test + void testComplexCall() { + SonataFlowMetricProcessEventListener listener = new SonataFlowMetricProcessEventListener(kogitoGAV, meterRegistry, ArrayStoreMode.JSON_STRING); + listener.registerObject(PROCESS_ID, null, + ObjectMapperFactory.get().createObjectNode().set("team", ObjectMapperFactory.get().createObjectNode().put("name", "Real Betis Balompie").put("age", 117))); + verify(builder, times(2)).tag("process_id", PROCESS_ID); + verify(builder).tag("param_name", "team.name"); + verify(builder).tag("param_value", "Real Betis Balompie"); + verify(builder).tag("param_name", "team.age"); + verify(builder).tag("param_value", "117"); + verify(counter, times(2)).increment(); + } + + @Test + void testArrayMultiParam() { + SonataFlowMetricProcessEventListener listener = new SonataFlowMetricProcessEventListener(kogitoGAV, meterRegistry, ArrayStoreMode.MULTI_PARAM); + listener.registerObject(PROCESS_ID, null, + ObjectMapperFactory.get().createObjectNode().set("teams", + ObjectMapperFactory.get().createArrayNode().add(ObjectMapperFactory.get().createObjectNode().put("name", "Real Betis Balompie")) + .add(ObjectMapperFactory.get().createObjectNode().put("name", "Real Sociedad")))); + verify(builder, times(2)).tag("process_id", PROCESS_ID); + verify(builder).tag("param_name", "teams[0].name"); + verify(builder).tag("param_value", "Real Betis Balompie"); + verify(builder).tag("param_name", "teams[1].name"); + verify(builder).tag("param_value", "Real Sociedad"); + verify(counter, times(2)).increment(); + } + + @Test + void testArrayJsonString() { + SonataFlowMetricProcessEventListener listener = new SonataFlowMetricProcessEventListener(kogitoGAV, meterRegistry, ArrayStoreMode.JSON_STRING); + ArrayNode arrayNode = ObjectMapperFactory.get().createArrayNode().add(ObjectMapperFactory.get().createObjectNode().put("name", "Real Betis Balompie")) + .add(ObjectMapperFactory.get().createObjectNode().put("name", "Real Sociedad")); + listener.registerObject(PROCESS_ID, null, + ObjectMapperFactory.get().createObjectNode().set("teams", arrayNode)); + verify(builder).tag("process_id", PROCESS_ID); + verify(builder).tag("param_name", "teams"); + verify(builder).tag("param_value", arrayNode.toString()); + verify(counter).increment(); + } + + @Test + void testArrayString() { + SonataFlowMetricProcessEventListener listener = new SonataFlowMetricProcessEventListener(kogitoGAV, meterRegistry, ArrayStoreMode.STRING); + ArrayNode arrayNode = ObjectMapperFactory.get().createArrayNode().add(ObjectMapperFactory.get().createObjectNode().put("name", "Real Betis Balompie")) + .add(ObjectMapperFactory.get().createObjectNode().put("name", "Real Sociedad")); + listener.registerObject(PROCESS_ID, null, + ObjectMapperFactory.get().createObjectNode().set("teams", arrayNode)); + verify(builder).tag("process_id", PROCESS_ID); + verify(builder).tag("param_name", "teams"); + verify(builder).tag("param_value", "[{name=Real Betis Balompie}, {name=Real Sociedad}]"); + verify(counter).increment(); + } +} diff --git a/kogito-serverless-workflow/pom.xml b/kogito-serverless-workflow/pom.xml index cfca4a918e3..0f57d6ee30c 100644 --- a/kogito-serverless-workflow/pom.xml +++ b/kogito-serverless-workflow/pom.xml @@ -57,6 +57,7 @@ kogito-serverless-workflow-executor-tests kogito-serverless-workflow-dmn-parser kogito-serverless-workflow-dmn + kogito-serverless-workflow-monitoring diff --git a/quarkus/addons/monitoring/pom.xml b/quarkus/addons/monitoring/pom.xml index 99cd85c7866..c154209e630 100644 --- a/quarkus/addons/monitoring/pom.xml +++ b/quarkus/addons/monitoring/pom.xml @@ -38,6 +38,7 @@ core prometheus elastic + sonataflow \ No newline at end of file diff --git a/quarkus/addons/monitoring/sonataflow/pom.xml b/quarkus/addons/monitoring/sonataflow/pom.xml new file mode 100644 index 00000000000..b98fd7cfd05 --- /dev/null +++ b/quarkus/addons/monitoring/sonataflow/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + org.kie + kie-addons-quarkus-monitoring-parent + 999-SNAPSHOT + + kie-addons-quarkus-monitoring-sonataflow + KIE Add-On Monitoring Sonataflow + + org.kie.kogito.monitoring.sonataflow.quarkus + + + + org.kie + kie-addons-quarkus-monitoring-core + + + org.kie.kogito + kogito-serverless-workflow-monitoring + + + \ No newline at end of file diff --git a/quarkus/addons/monitoring/sonataflow/src/main/java/org/kie/sonataflow/monitoring/SonataFlowMetricEventListenerFactory.java b/quarkus/addons/monitoring/sonataflow/src/main/java/org/kie/sonataflow/monitoring/SonataFlowMetricEventListenerFactory.java new file mode 100644 index 00000000000..2eedb74cd7f --- /dev/null +++ b/quarkus/addons/monitoring/sonataflow/src/main/java/org/kie/sonataflow/monitoring/SonataFlowMetricEventListenerFactory.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.kie.sonataflow.monitoring; + +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.kie.kogito.KogitoGAV; +import org.kie.kogito.config.ConfigBean; +import org.kie.kogito.internal.process.event.KogitoProcessEventListener; +import org.kie.kogito.serverless.workflow.monitoring.SonataFlowMetricProcessEventListener; +import org.kie.kogito.serverless.workflow.monitoring.SonataFlowMetricProcessEventListener.ArrayStoreMode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.micrometer.core.instrument.Metrics; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Produces; +import jakarta.inject.Inject; + +@ApplicationScoped +public class SonataFlowMetricEventListenerFactory { + + private static final Logger LOGGER = LoggerFactory.getLogger(SonataFlowMetricEventListenerFactory.class); + + @Inject + ConfigBean configBean; + + @ConfigProperty(name = "kie.monitoring.sonataflow.arrays.store", defaultValue = "JSON_STRING") + ArrayStoreMode arrayStoreMode; + + @Produces + public KogitoProcessEventListener produceProcessListener() { + LOGGER.info("Producing sonataflow listener for process monitoring."); + return new SonataFlowMetricProcessEventListener( + configBean.getGav().orElse(KogitoGAV.EMPTY_GAV), Metrics.globalRegistry, arrayStoreMode); + } +} diff --git a/quarkus/addons/monitoring/sonataflow/src/main/resources/META-INF/beans.xml b/quarkus/addons/monitoring/sonataflow/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..a0eb9fbf8cd --- /dev/null +++ b/quarkus/addons/monitoring/sonataflow/src/main/resources/META-INF/beans.xml @@ -0,0 +1,20 @@ + diff --git a/quarkus/addons/monitoring/sonataflow/src/main/resources/application.properties b/quarkus/addons/monitoring/sonataflow/src/main/resources/application.properties new file mode 100644 index 00000000000..7373d20328b --- /dev/null +++ b/quarkus/addons/monitoring/sonataflow/src/main/resources/application.properties @@ -0,0 +1 @@ +kogito.monitoring.process.useDefault=false \ No newline at end of file From 0a932412cda176f949f1c72e3338a6071686d3f1 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Fri, 3 May 2024 13:11:09 +0200 Subject: [PATCH 09/11] [Fix #3475] Parsing the errorMessage metadata keys in end nodes (#3491) * [Fix #3475] Parsing the errorMessage metadata keys in end nodes * [Fix #3475] Do not abort process instance * [Fix #3475] Adding IT test --- .../parser/handlers/StateHandler.java | 15 +++++- .../ErrorExpressionActionSupplier.java | 43 ++++++++++++++++ .../actions/ErrorExpressionAction.java | 50 +++++++++++++++++++ .../main/resources/errorWithMetadata.sw.json | 18 +++++++ .../kogito/quarkus/workflows/ErrorRestIT.java | 21 ++++++++ 5 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/suppliers/ErrorExpressionActionSupplier.java create mode 100644 kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/actions/ErrorExpressionAction.java create mode 100644 quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/errorWithMetadata.sw.json diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java index 599ea4a3dd2..3cec858b915 100644 --- a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java +++ b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/parser/handlers/StateHandler.java @@ -23,6 +23,7 @@ import java.util.Collection; import java.util.List; import java.util.ListIterator; +import java.util.Map; import java.util.NoSuchElementException; import java.util.Optional; @@ -51,6 +52,7 @@ import org.kie.kogito.serverless.workflow.parser.ServerlessWorkflowParser; import org.kie.kogito.serverless.workflow.suppliers.CollectorActionSupplier; import org.kie.kogito.serverless.workflow.suppliers.CompensationActionSupplier; +import org.kie.kogito.serverless.workflow.suppliers.ErrorExpressionActionSupplier; import org.kie.kogito.serverless.workflow.suppliers.ExpressionActionSupplier; import org.kie.kogito.serverless.workflow.suppliers.MergeActionSupplier; import org.kie.kogito.serverless.workflow.suppliers.ProduceEventActionSupplier; @@ -517,15 +519,26 @@ protected final void createTimerNode(RuleFlowNodeContainerFactory factory, WorkflowElementIdentifier id = parserContext.newId(); EndNodeFactory nodeFactory = factory.endNode(id); NodeFactory startNode = nodeFactory; + List produceEvents = end.getProduceEvents(); if (produceEvents != null && !produceEvents.isEmpty()) { startNode = handleProduceEvents(factory, nodeFactory, produceEvents); } + + Map metadata = state.getMetadata(); + if (metadata != null) { + String errorMessage = metadata.get("errorMessage"); + if (errorMessage != null && !errorMessage.isBlank()) { + NodeFactory errorMessageNode = + factory.actionNode(parserContext.newId()).action(new ErrorExpressionActionSupplier(workflow.getExpressionLang(), errorMessage, SWFConstants.DEFAULT_WORKFLOW_VAR)); + connect(errorMessageNode, startNode); + startNode = errorMessageNode; + } + } nodeFactory.terminate(end.isTerminate()); return startNode; } - @SuppressWarnings("squid:S1452") private NodeFactory compensationEvent(RuleFlowNodeContainerFactory factory, NodeFactory sourceFactory) { WorkflowElementIdentifier eventId = parserContext.newId(); NodeFactory compensationNode = diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/suppliers/ErrorExpressionActionSupplier.java b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/suppliers/ErrorExpressionActionSupplier.java new file mode 100644 index 00000000000..4331ea320db --- /dev/null +++ b/kogito-serverless-workflow/kogito-serverless-workflow-builder/src/main/java/org/kie/kogito/serverless/workflow/suppliers/ErrorExpressionActionSupplier.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.kie.kogito.serverless.workflow.suppliers; + +import org.jbpm.compiler.canonical.ExpressionSupplier; +import org.jbpm.compiler.canonical.ProcessMetaData; +import org.jbpm.compiler.canonical.descriptors.ExpressionUtils; +import org.kie.kogito.internal.process.runtime.KogitoNode; +import org.kie.kogito.serverless.workflow.actions.ErrorExpressionAction; + +import com.github.javaparser.ast.expr.Expression; +import com.github.javaparser.ast.expr.ObjectCreationExpr; + +public class ErrorExpressionActionSupplier extends ErrorExpressionAction implements ExpressionSupplier { + + private ObjectCreationExpr expression; + + public ErrorExpressionActionSupplier(String lang, String expr, String inputVar) { + super(lang, expr, inputVar); + this.expression = ExpressionUtils.getObjectCreationExpr(ErrorExpressionAction.class, lang, expr, inputVar); + } + + @Override + public Expression get(KogitoNode node, ProcessMetaData metadata) { + return expression; + } +} diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/actions/ErrorExpressionAction.java b/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/actions/ErrorExpressionAction.java new file mode 100644 index 00000000000..a4b1f1da11d --- /dev/null +++ b/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/actions/ErrorExpressionAction.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.kie.kogito.serverless.workflow.actions; + +import org.jbpm.process.instance.ProcessInstance; +import org.jbpm.workflow.instance.NodeInstance; +import org.kie.kogito.internal.process.runtime.KogitoProcessContext; + +import com.fasterxml.jackson.databind.JsonNode; + +public class ErrorExpressionAction extends BaseExpressionAction { + + public ErrorExpressionAction(String lang, String expr, String inputVar) { + super(lang, expr, inputVar); + } + + public void execute(KogitoProcessContext context) throws Exception { + if (expr.isValid()) { + JsonNode error = evaluate(context, JsonNode.class); + if (!error.isNull() && error.isTextual()) { + String errorStr = error.asText(); + if (!errorStr.isBlank()) { + setError(context, errorStr); + } + } + } else { + setError(context, expr.toString()); + } + } + + private void setError(KogitoProcessContext context, String error) { + ((ProcessInstance) context.getProcessInstance()).setErrorState((NodeInstance) context.getNodeInstance(), new IllegalArgumentException(error)); + } +} diff --git a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/errorWithMetadata.sw.json b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/errorWithMetadata.sw.json new file mode 100644 index 00000000000..7a7a9551e9a --- /dev/null +++ b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/main/resources/errorWithMetadata.sw.json @@ -0,0 +1,18 @@ +{ + "id": "errorWithMetadata", + "version": "1.0", + "name": "Workflow Error example with metadata", + "description": "An example of how to abort a workflow with error given a condition", + "start": "checkEven", + "states": [ + { + "name": "checkEven", + "type": "operation", + "actions": [], + "end" : true, + "metadata": { + "errorMessage": "if .number % 2 != 0 then \"Is Odd number!!!!\" else null end" + } + } + ] +} diff --git a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/ErrorRestIT.java b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/ErrorRestIT.java index 07e2ad9a2cd..84afb411927 100644 --- a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/ErrorRestIT.java +++ b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/java/org/kie/kogito/quarkus/workflows/ErrorRestIT.java @@ -75,4 +75,25 @@ private void innerErrorRest(String workflowId) { .body("workflowdata.numberType", is("even")) .body("workflowdata.perfect", is(false)); } + + @Test + public void testErrorWithMetadata() { + given() + .contentType(ContentType.JSON) + .accept(ContentType.JSON) + .body("{\"number\" : 12342}") + .when() + .post("/errorWithMetadata") + .then() + .statusCode(201); + + given() + .contentType(ContentType.JSON) + .accept(ContentType.JSON) + .body("{\"number\" : 12341}") + .when() + .post("/errorWithMetadata") + .then() + .statusCode(400); + } } From 23b1355ec046677487b9853a8e32c57c5b94ae70 Mon Sep 17 00:00:00 2001 From: Enrique Date: Mon, 6 May 2024 14:54:03 +0200 Subject: [PATCH 10/11] [incubator-kie-issues-1110] Add capability to store that node instance (#3488) * [incubator-kie-issues-1110] Add capability to store that node instance --- .../instance/NodeInstanceContainer.java | 3 + .../node/CompositeContextNodeInstance.java | 1 + .../instance/node/CompositeNodeInstance.java | 1 + .../serialization/MarshallerContextName.java | 22 +- .../MarshallerReaderContext.java | 4 + .../MarshallerWriterContext.java | 4 + .../serialization/NodeInstanceReader.java | 45 ++ .../serialization/NodeInstanceWriter.java | 41 ++ .../ProcessInstanceMarshallerException.java | 4 + .../ProcessInstanceMarshallerService.java | 28 +- .../ProtobufAbstractMarshallerContext.java | 5 +- .../impl/ProtobufMarshallerReaderContext.java | 15 + .../impl/ProtobufProcessInstanceReader.java | 447 ++---------------- .../impl/ProtobufProcessInstanceWriter.java | 423 ++--------------- ...ProtobufProcessMarshallerWriteContext.java | 15 +- .../state/AsyncEventNodeInstanceReader.java | 55 +++ .../state/AsyncEventNodeInstanceWriter.java | 46 ++ .../CompositeContextNodeInstanceReader.java | 73 +++ .../CompositeContextNodeInstanceWriter.java | 58 +++ .../state/DynamicNodeInstanceReader.java | 68 +++ .../state/DynamicNodeInstanceWriter.java | 53 +++ .../state/EventNodeInstanceReader.java | 46 ++ .../state/EventNodeInstanceWriter.java | 41 ++ .../EventSubProcessNodeInstanceReader.java | 68 +++ .../EventSubProcessNodeInstanceWriter.java | 53 +++ .../state/ForEachNodeInstanceReader.java | 62 +++ .../state/ForEachNodeInstanceWriter.java | 59 +++ .../state/JoinNodeInstanceReader.java | 70 +++ .../state/JoinNodeInstanceWriter.java | 66 +++ .../LambdaSubProcessNodeInstanceReader.java | 63 +++ .../LambdaSubProcessNodeInstanceWriter.java | 54 +++ .../state/MilestoneNodeInstanceReader.java | 67 +++ .../state/MilestoneNodeInstanceWriter.java | 53 +++ .../state/RuleSetNodeInstanceReader.java | 64 +++ .../state/RuleSetNodeInstanceWriter.java | 49 ++ .../state/StateNodeInstanceReader.java | 72 +++ .../state/StateNodeInstanceWriter.java | 57 +++ .../state/SubProcessNodeInstanceReader.java | 69 +++ .../state/SubProcessNodeInstanceWriter.java | 54 +++ .../state/TimerNodeInstanceReader.java | 54 +++ .../state/TimerNodeInstanceWriter.java | 42 ++ .../state/WorkItemNodeInstanceReader.java | 196 ++++++++ .../state/WorkItemNodeInstanceWriter.java | 204 ++++++++ ...jbpm.flow.serialization.NodeInstanceReader | 14 + ...jbpm.flow.serialization.NodeInstanceWriter | 14 + 45 files changed, 2187 insertions(+), 815 deletions(-) create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/NodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/NodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/AsyncEventNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/AsyncEventNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/CompositeContextNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/CompositeContextNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/DynamicNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/DynamicNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventSubProcessNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventSubProcessNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/ForEachNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/ForEachNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/JoinNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/JoinNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/LambdaSubProcessNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/LambdaSubProcessNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/MilestoneNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/MilestoneNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/RuleSetNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/RuleSetNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/StateNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/StateNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/SubProcessNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/SubProcessNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/TimerNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/TimerNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceReader.java create mode 100644 jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceWriter.java create mode 100644 jbpm/process-serialization-protobuf/src/main/resources/META-INF/services/org.jbpm.flow.serialization.NodeInstanceReader create mode 100644 jbpm/process-serialization-protobuf/src/main/resources/META-INF/services/org.jbpm.flow.serialization.NodeInstanceWriter diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstanceContainer.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstanceContainer.java index 65c8e09205d..3fb400cc16d 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstanceContainer.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/NodeInstanceContainer.java @@ -19,6 +19,7 @@ package org.jbpm.workflow.instance; import java.util.Collection; +import java.util.Map; import org.jbpm.workflow.core.node.AsyncEventNode; import org.kie.api.definition.process.Node; @@ -99,4 +100,6 @@ default Node resolveAsync(Node node) { } return node; } + + Map getIterationLevels(); } diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeContextNodeInstance.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeContextNodeInstance.java index 8800dda04eb..5d564f4d7a7 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeContextNodeInstance.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeContextNodeInstance.java @@ -51,6 +51,7 @@ public void setContextInstance(String contextId, ContextInstance contextInstance this.contextInstances.put(contextId, contextInstance); } + @Override public ContextInstance getContextInstance(String contextId) { ContextInstance contextInstance = this.contextInstances.get(contextId); if (contextInstance != null) { diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeNodeInstance.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeNodeInstance.java index e7571121645..2612be7998b 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeNodeInstance.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeNodeInstance.java @@ -468,6 +468,7 @@ public void setCurrentLevel(int currentLevel) { this.currentLevel = currentLevel; } + @Override public Map getIterationLevels() { return iterationLevels; } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerContextName.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerContextName.java index e3253299d8c..3ec1d8cc8fa 100644 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerContextName.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerContextName.java @@ -18,22 +18,36 @@ */ package org.jbpm.flow.serialization; +import java.util.function.Supplier; + +import org.jbpm.ruleflow.instance.RuleFlowProcessInstance; import org.kie.kogito.process.Process; public final class MarshallerContextName { - public static final MarshallerContextName OBJECT_MARSHALLING_STRATEGIES = new MarshallerContextName<>("OBJECT_MARSHALLING_STRATEGIES"); + public static final MarshallerContextName OBJECT_MARSHALLING_STRATEGIES = + new MarshallerContextName<>("OBJECT_MARSHALLING_STRATEGIES", () -> new ObjectMarshallerStrategy[0]); public static final MarshallerContextName MARSHALLER_FORMAT = new MarshallerContextName<>("FORMAT"); public static final MarshallerContextName> MARSHALLER_PROCESS = new MarshallerContextName<>("PROCESS"); + public static final MarshallerContextName MARSHALLER_PROCESS_INSTANCE = new MarshallerContextName<>("PROCESS_INSTANCE"); public static final MarshallerContextName MARSHALLER_INSTANCE_READ_ONLY = new MarshallerContextName<>("READ_ONLY"); - public static final MarshallerContextName MARSHALLER_INSTANCE_LISTENER = new MarshallerContextName<>("MARSHALLER_INSTANCE_LISTENERS"); + public static final MarshallerContextName MARSHALLER_INSTANCE_LISTENER = + new MarshallerContextName<>("MARSHALLER_INSTANCE_LISTENERS", () -> new ProcessInstanceMarshallerListener[0]); + public static final MarshallerContextName MARSHALLER_NODE_INSTANCE_READER = new MarshallerContextName<>("MARSHALLER_NODE_INSTANCE_READER", () -> new NodeInstanceReader[0]); + public static final MarshallerContextName MARSHALLER_NODE_INSTANCE_WRITER = new MarshallerContextName<>("MARSHALLER_NODE_INSTANCE_WRITER", () -> new NodeInstanceWriter[0]); public static final String MARSHALLER_FORMAT_JSON = "json"; private String name; + private Supplier defaultValue; private MarshallerContextName(String name) { + this(name, () -> null); + } + + private MarshallerContextName(String name, Supplier defaultValue) { this.name = name; + this.defaultValue = defaultValue; } public String name() { @@ -44,4 +58,8 @@ public String name() { public T cast(Object value) { return (T) value; } + + public T defaultValue() { + return defaultValue.get(); + } } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerReaderContext.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerReaderContext.java index 2ded4cc7b87..8d7e5135504 100644 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerReaderContext.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerReaderContext.java @@ -20,8 +20,12 @@ import java.io.InputStream; +import com.google.protobuf.Any; + public interface MarshallerReaderContext extends MarshallerContext { InputStream input(); + NodeInstanceReader findNodeInstanceReader(Any nodeInstance); + } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerWriterContext.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerWriterContext.java index 0e1cb715b04..32c1c15ffc9 100644 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerWriterContext.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/MarshallerWriterContext.java @@ -20,8 +20,12 @@ import java.io.OutputStream; +import org.kie.api.runtime.process.NodeInstance; + public interface MarshallerWriterContext extends MarshallerContext { OutputStream output(); + NodeInstanceWriter findNodeInstanceWriter(NodeInstance nodeInstance); + } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/NodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/NodeInstanceReader.java new file mode 100644 index 00000000000..2efbca435a5 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/NodeInstanceReader.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization; + +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public interface NodeInstanceReader extends Comparable { + Integer DEFAULT_ORDER = 10; + + default Integer order() { + return DEFAULT_ORDER; + } + + @Override + default int compareTo(NodeInstanceReader that) { + return this.order().compareTo(that.order()); + } + + Class type(); + + default boolean accept(Any value) { + return value.is(type()); + } + + NodeInstance read(MarshallerReaderContext context, Any value); +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/NodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/NodeInstanceWriter.java new file mode 100644 index 00000000000..dec298ba81f --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/NodeInstanceWriter.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization; + +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3; + +public interface NodeInstanceWriter extends Comparable { + Integer DEFAULT_ORDER = 10; + + default Integer order() { + return DEFAULT_ORDER; + } + + @Override + default int compareTo(NodeInstanceWriter that) { + return this.order().compareTo(that.order()); + } + + boolean accept(NodeInstance value); + + GeneratedMessageV3.Builder write(MarshallerWriterContext writer, NodeInstance value); + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/ProcessInstanceMarshallerException.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/ProcessInstanceMarshallerException.java index 14ee48fc655..e7c9719aa13 100644 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/ProcessInstanceMarshallerException.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/ProcessInstanceMarshallerException.java @@ -22,6 +22,10 @@ public class ProcessInstanceMarshallerException extends RuntimeException { private static final long serialVersionUID = -1676023219884892322L; + public ProcessInstanceMarshallerException(Throwable th) { + super(th); + } + public ProcessInstanceMarshallerException(String msg) { super(msg); } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/ProcessInstanceMarshallerService.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/ProcessInstanceMarshallerService.java index 0b55ca20330..6b0fbd300d9 100644 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/ProcessInstanceMarshallerService.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/ProcessInstanceMarshallerService.java @@ -31,6 +31,7 @@ import java.util.function.Supplier; import org.jbpm.flow.serialization.impl.ProtobufProcessInstanceMarshallerFactory; +import org.jbpm.util.JbpmClassLoaderUtil; import org.kie.kogito.process.Process; import org.kie.kogito.process.ProcessInstance; import org.kie.kogito.process.ProcessInstanceReadMode; @@ -49,6 +50,9 @@ public class ProcessInstanceMarshallerService { private ProcessInstanceMarshallerFactory processInstanceMarshallerFactory; + private List readers; + private List writers; + public class Builder { public Builder() { @@ -60,9 +64,10 @@ public Builder withProcessInstanceMarshallerFactory(ProcessInstanceMarshallerFac return this; } + @SuppressWarnings("unchecked") public Builder withContextEntries(Map, T> contextEntries) { for (Map.Entry, T> item : contextEntries.entrySet()) { - ProcessInstanceMarshallerService.this.contextEntries.put((MarshallerContextName) item.getKey(), (Object) item.getValue()); + ProcessInstanceMarshallerService.this.contextEntries.put((MarshallerContextName) item.getKey(), item.getValue()); } return this; } @@ -77,11 +82,23 @@ public Builder withDefaultListeners() { } public Builder withDefaultObjectMarshallerStrategies() { - ServiceLoader loader = ServiceLoader.load(ObjectMarshallerStrategy.class); + ServiceLoader loader = ServiceLoader.load(ObjectMarshallerStrategy.class, JbpmClassLoaderUtil.findClassLoader()); for (ObjectMarshallerStrategy strategy : loader) { ProcessInstanceMarshallerService.this.strats.add(strategy); } + + ServiceLoader readerLoader = ServiceLoader.load(NodeInstanceReader.class, JbpmClassLoaderUtil.findClassLoader()); + + for (NodeInstanceReader reader : readerLoader) { + ProcessInstanceMarshallerService.this.readers.add(reader); + } + + ServiceLoader writerLoader = ServiceLoader.load(NodeInstanceWriter.class, JbpmClassLoaderUtil.findClassLoader()); + + for (NodeInstanceWriter writer : writerLoader) { + ProcessInstanceMarshallerService.this.writers.add(writer); + } return this; } @@ -101,6 +118,8 @@ public Builder withObjectMarshallerStrategies(ObjectMarshallerStrategy... strate public ProcessInstanceMarshallerService build() { Collections.sort(ProcessInstanceMarshallerService.this.strats); + Collections.sort(ProcessInstanceMarshallerService.this.readers); + Collections.sort(ProcessInstanceMarshallerService.this.writers); return ProcessInstanceMarshallerService.this; } @@ -113,6 +132,8 @@ public static Builder newBuilder() { private ProcessInstanceMarshallerService() { this.listeners = new ArrayList<>(); this.strats = new ArrayList<>(); + this.readers = new ArrayList<>(); + this.writers = new ArrayList<>(); this.contextEntries = new HashMap<>(); } @@ -129,6 +150,7 @@ public byte[] marshallProcessInstance(ProcessInstance processInstance) { MarshallerWriterContext context = processInstanceMarshallerFactory.newWriterContext(baos); context.set(MarshallerContextName.MARSHALLER_PROCESS, processInstance.process()); context.set(MarshallerContextName.MARSHALLER_INSTANCE_LISTENER, listeners.toArray(ProcessInstanceMarshallerListener[]::new)); + context.set(MarshallerContextName.MARSHALLER_NODE_INSTANCE_WRITER, this.writers.toArray(NodeInstanceWriter[]::new)); setupEnvironment(context); org.jbpm.flow.serialization.ProcessInstanceMarshaller marshaller = processInstanceMarshallerFactory.newKogitoProcessInstanceMarshaller(); marshaller.writeProcessInstance(context, processInstance); @@ -144,6 +166,7 @@ public ProcessInstance unmarshallProcessInstance(byte[] data, Process proc context.set(MarshallerContextName.MARSHALLER_PROCESS, process); context.set(MarshallerContextName.MARSHALLER_INSTANCE_READ_ONLY, readOnly); context.set(MarshallerContextName.MARSHALLER_INSTANCE_LISTENER, listeners.toArray(ProcessInstanceMarshallerListener[]::new)); + context.set(MarshallerContextName.MARSHALLER_NODE_INSTANCE_READER, this.readers.toArray(NodeInstanceReader[]::new)); setupEnvironment(context); org.jbpm.flow.serialization.ProcessInstanceMarshaller marshaller = processInstanceMarshallerFactory.newKogitoProcessInstanceMarshaller(); return marshaller.readProcessInstance(context); @@ -170,6 +193,7 @@ public Consumer> createdReloadFunction(Supplier env; + private Map, Object> env; public ProtobufAbstractMarshallerContext() { this.env = new HashMap<>(); @@ -40,7 +40,8 @@ public ProtobufAbstractMarshallerContext() { @SuppressWarnings("unchecked") @Override public T get(MarshallerContextName key) { - return (T) env.get(key); + T value = (T) env.get(key); + return value != null ? value : key.defaultValue(); } @Override diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufMarshallerReaderContext.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufMarshallerReaderContext.java index 8ebb519caae..a7559dfacc1 100755 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufMarshallerReaderContext.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufMarshallerReaderContext.java @@ -20,7 +20,11 @@ import java.io.InputStream; +import org.jbpm.flow.serialization.MarshallerContextName; import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; + +import com.google.protobuf.Any; public class ProtobufMarshallerReaderContext extends ProtobufAbstractMarshallerContext implements MarshallerReaderContext { @@ -35,4 +39,15 @@ public InputStream input() { return is; } + @Override + public NodeInstanceReader findNodeInstanceReader(Any nodeInstance) { + NodeInstanceReader[] readers = this.get(MarshallerContextName.MARSHALLER_NODE_INSTANCE_READER); + for (NodeInstanceReader reader : readers) { + if (reader.accept(nodeInstance)) { + return reader; + } + } + return null; + } + } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceReader.java index afb3f851c4c..e42bf3c0a58 100644 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceReader.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceReader.java @@ -21,83 +21,42 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.net.URI; -import java.util.ArrayList; import java.util.Arrays; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; -import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; import org.jbpm.flow.serialization.MarshallerContextName; import org.jbpm.flow.serialization.MarshallerReaderContext; -import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.NodeInstanceReader; import org.jbpm.flow.serialization.ProcessInstanceMarshallerListener; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.AsyncEventNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.CompositeContextNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.DynamicNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.EventNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.EventSubProcessNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.ForEachNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.JoinNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.LambdaSubProcessNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.MilestoneNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.RuleSetNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.StateNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.SubProcessNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.TimerNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.WorkItemNodeInstanceContent; import org.jbpm.flow.serialization.protobuf.KogitoProcessInstanceProtobuf; import org.jbpm.flow.serialization.protobuf.KogitoTypesProtobuf; import org.jbpm.flow.serialization.protobuf.KogitoTypesProtobuf.SLAContext; import org.jbpm.flow.serialization.protobuf.KogitoTypesProtobuf.WorkflowContext; -import org.jbpm.flow.serialization.protobuf.KogitoWorkItemsProtobuf; -import org.jbpm.flow.serialization.protobuf.KogitoWorkItemsProtobuf.HumanTaskWorkItemData; import org.jbpm.process.core.context.exclusive.ExclusiveGroup; import org.jbpm.process.core.context.swimlane.SwimlaneContext; import org.jbpm.process.core.context.variable.VariableScope; +import org.jbpm.process.instance.ContextInstanceContainer; +import org.jbpm.process.instance.ContextableInstance; import org.jbpm.process.instance.context.exclusive.ExclusiveGroupInstance; import org.jbpm.process.instance.context.swimlane.SwimlaneContextInstance; import org.jbpm.process.instance.context.variable.VariableScopeInstance; -import org.jbpm.process.instance.impl.humantask.HumanTaskWorkItemImpl; -import org.jbpm.process.instance.impl.humantask.InternalHumanTaskWorkItem; -import org.jbpm.process.instance.impl.humantask.Reassignment; import org.jbpm.ruleflow.core.WorkflowElementIdentifierFactory; import org.jbpm.ruleflow.instance.RuleFlowProcessInstance; -import org.jbpm.workflow.core.node.AsyncEventNodeInstance; +import org.jbpm.workflow.instance.NodeInstanceContainer; import org.jbpm.workflow.instance.impl.NodeInstanceImpl; -import org.jbpm.workflow.instance.node.CompositeContextNodeInstance; -import org.jbpm.workflow.instance.node.DynamicNodeInstance; -import org.jbpm.workflow.instance.node.EventNodeInstance; -import org.jbpm.workflow.instance.node.EventSubProcessNodeInstance; -import org.jbpm.workflow.instance.node.ForEachNodeInstance; -import org.jbpm.workflow.instance.node.HumanTaskNodeInstance; -import org.jbpm.workflow.instance.node.JoinInstance; -import org.jbpm.workflow.instance.node.LambdaSubProcessNodeInstance; -import org.jbpm.workflow.instance.node.MilestoneNodeInstance; -import org.jbpm.workflow.instance.node.RuleSetNodeInstance; -import org.jbpm.workflow.instance.node.StateNodeInstance; -import org.jbpm.workflow.instance.node.SubProcessNodeInstance; -import org.jbpm.workflow.instance.node.TimerNodeInstance; -import org.jbpm.workflow.instance.node.WorkItemNodeInstance; -import org.kie.api.definition.process.WorkflowElementIdentifier; import org.kie.kogito.internal.process.runtime.KogitoNodeInstance; import org.kie.kogito.internal.process.runtime.KogitoNodeInstanceContainer; import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime; import org.kie.kogito.process.impl.AbstractProcess; -import org.kie.kogito.process.workitem.Attachment; -import org.kie.kogito.process.workitem.Comment; -import org.kie.kogito.process.workitems.InternalKogitoWorkItem; -import org.kie.kogito.process.workitems.impl.KogitoWorkItemImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.protobuf.Any; -import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Descriptors.FieldDescriptor; +import com.google.protobuf.GeneratedMessageV3; import com.google.protobuf.util.JsonFormat; import static org.jbpm.flow.serialization.protobuf.ProtobufTypeRegistryFactory.protobufTypeRegistryFactoryInstance; @@ -114,7 +73,7 @@ public ProtobufProcessInstanceReader(MarshallerReaderContext context) { this.ruleFlowProcessInstance = new RuleFlowProcessInstance(); this.varReader = new ProtobufVariableReader(context); this.listeners = context.get(MarshallerContextName.MARSHALLER_INSTANCE_LISTENER); - this.listeners = this.listeners != null ? this.listeners : new ProcessInstanceMarshallerListener[0]; + context.set(MarshallerContextName.MARSHALLER_PROCESS_INSTANCE, ruleFlowProcessInstance); } public RuleFlowProcessInstance read(InputStream input) throws IOException { @@ -212,25 +171,8 @@ private RuleFlowProcessInstance buildWorkflow(KogitoProcessInstanceProtobuf.Proc } WorkflowContext workflowContext = processInstanceProtobuf.getContext(); + buildWorkflowContext(processInstance, workflowContext); - for (KogitoTypesProtobuf.NodeInstance nodeInstanceProtobuf : workflowContext.getNodeInstanceList()) { - buildNodeInstance(nodeInstanceProtobuf, processInstance); - } - - for (KogitoTypesProtobuf.NodeInstanceGroup group : workflowContext.getExclusiveGroupList()) { - Function finder = nodeInstanceId -> processInstance.getNodeInstance(nodeInstanceId, true); - processInstance.addContextInstance(ExclusiveGroup.EXCLUSIVE_GROUP, buildExclusiveGroupInstance(group, finder)); - } - - processInstance.addContextInstance(VariableScope.VARIABLE_SCOPE, new VariableScopeInstance()); - if (workflowContext.getVariableCount() > 0) { - VariableScopeInstance variableScopeInstance = (VariableScopeInstance) processInstance.getContextInstance(VariableScope.VARIABLE_SCOPE); - varReader.buildVariables(workflowContext.getVariableList()).forEach(v -> variableScopeInstance.internalSetVariable(v.getName(), v.getValue())); - } - - if (workflowContext.getIterationLevelsCount() > 0) { - processInstance.getIterationLevels().putAll(buildIterationLevels(workflowContext.getIterationLevelsList())); - } KogitoProcessRuntime runtime = ((AbstractProcess) context.get(MarshallerContextName.MARSHALLER_PROCESS)).getProcessRuntime(); Arrays.stream(listeners).forEach(e -> e.afterUnmarshallProcess(runtime, processInstance)); return processInstance; @@ -257,58 +199,27 @@ private void setCommonNodeInstanceData(RuleFlowProcessInstance processInstance, } protected NodeInstanceImpl buildNodeInstance(KogitoTypesProtobuf.NodeInstance nodeInstance, KogitoNodeInstanceContainer parent) { - final com.google.protobuf.Any nodeContentProtobuf = nodeInstance.getContent(); - NodeInstanceImpl result = null; try { - if (nodeContentProtobuf.is(RuleSetNodeInstanceContent.class)) { - RuleSetNodeInstanceContent content = nodeContentProtobuf.unpack(RuleSetNodeInstanceContent.class); - result = buildRuleSetNodeInstance(content); - } else if (nodeContentProtobuf.is(ForEachNodeInstanceContent.class)) { - ForEachNodeInstanceContent content = nodeContentProtobuf.unpack(ForEachNodeInstanceContent.class); - result = buildForEachNodeInstance(content, nodeInstance, parent); - } else if (nodeContentProtobuf.is(LambdaSubProcessNodeInstanceContent.class)) { - LambdaSubProcessNodeInstanceContent content = nodeContentProtobuf.unpack(LambdaSubProcessNodeInstanceContent.class); - result = buildLambdaSubProcessNodeInstance(content); - } else if (nodeContentProtobuf.is(SubProcessNodeInstanceContent.class)) { - SubProcessNodeInstanceContent content = nodeContentProtobuf.unpack(SubProcessNodeInstanceContent.class); - result = buildSubProcessNodeInstance(content); - } else if (nodeContentProtobuf.is(StateNodeInstanceContent.class)) { - StateNodeInstanceContent content = nodeContentProtobuf.unpack(StateNodeInstanceContent.class); - result = buildStateNodeInstance(content); - } else if (nodeContentProtobuf.is(JoinNodeInstanceContent.class)) { - JoinNodeInstanceContent content = nodeContentProtobuf.unpack(JoinNodeInstanceContent.class); - result = buildJoinInstance(content); - } else if (nodeContentProtobuf.is(TimerNodeInstanceContent.class)) { - TimerNodeInstanceContent content = nodeContentProtobuf.unpack(TimerNodeInstanceContent.class); - result = buildTimerNodeInstance(content); - } else if (nodeContentProtobuf.is(EventNodeInstanceContent.class)) { - result = buildEventNodeInstance(); - } else if (nodeContentProtobuf.is(MilestoneNodeInstanceContent.class)) { - MilestoneNodeInstanceContent content = nodeContentProtobuf.unpack(MilestoneNodeInstanceContent.class); - result = buildMilestoneNodeInstance(content); - } else if (nodeContentProtobuf.is(DynamicNodeInstanceContent.class)) { - DynamicNodeInstanceContent content = nodeContentProtobuf.unpack(DynamicNodeInstanceContent.class); - result = buildDynamicNodeInstance(content, nodeInstance, parent); - } else if (nodeContentProtobuf.is(EventSubProcessNodeInstanceContent.class)) { - EventSubProcessNodeInstanceContent content = nodeContentProtobuf.unpack(EventSubProcessNodeInstanceContent.class); - result = buildEventSubProcessNodeInstance(content); - } else if (nodeContentProtobuf.is(CompositeContextNodeInstanceContent.class)) { - CompositeContextNodeInstanceContent content = nodeContentProtobuf.unpack(CompositeContextNodeInstanceContent.class); - result = buildCompositeContextNodeInstance(content, nodeInstance, parent); - } else if (nodeContentProtobuf.is(WorkItemNodeInstanceContent.class)) { - WorkItemNodeInstanceContent content = nodeContentProtobuf.unpack(WorkItemNodeInstanceContent.class); - result = buildWorkItemNodeInstance(content); - } else if (nodeContentProtobuf.is(AsyncEventNodeInstanceContent.class)) { - AsyncEventNodeInstanceContent content = nodeContentProtobuf.unpack(AsyncEventNodeInstanceContent.class); - result = buildAsyncEventNodeInstance(content); - } + com.google.protobuf.Any nodeContentProtobuf = nodeInstance.getContent(); - if (Objects.isNull(result)) { - throw new IllegalArgumentException("Unknown node instance"); + NodeInstanceReader reader = context.findNodeInstanceReader(nodeContentProtobuf); + if (reader == null) { + throw new IllegalArgumentException("Unknown node instance " + nodeInstance); } - + LOGGER.debug("Node reader {}", reader); + NodeInstanceImpl result = (NodeInstanceImpl) reader.read(context, nodeContentProtobuf); setCommonNodeInstanceData(ruleFlowProcessInstance, parent, nodeInstance, result); + LOGGER.debug("Node {} content {}", reader.type(), nodeContentProtobuf); + GeneratedMessageV3 content = nodeContentProtobuf.unpack(reader.type()); + LOGGER.debug("Node instance being reading {}", result); + FieldDescriptor fieldDescriptor = getContextField(content); + if (fieldDescriptor != null) { + LOGGER.debug("Node instance context being reading {}", result); + KogitoTypesProtobuf.WorkflowContext workflowContext = (KogitoTypesProtobuf.WorkflowContext) content.getField(fieldDescriptor); + buildWorkflowContext((NodeInstanceContainer & ContextInstanceContainer & ContextableInstance) result, workflowContext); + } + SLAContext slaNodeInstanceContext = nodeInstance.getSla(); result.internalSetSlaCompliance(slaNodeInstanceContext.getSlaCompliance()); if (slaNodeInstanceContext.getSlaDueDate() > 0) { @@ -324,282 +235,25 @@ protected NodeInstanceImpl buildNodeInstance(KogitoTypesProtobuf.NodeInstance no Arrays.stream(listeners).forEach(e -> e.afterUnmarshallNode(runtime, kogitoNodeInstance)); return result; } catch (IOException e) { - throw new IllegalArgumentException("Cannot read node instance content"); + throw new IllegalArgumentException("Cannot read node instance content", e); } } - private NodeInstanceImpl buildAsyncEventNodeInstance(AsyncEventNodeInstanceContent content) { - AsyncEventNodeInstance nodeInstance = new AsyncEventNodeInstance(); - nodeInstance.setJobId(content.getJobId()); - return nodeInstance; - } - - private NodeInstanceImpl buildCompositeContextNodeInstance(CompositeContextNodeInstanceContent content, KogitoTypesProtobuf.NodeInstance protoNodeInstance, - KogitoNodeInstanceContainer parentContainer) { - CompositeContextNodeInstance nodeInstance = new CompositeContextNodeInstance(); - - if (content.getTimerInstanceIdCount() > 0) { - List timerInstances = new ArrayList<>(); - for (String _timerId : content.getTimerInstanceIdList()) { - timerInstances.add(_timerId); + public FieldDescriptor getContextField(GeneratedMessageV3 message) { + for (FieldDescriptor field : message.getDescriptorForType().getFields()) { + if ("context".equals(field.getName())) { + return field; } - nodeInstance.internalSetTimerInstances(timerInstances); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); - } - - setCommonNodeInstanceData(ruleFlowProcessInstance, parentContainer, protoNodeInstance, nodeInstance); - - buildWorkflowContext(nodeInstance, content.getContext()); - return nodeInstance; - } - - private NodeInstanceImpl buildEventSubProcessNodeInstance(EventSubProcessNodeInstanceContent content) { - EventSubProcessNodeInstance nodeInstance = new EventSubProcessNodeInstance(); - - if (content.getTimerInstanceIdCount() > 0) { - List timerInstances = new ArrayList<>(); - for (String _timerId : content.getTimerInstanceIdList()) { - timerInstances.add(_timerId); - } - nodeInstance.internalSetTimerInstances(timerInstances); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); - } - buildWorkflowContext(nodeInstance, content.getContext()); - return nodeInstance; - } - - private NodeInstanceImpl buildDynamicNodeInstance(DynamicNodeInstanceContent content, KogitoTypesProtobuf.NodeInstance protoNodeInstance, - KogitoNodeInstanceContainer parentContainer) { - DynamicNodeInstance nodeInstance = new DynamicNodeInstance(); - if (content.getTimerInstanceIdCount() > 0) { - List timerInstances = new ArrayList<>(); - for (String _timerId : content.getTimerInstanceIdList()) { - timerInstances.add(_timerId); - } - nodeInstance.internalSetTimerInstances(timerInstances); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); - } - - setCommonNodeInstanceData(ruleFlowProcessInstance, parentContainer, protoNodeInstance, nodeInstance); - buildWorkflowContext(nodeInstance, content.getContext()); - - return nodeInstance; - - } - - private NodeInstanceImpl buildMilestoneNodeInstance(MilestoneNodeInstanceContent content) { - MilestoneNodeInstance nodeInstance = new MilestoneNodeInstance(); - if (content.getTimerInstanceIdCount() > 0) { - List timerInstances = new ArrayList<>(); - for (String _timerId : content.getTimerInstanceIdList()) { - timerInstances.add(_timerId); - } - nodeInstance.internalSetTimerInstances(timerInstances); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); - } - return nodeInstance; - } - - private NodeInstanceImpl buildEventNodeInstance() { - return new EventNodeInstance(); - } - - private NodeInstanceImpl buildTimerNodeInstance(TimerNodeInstanceContent content) { - TimerNodeInstance nodeInstance = new TimerNodeInstance(); - nodeInstance.internalSetTimerId(content.getTimerId()); - return nodeInstance; - } - - private NodeInstanceImpl buildJoinInstance(JoinNodeInstanceContent content) { - JoinInstance nodeInstance = new JoinInstance(); - if (content.getTriggerCount() > 0) { - Map triggers = new HashMap<>(); - for (JoinNodeInstanceContent.JoinTrigger _join : content.getTriggerList()) { - LOGGER.info("unmarshalling join {}", _join.getNodeId()); - triggers.put(WorkflowElementIdentifierFactory.fromExternalFormat(_join.getNodeId()), _join.getCounter()); - } - nodeInstance.internalSetTriggers(triggers); - } - return nodeInstance; - } - - private NodeInstanceImpl buildStateNodeInstance(StateNodeInstanceContent content) { - StateNodeInstance nodeInstance = new StateNodeInstance(); - if (content.getTimerInstanceIdCount() > 0) { - List timerInstances = new ArrayList<>(); - for (String _timerId : content.getTimerInstanceIdList()) { - timerInstances.add(_timerId); - } - nodeInstance.internalSetTimerInstances(timerInstances); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); } - return nodeInstance; + return null; } - private NodeInstanceImpl buildSubProcessNodeInstance(SubProcessNodeInstanceContent content) { - SubProcessNodeInstance nodeInstance = new SubProcessNodeInstance(); - nodeInstance.internalSetProcessInstanceId(content.getProcessInstanceId()); - if (content.getTimerInstanceIdCount() > 0) { - List timerInstances = new ArrayList<>(); - for (String timerId : content.getTimerInstanceIdList()) { - timerInstances.add(timerId); - } - nodeInstance.internalSetTimerInstances(timerInstances); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); - } - - return nodeInstance; - } - - private NodeInstanceImpl buildLambdaSubProcessNodeInstance(LambdaSubProcessNodeInstanceContent content) { - LambdaSubProcessNodeInstance nodeInstance = new LambdaSubProcessNodeInstance(); - nodeInstance.internalSetProcessInstanceId(content.getProcessInstanceId()); - if (content.getTimerInstanceIdCount() > 0) { - nodeInstance.internalSetTimerInstances(new ArrayList<>(content.getTimerInstanceIdList())); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); - } - return nodeInstance; - } - - private NodeInstanceImpl buildForEachNodeInstance(ForEachNodeInstanceContent content, KogitoTypesProtobuf.NodeInstance protoNodeInstance, KogitoNodeInstanceContainer parentContainer) { - ForEachNodeInstance nodeInstance = new ForEachNodeInstance(); - nodeInstance.setExecutedInstances(content.getExecutedInstances()); - nodeInstance.setTotalInstances(content.getTotalInstances()); - nodeInstance.setHasAsyncInstances(content.getHasAsyncInstances()); - - setCommonNodeInstanceData(ruleFlowProcessInstance, parentContainer, protoNodeInstance, nodeInstance); - buildWorkflowContext(nodeInstance, content.getContext()); - return nodeInstance; - } - - private NodeInstanceImpl buildRuleSetNodeInstance(RuleSetNodeInstanceContent content) { - RuleSetNodeInstance nodeInstance = new RuleSetNodeInstance(); - nodeInstance.setRuleFlowGroup(content.getRuleFlowGroup()); - if (content.getTimerInstanceIdCount() > 0) { - nodeInstance.internalSetTimerInstances(new ArrayList<>(content.getTimerInstanceIdList())); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); - } - - return nodeInstance; - } - - private NodeInstanceImpl buildWorkItemNodeInstance(WorkItemNodeInstanceContent content) { - try { - WorkItemNodeInstance nodeInstance = instanceWorkItem(content); - if (nodeInstance instanceof HumanTaskNodeInstance) { - HumanTaskNodeInstance humanTaskNodeInstance = (HumanTaskNodeInstance) nodeInstance; - InternalHumanTaskWorkItem workItem = humanTaskNodeInstance.getWorkItem(); - Any workItemDataMessage = content.getWorkItemData(); - if (workItemDataMessage.is(HumanTaskWorkItemData.class)) { - HumanTaskWorkItemData workItemData = workItemDataMessage.unpack(HumanTaskWorkItemData.class); - humanTaskNodeInstance.getNotCompletedDeadlineTimers().putAll(buildDeadlines(workItemData.getCompletedDeadlinesMap())); - humanTaskNodeInstance.getNotCompletedReassigments().putAll(buildReassignments(workItemData.getCompletedReassigmentsMap())); - humanTaskNodeInstance.getNotStartedDeadlineTimers().putAll(buildDeadlines(workItemData.getStartDeadlinesMap())); - humanTaskNodeInstance.getNotStartedReassignments().putAll(buildReassignments(workItemData.getStartReassigmentsMap())); - - if (workItemData.hasTaskName()) { - workItem.setTaskName(workItemData.getTaskName()); - } - if (workItemData.hasTaskDescription()) { - workItem.setTaskDescription(workItemData.getTaskDescription()); - } - if (workItemData.hasTaskPriority()) { - workItem.setTaskPriority(workItemData.getTaskPriority()); - } - if (workItemData.hasTaskReferenceName()) { - workItem.setReferenceName(workItemData.getTaskReferenceName()); - } - if (workItemData.hasActualOwner()) { - workItem.setActualOwner(workItemData.getActualOwner()); - } - workItem.getAdminUsers().addAll(workItemData.getAdminUsersList()); - workItem.getAdminGroups().addAll(workItemData.getAdminGroupsList()); - workItem.getPotentialUsers().addAll(workItemData.getPotUsersList()); - workItem.getPotentialGroups().addAll(workItemData.getPotGroupsList()); - workItem.getExcludedUsers().addAll(workItemData.getExcludedUsersList()); - workItem.getComments().putAll(workItemData.getCommentsList().stream().map(this::buildComment).collect(Collectors.toMap(Comment::getId, Function.identity()))); - workItem.getAttachments().putAll(workItemData.getAttachmentsList().stream().map(this::buildAttachment).collect(Collectors.toMap(Attachment::getId, Function.identity()))); - - } - - } - - nodeInstance.internalSetWorkItemId(content.getWorkItemId()); - InternalKogitoWorkItem workItem = (InternalKogitoWorkItem) nodeInstance.getWorkItem(); - workItem.setId(content.getWorkItemId()); - workItem.setProcessInstanceId(ruleFlowProcessInstance.getStringId()); - workItem.setName(content.getName()); - workItem.setState(content.getState()); - workItem.setDeploymentId(ruleFlowProcessInstance.getDeploymentId()); - workItem.setProcessInstance(ruleFlowProcessInstance); - workItem.setPhaseId(content.getPhaseId()); - workItem.setPhaseStatus(content.getPhaseStatus()); - workItem.setStartDate(new Date(content.getStartDate())); - if (content.getCompleteDate() > 0) { - workItem.setCompleteDate(new Date(content.getCompleteDate())); - } - - if (content.getTimerInstanceIdCount() > 0) { - nodeInstance.internalSetTimerInstances(new ArrayList<>(content.getTimerInstanceIdList())); - } - if (!content.getTimerInstanceReferenceMap().isEmpty()) { - nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); - } - nodeInstance.internalSetProcessInstanceId(content.getErrorHandlingProcessInstanceId()); - varReader.buildVariables(content.getVariableList()).forEach(var -> nodeInstance.getWorkItem().getParameters().put(var.getName(), var.getValue())); - varReader.buildVariables(content.getResultList()).forEach(var -> nodeInstance.getWorkItem().getResults().put(var.getName(), var.getValue())); - return nodeInstance; - } catch (InvalidProtocolBufferException ex) { - throw new ProcessInstanceMarshallerException("cannot unpack node instance", ex); - } - } - - private WorkItemNodeInstance instanceWorkItem(WorkItemNodeInstanceContent content) { - if (content.hasWorkItemData()) { - Any workItemDataMessage = content.getWorkItemData(); - if (workItemDataMessage.is(HumanTaskWorkItemData.class)) { - HumanTaskNodeInstance nodeInstance = new HumanTaskNodeInstance(); - HumanTaskWorkItemImpl workItem = new HumanTaskWorkItemImpl(); - nodeInstance.internalSetWorkItem(workItem); - return nodeInstance; - } else { - throw new ProcessInstanceMarshallerException("Don't know which type of work item is"); - } - } else { - WorkItemNodeInstance nodeInstance = new WorkItemNodeInstance(); - KogitoWorkItemImpl workItem = new KogitoWorkItemImpl(); - workItem.setId(UUID.randomUUID().toString()); - nodeInstance.internalSetWorkItem(workItem); - return nodeInstance; - } - } - - private void buildWorkflowContext(CompositeContextNodeInstance container, WorkflowContext workflowContext) { + private void buildWorkflowContext(T container, WorkflowContext workflowContext) { if (workflowContext.getNodeInstanceCount() > 0) { for (KogitoTypesProtobuf.NodeInstance nodeInstanceProtobuf : workflowContext.getNodeInstanceList()) { buildNodeInstance(nodeInstanceProtobuf, container); } } - for (KogitoTypesProtobuf.NodeInstanceGroup group : workflowContext.getExclusiveGroupList()) { - Function finder = nodeInstanceId -> container.getNodeInstance(nodeInstanceId, true); - container.addContextInstance(ExclusiveGroup.EXCLUSIVE_GROUP, buildExclusiveGroupInstance(group, finder)); - } container.addContextInstance(VariableScope.VARIABLE_SCOPE, new VariableScopeInstance()); if (workflowContext.getVariableCount() > 0) { @@ -609,6 +263,10 @@ private void buildWorkflowContext(CompositeContextNodeInstance container, Workfl if (workflowContext.getIterationLevelsCount() > 0) { container.getIterationLevels().putAll(buildIterationLevels(workflowContext.getIterationLevelsList())); } + for (KogitoTypesProtobuf.NodeInstanceGroup group : workflowContext.getExclusiveGroupList()) { + Function finder = nodeInstanceId -> container.getNodeInstance(nodeInstanceId, true); + container.addContextInstance(ExclusiveGroup.EXCLUSIVE_GROUP, buildExclusiveGroupInstance(group, finder)); + } } private ExclusiveGroupInstance buildExclusiveGroupInstance(KogitoTypesProtobuf.NodeInstanceGroup group, Function finder) { @@ -629,39 +287,4 @@ private Map buildIterationLevels(List> buildDeadlines(Map deadlinesProtobuf) { - Map> deadlines = new HashMap<>(); - for (Map.Entry entry : deadlinesProtobuf.entrySet()) { - Map notification = new HashMap<>(); - for (Map.Entry pair : entry.getValue().getContentMap().entrySet()) { - notification.put(pair.getKey(), pair.getValue()); - } - deadlines.put(entry.getKey(), notification); - } - return deadlines; - } - - private Map buildReassignments(Map reassignmentsProtobuf) { - Map reassignments = new HashMap<>(); - for (Map.Entry entry : reassignmentsProtobuf.entrySet()) { - reassignments.put(entry.getKey(), new Reassignment(entry.getValue().getUsersList().stream().collect(Collectors - .toSet()), entry.getValue().getGroupsList().stream().collect(Collectors.toSet()))); - } - return reassignments; - } } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceWriter.java index 23ffb8becea..b0f67430dbb 100644 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceWriter.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceWriter.java @@ -26,72 +26,39 @@ import java.util.Collections; import java.util.Comparator; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.stream.Collectors; import org.jbpm.flow.serialization.MarshallerContextName; import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; import org.jbpm.flow.serialization.ProcessInstanceMarshallerListener; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.AsyncEventNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.CompositeContextNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.DynamicNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.EventNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.EventSubProcessNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.ForEachNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.JoinNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.JoinNodeInstanceContent.JoinTrigger; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.LambdaSubProcessNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.MilestoneNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.RuleSetNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.StateNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.SubProcessNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.TimerNodeInstanceContent; -import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.WorkItemNodeInstanceContent; import org.jbpm.flow.serialization.protobuf.KogitoProcessInstanceProtobuf; import org.jbpm.flow.serialization.protobuf.KogitoTypesProtobuf; import org.jbpm.flow.serialization.protobuf.KogitoTypesProtobuf.WorkflowContext; -import org.jbpm.flow.serialization.protobuf.KogitoWorkItemsProtobuf; -import org.jbpm.flow.serialization.protobuf.KogitoWorkItemsProtobuf.HumanTaskWorkItemData; import org.jbpm.process.core.context.exclusive.ExclusiveGroup; import org.jbpm.process.core.context.swimlane.SwimlaneContext; import org.jbpm.process.core.context.variable.VariableScope; import org.jbpm.process.instance.ContextInstance; +import org.jbpm.process.instance.ContextInstanceContainer; +import org.jbpm.process.instance.ContextableInstance; import org.jbpm.process.instance.context.exclusive.ExclusiveGroupInstance; import org.jbpm.process.instance.context.swimlane.SwimlaneContextInstance; import org.jbpm.process.instance.context.variable.VariableScopeInstance; -import org.jbpm.process.instance.impl.humantask.Reassignment; -import org.jbpm.workflow.core.node.AsyncEventNodeInstance; +import org.jbpm.ruleflow.instance.RuleFlowProcessInstance; +import org.jbpm.workflow.instance.NodeInstanceContainer; import org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl; -import org.jbpm.workflow.instance.node.CompositeContextNodeInstance; -import org.jbpm.workflow.instance.node.DynamicNodeInstance; -import org.jbpm.workflow.instance.node.EventNodeInstance; -import org.jbpm.workflow.instance.node.EventSubProcessNodeInstance; -import org.jbpm.workflow.instance.node.ForEachNodeInstance; -import org.jbpm.workflow.instance.node.HumanTaskNodeInstance; -import org.jbpm.workflow.instance.node.JoinInstance; -import org.jbpm.workflow.instance.node.LambdaSubProcessNodeInstance; -import org.jbpm.workflow.instance.node.MilestoneNodeInstance; -import org.jbpm.workflow.instance.node.RuleSetNodeInstance; -import org.jbpm.workflow.instance.node.StateNodeInstance; -import org.jbpm.workflow.instance.node.SubProcessNodeInstance; -import org.jbpm.workflow.instance.node.TimerNodeInstance; -import org.jbpm.workflow.instance.node.WorkItemNodeInstance; -import org.kie.api.definition.process.WorkflowElementIdentifier; import org.kie.api.runtime.process.NodeInstance; import org.kie.kogito.internal.process.runtime.KogitoNodeInstance; import org.kie.kogito.internal.process.runtime.KogitoProcessRuntime; -import org.kie.kogito.internal.process.runtime.KogitoWorkItem; import org.kie.kogito.process.impl.AbstractProcess; -import org.kie.kogito.process.workitem.Attachment; -import org.kie.kogito.process.workitem.Comment; -import org.kie.kogito.process.workitem.HumanTaskWorkItem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.protobuf.Any; +import com.google.protobuf.Descriptors.FieldDescriptor; +import com.google.protobuf.GeneratedMessageV3; import com.google.protobuf.util.JsonFormat; import static org.jbpm.flow.serialization.MarshallerContextName.MARSHALLER_FORMAT; @@ -108,10 +75,11 @@ public ProtobufProcessInstanceWriter(MarshallerWriterContext context) { this.context = context; this.varWriter = new ProtobufVariableWriter(context); this.listeners = context.get(MarshallerContextName.MARSHALLER_INSTANCE_LISTENER); - this.listeners = this.listeners != null ? this.listeners : new ProcessInstanceMarshallerListener[0]; } public void writeProcessInstance(WorkflowProcessInstanceImpl workFlow, OutputStream os) throws IOException { + context.set(MarshallerContextName.MARSHALLER_PROCESS_INSTANCE, (RuleFlowProcessInstance) workFlow); + LOGGER.debug("writing process instance {}", workFlow.getId()); KogitoProcessRuntime runtime = ((AbstractProcess) context.get(MarshallerContextName.MARSHALLER_PROCESS)).getProcessRuntime(); Arrays.stream(listeners).forEach(e -> e.beforeMarshallProcess(runtime, workFlow)); @@ -166,12 +134,7 @@ public void writeProcessInstance(WorkflowProcessInstanceImpl workFlow, OutputStr instance.addAllSwimlaneContext(buildSwimlaneContexts((SwimlaneContextInstance) workFlow.getContextInstance(SwimlaneContext.SWIMLANE_SCOPE))); - List nodeInstances = new ArrayList<>(workFlow.getNodeInstances()); - List exclusiveGroupInstances = workFlow.getContextInstances(ExclusiveGroup.EXCLUSIVE_GROUP); - VariableScopeInstance variableScopeInstance = (VariableScopeInstance) workFlow.getContextInstance(VariableScope.VARIABLE_SCOPE); - List> variables = new ArrayList<>(variableScopeInstance.getVariables().entrySet()); - List> iterationlevels = new ArrayList<>(workFlow.getIterationLevels().entrySet()); - instance.setContext(buildWorkflowContext(nodeInstances, exclusiveGroupInstances, variables, iterationlevels)); + instance.setContext(buildWorkflowContext(workFlow)); KogitoProcessInstanceProtobuf.ProcessInstance piProtobuf = instance.build(); @@ -251,216 +214,41 @@ private List) context.get(MarshallerContextName.MARSHALLER_PROCESS)).getProcessRuntime(); Arrays.stream(listeners).forEach(e -> e.beforeMarshallNode(runtime, (KogitoNodeInstance) nodeInstance)); - if (nodeInstance instanceof RuleSetNodeInstance) { - return buildRuleSetNodeInstance((RuleSetNodeInstance) nodeInstance); - } else if (nodeInstance instanceof ForEachNodeInstance) { - return buildForEachNodeInstance((ForEachNodeInstance) nodeInstance); - } else if (nodeInstance instanceof LambdaSubProcessNodeInstance) { - return buildLambdaSubProcessNodeInstance((LambdaSubProcessNodeInstance) nodeInstance); - } else if (nodeInstance instanceof SubProcessNodeInstance) { - return buildSubProcessNodeInstance((SubProcessNodeInstance) nodeInstance); - } else if (nodeInstance instanceof StateNodeInstance) { - return buildStateNodeInstance((StateNodeInstance) nodeInstance); - } else if (nodeInstance instanceof JoinInstance) { - return buildJoinInstance((JoinInstance) nodeInstance); - } else if (nodeInstance instanceof TimerNodeInstance) { - return buildTimerNodeInstance((TimerNodeInstance) nodeInstance); - } else if (nodeInstance instanceof AsyncEventNodeInstance) { - return buildAsyncEventNodeInstance((AsyncEventNodeInstance) nodeInstance); - } else if (nodeInstance instanceof EventNodeInstance) { - return buildEventNodeInstance(); - } else if (nodeInstance instanceof MilestoneNodeInstance) { - return buildMilestoneNodeInstance((MilestoneNodeInstance) nodeInstance); - } else if (nodeInstance instanceof DynamicNodeInstance) { - return buildDynamicNodeInstance((DynamicNodeInstance) nodeInstance); - } else if (nodeInstance instanceof EventSubProcessNodeInstance) { - return buildEventSubProcessNodeInstance((EventSubProcessNodeInstance) nodeInstance); - } else if (nodeInstance instanceof CompositeContextNodeInstance) { - return buildCompositeContextNodeInstance((CompositeContextNodeInstance) nodeInstance); - } else if (nodeInstance instanceof HumanTaskNodeInstance) { - return buildHumanTaskNodeInstance((HumanTaskNodeInstance) nodeInstance); - } else if (nodeInstance instanceof WorkItemNodeInstance) { - return buildWorkItemNodeInstance((WorkItemNodeInstance) nodeInstance); - } else { + NodeInstanceWriter writer = context.findNodeInstanceWriter(nodeInstance); + if (writer == null) { throw new IllegalArgumentException("Unknown node instance type: " + nodeInstance); } - } - - private Any buildAsyncEventNodeInstance(AsyncEventNodeInstance nodeInstance) { - AsyncEventNodeInstanceContent.Builder builder = AsyncEventNodeInstanceContent.newBuilder(); - if (nodeInstance.getJobId() != null) { - builder.setJobId(nodeInstance.getJobId()); - } - return Any.pack(builder.build()); - } - - private Any buildRuleSetNodeInstance(RuleSetNodeInstance nodeInstance) { - RuleSetNodeInstanceContent.Builder ruleSet = RuleSetNodeInstanceContent.newBuilder(); - ruleSet.setRuleFlowGroup(nodeInstance.getRuleFlowGroup()); - ruleSet.addAllTimerInstanceId(nodeInstance.getTimerInstances()); - if (nodeInstance.getTimerInstancesReference() != null) { - ruleSet.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } - return Any.pack(ruleSet.build()); - } - - private Any buildForEachNodeInstance(ForEachNodeInstance nodeInstance) { - ForEachNodeInstanceContent.Builder foreachBuilder = ForEachNodeInstanceContent.newBuilder(); - - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - foreachBuilder.addAllTimerInstanceId(timerInstances); - } - if (nodeInstance.getTimerInstancesReference() != null) { - foreachBuilder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } - List nodeInstances = nodeInstance.getNodeInstances().stream().filter(CompositeContextNodeInstance.class::isInstance).collect(Collectors.toList()); - - List exclusiveGroupInstances = nodeInstance.getContextInstances(ExclusiveGroup.EXCLUSIVE_GROUP); - VariableScopeInstance variableScopeInstance = (VariableScopeInstance) nodeInstance.getContextInstance(VariableScope.VARIABLE_SCOPE); - List> variables = (variableScopeInstance != null) ? new ArrayList<>(variableScopeInstance.getVariables().entrySet()) : Collections.emptyList(); - List> iterationlevels = new ArrayList<>(nodeInstance.getIterationLevels().entrySet()); - foreachBuilder.setContext(buildWorkflowContext(nodeInstances, exclusiveGroupInstances, variables, iterationlevels)); - - foreachBuilder - .setTotalInstances(nodeInstance.getTotalInstances()) - .setExecutedInstances(nodeInstance.getExecutedInstances()) - .setHasAsyncInstances(nodeInstance.getHasAsyncInstances()); - return Any.pack(foreachBuilder.build()); - } - - private Any buildLambdaSubProcessNodeInstance(LambdaSubProcessNodeInstance nodeInstance) { - LambdaSubProcessNodeInstanceContent.Builder builder = LambdaSubProcessNodeInstanceContent.newBuilder(); - builder.setProcessInstanceId(nodeInstance.getProcessInstanceId()); - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - builder.addAllTimerInstanceId(timerInstances); - } - if (nodeInstance.getTimerInstancesReference() != null) { - builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } - return Any.pack(builder.build()); - } + LOGGER.debug("Node writer {}", writer); + GeneratedMessageV3.Builder builder = writer.write(context, nodeInstance); - private Any buildSubProcessNodeInstance(SubProcessNodeInstance nodeInstance) { - SubProcessNodeInstanceContent.Builder builder = SubProcessNodeInstanceContent.newBuilder(); - builder.setProcessInstanceId(nodeInstance.getProcessInstanceId()); - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - builder.addAllTimerInstanceId(timerInstances); + LOGGER.debug("Node instance being writing {}", nodeInstance); + FieldDescriptor fieldContext = getContextField(builder); + if (fieldContext != null) { + LOGGER.debug("Node instance context being writing {}", nodeInstance); + builder.setField(fieldContext, buildWorkflowContext((NodeInstanceContainer & ContextInstanceContainer & ContextableInstance) nodeInstance)); } - if (nodeInstance.getTimerInstancesReference() != null) { - builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } - return Any.pack(builder.build()); - } - private Any buildStateNodeInstance(StateNodeInstance nodeInstance) { - StateNodeInstanceContent.Builder builder = StateNodeInstanceContent.newBuilder(); - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - builder.addAllTimerInstanceId(timerInstances); - } - if (nodeInstance.getTimerInstancesReference() != null) { - builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } return Any.pack(builder.build()); } - private Any buildJoinInstance(JoinInstance nodeInstance) { - JoinNodeInstanceContent.Builder joinBuilder = JoinNodeInstanceContent.newBuilder(); - Map triggers = nodeInstance.getTriggers(); - List keys = new ArrayList<>(triggers.keySet()); - Collections.sort(keys); - - for (WorkflowElementIdentifier key : keys) { - LOGGER.info("marshalling join {}", key.toExternalFormat()); - joinBuilder.addTrigger(JoinTrigger.newBuilder() - .setNodeId(key.toExternalFormat()) - .setCounter(triggers.get(key)) - .build()); - } - - return Any.pack(joinBuilder.build()); - } - - private Any buildTimerNodeInstance(TimerNodeInstance nodeInstance) { - return Any.pack(TimerNodeInstanceContent.newBuilder().setTimerId(nodeInstance.getTimerId()).build()); - } - - private Any buildEventNodeInstance() { - return Any.pack(EventNodeInstanceContent.newBuilder().build()); - } - - private Any buildMilestoneNodeInstance(MilestoneNodeInstance nodeInstance) { - MilestoneNodeInstanceContent.Builder builder = MilestoneNodeInstanceContent.newBuilder(); - - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - builder.addAllTimerInstanceId(timerInstances); - } - if (nodeInstance.getTimerInstancesReference() != null) { - builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } - return Any.pack(builder.build()); - } - - private Any buildDynamicNodeInstance(DynamicNodeInstance nodeInstance) { - - DynamicNodeInstanceContent.Builder builder = DynamicNodeInstanceContent.newBuilder(); - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - builder.addAllTimerInstanceId(timerInstances); - } - if (nodeInstance.getTimerInstancesReference() != null) { - builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } - - builder.setContext(buildWorkflowContext(nodeInstance)); - - return Any.pack(builder.build()); - } - - private Any buildEventSubProcessNodeInstance(EventSubProcessNodeInstance nodeInstance) { - - EventSubProcessNodeInstanceContent.Builder builder = EventSubProcessNodeInstanceContent.newBuilder(); - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - builder.addAllTimerInstanceId(timerInstances); - } - if (nodeInstance.getTimerInstancesReference() != null) { - builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } - - builder.setContext(buildWorkflowContext(nodeInstance)); - - return Any.pack(builder.build()); - } - - private Any buildCompositeContextNodeInstance(CompositeContextNodeInstance nodeInstance) { - - CompositeContextNodeInstanceContent.Builder builder = CompositeContextNodeInstanceContent.newBuilder(); - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - builder.addAllTimerInstanceId(timerInstances); - } - if (nodeInstance.getTimerInstancesReference() != null) { - builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + public FieldDescriptor getContextField(GeneratedMessageV3.Builder builder) { + for (FieldDescriptor field : builder.getDescriptorForType().getFields()) { + if ("context".equals(field.getName())) { + return field; + } } - - builder.setContext(buildWorkflowContext(nodeInstance)); - - return Any.pack(builder.build()); + return null; } - private WorkflowContext buildWorkflowContext(CompositeContextNodeInstance nodeInstance) { + private WorkflowContext buildWorkflowContext(T nodeInstance) { List nodeInstances = new ArrayList<>(nodeInstance.getNodeInstances()); List exclusiveGroupInstances = nodeInstance.getContextInstances(ExclusiveGroup.EXCLUSIVE_GROUP); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) nodeInstance.getContextInstance(VariableScope.VARIABLE_SCOPE); @@ -469,46 +257,6 @@ private WorkflowContext buildWorkflowContext(CompositeContextNodeInstance nodeIn return buildWorkflowContext(nodeInstances, exclusiveGroupInstances, variables, iterationlevels); } - private Any buildWorkItemNodeInstance(WorkItemNodeInstance nodeInstance) { - return Any.pack(buildWorkItemNodeInstanceBuilder(nodeInstance).build()); - } - - private WorkItemNodeInstanceContent.Builder buildWorkItemNodeInstanceBuilder(WorkItemNodeInstance nodeInstance) { - WorkItemNodeInstanceContent.Builder builder = WorkItemNodeInstanceContent.newBuilder(); - - List timerInstances = nodeInstance.getTimerInstances(); - if (timerInstances != null) { - builder.addAllTimerInstanceId(timerInstances); - } - if (nodeInstance.getTimerInstancesReference() != null) { - builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); - } - if (nodeInstance.getExceptionHandlingProcessInstanceId() != null) { - builder.setErrorHandlingProcessInstanceId(nodeInstance.getExceptionHandlingProcessInstanceId()); - } - KogitoWorkItem workItem = nodeInstance.getWorkItem(); - - builder.setWorkItemId(nodeInstance.getWorkItemId()) - .setName(workItem.getName()) - .setState(workItem.getState()) - .setPhaseId(workItem.getPhaseId()) - .setPhaseStatus(workItem.getPhaseStatus()) - .setStartDate(workItem.getStartDate().getTime()) - .addAllVariable(varWriter.buildVariables(new ArrayList<>(workItem.getParameters().entrySet()))) - .addAllResult(varWriter.buildVariables(new ArrayList<>(workItem.getResults().entrySet()))); - - if (workItem.getCompleteDate() != null) { - builder.setCompleteDate(workItem.getCompleteDate().getTime()); - } - return builder; - } - - private Any buildHumanTaskNodeInstance(HumanTaskNodeInstance nodeInstance) { - WorkItemNodeInstanceContent.Builder builder = buildWorkItemNodeInstanceBuilder(nodeInstance); - builder.setWorkItemData(Any.pack(buildHumanTaskWorkItemData(nodeInstance, (HumanTaskWorkItem) nodeInstance.getWorkItem()))); - return Any.pack(builder.build()); - } - private List buildGroups(List exclusiveGroupInstances) { if (exclusiveGroupInstances == null) { return Collections.emptyList(); @@ -545,121 +293,4 @@ private List buildIterationLevels(List buildComments(Iterable comments) { - List commentsProtobuf = new ArrayList<>(); - for (Comment comment : comments) { - KogitoWorkItemsProtobuf.Comment workItemComment = KogitoWorkItemsProtobuf.Comment.newBuilder() - .setId(comment.getId().toString()) - .setContent(comment.getContent()) - .setUpdatedBy(comment.getUpdatedBy()) - .setUpdatedAt(comment.getUpdatedAt().getTime()) - .build(); - commentsProtobuf.add(workItemComment); - } - return commentsProtobuf; - } - - private List buildAttachments(Iterable attachments) { - List attachmentProtobuf = new ArrayList<>(); - for (Attachment attachment : attachments) { - KogitoWorkItemsProtobuf.Attachment workItemAttachment = KogitoWorkItemsProtobuf.Attachment.newBuilder() - .setId(attachment.getId().toString()).setContent(attachment.getContent().toString()) - .setUpdatedBy(attachment.getUpdatedBy()).setUpdatedAt(attachment.getUpdatedAt().getTime()) - .setName(attachment.getName()) - .build(); - attachmentProtobuf.add(workItemAttachment); - } - return attachmentProtobuf; - } - - private Map buildDeadlines(Map> deadlines) { - Map deadlinesProtobuf = new HashMap<>(); - for (Map.Entry> entry : deadlines.entrySet()) { - KogitoWorkItemsProtobuf.Deadline.Builder builder = KogitoWorkItemsProtobuf.Deadline.newBuilder(); - entry.getValue().forEach((k, v) -> builder.putContent(k, v.toString())); - deadlinesProtobuf.put(entry.getKey(), builder.build()); - } - return deadlinesProtobuf; - } - - private Map buildReassignments(Map reassignments) { - Map reassignmentsProtobuf = new HashMap<>(); - for (Map.Entry entry : reassignments.entrySet()) { - KogitoWorkItemsProtobuf.Reassignment.Builder builder = KogitoWorkItemsProtobuf.Reassignment.newBuilder(); - builder.addAllGroups(entry.getValue().getPotentialGroups()); - builder.addAllUsers(entry.getValue().getPotentialUsers()); - reassignmentsProtobuf.put(entry.getKey(), builder.build()); - } - return reassignmentsProtobuf; - } - } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessMarshallerWriteContext.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessMarshallerWriteContext.java index 906bd9da1ae..74fb7a559d8 100755 --- a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessMarshallerWriteContext.java +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessMarshallerWriteContext.java @@ -20,14 +20,16 @@ import java.io.OutputStream; +import org.jbpm.flow.serialization.MarshallerContextName; import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.kie.api.runtime.process.NodeInstance; /** * Extension to default MarshallerWriteContext */ public class ProtobufProcessMarshallerWriteContext extends ProtobufAbstractMarshallerContext implements MarshallerWriterContext { - private OutputStream os; public ProtobufProcessMarshallerWriteContext(OutputStream os) { @@ -39,4 +41,15 @@ public OutputStream output() { return os; } + @Override + public NodeInstanceWriter findNodeInstanceWriter(NodeInstance nodeInstance) { + NodeInstanceWriter[] writers = this.get(MarshallerContextName.MARSHALLER_NODE_INSTANCE_WRITER); + for (NodeInstanceWriter writer : writers) { + if (writer.accept(nodeInstance)) { + return writer; + } + } + return null; + } + } diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/AsyncEventNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/AsyncEventNodeInstanceReader.java new file mode 100644 index 00000000000..285165186c0 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/AsyncEventNodeInstanceReader.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.AsyncEventNodeInstanceContent; +import org.jbpm.workflow.core.node.AsyncEventNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class AsyncEventNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(AsyncEventNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any marshalled) { + try { + AsyncEventNodeInstanceContent content = marshalled.unpack(AsyncEventNodeInstanceContent.class); + AsyncEventNodeInstance nodeInstance = new AsyncEventNodeInstance(); + nodeInstance.setJobId(content.getJobId()); + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return AsyncEventNodeInstanceContent.class; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/AsyncEventNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/AsyncEventNodeInstanceWriter.java new file mode 100644 index 00000000000..69445449f61 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/AsyncEventNodeInstanceWriter.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.AsyncEventNodeInstanceContent; +import org.jbpm.workflow.core.node.AsyncEventNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class AsyncEventNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof AsyncEventNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + AsyncEventNodeInstance nodeInstance = (AsyncEventNodeInstance) value; + AsyncEventNodeInstanceContent.Builder builder = AsyncEventNodeInstanceContent.newBuilder(); + if (nodeInstance.getJobId() != null) { + builder.setJobId(nodeInstance.getJobId()); + } + return builder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/CompositeContextNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/CompositeContextNodeInstanceReader.java new file mode 100644 index 00000000000..6f1bdbf3c94 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/CompositeContextNodeInstanceReader.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.CompositeContextNodeInstanceContent; +import org.jbpm.workflow.instance.node.CompositeContextNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class CompositeContextNodeInstanceReader implements NodeInstanceReader { + + @Override + public Integer order() { + return NodeInstanceReader.super.order() + 1; + } + + @Override + public boolean accept(Any value) { + return value.is(CompositeContextNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any marshalled) { + try { + CompositeContextNodeInstanceContent content = marshalled.unpack(CompositeContextNodeInstanceContent.class); + CompositeContextNodeInstance nodeInstance = new CompositeContextNodeInstance(); + + if (content.getTimerInstanceIdCount() > 0) { + List timerInstances = new ArrayList<>(); + for (String _timerId : content.getTimerInstanceIdList()) { + timerInstances.add(_timerId); + } + nodeInstance.internalSetTimerInstances(timerInstances); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return CompositeContextNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/CompositeContextNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/CompositeContextNodeInstanceWriter.java new file mode 100644 index 00000000000..e80f7179ce6 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/CompositeContextNodeInstanceWriter.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.CompositeContextNodeInstanceContent; +import org.jbpm.workflow.instance.node.CompositeContextNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class CompositeContextNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public Integer order() { + return NodeInstanceWriter.super.order() + 1; + } + + @Override + public boolean accept(NodeInstance value) { + return value instanceof CompositeContextNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + CompositeContextNodeInstance nodeInstance = (CompositeContextNodeInstance) value; + CompositeContextNodeInstanceContent.Builder builder = CompositeContextNodeInstanceContent.newBuilder(); + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + builder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + + return builder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/DynamicNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/DynamicNodeInstanceReader.java new file mode 100644 index 00000000000..c59009fe67e --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/DynamicNodeInstanceReader.java @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.DynamicNodeInstanceContent; +import org.jbpm.workflow.instance.node.DynamicNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class DynamicNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(DynamicNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + DynamicNodeInstanceContent content = value.unpack(DynamicNodeInstanceContent.class); + DynamicNodeInstance nodeInstance = new DynamicNodeInstance(); + if (content.getTimerInstanceIdCount() > 0) { + List timerInstances = new ArrayList<>(); + for (String _timerId : content.getTimerInstanceIdList()) { + timerInstances.add(_timerId); + } + nodeInstance.internalSetTimerInstances(timerInstances); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return DynamicNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/DynamicNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/DynamicNodeInstanceWriter.java new file mode 100644 index 00000000000..325268fbd80 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/DynamicNodeInstanceWriter.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.DynamicNodeInstanceContent; +import org.jbpm.workflow.instance.node.DynamicNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class DynamicNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof DynamicNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + DynamicNodeInstance nodeInstance = (DynamicNodeInstance) value; + DynamicNodeInstanceContent.Builder builder = DynamicNodeInstanceContent.newBuilder(); + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + builder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + + return builder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventNodeInstanceReader.java new file mode 100644 index 00000000000..165c8448f43 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventNodeInstanceReader.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.EventNodeInstanceContent; +import org.jbpm.workflow.instance.node.EventNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class EventNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(EventNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + return new EventNodeInstance(); + } + + @Override + public Class type() { + return EventNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventNodeInstanceWriter.java new file mode 100644 index 00000000000..6d4cd4216f1 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventNodeInstanceWriter.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.EventNodeInstanceContent; +import org.jbpm.workflow.instance.node.EventNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class EventNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof EventNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + return EventNodeInstanceContent.newBuilder(); + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventSubProcessNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventSubProcessNodeInstanceReader.java new file mode 100644 index 00000000000..150fa8c012e --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventSubProcessNodeInstanceReader.java @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.EventSubProcessNodeInstanceContent; +import org.jbpm.workflow.instance.node.EventSubProcessNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class EventSubProcessNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(EventSubProcessNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any marshalled) { + try { + EventSubProcessNodeInstanceContent content = marshalled.unpack(EventSubProcessNodeInstanceContent.class); + EventSubProcessNodeInstance nodeInstance = new EventSubProcessNodeInstance(); + + if (content.getTimerInstanceIdCount() > 0) { + List timerInstances = new ArrayList<>(); + for (String _timerId : content.getTimerInstanceIdList()) { + timerInstances.add(_timerId); + } + nodeInstance.internalSetTimerInstances(timerInstances); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return EventSubProcessNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventSubProcessNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventSubProcessNodeInstanceWriter.java new file mode 100644 index 00000000000..10cc62573ab --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/EventSubProcessNodeInstanceWriter.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.EventSubProcessNodeInstanceContent; +import org.jbpm.workflow.instance.node.EventSubProcessNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class EventSubProcessNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof EventSubProcessNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + EventSubProcessNodeInstance nodeInstance = (EventSubProcessNodeInstance) value; + EventSubProcessNodeInstanceContent.Builder builder = EventSubProcessNodeInstanceContent.newBuilder(); + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + builder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + + return builder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/ForEachNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/ForEachNodeInstanceReader.java new file mode 100644 index 00000000000..06899ece2a4 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/ForEachNodeInstanceReader.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.ForEachNodeInstanceContent; +import org.jbpm.workflow.instance.node.ForEachNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class ForEachNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(ForEachNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + ForEachNodeInstanceContent content = value.unpack(ForEachNodeInstanceContent.class); + ForEachNodeInstance nodeInstance = new ForEachNodeInstance(); + if (content.getTimerInstanceIdCount() > 0) { + nodeInstance.internalSetTimerInstances(content.getTimerInstanceIdList().stream().toList()); + } + if (content.getTimerInstanceReferenceCount() > 0) { + nodeInstance.internalSetTimerInstancesReference(content.getTimerInstanceReferenceMap()); + } + nodeInstance.setExecutedInstances(content.getExecutedInstances()); + nodeInstance.setTotalInstances(content.getTotalInstances()); + nodeInstance.setHasAsyncInstances(content.getHasAsyncInstances()); + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return ForEachNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/ForEachNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/ForEachNodeInstanceWriter.java new file mode 100644 index 00000000000..4051e5534e1 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/ForEachNodeInstanceWriter.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.ForEachNodeInstanceContent; +import org.jbpm.workflow.instance.node.ForEachNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class ForEachNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof ForEachNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + ForEachNodeInstance nodeInstance = (ForEachNodeInstance) value; + ForEachNodeInstanceContent.Builder foreachBuilder = ForEachNodeInstanceContent.newBuilder(); + + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + foreachBuilder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + foreachBuilder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + + foreachBuilder + .setTotalInstances(nodeInstance.getTotalInstances()) + .setExecutedInstances(nodeInstance.getExecutedInstances()) + .setHasAsyncInstances(nodeInstance.getHasAsyncInstances()); + + return foreachBuilder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/JoinNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/JoinNodeInstanceReader.java new file mode 100644 index 00000000000..9ed9866936e --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/JoinNodeInstanceReader.java @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.HashMap; +import java.util.Map; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.JoinNodeInstanceContent; +import org.jbpm.ruleflow.core.WorkflowElementIdentifierFactory; +import org.jbpm.workflow.instance.node.JoinInstance; +import org.kie.api.definition.process.WorkflowElementIdentifier; +import org.kie.api.runtime.process.NodeInstance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class JoinNodeInstanceReader implements NodeInstanceReader { + + private static Logger LOGGER = LoggerFactory.getLogger(JoinNodeInstanceReader.class); + + @Override + public boolean accept(Any value) { + return value.is(JoinNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + JoinNodeInstanceContent content = value.unpack(JoinNodeInstanceContent.class); + JoinInstance nodeInstance = new JoinInstance(); + if (content.getTriggerCount() > 0) { + Map triggers = new HashMap<>(); + for (JoinNodeInstanceContent.JoinTrigger _join : content.getTriggerList()) { + LOGGER.debug("unmarshalling join {}", _join.getNodeId()); + triggers.put(WorkflowElementIdentifierFactory.fromExternalFormat(_join.getNodeId()), _join.getCounter()); + } + nodeInstance.internalSetTriggers(triggers); + } + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return JoinNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/JoinNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/JoinNodeInstanceWriter.java new file mode 100644 index 00000000000..041150d1d06 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/JoinNodeInstanceWriter.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.JoinNodeInstanceContent; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.JoinNodeInstanceContent.JoinTrigger; +import org.jbpm.workflow.instance.node.JoinInstance; +import org.kie.api.definition.process.WorkflowElementIdentifier; +import org.kie.api.runtime.process.NodeInstance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class JoinNodeInstanceWriter implements NodeInstanceWriter { + + private static final Logger LOGGER = LoggerFactory.getLogger(JoinNodeInstanceWriter.class); + + @Override + public boolean accept(NodeInstance value) { + return value instanceof JoinInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + JoinInstance nodeInstance = (JoinInstance) value; + JoinNodeInstanceContent.Builder joinBuilder = JoinNodeInstanceContent.newBuilder(); + Map triggers = nodeInstance.getTriggers(); + List keys = new ArrayList<>(triggers.keySet()); + Collections.sort(keys); + + for (WorkflowElementIdentifier key : keys) { + LOGGER.info("marshalling join {}", key.toExternalFormat()); + joinBuilder.addTrigger(JoinTrigger.newBuilder() + .setNodeId(key.toExternalFormat()) + .setCounter(triggers.get(key)) + .build()); + } + + return joinBuilder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/LambdaSubProcessNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/LambdaSubProcessNodeInstanceReader.java new file mode 100644 index 00000000000..2c9ee577d97 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/LambdaSubProcessNodeInstanceReader.java @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.LambdaSubProcessNodeInstanceContent; +import org.jbpm.workflow.instance.node.LambdaSubProcessNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class LambdaSubProcessNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(LambdaSubProcessNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + LambdaSubProcessNodeInstanceContent content = value.unpack(LambdaSubProcessNodeInstanceContent.class); + LambdaSubProcessNodeInstance nodeInstance = new LambdaSubProcessNodeInstance(); + nodeInstance.internalSetProcessInstanceId(content.getProcessInstanceId()); + if (content.getTimerInstanceIdCount() > 0) { + nodeInstance.internalSetTimerInstances(new ArrayList<>(content.getTimerInstanceIdList())); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return LambdaSubProcessNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/LambdaSubProcessNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/LambdaSubProcessNodeInstanceWriter.java new file mode 100644 index 00000000000..31178c2f6c2 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/LambdaSubProcessNodeInstanceWriter.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.LambdaSubProcessNodeInstanceContent; +import org.jbpm.workflow.instance.node.LambdaSubProcessNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class LambdaSubProcessNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof LambdaSubProcessNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + LambdaSubProcessNodeInstance nodeInstance = (LambdaSubProcessNodeInstance) value; + LambdaSubProcessNodeInstanceContent.Builder builder = LambdaSubProcessNodeInstanceContent.newBuilder(); + builder.setProcessInstanceId(nodeInstance.getProcessInstanceId()); + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + builder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + + return builder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/MilestoneNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/MilestoneNodeInstanceReader.java new file mode 100644 index 00000000000..59398746c26 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/MilestoneNodeInstanceReader.java @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.MilestoneNodeInstanceContent; +import org.jbpm.workflow.instance.node.MilestoneNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class MilestoneNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(MilestoneNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + MilestoneNodeInstanceContent content = value.unpack(MilestoneNodeInstanceContent.class); + MilestoneNodeInstance nodeInstance = new MilestoneNodeInstance(); + if (content.getTimerInstanceIdCount() > 0) { + List timerInstances = new ArrayList<>(); + for (String _timerId : content.getTimerInstanceIdList()) { + timerInstances.add(_timerId); + } + nodeInstance.internalSetTimerInstances(timerInstances); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return MilestoneNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/MilestoneNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/MilestoneNodeInstanceWriter.java new file mode 100644 index 00000000000..3a6bfc694dc --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/MilestoneNodeInstanceWriter.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.MilestoneNodeInstanceContent; +import org.jbpm.workflow.instance.node.MilestoneNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class MilestoneNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof MilestoneNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + MilestoneNodeInstance nodeInstance = (MilestoneNodeInstance) value; + MilestoneNodeInstanceContent.Builder builder = MilestoneNodeInstanceContent.newBuilder(); + + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + builder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + return builder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/RuleSetNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/RuleSetNodeInstanceReader.java new file mode 100644 index 00000000000..9123a520a5d --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/RuleSetNodeInstanceReader.java @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.RuleSetNodeInstanceContent; +import org.jbpm.workflow.instance.node.RuleSetNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class RuleSetNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(RuleSetNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + RuleSetNodeInstanceContent content = value.unpack(RuleSetNodeInstanceContent.class); + RuleSetNodeInstance nodeInstance = new RuleSetNodeInstance(); + nodeInstance.setRuleFlowGroup(content.getRuleFlowGroup()); + if (content.getTimerInstanceIdCount() > 0) { + nodeInstance.internalSetTimerInstances(new ArrayList<>(content.getTimerInstanceIdList())); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return RuleSetNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/RuleSetNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/RuleSetNodeInstanceWriter.java new file mode 100644 index 00000000000..8b86f45a294 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/RuleSetNodeInstanceWriter.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.RuleSetNodeInstanceContent; +import org.jbpm.workflow.instance.node.RuleSetNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class RuleSetNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof RuleSetNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + RuleSetNodeInstance nodeInstance = (RuleSetNodeInstance) value; + RuleSetNodeInstanceContent.Builder ruleSet = RuleSetNodeInstanceContent.newBuilder(); + ruleSet.setRuleFlowGroup(nodeInstance.getRuleFlowGroup()); + ruleSet.addAllTimerInstanceId(nodeInstance.getTimerInstances()); + if (nodeInstance.getTimerInstancesReference() != null) { + ruleSet.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + + return ruleSet; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/StateNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/StateNodeInstanceReader.java new file mode 100644 index 00000000000..7f8df9c41e7 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/StateNodeInstanceReader.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.StateNodeInstanceContent; +import org.jbpm.workflow.instance.node.StateNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class StateNodeInstanceReader implements NodeInstanceReader { + + @Override + public Integer order() { + return NodeInstanceReader.super.order() + 1; + } + + @Override + public boolean accept(Any value) { + return value.is(StateNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + StateNodeInstanceContent content = value.unpack(StateNodeInstanceContent.class); + StateNodeInstance nodeInstance = new StateNodeInstance(); + if (content.getTimerInstanceIdCount() > 0) { + List timerInstances = new ArrayList<>(); + for (String _timerId : content.getTimerInstanceIdList()) { + timerInstances.add(_timerId); + } + nodeInstance.internalSetTimerInstances(timerInstances); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return StateNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/StateNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/StateNodeInstanceWriter.java new file mode 100644 index 00000000000..a9ff770c2e1 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/StateNodeInstanceWriter.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.StateNodeInstanceContent; +import org.jbpm.workflow.instance.node.StateNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class StateNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public Integer order() { + return NodeInstanceWriter.super.order() + 1; + } + + @Override + public boolean accept(NodeInstance value) { + return value instanceof StateNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + StateNodeInstance nodeInstance = (StateNodeInstance) value; + StateNodeInstanceContent.Builder builder = StateNodeInstanceContent.newBuilder(); + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + builder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + return builder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/SubProcessNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/SubProcessNodeInstanceReader.java new file mode 100644 index 00000000000..5581620d6bb --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/SubProcessNodeInstanceReader.java @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.SubProcessNodeInstanceContent; +import org.jbpm.workflow.instance.node.SubProcessNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class SubProcessNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(SubProcessNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + SubProcessNodeInstanceContent content = value.unpack(SubProcessNodeInstanceContent.class); + SubProcessNodeInstance nodeInstance = new SubProcessNodeInstance(); + nodeInstance.internalSetProcessInstanceId(content.getProcessInstanceId()); + if (content.getTimerInstanceIdCount() > 0) { + List timerInstances = new ArrayList<>(); + for (String timerId : content.getTimerInstanceIdList()) { + timerInstances.add(timerId); + } + nodeInstance.internalSetTimerInstances(timerInstances); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return SubProcessNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/SubProcessNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/SubProcessNodeInstanceWriter.java new file mode 100644 index 00000000000..c53fc1e0816 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/SubProcessNodeInstanceWriter.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.List; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.SubProcessNodeInstanceContent; +import org.jbpm.workflow.instance.node.SubProcessNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class SubProcessNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof SubProcessNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + SubProcessNodeInstance nodeInstance = (SubProcessNodeInstance) value; + SubProcessNodeInstanceContent.Builder builder = SubProcessNodeInstanceContent.newBuilder(); + builder.setProcessInstanceId(nodeInstance.getProcessInstanceId()); + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + builder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + + return builder; + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/TimerNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/TimerNodeInstanceReader.java new file mode 100644 index 00000000000..757daa8ae15 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/TimerNodeInstanceReader.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.TimerNodeInstanceContent; +import org.jbpm.workflow.instance.node.TimerNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; + +public class TimerNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(TimerNodeInstanceContent.class); + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + TimerNodeInstanceContent content = value.unpack(TimerNodeInstanceContent.class); + TimerNodeInstance nodeInstance = new TimerNodeInstance(); + nodeInstance.internalSetTimerId(content.getTimerId()); + return nodeInstance; + } catch (Exception e) { + throw new ProcessInstanceMarshallerException(e); + } + } + + @Override + public Class type() { + return TimerNodeInstanceContent.class; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/TimerNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/TimerNodeInstanceWriter.java new file mode 100644 index 00000000000..67d5e5ac4cd --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/TimerNodeInstanceWriter.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.TimerNodeInstanceContent; +import org.jbpm.workflow.instance.node.TimerNodeInstance; +import org.kie.api.runtime.process.NodeInstance; + +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class TimerNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof TimerNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + TimerNodeInstance nodeInstance = (TimerNodeInstance) value; + return TimerNodeInstanceContent.newBuilder().setTimerId(nodeInstance.getTimerId()); + } + +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceReader.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceReader.java new file mode 100644 index 00000000000..115c7510d02 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceReader.java @@ -0,0 +1,196 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.net.URI; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.jbpm.flow.serialization.MarshallerContextName; +import org.jbpm.flow.serialization.MarshallerReaderContext; +import org.jbpm.flow.serialization.NodeInstanceReader; +import org.jbpm.flow.serialization.ProcessInstanceMarshallerException; +import org.jbpm.flow.serialization.impl.ProtobufVariableReader; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.WorkItemNodeInstanceContent; +import org.jbpm.flow.serialization.protobuf.KogitoWorkItemsProtobuf; +import org.jbpm.flow.serialization.protobuf.KogitoWorkItemsProtobuf.HumanTaskWorkItemData; +import org.jbpm.process.instance.impl.humantask.HumanTaskWorkItemImpl; +import org.jbpm.process.instance.impl.humantask.InternalHumanTaskWorkItem; +import org.jbpm.process.instance.impl.humantask.Reassignment; +import org.jbpm.ruleflow.instance.RuleFlowProcessInstance; +import org.jbpm.workflow.instance.node.HumanTaskNodeInstance; +import org.jbpm.workflow.instance.node.WorkItemNodeInstance; +import org.kie.api.runtime.process.NodeInstance; +import org.kie.kogito.process.workitem.Attachment; +import org.kie.kogito.process.workitem.Comment; +import org.kie.kogito.process.workitems.InternalKogitoWorkItem; +import org.kie.kogito.process.workitems.impl.KogitoWorkItemImpl; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; +import com.google.protobuf.InvalidProtocolBufferException; + +public class WorkItemNodeInstanceReader implements NodeInstanceReader { + + @Override + public boolean accept(Any value) { + return value.is(WorkItemNodeInstanceContent.class); + } + + @Override + public Class type() { + return WorkItemNodeInstanceContent.class; + } + + @Override + public NodeInstance read(MarshallerReaderContext context, Any value) { + try { + ProtobufVariableReader varReader = new ProtobufVariableReader(context); + WorkItemNodeInstanceContent content = value.unpack(WorkItemNodeInstanceContent.class); + WorkItemNodeInstance nodeInstance = instanceWorkItem(content); + if (nodeInstance instanceof HumanTaskNodeInstance) { + HumanTaskNodeInstance humanTaskNodeInstance = (HumanTaskNodeInstance) nodeInstance; + InternalHumanTaskWorkItem workItem = humanTaskNodeInstance.getWorkItem(); + Any workItemDataMessage = content.getWorkItemData(); + if (workItemDataMessage.is(HumanTaskWorkItemData.class)) { + HumanTaskWorkItemData workItemData = workItemDataMessage.unpack(HumanTaskWorkItemData.class); + humanTaskNodeInstance.getNotCompletedDeadlineTimers().putAll(buildDeadlines(workItemData.getCompletedDeadlinesMap())); + humanTaskNodeInstance.getNotCompletedReassigments().putAll(buildReassignments(workItemData.getCompletedReassigmentsMap())); + humanTaskNodeInstance.getNotStartedDeadlineTimers().putAll(buildDeadlines(workItemData.getStartDeadlinesMap())); + humanTaskNodeInstance.getNotStartedReassignments().putAll(buildReassignments(workItemData.getStartReassigmentsMap())); + + if (workItemData.hasTaskName()) { + workItem.setTaskName(workItemData.getTaskName()); + } + if (workItemData.hasTaskDescription()) { + workItem.setTaskDescription(workItemData.getTaskDescription()); + } + if (workItemData.hasTaskPriority()) { + workItem.setTaskPriority(workItemData.getTaskPriority()); + } + if (workItemData.hasTaskReferenceName()) { + workItem.setReferenceName(workItemData.getTaskReferenceName()); + } + if (workItemData.hasActualOwner()) { + workItem.setActualOwner(workItemData.getActualOwner()); + } + workItem.getAdminUsers().addAll(workItemData.getAdminUsersList()); + workItem.getAdminGroups().addAll(workItemData.getAdminGroupsList()); + workItem.getPotentialUsers().addAll(workItemData.getPotUsersList()); + workItem.getPotentialGroups().addAll(workItemData.getPotGroupsList()); + workItem.getExcludedUsers().addAll(workItemData.getExcludedUsersList()); + workItem.getComments().putAll(workItemData.getCommentsList().stream().map(this::buildComment).collect(Collectors.toMap(Comment::getId, Function.identity()))); + workItem.getAttachments().putAll(workItemData.getAttachmentsList().stream().map(this::buildAttachment).collect(Collectors.toMap(Attachment::getId, Function.identity()))); + + } + + } + + RuleFlowProcessInstance ruleFlowProcessInstance = context.get(MarshallerContextName.MARSHALLER_PROCESS_INSTANCE); + nodeInstance.internalSetWorkItemId(content.getWorkItemId()); + InternalKogitoWorkItem workItem = (InternalKogitoWorkItem) nodeInstance.getWorkItem(); + workItem.setId(content.getWorkItemId()); + workItem.setProcessInstanceId(ruleFlowProcessInstance.getStringId()); + workItem.setName(content.getName()); + workItem.setState(content.getState()); + workItem.setDeploymentId(ruleFlowProcessInstance.getDeploymentId()); + workItem.setProcessInstance(ruleFlowProcessInstance); + workItem.setPhaseId(content.getPhaseId()); + workItem.setPhaseStatus(content.getPhaseStatus()); + workItem.setStartDate(new Date(content.getStartDate())); + if (content.getCompleteDate() > 0) { + workItem.setCompleteDate(new Date(content.getCompleteDate())); + } + + if (content.getTimerInstanceIdCount() > 0) { + nodeInstance.internalSetTimerInstances(new ArrayList<>(content.getTimerInstanceIdList())); + } + if (!content.getTimerInstanceReferenceMap().isEmpty()) { + nodeInstance.internalSetTimerInstancesReference(new HashMap<>(content.getTimerInstanceReferenceMap())); + } + nodeInstance.internalSetProcessInstanceId(content.getErrorHandlingProcessInstanceId()); + varReader.buildVariables(content.getVariableList()).forEach(var -> nodeInstance.getWorkItem().getParameters().put(var.getName(), var.getValue())); + varReader.buildVariables(content.getResultList()).forEach(var -> nodeInstance.getWorkItem().getResults().put(var.getName(), var.getValue())); + return nodeInstance; + } catch (InvalidProtocolBufferException ex) { + throw new ProcessInstanceMarshallerException("cannot unpack node instance", ex); + } + } + + private WorkItemNodeInstance instanceWorkItem(WorkItemNodeInstanceContent content) { + if (content.hasWorkItemData()) { + Any workItemDataMessage = content.getWorkItemData(); + if (workItemDataMessage.is(HumanTaskWorkItemData.class)) { + HumanTaskNodeInstance nodeInstance = new HumanTaskNodeInstance(); + HumanTaskWorkItemImpl workItem = new HumanTaskWorkItemImpl(); + nodeInstance.internalSetWorkItem(workItem); + return nodeInstance; + } else { + throw new ProcessInstanceMarshallerException("Don't know which type of work item is"); + } + } else { + WorkItemNodeInstance nodeInstance = new WorkItemNodeInstance(); + KogitoWorkItemImpl workItem = new KogitoWorkItemImpl(); + workItem.setId(UUID.randomUUID().toString()); + nodeInstance.internalSetWorkItem(workItem); + return nodeInstance; + } + } + + private Comment buildComment(KogitoWorkItemsProtobuf.Comment comment) { + Comment result = new Comment(comment.getId(), comment.getUpdatedBy()); + result.setContent(comment.getContent()); + result.setUpdatedAt(new Date(comment.getUpdatedAt())); + return result; + } + + private Attachment buildAttachment(KogitoWorkItemsProtobuf.Attachment attachment) { + Attachment result = new Attachment(attachment.getId(), attachment.getUpdatedBy()); + result.setContent(URI.create(attachment.getContent())); + result.setUpdatedAt(new Date(attachment.getUpdatedAt())); + result.setName(attachment.getName()); + return result; + } + + private Map> buildDeadlines(Map deadlinesProtobuf) { + Map> deadlines = new HashMap<>(); + for (Map.Entry entry : deadlinesProtobuf.entrySet()) { + Map notification = new HashMap<>(); + for (Map.Entry pair : entry.getValue().getContentMap().entrySet()) { + notification.put(pair.getKey(), pair.getValue()); + } + deadlines.put(entry.getKey(), notification); + } + return deadlines; + } + + private Map buildReassignments(Map reassignmentsProtobuf) { + Map reassignments = new HashMap<>(); + for (Map.Entry entry : reassignmentsProtobuf.entrySet()) { + reassignments.put(entry.getKey(), new Reassignment(entry.getValue().getUsersList().stream().collect(Collectors + .toSet()), entry.getValue().getGroupsList().stream().collect(Collectors.toSet()))); + } + return reassignments; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceWriter.java b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceWriter.java new file mode 100644 index 00000000000..50609b1ffd3 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceWriter.java @@ -0,0 +1,204 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.flow.serialization.impl.marshallers.state; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.jbpm.flow.serialization.MarshallerWriterContext; +import org.jbpm.flow.serialization.NodeInstanceWriter; +import org.jbpm.flow.serialization.impl.ProtobufVariableWriter; +import org.jbpm.flow.serialization.protobuf.KogitoNodeInstanceContentsProtobuf.WorkItemNodeInstanceContent; +import org.jbpm.flow.serialization.protobuf.KogitoWorkItemsProtobuf; +import org.jbpm.flow.serialization.protobuf.KogitoWorkItemsProtobuf.HumanTaskWorkItemData; +import org.jbpm.process.instance.impl.humantask.Reassignment; +import org.jbpm.workflow.instance.node.HumanTaskNodeInstance; +import org.jbpm.workflow.instance.node.WorkItemNodeInstance; +import org.kie.api.runtime.process.NodeInstance; +import org.kie.kogito.internal.process.runtime.KogitoWorkItem; +import org.kie.kogito.process.workitem.Attachment; +import org.kie.kogito.process.workitem.Comment; +import org.kie.kogito.process.workitem.HumanTaskWorkItem; + +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3.Builder; + +public class WorkItemNodeInstanceWriter implements NodeInstanceWriter { + + @Override + public boolean accept(NodeInstance value) { + return value instanceof WorkItemNodeInstance; + } + + @Override + public Builder write(MarshallerWriterContext context, NodeInstance value) { + ProtobufVariableWriter varWriter = new ProtobufVariableWriter(context); + WorkItemNodeInstance nodeInstance = (WorkItemNodeInstance) value; + WorkItemNodeInstanceContent.Builder builder = WorkItemNodeInstanceContent.newBuilder(); + + List timerInstances = nodeInstance.getTimerInstances(); + if (timerInstances != null) { + builder.addAllTimerInstanceId(timerInstances); + } + if (nodeInstance.getTimerInstancesReference() != null) { + builder.putAllTimerInstanceReference(nodeInstance.getTimerInstancesReference()); + } + if (nodeInstance.getExceptionHandlingProcessInstanceId() != null) { + builder.setErrorHandlingProcessInstanceId(nodeInstance.getExceptionHandlingProcessInstanceId()); + } + KogitoWorkItem workItem = nodeInstance.getWorkItem(); + + builder.setWorkItemId(nodeInstance.getWorkItemId()) + .setName(workItem.getName()) + .setState(workItem.getState()) + .setPhaseId(workItem.getPhaseId()) + .setPhaseStatus(workItem.getPhaseStatus()) + .setStartDate(workItem.getStartDate().getTime()) + .addAllVariable(varWriter.buildVariables(new ArrayList<>(workItem.getParameters().entrySet()))) + .addAllResult(varWriter.buildVariables(new ArrayList<>(workItem.getResults().entrySet()))); + + if (workItem.getCompleteDate() != null) { + builder.setCompleteDate(workItem.getCompleteDate().getTime()); + } + + if (nodeInstance instanceof HumanTaskNodeInstance) { + builder.setWorkItemData(Any.pack(buildHumanTaskWorkItemData((HumanTaskNodeInstance) nodeInstance, (HumanTaskWorkItem) nodeInstance.getWorkItem()))); + } + return builder; + } + + private HumanTaskWorkItemData buildHumanTaskWorkItemData(HumanTaskNodeInstance nodeInstance, HumanTaskWorkItem workItem) { + HumanTaskWorkItemData.Builder builder = HumanTaskWorkItemData.newBuilder(); + + if (workItem.getTaskPriority() != null) { + builder.setTaskPriority(workItem.getTaskPriority()); + } + + if (workItem.getReferenceName() != null) { + builder.setTaskReferenceName(workItem.getReferenceName()); + } + if (workItem.getTaskDescription() != null) { + builder.setTaskDescription(workItem.getTaskDescription()); + } + + if (workItem.getActualOwner() != null) { + builder.setActualOwner(workItem.getActualOwner()); + } + + if (workItem.getTaskName() != null) { + builder.setTaskName(workItem.getTaskName()); + } + + if (workItem.getPotentialUsers() != null) { + builder.addAllPotUsers(workItem.getPotentialUsers()); + } + + if (workItem.getPotentialGroups() != null) { + builder.addAllPotGroups(workItem.getPotentialGroups()); + } + + if (workItem.getExcludedUsers() != null) { + builder.addAllExcludedUsers(workItem.getExcludedUsers()); + } + + if (workItem.getAdminUsers() != null) { + builder.addAllAdminUsers(workItem.getAdminUsers()); + } + + if (workItem.getAdminGroups() != null) { + builder.addAllAdminGroups(workItem.getAdminGroups()); + } + + if (workItem.getComments() != null) { + builder.addAllComments(buildComments(workItem.getComments().values())); + } + + if (workItem.getAttachments() != null) { + builder.addAllAttachments(buildAttachments(workItem.getAttachments().values())); + } + + if (nodeInstance.getNotStartedDeadlineTimers() != null) { + builder.putAllStartDeadlines(buildDeadlines(nodeInstance.getNotStartedDeadlineTimers())); + } + + if (nodeInstance.getNotStartedReassignments() != null) { + builder.putAllStartReassigments(buildReassignments(nodeInstance.getNotStartedReassignments())); + } + + if (nodeInstance.getNotCompletedDeadlineTimers() != null) { + builder.putAllCompletedDeadlines(buildDeadlines(nodeInstance.getNotCompletedDeadlineTimers())); + } + + if (nodeInstance.getNotCompletedReassigments() != null) { + builder.putAllCompletedReassigments(buildReassignments(nodeInstance.getNotCompletedReassigments())); + } + + return builder.build(); + } + + private List buildComments(Iterable comments) { + List commentsProtobuf = new ArrayList<>(); + for (Comment comment : comments) { + KogitoWorkItemsProtobuf.Comment workItemComment = KogitoWorkItemsProtobuf.Comment.newBuilder() + .setId(comment.getId().toString()) + .setContent(comment.getContent()) + .setUpdatedBy(comment.getUpdatedBy()) + .setUpdatedAt(comment.getUpdatedAt().getTime()) + .build(); + commentsProtobuf.add(workItemComment); + } + return commentsProtobuf; + } + + private List buildAttachments(Iterable attachments) { + List attachmentProtobuf = new ArrayList<>(); + for (Attachment attachment : attachments) { + KogitoWorkItemsProtobuf.Attachment workItemAttachment = KogitoWorkItemsProtobuf.Attachment.newBuilder() + .setId(attachment.getId().toString()).setContent(attachment.getContent().toString()) + .setUpdatedBy(attachment.getUpdatedBy()).setUpdatedAt(attachment.getUpdatedAt().getTime()) + .setName(attachment.getName()) + .build(); + attachmentProtobuf.add(workItemAttachment); + } + return attachmentProtobuf; + } + + private Map buildDeadlines(Map> deadlines) { + Map deadlinesProtobuf = new HashMap<>(); + for (Map.Entry> entry : deadlines.entrySet()) { + KogitoWorkItemsProtobuf.Deadline.Builder builder = KogitoWorkItemsProtobuf.Deadline.newBuilder(); + entry.getValue().forEach((k, v) -> builder.putContent(k, v.toString())); + deadlinesProtobuf.put(entry.getKey(), builder.build()); + } + return deadlinesProtobuf; + } + + private Map buildReassignments(Map reassignments) { + Map reassignmentsProtobuf = new HashMap<>(); + for (Map.Entry entry : reassignments.entrySet()) { + KogitoWorkItemsProtobuf.Reassignment.Builder builder = KogitoWorkItemsProtobuf.Reassignment.newBuilder(); + builder.addAllGroups(entry.getValue().getPotentialGroups()); + builder.addAllUsers(entry.getValue().getPotentialUsers()); + reassignmentsProtobuf.put(entry.getKey(), builder.build()); + } + return reassignmentsProtobuf; + } +} diff --git a/jbpm/process-serialization-protobuf/src/main/resources/META-INF/services/org.jbpm.flow.serialization.NodeInstanceReader b/jbpm/process-serialization-protobuf/src/main/resources/META-INF/services/org.jbpm.flow.serialization.NodeInstanceReader new file mode 100644 index 00000000000..77fa53e0dd3 --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/resources/META-INF/services/org.jbpm.flow.serialization.NodeInstanceReader @@ -0,0 +1,14 @@ +org.jbpm.flow.serialization.impl.marshallers.state.AsyncEventNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.CompositeContextNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.DynamicNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.EventNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.EventSubProcessNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.ForEachNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.JoinNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.LambdaSubProcessNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.MilestoneNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.RuleSetNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.StateNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.SubProcessNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.TimerNodeInstanceReader +org.jbpm.flow.serialization.impl.marshallers.state.WorkItemNodeInstanceReader \ No newline at end of file diff --git a/jbpm/process-serialization-protobuf/src/main/resources/META-INF/services/org.jbpm.flow.serialization.NodeInstanceWriter b/jbpm/process-serialization-protobuf/src/main/resources/META-INF/services/org.jbpm.flow.serialization.NodeInstanceWriter new file mode 100644 index 00000000000..293ab4529da --- /dev/null +++ b/jbpm/process-serialization-protobuf/src/main/resources/META-INF/services/org.jbpm.flow.serialization.NodeInstanceWriter @@ -0,0 +1,14 @@ +org.jbpm.flow.serialization.impl.marshallers.state.AsyncEventNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.CompositeContextNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.DynamicNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.EventNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.EventSubProcessNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.ForEachNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.JoinNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.LambdaSubProcessNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.MilestoneNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.RuleSetNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.StateNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.SubProcessNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.TimerNodeInstanceWriter +org.jbpm.flow.serialization.impl.marshallers.state.WorkItemNodeInstanceWriter \ No newline at end of file From 1bf2feb119888f88dbafc6595fe9a1b6f5ce8e52 Mon Sep 17 00:00:00 2001 From: Enrique Date: Mon, 6 May 2024 14:54:25 +0200 Subject: [PATCH 11/11] [incubator-kie-issues-1136] Add script onEntry, on Exit for java (#3490) * [incubator-kie-issues-1136] Add script onEntry, on Exit for java --- .../org/jbpm/bpmn2/xml/GlobalHandler.java | 21 +++ .../canonical/AbstractNodeVisitor.java | 43 +++++ .../compiler/canonical/AbstractVisitor.java | 3 +- .../builder/action/ActionCompiler.java | 36 ++++ .../action/ActionCompilerRegistry.java | 62 ++++++ .../builder/action/JavaActionCompiler.java | 82 ++++++++ .../builder/action/MVELActionCompiler.java | 50 +++++ ...jbpm.process.builder.action.ActionCompiler | 2 + .../factory/AbstractCompositeNodeFactory.java | 1 + .../core/factory/ExtendedNodeFactory.java | 26 --- .../ruleflow/core/factory/NodeFactory.java | 28 +++ .../validation/RuleFlowProcessValidator.java | 23 --- .../workflow/core/impl/ExtendedNodeImpl.java | 4 + .../RuleFlowProcessValidatorTest.java | 35 ---- .../java/org/jbpm/bpmn2/ActivityTest.java | 58 +++--- .../utils/EventTrackerProcessListener.java | 50 +++++ .../jbpm/test/utils/ProcessTestHelper.java | 9 + ...BPMN2-SubProcessWithEntryExitScripts.bpmn2 | 177 ++++++++++++++++++ 18 files changed, 593 insertions(+), 117 deletions(-) create mode 100644 jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/ActionCompiler.java create mode 100644 jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/ActionCompilerRegistry.java create mode 100644 jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/JavaActionCompiler.java create mode 100644 jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/MVELActionCompiler.java create mode 100644 jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.jbpm.process.builder.action.ActionCompiler create mode 100644 jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/EventTrackerProcessListener.java create mode 100755 jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/resources/unit/project/src/main/bpmn/BPMN2-SubProcessWithEntryExitScripts.bpmn2 diff --git a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/GlobalHandler.java b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/GlobalHandler.java index b91a7b931d3..6f66de03e55 100755 --- a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/GlobalHandler.java +++ b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/GlobalHandler.java @@ -18,13 +18,18 @@ */ package org.jbpm.bpmn2.xml; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import org.jbpm.compiler.xml.Handler; import org.jbpm.compiler.xml.Parser; import org.jbpm.compiler.xml.core.BaseAbstractHandler; +import org.jbpm.process.core.context.variable.Variable; +import org.jbpm.process.core.context.variable.VariableScope; +import org.jbpm.process.core.datatype.DataTypeResolver; import org.jbpm.workflow.core.impl.WorkflowProcessImpl; import org.kie.api.definition.process.Process; import org.xml.sax.Attributes; @@ -53,6 +58,7 @@ public Object start(final String uri, final String identifier = attrs.getValue("identifier"); final String type = attrs.getValue("type"); + process.addImports(Collections.singleton(type)); emptyAttributeCheck(localName, "identifier", identifier, parser); emptyAttributeCheck(localName, "type", type, parser); @@ -63,6 +69,21 @@ public Object start(final String uri, } map.put(identifier, type); + VariableScope variableScope = (VariableScope) process.getDefaultContext(VariableScope.VARIABLE_SCOPE); + List variables = variableScope.getVariables(); + Variable variable = new Variable(); + variable.setId(identifier); + variable.setType(DataTypeResolver.fromType(type, parser.getClassLoader())); + // if name is given use it as variable name instead of id + if (identifier != null && identifier.length() > 0) { + variable.setName(identifier); + variable.setMetaData(identifier, variable.getName()); + } else { + variable.setName(identifier); + } + variable.setMetaData(identifier, variable.getName()); + variables.add(variable); + return null; } diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractNodeVisitor.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractNodeVisitor.java index c5cffb2e7b4..e3429dcdbb4 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractNodeVisitor.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractNodeVisitor.java @@ -20,8 +20,11 @@ import java.util.ArrayList; import java.util.List; +import java.util.Objects; +import java.util.function.Predicate; import java.util.stream.Collectors; +import org.jbpm.process.builder.action.ActionCompilerRegistry; import org.jbpm.process.core.ContextContainer; import org.jbpm.process.core.context.variable.Mappable; import org.jbpm.process.core.context.variable.Variable; @@ -33,6 +36,8 @@ import org.jbpm.workflow.core.impl.ConnectionImpl; import org.jbpm.workflow.core.impl.DataAssociation; import org.jbpm.workflow.core.impl.DataDefinition; +import org.jbpm.workflow.core.impl.DroolsConsequenceAction; +import org.jbpm.workflow.core.impl.ExtendedNodeImpl; import org.jbpm.workflow.core.node.Assignment; import org.jbpm.workflow.core.node.HumanTaskNode; import org.jbpm.workflow.core.node.StartNode; @@ -69,6 +74,7 @@ import static org.jbpm.ruleflow.core.Metadata.HIDDEN; import static org.jbpm.ruleflow.core.factory.NodeFactory.METHOD_DONE; import static org.jbpm.ruleflow.core.factory.NodeFactory.METHOD_NAME; +import static org.kie.kogito.internal.utils.ConversionUtils.sanitizeString; public abstract class AbstractNodeVisitor extends AbstractVisitor { @@ -79,6 +85,43 @@ public void visitNode(T node, BlockStmt body, VariableScope variableScope, Proce if (isAdHocNode(node) && !(node instanceof HumanTaskNode)) { metadata.addSignal(node.getName(), null); } + if (isExtendedNode(node)) { + ExtendedNodeImpl extendedNodeImpl = (ExtendedNodeImpl) node; + addScript(extendedNodeImpl, body, ON_ACTION_SCRIPT_METHOD, ExtendedNodeImpl.EVENT_NODE_ENTER); + addScript(extendedNodeImpl, body, ON_ACTION_SCRIPT_METHOD, ExtendedNodeImpl.EVENT_NODE_EXIT); + } + } + + private void addScript(ExtendedNodeImpl extendedNodeImpl, BlockStmt body, String factoryMethod, String actionType) { + if (!extendedNodeImpl.hasActions(actionType)) { + return; + } + List scripts = extendedNodeImpl.getActions(actionType).stream() + .filter(Predicate.not(Objects::isNull)) + .filter(DroolsConsequenceAction.class::isInstance) + .map(DroolsConsequenceAction.class::cast) + .filter(e -> e.getConsequence() != null && !e.getConsequence().isBlank()) + .toList(); + + for (DroolsConsequenceAction script : scripts) { + body.addStatement(getFactoryMethod(getNodeId((T) extendedNodeImpl), factoryMethod, + new StringLiteralExpr(actionType), + new StringLiteralExpr(script.getDialect()), + new StringLiteralExpr(sanitizeString(script.getConsequence())), + buildDroolsConsequenceAction(extendedNodeImpl, script.getDialect(), script.getConsequence()))); + ; + } + } + + private Expression buildDroolsConsequenceAction(ExtendedNodeImpl extendedNodeImpl, String dialect, String script) { + if (script == null) { + return new NullLiteralExpr(); + } + return ActionCompilerRegistry.instance().find(dialect).buildAction(extendedNodeImpl, script); + } + + private boolean isExtendedNode(T node) { + return node instanceof ExtendedNodeImpl; } private boolean isAdHocNode(Node node) { diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractVisitor.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractVisitor.java index ce0168cfe0e..17dd3cd9d36 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractVisitor.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/canonical/AbstractVisitor.java @@ -54,8 +54,9 @@ public abstract class AbstractVisitor { + protected static final String ON_ACTION_SCRIPT_METHOD = "onActionScript"; protected static final String FACTORY_FIELD_NAME = "factory"; - protected static final String KCONTEXT_VAR = "kcontext"; + public static final String KCONTEXT_VAR = "kcontext"; protected MethodCallExpr getWorkflowElementConstructor(WorkflowElementIdentifier identifier) { Type type = new ClassOrInterfaceType().setName(WorkflowElementIdentifierFactory.class.getName()); diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/ActionCompiler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/ActionCompiler.java new file mode 100644 index 00000000000..16f476209a3 --- /dev/null +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/ActionCompiler.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.builder.action; + +import java.util.Arrays; + +import org.jbpm.workflow.core.impl.NodeImpl; + +import com.github.javaparser.ast.expr.Expression; + +public interface ActionCompiler { + + String[] dialects(); + + default boolean accept(String dialect) { + return Arrays.asList(dialect).contains(dialect); + } + + Expression buildAction(NodeImpl nodeImpl, String scrtip); +} diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/ActionCompilerRegistry.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/ActionCompilerRegistry.java new file mode 100644 index 00000000000..9edb3e5d774 --- /dev/null +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/ActionCompilerRegistry.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.builder.action; + +import java.util.ArrayList; +import java.util.List; +import java.util.ServiceLoader; + +import org.jbpm.util.JbpmClassLoaderUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ActionCompilerRegistry { + + private static final Logger logger = LoggerFactory.getLogger(ActionCompilerRegistry.class); + + private static ActionCompilerRegistry INSTANCE; + + private List registry; + + public static ActionCompilerRegistry instance() { + if (INSTANCE == null) { + INSTANCE = new ActionCompilerRegistry(); + } + return INSTANCE; + } + + protected ActionCompilerRegistry() { + this.registry = new ArrayList<>(); + ServiceLoader.load(ActionCompiler.class, JbpmClassLoaderUtil.findClassLoader()).forEach(registry::add); + } + + public void register(ActionCompiler actionCompiler) { + this.registry.add(actionCompiler); + logger.debug("Manual registration of scripting language {} with instance {}", List.of(actionCompiler.dialects()), actionCompiler); + } + + public ActionCompiler find(String language) { + for (ActionCompiler transformer : registry) { + if (transformer.accept(language)) { + return transformer; + } + } + throw new IllegalArgumentException("action compiler not support for dialect " + language); + } +} \ No newline at end of file diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/JavaActionCompiler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/JavaActionCompiler.java new file mode 100644 index 00000000000..f2762126f28 --- /dev/null +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/JavaActionCompiler.java @@ -0,0 +1,82 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.builder.action; + +import java.util.HashSet; +import java.util.Set; + +import org.jbpm.compiler.canonical.AbstractNodeVisitor; +import org.jbpm.process.core.context.variable.Variable; +import org.jbpm.process.core.context.variable.VariableScope; +import org.jbpm.workflow.core.impl.NodeImpl; + +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.expr.AssignExpr; +import com.github.javaparser.ast.expr.AssignExpr.Operator; +import com.github.javaparser.ast.expr.CastExpr; +import com.github.javaparser.ast.expr.Expression; +import com.github.javaparser.ast.expr.LambdaExpr; +import com.github.javaparser.ast.expr.MethodCallExpr; +import com.github.javaparser.ast.expr.NameExpr; +import com.github.javaparser.ast.expr.StringLiteralExpr; +import com.github.javaparser.ast.expr.VariableDeclarationExpr; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.type.ClassOrInterfaceType; +import com.github.javaparser.ast.type.Type; + +public class JavaActionCompiler implements ActionCompiler { + + @Override + public String[] dialects() { + return new String[] { "java" }; + } + + @Override + public boolean accept(String dialect) { + return dialect.toLowerCase().contains("java"); + } + + @Override + public Expression buildAction(NodeImpl nodeImpl, String script) { + BlockStmt newDroolsConsequenceActionExpression = new BlockStmt(); + newDroolsConsequenceActionExpression = StaticJavaParser.parseBlock("{" + script + "}"); + Set identifiers = new HashSet<>(newDroolsConsequenceActionExpression.findAll(NameExpr.class)); + for (NameExpr identifier : identifiers) { + VariableScope scope = (VariableScope) nodeImpl.resolveContext(VariableScope.VARIABLE_SCOPE, identifier.getNameAsString()); + if (scope == null) { + continue; + } + Variable var = scope.findVariable(identifier.getNameAsString()); + if (var == null) { + continue; + } + Type type = StaticJavaParser.parseType(var.getType().getStringType()); + VariableDeclarationExpr target = new VariableDeclarationExpr(type, var.getName()); + Expression source = new MethodCallExpr(new NameExpr(AbstractNodeVisitor.KCONTEXT_VAR), "getVariable", NodeList.nodeList(new StringLiteralExpr(var.getName()))); + source = new CastExpr(type, source); + AssignExpr assign = new AssignExpr(target, source, Operator.ASSIGN); + newDroolsConsequenceActionExpression.addStatement(0, assign); + } + ClassOrInterfaceType type = StaticJavaParser.parseClassOrInterfaceType(org.kie.kogito.internal.process.runtime.KogitoProcessContext.class.getName()); + return new LambdaExpr(NodeList.nodeList(new Parameter(type, AbstractNodeVisitor.KCONTEXT_VAR)), newDroolsConsequenceActionExpression, true); + } + +} diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/MVELActionCompiler.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/MVELActionCompiler.java new file mode 100644 index 00000000000..83124237aff --- /dev/null +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/process/builder/action/MVELActionCompiler.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.builder.action; + +import org.jbpm.compiler.canonical.AbstractNodeVisitor; +import org.jbpm.workflow.core.impl.NodeImpl; + +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.expr.Expression; +import com.github.javaparser.ast.expr.LambdaExpr; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.type.ClassOrInterfaceType; + +import static org.kie.kogito.internal.utils.ConversionUtils.sanitizeString; + +public class MVELActionCompiler implements ActionCompiler { + + @Override + public String[] dialects() { + return new String[] { "mvel" }; + } + + @Override + public Expression buildAction(NodeImpl nodeImpl, String script) { + BlockStmt actionExpression = StaticJavaParser.parseBlock( + "{ org.mvel2.MVEL.eval(\"" + sanitizeString(script) + + "\", new org.jbpm.workflow.instance.impl.NodeInstanceResolverFactory((org.jbpm.workflow.instance.NodeInstance) kcontext.getNodeInstance())); }"); + ClassOrInterfaceType type = StaticJavaParser.parseClassOrInterfaceType(org.kie.kogito.internal.process.runtime.KogitoProcessContext.class.getName()); + return new LambdaExpr(NodeList.nodeList(new Parameter(type, AbstractNodeVisitor.KCONTEXT_VAR)), actionExpression, true); + } + +} diff --git a/jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.jbpm.process.builder.action.ActionCompiler b/jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.jbpm.process.builder.action.ActionCompiler new file mode 100644 index 00000000000..d9494beeea5 --- /dev/null +++ b/jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.jbpm.process.builder.action.ActionCompiler @@ -0,0 +1,2 @@ +org.jbpm.process.builder.action.JavaActionCompiler +org.jbpm.process.builder.action.MVELActionCompiler \ No newline at end of file diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/AbstractCompositeNodeFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/AbstractCompositeNodeFactory.java index 0befff9481e..329534bbedc 100644 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/AbstractCompositeNodeFactory.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/AbstractCompositeNodeFactory.java @@ -109,4 +109,5 @@ public P done() { } return super.done(); } + } diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/ExtendedNodeFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/ExtendedNodeFactory.java index 0653d5f6df6..0a22a65261d 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/ExtendedNodeFactory.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/ExtendedNodeFactory.java @@ -18,14 +18,9 @@ */ package org.jbpm.ruleflow.core.factory; -import java.util.ArrayList; -import java.util.List; - import org.jbpm.ruleflow.core.RuleFlowNodeContainerFactory; -import org.jbpm.workflow.core.DroolsAction; import org.jbpm.workflow.core.Node; import org.jbpm.workflow.core.NodeContainer; -import org.jbpm.workflow.core.impl.DroolsConsequenceAction; import org.jbpm.workflow.core.impl.ExtendedNodeImpl; import org.kie.api.definition.process.WorkflowElementIdentifier; @@ -39,25 +34,4 @@ protected ExtendedNodeImpl getExtendedNode() { return (ExtendedNodeImpl) getNode(); } - public T onEntryAction(String dialect, String action) { - if (getExtendedNode().getActions(dialect) != null) { - getExtendedNode().getActions(dialect).add(new DroolsConsequenceAction(dialect, action)); - } else { - List actions = new ArrayList<>(); - actions.add(new DroolsConsequenceAction(dialect, action)); - getExtendedNode().setActions(ExtendedNodeImpl.EVENT_NODE_ENTER, actions); - } - return (T) this; - } - - public T onExitAction(String dialect, String action) { - if (getExtendedNode().getActions(dialect) != null) { - getExtendedNode().getActions(dialect).add(new DroolsConsequenceAction(dialect, action)); - } else { - List actions = new ArrayList<>(); - actions.add(new DroolsConsequenceAction(dialect, action)); - getExtendedNode().setActions(ExtendedNodeImpl.EVENT_NODE_EXIT, actions); - } - return (T) this; - } } diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/NodeFactory.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/NodeFactory.java index bcbfb1f475f..ba22a6d53bc 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/NodeFactory.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/factory/NodeFactory.java @@ -18,10 +18,15 @@ */ package org.jbpm.ruleflow.core.factory; +import java.util.ArrayList; + import org.jbpm.process.core.context.variable.Mappable; +import org.jbpm.process.instance.impl.Action; import org.jbpm.ruleflow.core.RuleFlowNodeContainerFactory; import org.jbpm.workflow.core.Node; import org.jbpm.workflow.core.NodeContainer; +import org.jbpm.workflow.core.impl.DroolsConsequenceAction; +import org.jbpm.workflow.core.impl.ExtendedNodeImpl; import org.kie.api.definition.process.WorkflowElementIdentifier; public abstract class NodeFactory, P extends RuleFlowNodeContainerFactory> implements MappableNodeFactory { @@ -71,4 +76,27 @@ public Mappable getMappableNode() { return (Mappable) node; } + public T onEntryAction(String dialect, String action) { + return onActionScript(ExtendedNodeImpl.EVENT_NODE_ENTER, dialect, action, null); + } + + public T onExitAction(String dialect, String action) { + return onActionScript(ExtendedNodeImpl.EVENT_NODE_EXIT, dialect, action, null); + } + + public T onActionScript(String type, String dialect, String script, Action compiledScript) { + DroolsConsequenceAction action = new DroolsConsequenceAction(dialect, script); + if (compiledScript != null) { + action.setMetaData("Action", compiledScript); + } + if (getExtendedNode().getActions(type) == null) { + getExtendedNode().setActions(type, new ArrayList<>()); + } + getExtendedNode().getActions(type).add(action); + return (T) this; + } + + private ExtendedNodeImpl getExtendedNode() { + return (ExtendedNodeImpl) getNode(); + } } diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidator.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidator.java index f1bb75950a4..5319367af5d 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidator.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidator.java @@ -45,12 +45,10 @@ import org.jbpm.ruleflow.core.Metadata; import org.jbpm.ruleflow.core.RuleFlowProcess; import org.jbpm.workflow.core.Constraint; -import org.jbpm.workflow.core.DroolsAction; import org.jbpm.workflow.core.Node; import org.jbpm.workflow.core.WorkflowProcess; import org.jbpm.workflow.core.impl.DataAssociation; import org.jbpm.workflow.core.impl.DroolsConsequenceAction; -import org.jbpm.workflow.core.impl.ExtendedNodeImpl; import org.jbpm.workflow.core.impl.NodeImpl; import org.jbpm.workflow.core.node.ActionNode; import org.jbpm.workflow.core.node.BoundaryEventNode; @@ -189,7 +187,6 @@ protected void validateNodes(org.kie.api.definition.process.Node[] nodes, errors); } else if (node instanceof RuleSetNode) { final RuleSetNode ruleSetNode = (RuleSetNode) node; - validateOnEntryOnExitScripts(ruleSetNode, errors, process); if (ruleSetNode.getFrom() == null && !acceptsNoIncomingConnections(node)) { addErrorMessage(process, node, @@ -318,7 +315,6 @@ protected void validateNodes(org.kie.api.definition.process.Node[] nodes, } } else if (node instanceof MilestoneNode) { final MilestoneNode milestone = (MilestoneNode) node; - validateOnEntryOnExitScripts(milestone, errors, process); if (milestone.getFrom() == null && !acceptsNoIncomingConnections(node)) { addErrorMessage(process, node, @@ -350,7 +346,6 @@ protected void validateNodes(org.kie.api.definition.process.Node[] nodes, } } else if (node instanceof SubProcessNode) { final SubProcessNode subProcess = (SubProcessNode) node; - validateOnEntryOnExitScripts(subProcess, errors, process); if (subProcess.getFrom() == null && !acceptsNoIncomingConnections(node)) { addErrorMessage(process, node, @@ -429,7 +424,6 @@ protected void validateNodes(org.kie.api.definition.process.Node[] nodes, } } else if (node instanceof WorkItemNode) { final WorkItemNode workItemNode = (WorkItemNode) node; - validateOnEntryOnExitScripts(workItemNode, errors, process); if (workItemNode.getFrom() == null && !acceptsNoIncomingConnections(node)) { addErrorMessage(process, node, @@ -469,7 +463,6 @@ protected void validateNodes(org.kie.api.definition.process.Node[] nodes, } } else if (node instanceof ForEachNode) { final ForEachNode forEachNode = (ForEachNode) node; - validateOnEntryOnExitScripts(forEachNode, errors, process); String variableName = forEachNode.getVariableName(); if (variableName == null || "".equals(variableName)) { addErrorMessage(process, @@ -513,7 +506,6 @@ protected void validateNodes(org.kie.api.definition.process.Node[] nodes, process); } else if (node instanceof DynamicNode) { final DynamicNode dynamicNode = (DynamicNode) node; - validateOnEntryOnExitScripts(dynamicNode, errors, process); if (dynamicNode.getDefaultIncomingConnections().isEmpty() && !acceptsNoIncomingConnections(dynamicNode)) { addErrorMessage(process, @@ -540,7 +532,6 @@ protected void validateNodes(org.kie.api.definition.process.Node[] nodes, process); } else if (node instanceof CompositeNode) { final CompositeNode compositeNode = (CompositeNode) node; - validateOnEntryOnExitScripts(compositeNode, errors, process); for (Map.Entry inType : compositeNode.getLinkedIncomingNodes().entrySet()) { if (compositeNode.getIncomingConnections(inType.getKey()).isEmpty() && !acceptsNoIncomingConnections(node)) { addErrorMessage(process, @@ -949,20 +940,6 @@ public ProcessValidationError[] validateProcess(Process process) { return validateProcess((RuleFlowProcess) process); } - //TODO To be removed once https://issues.redhat.com/browse/KOGITO-2067 is fixed - private void validateOnEntryOnExitScripts(Node node, List errors, RuleFlowProcess process) { - if (node instanceof ExtendedNodeImpl) { - List actions = ((ExtendedNodeImpl) node).getActions(ExtendedNodeImpl.EVENT_NODE_ENTER); - if (actions != null && !actions.isEmpty()) { - addErrorMessage(process, node, errors, "On Entry Action is not yet supported in Kogito"); - } - actions = ((ExtendedNodeImpl) node).getActions(ExtendedNodeImpl.EVENT_NODE_EXIT); - if (actions != null && !actions.isEmpty()) { - addErrorMessage(process, node, errors, "On Exit Action is not yet supported in Kogito"); - } - } - } - private void validateVariables(List errors, RuleFlowProcess process) { List variables = process.getVariableScope().getVariables(); diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/ExtendedNodeImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/ExtendedNodeImpl.java index 8a41d90e607..a0f4e215830 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/ExtendedNodeImpl.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/ExtendedNodeImpl.java @@ -39,6 +39,10 @@ public void setActions(String type, List actions) { this.actions.put(type, actions); } + public boolean hasActions(String type) { + return this.actions.get(type) != null; + } + public List getActions(String type) { return this.actions.get(type); } diff --git a/jbpm/jbpm-flow/src/test/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidatorTest.java b/jbpm/jbpm-flow/src/test/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidatorTest.java index f6e52f25e7c..a2d99b7a714 100755 --- a/jbpm/jbpm-flow/src/test/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidatorTest.java +++ b/jbpm/jbpm-flow/src/test/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidatorTest.java @@ -26,26 +26,17 @@ import org.jbpm.process.core.validation.ProcessValidationError; import org.jbpm.ruleflow.core.RuleFlowProcess; import org.jbpm.ruleflow.core.WorkflowElementIdentifierFactory; -import org.jbpm.workflow.core.DroolsAction; import org.jbpm.workflow.core.Node; import org.jbpm.workflow.core.impl.DroolsConsequenceAction; -import org.jbpm.workflow.core.impl.ExtendedNodeImpl; import org.jbpm.workflow.core.node.ActionNode; import org.jbpm.workflow.core.node.CompositeNode; import org.jbpm.workflow.core.node.DynamicNode; import org.jbpm.workflow.core.node.EndNode; -import org.jbpm.workflow.core.node.ForEachNode; -import org.jbpm.workflow.core.node.MilestoneNode; -import org.jbpm.workflow.core.node.RuleSetNode; import org.jbpm.workflow.core.node.StartNode; -import org.jbpm.workflow.core.node.SubProcessNode; -import org.jbpm.workflow.core.node.WorkItemNode; -import org.jbpm.workflow.instance.rule.RuleType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.kie.api.definition.process.WorkflowElementIdentifier; -import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -211,32 +202,6 @@ void testCompositeNodeNoStart() { assertThat(errors[0].getMessage()).isEqualTo("Node 'CompositeNode' [3] Composite has no start node defined."); } - //TODO To be removed once https://issues.redhat.com/browse/KOGITO-2067 is fixed - @Test - void testOnEntryOnExitValidation() { - testNodeOnEntryOnExit(new MilestoneNode()); - RuleSetNode ruleSetNode = new RuleSetNode(); - ruleSetNode.setRuleType(mock(RuleType.class)); - testNodeOnEntryOnExit(ruleSetNode); - testNodeOnEntryOnExit(new SubProcessNode()); - testNodeOnEntryOnExit(new WorkItemNode()); - testNodeOnEntryOnExit(new ForEachNode(one)); - testNodeOnEntryOnExit(new DynamicNode()); - testNodeOnEntryOnExit(new CompositeNode()); - } - - private void testNodeOnEntryOnExit(ExtendedNodeImpl node) { - List errors = new ArrayList<>(); - node.setName("name"); - node.setId(node.getId()); - node.setActions(ExtendedNodeImpl.EVENT_NODE_ENTER, singletonList(new DroolsAction())); - node.setActions(ExtendedNodeImpl.EVENT_NODE_EXIT, singletonList(new DroolsAction())); - validator.validateNodes(new org.kie.api.definition.process.Node[] { node }, errors, process); - assertThat(errors).extracting("message").contains( - "Node 'name' [" + node.getId().toExternalFormat() + "] On Entry Action is not yet supported in Kogito", - "Node 'name' [" + node.getId().toExternalFormat() + "] On Exit Action is not yet supported in Kogito"); - } - @Test void testScriptTaskDialect() { StartNode startNode = new StartNode(); diff --git a/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java index 9af1206fb28..319595851d3 100755 --- a/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java @@ -34,6 +34,8 @@ import org.jbpm.bpmn2.objects.HelloService; import org.jbpm.bpmn2.objects.Person; import org.jbpm.bpmn2.objects.TestWorkItemHandler; +import org.jbpm.bpmn2.subprocess.SubProcessWithEntryExitScriptsModel; +import org.jbpm.bpmn2.subprocess.SubProcessWithEntryExitScriptsProcess; import org.jbpm.bpmn2.test.RequirePersistence; import org.jbpm.process.builder.ActionBuilder; import org.jbpm.process.builder.AssignmentBuilder; @@ -49,6 +51,8 @@ import org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler; import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler; import org.jbpm.test.util.ProcessCompletedCountDownProcessEventListener; +import org.jbpm.test.utils.EventTrackerProcessListener; +import org.jbpm.test.utils.ProcessTestHelper; import org.jbpm.workflow.core.impl.DataAssociation; import org.jbpm.workflow.core.impl.DataDefinition; import org.jbpm.workflow.core.node.ActionNode; @@ -76,6 +80,7 @@ import org.kie.api.event.rule.MatchCreatedEvent; import org.kie.api.runtime.process.DataTransformer; import org.kie.api.runtime.process.NodeInstance; +import org.kie.kogito.Application; import org.kie.kogito.internal.process.event.DefaultKogitoProcessEventListener; import org.kie.kogito.internal.process.runtime.KogitoNodeInstanceContainer; import org.kie.kogito.internal.process.runtime.KogitoProcessInstance; @@ -83,6 +88,7 @@ import org.kie.kogito.internal.process.runtime.KogitoWorkItem; import org.kie.kogito.internal.process.runtime.KogitoWorkItemManager; import org.kie.kogito.internal.process.runtime.KogitoWorkflowProcessInstance; +import org.kie.kogito.process.ProcessInstance; import org.kie.kogito.process.workitems.InternalKogitoWorkItem; import static org.assertj.core.api.Assertions.assertThat; @@ -426,39 +432,27 @@ public void testCallActivityWithContantsAssignment() throws Exception { } @Test - @Disabled("On Exit not supported, see https://issues.redhat.com/browse/KOGITO-2067") public void testSubProcessWithEntryExitScripts() throws Exception { - kruntime = createKogitoProcessRuntime("subprocess/BPMN2-SubProcessWithEntryExitScripts.bpmn2"); - TestWorkItemHandler handler = new TestWorkItemHandler(); - kruntime.getKogitoWorkItemManager().registerWorkItemHandler("Human Task", handler); - - KogitoProcessInstance processInstance = kruntime.startProcess("com.sample.bpmn.hello"); - - assertNodeTriggered(processInstance.getStringId(), "Task1"); - Object var1 = getProcessVarValue(processInstance, "var1"); - assertThat(var1).isNotNull().hasToString("10"); - - assertNodeTriggered(processInstance.getStringId(), "Task2"); - Object var2 = getProcessVarValue(processInstance, "var2"); - assertThat(var2).isNotNull().hasToString("20"); - - assertNodeTriggered(processInstance.getStringId(), "Task3"); - Object var3 = getProcessVarValue(processInstance, "var3"); - assertThat(var3).isNotNull().hasToString("30"); - - assertNodeTriggered(processInstance.getStringId(), "SubProcess"); - Object var4 = getProcessVarValue(processInstance, "var4"); - assertThat(var4).isNotNull().hasToString("40"); - - Object var5 = getProcessVarValue(processInstance, "var5"); - assertThat(var5).isNotNull().hasToString("50"); - - org.kie.kogito.internal.process.runtime.KogitoWorkItem workItem = handler.getWorkItem(); - assertThat(workItem).isNotNull(); - - kruntime.getKogitoWorkItemManager().completeWorkItem(workItem.getStringId(), null); - - assertProcessInstanceCompleted(processInstance); + Application app = ProcessTestHelper.newApplication(); + EventTrackerProcessListener listener = new EventTrackerProcessListener(); + ProcessTestHelper.registerProcessEventListener(app, listener); + + org.kie.kogito.process.Process process = SubProcessWithEntryExitScriptsProcess.newProcess(app); + ProcessInstance processInstance = process.createInstance(process.createModel()); + processInstance.start(); + + assertThat(listener.tracked()).anyMatch(ProcessTestHelper.triggered("Task1")); + assertThat(processInstance.variables().getVar1()).isNotNull().hasToString("10"); + assertThat(listener.tracked()).anyMatch(ProcessTestHelper.triggered("Task2")); + assertThat(processInstance.variables().getVar2()).isNotNull().hasToString("20"); + assertThat(listener.tracked()).anyMatch(ProcessTestHelper.triggered("Task3")); + assertThat(processInstance.variables().getVar3()).isNotNull().hasToString("30"); + assertThat(listener.tracked()).anyMatch(ProcessTestHelper.triggered("SubProcess")); + assertThat(processInstance.variables().getVar4()).isNotNull().hasToString("40"); + assertThat(processInstance.variables().getVar5()).isNotNull().hasToString("50"); + + ProcessTestHelper.completeWorkItem(processInstance, "john", Collections.emptyMap()); + assertThat(processInstance).extracting(ProcessInstance::status).isEqualTo(ProcessInstance.STATE_COMPLETED); } @Test diff --git a/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/EventTrackerProcessListener.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/EventTrackerProcessListener.java new file mode 100644 index 00000000000..e88492b1253 --- /dev/null +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/EventTrackerProcessListener.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.test.utils; + +import java.util.ArrayList; +import java.util.List; + +import org.kie.api.event.process.ProcessNodeEvent; +import org.kie.api.event.process.ProcessNodeLeftEvent; +import org.kie.api.event.process.ProcessNodeTriggeredEvent; +import org.kie.kogito.internal.process.event.DefaultKogitoProcessEventListener; + +public class EventTrackerProcessListener extends DefaultKogitoProcessEventListener { + + List nodeEvents; + + public EventTrackerProcessListener() { + this.nodeEvents = new ArrayList<>(); + } + + @Override + public void afterNodeTriggered(ProcessNodeTriggeredEvent event) { + nodeEvents.add(event); + } + + @Override + public void afterNodeLeft(ProcessNodeLeftEvent event) { + nodeEvents.add(event); + } + + public List tracked() { + return nodeEvents; + } +} diff --git a/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ProcessTestHelper.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ProcessTestHelper.java index d191f061931..6c1d8ac54a0 100644 --- a/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ProcessTestHelper.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/test/utils/ProcessTestHelper.java @@ -21,7 +21,10 @@ import java.util.List; import java.util.Map; import java.util.function.Consumer; +import java.util.function.Predicate; +import org.kie.api.event.process.ProcessNodeEvent; +import org.kie.api.event.process.ProcessNodeTriggeredEvent; import org.kie.kogito.Application; import org.kie.kogito.Model; import org.kie.kogito.StaticApplication; @@ -76,4 +79,10 @@ public static WorkItem findWorkItem(ProcessInstance processInst return workItems.stream().findFirst().get(); } + public static Predicate triggered(String nodeName) { + return e -> { + return e instanceof ProcessNodeTriggeredEvent && nodeName.equals(((ProcessNodeTriggeredEvent) e).getNodeInstance().getNodeName()); + }; + } + } diff --git a/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/resources/unit/project/src/main/bpmn/BPMN2-SubProcessWithEntryExitScripts.bpmn2 b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/resources/unit/project/src/main/bpmn/BPMN2-SubProcessWithEntryExitScripts.bpmn2 new file mode 100755 index 00000000000..3dce9dac8c6 --- /dev/null +++ b/jbpm/jbpm-tools/jbpm-tools-maven-plugin/src/test/resources/unit/project/src/main/bpmn/BPMN2-SubProcessWithEntryExitScripts.bpmn2 @@ -0,0 +1,177 @@ + + + + + + + + + + + + + _1-_2 + SequenceFlow_11 + System.err.println("Task 1, var1 = 10"); +kcontext.setVariable("var1", new Integer(10)); + + + + _1-_2 + + + + SequenceFlow_12 + SequenceFlow_7 + System.err.println("Task 3, var3 = 30"); +kcontext.setVariable("var3",30); + + + + + SequenceFlow_8 + + + + SequenceFlow_7 + SequenceFlow_8 + + + + + + + + + + _DataInput_150 + _DataInput_151 + _DataInput_152 + _DataInput_153 + _DataInput_154 + _DataInput_155 + _DataInput_156 + + + + + _DataInput_150 + + + _DataInput_151 + + + _DataInput_152 + + + _DataInput_153 + + + _DataInput_154 + + + _DataInput_155 + + + _DataInput_156 + + + + + + + System.err.println("SubProcess, var4 = 40"); +kcontext.setVariable("var4",40); + + + + System.err.println("SubProcess, var5 = 50"); +kcontext.setVariable("var5",50); + + + + SequenceFlow_11 + SequenceFlow_12 + + SequenceFlow_10 + + + + SequenceFlow_10 + SequenceFlow_9 + System.err.println("Task 2, var2 = 20"); +kcontext.setVariable("var2",20); + + + + + SequenceFlow_9 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file