This is an automated email from the ASF dual-hosted git repository.

egonzalez pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-runtimes.git


The following commit(s) were added to refs/heads/main by this push:
     new c8f6ef9e4f [Incubator-kie-issues#1913] Ability to dynamically run a 
Decision based on process variables (#3885)
c8f6ef9e4f is described below

commit c8f6ef9e4fb2ebdd79df764ba50d5f3634ac319f
Author: Abhiram Gundala <[email protected]>
AuthorDate: Fri May 16 10:25:54 2025 -0400

    [Incubator-kie-issues#1913] Ability to dynamically run a Decision based on 
process variables (#3885)
---
 .../jbpm/bpmn2/xml/BusinessRuleTaskHandler.java    |   8 +-
 .../src/test/java/org/jbpm/bpmn2/ActivityTest.java |  41 ++++
 .../BPMN2-BusinessRuleTaskWithDynamicRule.drl      |  46 +++++
 ...BPMN2-BusinessRuleTaskWithDynamicUnitName.bpmn2 | 164 ++++++++++++++++
 ...PMN2-BusinessRuleTaskDMNByDynamicVariable.bpmn2 | 208 +++++++++++++++++++++
 .../src/test/resources/dmn/dynamic-dmn1.dmn        | 208 +++++++++++++++++++++
 .../src/test/resources/dmn/dynamic-dmn2.dmn        | 208 +++++++++++++++++++++
 7 files changed, 882 insertions(+), 1 deletion(-)

diff --git 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BusinessRuleTaskHandler.java 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BusinessRuleTaskHandler.java
index 6956bf551f..bcffa616e0 100755
--- 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BusinessRuleTaskHandler.java
+++ 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BusinessRuleTaskHandler.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.jbpm.compiler.xml.Parser;
 import org.jbpm.workflow.core.Node;
 import org.jbpm.workflow.core.impl.DataAssociation;
+import org.jbpm.workflow.core.impl.DataDefinition;
 import org.jbpm.workflow.core.node.Assignment;
 import org.jbpm.workflow.core.node.RuleSetNode;
 import org.jbpm.workflow.instance.rule.RuleType;
@@ -66,7 +67,12 @@ public class BusinessRuleTaskHandler extends 
AbstractNodeHandler {
             Map<String, String> parameters = new HashMap<>();
             for (DataAssociation dataAssociation : 
ruleSetNode.getIoSpecification().getDataInputAssociation()) {
                 for (Assignment assignment : dataAssociation.getAssignments()) 
{
-                    parameters.put(assignment.getTo().getLabel(), 
assignment.getFrom().getExpression());
+                    DataDefinition fromDefinition = assignment.getFrom();
+                    String fromValue = fromDefinition.getExpression();
+                    if (!fromDefinition.hasExpression()) {
+                        fromValue = String.format("#{%s}", 
fromDefinition.getId());
+                    }
+                    parameters.put(assignment.getTo().getLabel(), fromValue);
                 }
             }
 
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 8e36d1a04f..7f0a8e83ac 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
@@ -177,6 +177,8 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
 import org.kie.api.definition.process.Node;
 import org.kie.api.definition.process.NodeContainer;
 import org.kie.api.definition.process.Process;
@@ -1204,6 +1206,23 @@ public class ActivityTest extends JbpmBpmn2TestCase {
         assertProcessInstanceFinished(processInstance, kruntime);
     }
 
+    @ParameterizedTest
+    @CsvSource({ "JohnsRuleFlow, john", "MarysRuleFlow, mary" })
+    public void testBusinessRuleTaskWithDataInputsWithDynamicUnitName(String 
ruleFlowName, String expectedName) throws Exception {
+        kruntime = 
createKogitoProcessRuntime("BPMN2-BusinessRuleTaskWithDynamicUnitName.bpmn2",
+                "BPMN2-BusinessRuleTaskWithDynamicRule.drl");
+
+        Person person = new Person();
+        Map<String, Object> params = new HashMap<>();
+        params.put("person", person);
+        params.put("unitName", ruleFlowName);
+        KogitoProcessInstance processInstance = kruntime.startProcess(
+                "BPMN2-BusinessRuleTask", params);
+
+        assertProcessInstanceFinished(processInstance, kruntime);
+        assertThat(person.getName()).isEqualTo(expectedName);
+    }
+
     @Test
     public void testBusinessRuleTaskWithContionalEvent() throws Exception {
         kruntime = 
createKogitoProcessRuntime("BPMN2-ConditionalEventRuleTask.bpmn2",
@@ -1718,6 +1737,28 @@ public class ActivityTest extends JbpmBpmn2TestCase {
         assertThat(vacationDays).isEqualTo(BigDecimal.valueOf(5));
     }
 
+    @ParameterizedTest
+    @CsvSource({ "dynamic-dmn1, https://www.drools.org/kie-dmn1, Extra days 
case 1, 5",
+            "dynamic-dmn1, https://www.drools.org/kie-dmn1, Extra days case 2, 
5",
+            "dynamic-dmn2, https://www.drools.org/kie-dmn2, Extra days case 1, 
10",
+            "dynamic-dmn2, https://www.drools.org/kie-dmn2, Extra days case 2, 
10" })
+    public void testDMNBusinessRuleTaskWithDynamicVariables(String dmn, String 
namespace, String decision, int expectedVacationDays) throws Exception {
+        kruntime = createKogitoProcessRuntime(
+                "dmn/BPMN2-BusinessRuleTaskDMNByDynamicVariable.bpmn2", 
String.format("dmn/%s.dmn", dmn));
+
+        Map<String, Object> params = new HashMap<>();
+        params.put("age", 16);
+        params.put("yearsOfService", 1);
+        params.put("model_name", dmn);
+        params.put("namespace", namespace);
+        params.put("decision_name", decision);
+        KogitoProcessInstance processInstance = 
kruntime.startProcess("BPMN2-BusinessRuleTask", params);
+
+        assertProcessInstanceFinished(processInstance, kruntime);
+        BigDecimal vacationDays = (BigDecimal) 
((KogitoWorkflowProcessInstance) processInstance).getVariable("vacationDays");
+        
assertThat(vacationDays).isEqualTo(BigDecimal.valueOf(expectedVacationDays));
+    }
+
     @Disabled
     @Test
     public void testDMNBusinessRuleTaskMultipleDecisionsOutput() throws 
Exception {
diff --git 
a/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDynamicRule.drl 
b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDynamicRule.drl
new file mode 100644
index 0000000000..3ca7f9c74a
--- /dev/null
+++ 
b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDynamicRule.drl
@@ -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 defaultPackge
+
+
+import org.jbpm.bpmn2.objects.Person;
+
+rule "Johns rule" ruleflow-group "JohnsRuleFlow"
+no-loop
+    when
+        $p : Person(name == null)
+    then
+        modify ($p){
+            setName("john")
+        }
+        System.out.println("Hello " + $p.getName());
+
+end
+
+rule "Marys Rule" ruleflow-group "MarysRuleFlow"
+no-loop
+    when
+        $p : Person(name == null)
+    then
+        modify ($p){
+            setName("mary")
+        }
+        System.out.println("Hello " + $p.getName());
+
+end
diff --git 
a/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDynamicUnitName.bpmn2
 
b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDynamicUnitName.bpmn2
new file mode 100644
index 0000000000..f223067ed1
--- /dev/null
+++ 
b/jbpm/jbpm-tests/src/test/resources/BPMN2-BusinessRuleTaskWithDynamicUnitName.bpmn2
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://www.omg.org/bpmn20"; 
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"; 
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"; 
xmlns:bpsim="http://www.bpsim.org/schemas/1.0"; 
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"; 
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"; 
xmlns:drools="http://www.jboss.org/drools"; id="_4stiAC9sEeOaG4BBbqOFwA" 
xsi:schemaLocation="http://www.omg.org/spec/BPMN/201 [...]
+  <bpmn2:itemDefinition id="_personItem" 
structureRef="org.jbpm.bpmn2.objects.Person"/>
+  <bpmn2:itemDefinition id="_unitNameItem" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition 
id="__B837821D-9CA0-431E-8D4C-8065C3493CE7_personinInputItem" 
structureRef="org.jbpm.bpmn2.objects.Person"/>
+  <bpmn2:itemDefinition 
id="__B837821D-9CA0-431E-8D4C-8065C3493CE7_personoutOutputItem" 
structureRef="org.jbpm.bpmn2.objects.Person"/>
+  <bpmn2:process id="BPMN2-BusinessRuleTask" 
drools:packageName="org.jbpm.bpmn2.objects" drools:version="1.0" 
name="withrules" isExecutable="true">
+    <bpmn2:property id="person" itemSubjectRef="_personItem"/>
+    <bpmn2:property id="unitName" itemSubjectRef="_unitNameItem"/>
+    <bpmn2:startEvent id="processStartEvent" drools:bgcolor="#9acd32" 
drools:selectable="true" name="">
+      <bpmn2:outgoing>_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="_B837821D-9CA0-431E-8D4C-8065C3493CE7" 
drools:selectable="true" drools:ruleFlowGroup="#{unitName}" 
drools:scriptFormat="http://www.java.com/java"; name="Evaluate rule">
+      <bpmn2:incoming>_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA</bpmn2:incoming>
+      <bpmn2:outgoing>_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="_4suJEC9sEeOaG4BBbqOFwA">
+        <bpmn2:dataInput 
id="_B837821D-9CA0-431E-8D4C-8065C3493CE7_personinInput" 
drools:dtype="org.jbpm.bpmn2.objects.Person" 
itemSubjectRef="__B837821D-9CA0-431E-8D4C-8065C3493CE7_personinInputItem" 
name="personin"/>
+        <bpmn2:dataOutput 
id="_B837821D-9CA0-431E-8D4C-8065C3493CE7_personoutOutput" 
drools:dtype="org.jbpm.bpmn2.objects.Person" 
itemSubjectRef="__B837821D-9CA0-431E-8D4C-8065C3493CE7_personoutOutputItem" 
name="personin"/>
+        <bpmn2:inputSet id="_4suJES9sEeOaG4BBbqOFwA">
+          
<bpmn2:dataInputRefs>_B837821D-9CA0-431E-8D4C-8065C3493CE7_personinInput</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="_4suJEi9sEeOaG4BBbqOFwA">
+          
<bpmn2:dataOutputRefs>_B837821D-9CA0-431E-8D4C-8065C3493CE7_personoutOutput</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="_4suJEy9sEeOaG4BBbqOFwA">
+        <bpmn2:sourceRef>person</bpmn2:sourceRef>
+        
<bpmn2:targetRef>_B837821D-9CA0-431E-8D4C-8065C3493CE7_personinInput</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="_4suJFC9sEeOaG4BBbqOFwA">
+        
<bpmn2:sourceRef>_B837821D-9CA0-431E-8D4C-8065C3493CE7_personoutOutput</bpmn2:sourceRef>
+        <bpmn2:targetRef>person</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA" 
drools:bgcolor="#000000" drools:selectable="true" sourceRef="processStartEvent" 
targetRef="_B837821D-9CA0-431E-8D4C-8065C3493CE7"/>
+    <bpmn2:scriptTask id="_93BD2C60-4B4B-4AF6-A393-B75C3999135F" 
drools:selectable="true" name="Printout" 
scriptFormat="http://www.java.com/java";>
+      <bpmn2:incoming>_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10</bpmn2:incoming>
+      <bpmn2:outgoing>_00D2A1E8-F343-478F-B301-B11C551F1037</bpmn2:outgoing>
+      <bpmn2:script><![CDATA[System.out.println("Person " + 
person.getName());]]></bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10" 
drools:bgcolor="#000000" drools:selectable="true" 
sourceRef="_B837821D-9CA0-431E-8D4C-8065C3493CE7" 
targetRef="_93BD2C60-4B4B-4AF6-A393-B75C3999135F"/>
+    <bpmn2:endEvent id="_5D14605E-F34F-475C-A3A3-A3F3F09ACB21" 
drools:bgcolor="#ff6347" drools:selectable="true" name="">
+      <bpmn2:incoming>_00D2A1E8-F343-478F-B301-B11C551F1037</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="_00D2A1E8-F343-478F-B301-B11C551F1037" 
drools:bgcolor="#000000" drools:selectable="true" 
sourceRef="_93BD2C60-4B4B-4AF6-A393-B75C3999135F" 
targetRef="_5D14605E-F34F-475C-A3A3-A3F3F09ACB21"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="_4suJFS9sEeOaG4BBbqOFwA">
+    <bpmndi:BPMNPlane id="_4suJFi9sEeOaG4BBbqOFwA" 
bpmnElement="BPMN2-BusinessRuleTask">
+      <bpmndi:BPMNShape id="_4suJFy9sEeOaG4BBbqOFwA" 
bpmnElement="processStartEvent">
+        <dc:Bounds height="30.0" width="30.0" x="120.0" y="165.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="_4suJGC9sEeOaG4BBbqOFwA" 
bpmnElement="_B837821D-9CA0-431E-8D4C-8065C3493CE7">
+        <dc:Bounds height="80.0" width="100.0" x="195.0" y="140.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="_4suJGS9sEeOaG4BBbqOFwA" 
bpmnElement="_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA">
+        <di:waypoint xsi:type="dc:Point" x="135.0" y="180.0"/>
+        <di:waypoint xsi:type="dc:Point" x="245.0" y="180.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="_4suJGi9sEeOaG4BBbqOFwA" 
bpmnElement="_93BD2C60-4B4B-4AF6-A393-B75C3999135F">
+        <dc:Bounds height="80.0" width="100.0" x="340.0" y="140.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="_4suJGy9sEeOaG4BBbqOFwA" 
bpmnElement="_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10">
+        <di:waypoint xsi:type="dc:Point" x="245.0" y="180.0"/>
+        <di:waypoint xsi:type="dc:Point" x="390.0" y="180.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="_4suJHC9sEeOaG4BBbqOFwA" 
bpmnElement="_5D14605E-F34F-475C-A3A3-A3F3F09ACB21">
+        <dc:Bounds height="28.0" width="28.0" x="481.0" y="162.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="_4suJHS9sEeOaG4BBbqOFwA" 
bpmnElement="_00D2A1E8-F343-478F-B301-B11C551F1037">
+        <di:waypoint xsi:type="dc:Point" x="390.0" y="180.0"/>
+        <di:waypoint xsi:type="dc:Point" x="495.0" y="176.0"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+  <bpmn2:relationship id="_4suJHi9sEeOaG4BBbqOFwA" type="BPSimData">
+    <bpmn2:extensionElements>
+      <bpsim:BPSimData>
+        <bpsim:Scenario xsi:type="bpsim:Scenario" id="default" 
name="Simulationscenario">
+          <bpsim:ScenarioParameters xsi:type="bpsim:ScenarioParameters" 
baseTimeUnit="min"/>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_B837821D-9CA0-431E-8D4C-8065C3493CE7" id="_4suJHy9sEeOaG4BBbqOFwA">
+            <bpsim:TimeParameters xsi:type="bpsim:TimeParameters">
+              <bpsim:ProcessingTime xsi:type="bpsim:Parameter">
+                <bpsim:UniformDistribution max="10.0" min="5.0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+            <bpsim:CostParameters xsi:type="bpsim:CostParameters">
+              <bpsim:UnitCost xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="0.0"/>
+              </bpsim:UnitCost>
+            </bpsim:CostParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_93BD2C60-4B4B-4AF6-A393-B75C3999135F" id="_4suwIC9sEeOaG4BBbqOFwA">
+            <bpsim:TimeParameters xsi:type="bpsim:TimeParameters">
+              <bpsim:ProcessingTime xsi:type="bpsim:Parameter">
+                <bpsim:UniformDistribution max="10.0" min="5.0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+            <bpsim:CostParameters xsi:type="bpsim:CostParameters">
+              <bpsim:UnitCost xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="0.0"/>
+              </bpsim:UnitCost>
+            </bpsim:CostParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_00D2A1E8-F343-478F-B301-B11C551F1037" id="_4suwIS9sEeOaG4BBbqOFwA">
+            <bpsim:ControlParameters xsi:type="bpsim:ControlParameters">
+              <bpsim:Probability xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="100.0"/>
+              </bpsim:Probability>
+            </bpsim:ControlParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="processStartEvent" id="_4suwIi9sEeOaG4BBbqOFwA">
+            <bpsim:TimeParameters xsi:type="bpsim:TimeParameters">
+              <bpsim:WaitTime xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="0.0"/>
+              </bpsim:WaitTime>
+            </bpsim:TimeParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_5D14605E-F34F-475C-A3A3-A3F3F09ACB21" id="_4suwIy9sEeOaG4BBbqOFwA">
+            <bpsim:TimeParameters xsi:type="bpsim:TimeParameters">
+              <bpsim:ProcessingTime xsi:type="bpsim:Parameter">
+                <bpsim:UniformDistribution max="10.0" min="5.0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10" id="_4suwJC9sEeOaG4BBbqOFwA">
+            <bpsim:ControlParameters xsi:type="bpsim:ControlParameters">
+              <bpsim:Probability xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="100.0"/>
+              </bpsim:Probability>
+            </bpsim:ControlParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA" id="_4suwJS9sEeOaG4BBbqOFwA">
+            <bpsim:ControlParameters xsi:type="bpsim:ControlParameters">
+              <bpsim:Probability xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="100.0"/>
+              </bpsim:Probability>
+            </bpsim:ControlParameters>
+          </bpsim:ElementParameters>
+        </bpsim:Scenario>
+      </bpsim:BPSimData>
+    </bpmn2:extensionElements>
+    <bpmn2:source>_4stiAC9sEeOaG4BBbqOFwA</bpmn2:source>
+    <bpmn2:target>_4stiAC9sEeOaG4BBbqOFwA</bpmn2:target>
+  </bpmn2:relationship>
+</bpmn2:definitions>
diff --git 
a/jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNByDynamicVariable.bpmn2
 
b/jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNByDynamicVariable.bpmn2
new file mode 100644
index 0000000000..f8e37217cb
--- /dev/null
+++ 
b/jbpm/jbpm-tests/src/test/resources/dmn/BPMN2-BusinessRuleTaskDMNByDynamicVariable.bpmn2
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://www.omg.org/bpmn20"; 
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"; 
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"; 
xmlns:bpsim="http://www.bpsim.org/schemas/1.0"; 
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"; 
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"; 
xmlns:drools="http://www.jboss.org/drools"; id="_4stiAC9sEeOaG4BBbqOFwA" 
xsi:schemaLocation="http://www.omg.org/spec/BPMN/201 [...]
+  <bpmn2:itemDefinition id="_ageItem" structureRef="Integer"/>
+  <bpmn2:itemDefinition id="_yearsOfServiceItem" structureRef="Integer"/>
+  <bpmn2:itemDefinition id="_vacationDaysItem" 
structureRef="java.math.BigDecimal"/>
+  <bpmn2:itemDefinition id="_model_nameItem" structureRef="String"/>
+  <bpmn2:itemDefinition id="_namespaceItem" structureRef="String"/>
+  <bpmn2:itemDefinition id="_decision_nameItem" structureRef="String"/>
+  <bpmn2:itemDefinition 
id="__B837821D-9CA0-431E-8D4C-8065C3493CE7_ageinInputItem" 
structureRef="Integer"/>
+  <bpmn2:itemDefinition 
id="__B837821D-9CA0-431E-8D4C-8065C3493CE7_yearsOfServiceinInputItem" 
structureRef="Integer"/>
+  <bpmn2:itemDefinition 
id="__B837821D-9CA0-431E-8D4C-8065C3493CE7_vacationDaysOutputItem" 
structureRef="Integer"/>
+  <bpmn2:itemDefinition 
id="__B837821D-9CA0-431E-8D4C-8065C3493CE7_namespaceInputItem" 
structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition 
id="__B837821D-9CA0-431E-8D4C-8065C3493CE7_modelInputItem" 
structureRef="java.lang.String"/>
+  <bpmn2:process id="BPMN2-BusinessRuleTask" 
drools:packageName="org.jbpm.bpmn2.objects" drools:version="1.0" 
name="withrules" isExecutable="true">
+    <bpmn2:property id="age" itemSubjectRef="_ageItem"/>
+    <bpmn2:property id="yearsOfService" itemSubjectRef="_yearsOfServiceItem"/>
+    <bpmn2:property id="vacationDays" itemSubjectRef="_vacationDaysItem"/>
+    <bpmn2:property id="model_name" itemSubjectRef="_modelItem"/>
+    <bpmn2:property id="namespace" itemSubjectRef="_namespaceItem"/>
+    <bpmn2:property id="decision_name" itemSubjectRef="_decision_nameItem"/>
+    <bpmn2:startEvent id="processStartEvent" drools:bgcolor="#9acd32" 
drools:selectable="true" name="">
+      <bpmn2:outgoing>_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:businessRuleTask id="_B837821D-9CA0-431E-8D4C-8065C3493CE7" 
name="Evaluate rule" implementation="http://www.jboss.org/drools/dmn";>
+      <bpmn2:incoming>_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA</bpmn2:incoming>
+      <bpmn2:outgoing>_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10</bpmn2:outgoing>
+      <bpmn2:ioSpecification id="_4suJEC9sEeOaG4BBbqOFwA">
+        <bpmn2:dataInput id="_B837821D-9CA0-431E-8D4C-8065C3493CE7_ageinInput" 
drools:dtype="java.lang.Integer" 
itemSubjectRef="__B837821D-9CA0-431E-8D4C-8065C3493CE7_ageinInputItem" 
name="Age"/>
+        <bpmn2:dataInput 
id="_B837821D-9CA0-431E-8D4C-8065C3493CE7_yearsOfServiceinInput" 
drools:dtype="java.lang.Integer" 
itemSubjectRef="__B837821D-9CA0-431E-8D4C-8065C3493CE7_yearsOfServiceinInputItem"
 name="Years of Service"/>
+        <bpmn2:dataInput 
id="_B837821D-9CA0-431E-8D4C-8065C3493CE7_namespaceInput" 
drools:dtype="java.lang.String" 
itemSubjectRef="__B837821D-9CA0-431E-8D4C-8065C3493CE7_namespaceInputItem" 
name="namespace"/>
+        <bpmn2:dataInput id="_B837821D-9CA0-431E-8D4C-8065C3493CE7_modelInput" 
drools:dtype="java.lang.String" 
itemSubjectRef="__B837821D-9CA0-431E-8D4C-8065C3493CE7_modelInputItem" 
name="model"/>
+        <bpmn2:dataInput 
id="_B837821D-9CA0-431E-8D4C-8065C3493CE7_decisionInput" 
drools:dtype="java.lang.String" 
itemSubjectRef="__B837821D-9CA0-431E-8D4C-8065C3493CE7_decisionInputItem" 
name="decision"/>
+        <bpmn2:dataOutput 
id="_B837821D-9CA0-431E-8D4C-8065C3493CE7_vacationDaysoutOutput" 
drools:dtype="java.math.BigDecimal" 
itemSubjectRef="__B837821D-9CA0-431E-8D4C-8065C3493CE7_vacationDaysOutputItem" 
name="Extra days case 1"/>
+        <bpmn2:inputSet id="_4suJES9sEeOaG4BBbqOFwA">
+          
<bpmn2:dataInputRefs>_B837821D-9CA0-431E-8D4C-8065C3493CE7_ageinInput</bpmn2:dataInputRefs>
+          
<bpmn2:dataInputRefs>_B837821D-9CA0-431E-8D4C-8065C3493CE7_yearsOfServiceinInput</bpmn2:dataInputRefs>
+          
<bpmn2:dataInputRefs>_B837821D-9CA0-431E-8D4C-8065C3493CE7_namespaceInput</bpmn2:dataInputRefs>
+          
<bpmn2:dataInputRefs>_B837821D-9CA0-431E-8D4C-8065C3493CE7_modelInput</bpmn2:dataInputRefs>
+          
<bpmn2:dataInputRefs>_B837821D-9CA0-431E-8D4C-8065C3493CE7_decisionInput</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet id="_4suJEi9sEeOaG4BBbqOFwA">
+          
<bpmn2:dataOutputRefs>_B837821D-9CA0-431E-8D4C-8065C3493CE7_vacationDaysoutOutput</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="_4suJEy9sEeOaG4BBbqOFwA">
+        <bpmn2:sourceRef>age</bpmn2:sourceRef>
+        
<bpmn2:targetRef>_B837821D-9CA0-431E-8D4C-8065C3493CE7_ageinInput</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="_4suJEy9sEeOaG4BBbqOFwB">
+        <bpmn2:sourceRef>yearsOfService</bpmn2:sourceRef>
+        
<bpmn2:targetRef>_B837821D-9CA0-431E-8D4C-8065C3493CE7_yearsOfServiceinInput</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="_OJ4c8mYDEeavbo3IsNuQ2g">
+        
<bpmn2:targetRef>_B837821D-9CA0-431E-8D4C-8065C3493CE7_namespaceInput</bpmn2:targetRef>
+        <bpmn2:assignment id="_OJ4c82YDEeavbo3IsNuQ1g">
+          <bpmn2:from xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="bpmn2:tFormalExpression" 
id="_OJ4c9GYDEeavbo3IsNuQ1g">#{namespace}</bpmn2:from>
+          <bpmn2:to xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="bpmn2:tFormalExpression" 
id="_OJ4c9WYDEeavbo3IsNuQ1g">_B837821D-9CA0-431E-8D4C-8065C3493CE7_namespaceInput</bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="_OJ4c8mYDEeavbo3IsNuQ3g">
+        
<bpmn2:targetRef>_B837821D-9CA0-431E-8D4C-8065C3493CE7_modelInput</bpmn2:targetRef>
+        <bpmn2:assignment id="_OJ4c82YDEeavbo3IsNuQ5g">
+          <bpmn2:from xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="bpmn2:tFormalExpression" 
id="_OJ4c9GYDEeavbo3IsNuQ3g">#{model_name}</bpmn2:from>
+          <bpmn2:to xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="bpmn2:tFormalExpression" 
id="_OJ4c9WYDEeavbo3IsNuQ3g">_B837821D-9CA0-431E-8D4C-8065C3493CE7_modelInput</bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation id="_OJ4c8mYDEeavbo3IsNuQ7g">
+        
<bpmn2:targetRef>_B837821D-9CA0-431E-8D4C-8065C3493CE7_decisionInput</bpmn2:targetRef>
+        <bpmn2:assignment id="_OJ4c82YDEeavbo3IsNuQ8g">
+          <bpmn2:from xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="bpmn2:tFormalExpression" 
id="_OJ4c9GYDEeavbo3IsNuQ9g">#{decision_name}</bpmn2:from>
+          <bpmn2:to xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="bpmn2:tFormalExpression" 
id="_OJ4c9WYDEeavbo3IsNuQ9g">_B837821D-9CA0-431E-8D4C-8065C3493CE7_decisionInput</bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="_4suJFC9sEeOaG4BBbqOFwA">
+        
<bpmn2:sourceRef>_B837821D-9CA0-431E-8D4C-8065C3493CE7_vacationDaysoutOutput</bpmn2:sourceRef>
+        <bpmn2:targetRef>vacationDays</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:sequenceFlow id="_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA" 
drools:bgcolor="#000000" drools:selectable="true" sourceRef="processStartEvent" 
targetRef="_B837821D-9CA0-431E-8D4C-8065C3493CE7"/>
+    <bpmn2:scriptTask id="_93BD2C60-4B4B-4AF6-A393-B75C3999135F" 
drools:selectable="true" name="Printout" 
scriptFormat="http://www.java.com/java";>
+      <bpmn2:incoming>_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10</bpmn2:incoming>
+      <bpmn2:outgoing>_00D2A1E8-F343-478F-B301-B11C551F1037</bpmn2:outgoing>
+      <bpmn2:script><![CDATA[System.out.println("Vacation days  " + 
vacationDays);]]></bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10" 
drools:bgcolor="#000000" drools:selectable="true" 
sourceRef="_B837821D-9CA0-431E-8D4C-8065C3493CE7" 
targetRef="_93BD2C60-4B4B-4AF6-A393-B75C3999135F"/>
+    <bpmn2:endEvent id="_5D14605E-F34F-475C-A3A3-A3F3F09ACB21" 
drools:bgcolor="#ff6347" drools:selectable="true" name="">
+      <bpmn2:incoming>_00D2A1E8-F343-478F-B301-B11C551F1037</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:sequenceFlow id="_00D2A1E8-F343-478F-B301-B11C551F1037" 
drools:bgcolor="#000000" drools:selectable="true" 
sourceRef="_93BD2C60-4B4B-4AF6-A393-B75C3999135F" 
targetRef="_5D14605E-F34F-475C-A3A3-A3F3F09ACB21"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="_4suJFS9sEeOaG4BBbqOFwA">
+    <bpmndi:BPMNPlane id="_4suJFi9sEeOaG4BBbqOFwA" 
bpmnElement="BPMN2-BusinessRuleTask">
+      <bpmndi:BPMNShape id="_4suJFy9sEeOaG4BBbqOFwA" 
bpmnElement="processStartEvent">
+        <dc:Bounds height="30.0" width="30.0" x="120.0" y="165.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="_4suJGC9sEeOaG4BBbqOFwA" 
bpmnElement="_B837821D-9CA0-431E-8D4C-8065C3493CE7">
+        <dc:Bounds height="80.0" width="100.0" x="195.0" y="140.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="_4suJGS9sEeOaG4BBbqOFwA" 
bpmnElement="_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA">
+        <di:waypoint xsi:type="dc:Point" x="135.0" y="180.0"/>
+        <di:waypoint xsi:type="dc:Point" x="245.0" y="180.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="_4suJGi9sEeOaG4BBbqOFwA" 
bpmnElement="_93BD2C60-4B4B-4AF6-A393-B75C3999135F">
+        <dc:Bounds height="80.0" width="100.0" x="340.0" y="140.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="_4suJGy9sEeOaG4BBbqOFwA" 
bpmnElement="_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10">
+        <di:waypoint xsi:type="dc:Point" x="245.0" y="180.0"/>
+        <di:waypoint xsi:type="dc:Point" x="390.0" y="180.0"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="_4suJHC9sEeOaG4BBbqOFwA" 
bpmnElement="_5D14605E-F34F-475C-A3A3-A3F3F09ACB21">
+        <dc:Bounds height="28.0" width="28.0" x="481.0" y="162.0"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="_4suJHS9sEeOaG4BBbqOFwA" 
bpmnElement="_00D2A1E8-F343-478F-B301-B11C551F1037">
+        <di:waypoint xsi:type="dc:Point" x="390.0" y="180.0"/>
+        <di:waypoint xsi:type="dc:Point" x="495.0" y="176.0"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+  <bpmn2:relationship id="_4suJHi9sEeOaG4BBbqOFwA" type="BPSimData">
+    <bpmn2:extensionElements>
+      <bpsim:BPSimData>
+        <bpsim:Scenario xsi:type="bpsim:Scenario" id="default" 
name="Simulationscenario">
+          <bpsim:ScenarioParameters xsi:type="bpsim:ScenarioParameters" 
baseTimeUnit="min"/>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_B837821D-9CA0-431E-8D4C-8065C3493CE7" id="_4suJHy9sEeOaG4BBbqOFwA">
+            <bpsim:TimeParameters xsi:type="bpsim:TimeParameters">
+              <bpsim:ProcessingTime xsi:type="bpsim:Parameter">
+                <bpsim:UniformDistribution max="10.0" min="5.0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+            <bpsim:CostParameters xsi:type="bpsim:CostParameters">
+              <bpsim:UnitCost xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="0.0"/>
+              </bpsim:UnitCost>
+            </bpsim:CostParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_93BD2C60-4B4B-4AF6-A393-B75C3999135F" id="_4suwIC9sEeOaG4BBbqOFwA">
+            <bpsim:TimeParameters xsi:type="bpsim:TimeParameters">
+              <bpsim:ProcessingTime xsi:type="bpsim:Parameter">
+                <bpsim:UniformDistribution max="10.0" min="5.0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+            <bpsim:CostParameters xsi:type="bpsim:CostParameters">
+              <bpsim:UnitCost xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="0.0"/>
+              </bpsim:UnitCost>
+            </bpsim:CostParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_00D2A1E8-F343-478F-B301-B11C551F1037" id="_4suwIS9sEeOaG4BBbqOFwA">
+            <bpsim:ControlParameters xsi:type="bpsim:ControlParameters">
+              <bpsim:Probability xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="100.0"/>
+              </bpsim:Probability>
+            </bpsim:ControlParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="processStartEvent" id="_4suwIi9sEeOaG4BBbqOFwA">
+            <bpsim:TimeParameters xsi:type="bpsim:TimeParameters">
+              <bpsim:WaitTime xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="0.0"/>
+              </bpsim:WaitTime>
+            </bpsim:TimeParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_5D14605E-F34F-475C-A3A3-A3F3F09ACB21" id="_4suwIy9sEeOaG4BBbqOFwA">
+            <bpsim:TimeParameters xsi:type="bpsim:TimeParameters">
+              <bpsim:ProcessingTime xsi:type="bpsim:Parameter">
+                <bpsim:UniformDistribution max="10.0" min="5.0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_CDF5A14A-D296-42A4-9EAF-2F0910A4BC10" id="_4suwJC9sEeOaG4BBbqOFwA">
+            <bpsim:ControlParameters xsi:type="bpsim:ControlParameters">
+              <bpsim:Probability xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="100.0"/>
+              </bpsim:Probability>
+            </bpsim:ControlParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters xsi:type="bpsim:ElementParameters" 
elementRef="_DE49B781-CAB0-4C7E-81AE-1A4EA34648CA" id="_4suwJS9sEeOaG4BBbqOFwA">
+            <bpsim:ControlParameters xsi:type="bpsim:ControlParameters">
+              <bpsim:Probability xsi:type="bpsim:Parameter">
+                <bpsim:FloatingParameter value="100.0"/>
+              </bpsim:Probability>
+            </bpsim:ControlParameters>
+          </bpsim:ElementParameters>
+        </bpsim:Scenario>
+      </bpsim:BPSimData>
+    </bpmn2:extensionElements>
+    <bpmn2:source>_4stiAC9sEeOaG4BBbqOFwA</bpmn2:source>
+    <bpmn2:target>_4stiAC9sEeOaG4BBbqOFwA</bpmn2:target>
+  </bpmn2:relationship>
+</bpmn2:definitions>
diff --git a/jbpm/jbpm-tests/src/test/resources/dmn/dynamic-dmn1.dmn 
b/jbpm/jbpm-tests/src/test/resources/dmn/dynamic-dmn1.dmn
new file mode 100644
index 0000000000..6b0ca9fe8d
--- /dev/null
+++ b/jbpm/jbpm-tests/src/test/resources/dmn/dynamic-dmn1.dmn
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<semantic:definitions xmlns="https://www.drools.org/kie-dmn";
+                      xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/";
+                      xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/";
+                      xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/";
+                      xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/";
+                      xmlns:kie="https://www.drools.org/kie-dmn";
+                      
xmlns:semantic="http://www.omg.org/spec/DMN/20180521/MODEL/";
+                      id="_dynamic-dmn1"
+                      name="dynamic-dmn1"
+                      namespace="https://www.drools.org/kie-dmn1";>
+   <semantic:inputData id="i_Age" name="Age">
+      <semantic:variable name="Age" typeRef="number"/>
+   </semantic:inputData>
+   <semantic:inputData id="i_Years_of_Service" name="Years of Service">
+      <semantic:variable name="Years of Service" typeRef="number"/>
+   </semantic:inputData>
+   <semantic:decision name="Total Vacation Days" id="d_Total_Vacation_Days">
+      <semantic:variable name="Total Vacation Days" typeRef="number"/>
+      <semantic:informationRequirement>
+         <semantic:requiredDecision href="#d_Base_Vacation_Days"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredDecision href="#d_Extra_days_case_1"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredDecision href="#d_Extra_days_case_2"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredDecision href="#d_Extra_days_case_3"/>
+      </semantic:informationRequirement>
+      <semantic:literalExpression>
+         <semantic:text>Base Vacation Days +
+        max( Extra days case 1, Extra days case 3 ) +
+        Extra days case 2
+      </semantic:text>
+      </semantic:literalExpression>
+   </semantic:decision>
+   <semantic:decision name="Extra days case 1" id="d_Extra_days_case_1">
+      <semantic:variable name="Extra days case 1" typeRef="number"/>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Age"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Years_of_Service"/>
+      </semantic:informationRequirement>
+      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
+         <semantic:input id="d_Extra_days_case_1_dt_i_age" label="Age">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Age</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:input id="d_Extra_days_case_1_dt_i_years" label="Years of 
Service">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Years of Service</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:output id="d_Extra_days_case_1_dt_o" label="Extra days">
+            <semantic:defaultOutputEntry>
+               <semantic:text>0</semantic:text>
+            </semantic:defaultOutputEntry>
+         </semantic:output>
+         <semantic:rule id="d_Extra_days_case_1_dt_r1">
+            <semantic:inputEntry id="d_Extra_days_case_1_dt_r1_i1">
+               <semantic:text>&lt;18,&gt;=60</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_1_dt_r1_i2">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_1_dt_r1_o1">
+               <semantic:text>5</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+         <semantic:rule id="d_Extra_days_case_1_dt_r2">
+            <semantic:inputEntry id="d_Extra_days_case_1_dt_r2_i1">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_1_dt_r2_i2">
+               <semantic:text>&gt;=30</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_1_dt_r2_o1">
+               <semantic:text>5</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+      </semantic:decisionTable>
+   </semantic:decision>
+   <semantic:decision name="Extra days case 2" id="d_Extra_days_case_2">
+      <semantic:variable name="Extra days case 2" typeRef="number"/>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Age"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Years_of_Service"/>
+      </semantic:informationRequirement>
+      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
+         <semantic:input id="d_Extra_days_case_2_dt_i_age" label="Age">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Age</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:input id="d_Extra_days_case_2_dt_i_years" label="Years of 
Service">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Years of Service</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:output id="d_Extra_days_case_2_dt_o" label="Extra days">
+            <semantic:defaultOutputEntry>
+               <semantic:text>0</semantic:text>
+            </semantic:defaultOutputEntry>
+         </semantic:output>
+         <semantic:rule id="d_Extra_days_case_2_dt_r1">
+            <semantic:inputEntry id="d_Extra_days_case_2_dt_r1_i1">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_2_dt_r1_i2">
+               <semantic:text>&gt;=30</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_2_dt_r1_o1">
+               <semantic:text>3</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+         <semantic:rule id="d_Extra_days_case_2_dt_r2">
+            <semantic:inputEntry id="d_Extra_days_case_2_dt_r2_i1">
+               <semantic:text>&gt;=60</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_2_dt_r2_i2">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_2_dt_r2_o1">
+               <semantic:text>3</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+      </semantic:decisionTable>
+   </semantic:decision>
+   <semantic:decision name="Extra days case 3" id="d_Extra_days_case_3">
+      <semantic:variable name="Extra days case 3" typeRef="number"/>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Age"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Years_of_Service"/>
+      </semantic:informationRequirement>
+      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
+         <semantic:input id="d_Extra_days_case_3_dt_i_age" label="Age">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Age</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:input id="d_Extra_days_case_3_dt_i_years" label="Years of 
Service">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Years of Service</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:output id="d_Extra_days_case_3_dt_o" label="Extra days">
+            <semantic:defaultOutputEntry>
+               <semantic:text>0</semantic:text>
+            </semantic:defaultOutputEntry>
+         </semantic:output>
+         <semantic:rule id="d_Extra_days_case_3_dt_r1">
+            <semantic:inputEntry id="d_Extra_days_case_3_dt_r1_i1">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_3_dt_r1_i2">
+               <semantic:text>[15..30)</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_3_dt_r1_o1">
+               <semantic:text>2</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+         <semantic:rule id="d_Extra_days_case_3_dt_r2">
+            <semantic:inputEntry id="d_Extra_days_case_3_dt_r2_i1">
+               <semantic:text>&gt;=45</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_3_dt_r2_i2">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_3_dt_r2_o1">
+               <semantic:text>2</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+      </semantic:decisionTable>
+   </semantic:decision>
+   <semantic:decision id="d_Base_Vacation_Days" name="Base Vacation Days">
+      <semantic:variable name="Base Vacation Days" typeRef="number"/>
+      <semantic:literalExpression>
+         <semantic:text>22</semantic:text>
+      </semantic:literalExpression>
+   </semantic:decision>
+</semantic:definitions>
diff --git a/jbpm/jbpm-tests/src/test/resources/dmn/dynamic-dmn2.dmn 
b/jbpm/jbpm-tests/src/test/resources/dmn/dynamic-dmn2.dmn
new file mode 100644
index 0000000000..a3fa72d92f
--- /dev/null
+++ b/jbpm/jbpm-tests/src/test/resources/dmn/dynamic-dmn2.dmn
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<semantic:definitions xmlns="https://www.drools.org/kie-dmn";
+                      xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/";
+                      xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/";
+                      xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/";
+                      xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/";
+                      xmlns:kie="https://www.drools.org/kie-dmn";
+                      
xmlns:semantic="http://www.omg.org/spec/DMN/20180521/MODEL/";
+                      id="_dynamic-dmn2"
+                      name="dynamic-dmn2"
+                      namespace="https://www.drools.org/kie-dmn2";>
+   <semantic:inputData id="i_Age" name="Age">
+      <semantic:variable name="Age" typeRef="number"/>
+   </semantic:inputData>
+   <semantic:inputData id="i_Years_of_Service" name="Years of Service">
+      <semantic:variable name="Years of Service" typeRef="number"/>
+   </semantic:inputData>
+   <semantic:decision name="Total Vacation Days" id="d_Total_Vacation_Days">
+      <semantic:variable name="Total Vacation Days" typeRef="number"/>
+      <semantic:informationRequirement>
+         <semantic:requiredDecision href="#d_Base_Vacation_Days"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredDecision href="#d_Extra_days_case_1"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredDecision href="#d_Extra_days_case_2"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredDecision href="#d_Extra_days_case_3"/>
+      </semantic:informationRequirement>
+      <semantic:literalExpression>
+         <semantic:text>Base Vacation Days +
+        max( Extra days case 1, Extra days case 3 ) +
+        Extra days case 2
+      </semantic:text>
+      </semantic:literalExpression>
+   </semantic:decision>
+   <semantic:decision name="Extra days case 1" id="d_Extra_days_case_1">
+      <semantic:variable name="Extra days case 1" typeRef="number"/>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Age"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Years_of_Service"/>
+      </semantic:informationRequirement>
+      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
+         <semantic:input id="d_Extra_days_case_1_dt_i_age" label="Age">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Age</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:input id="d_Extra_days_case_1_dt_i_years" label="Years of 
Service">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Years of Service</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:output id="d_Extra_days_case_1_dt_o" label="Extra days">
+            <semantic:defaultOutputEntry>
+               <semantic:text>0</semantic:text>
+            </semantic:defaultOutputEntry>
+         </semantic:output>
+         <semantic:rule id="d_Extra_days_case_1_dt_r1">
+            <semantic:inputEntry id="d_Extra_days_case_1_dt_r1_i1">
+               <semantic:text>&lt;18,&gt;=60</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_1_dt_r1_i2">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_1_dt_r1_o1">
+               <semantic:text>10</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+         <semantic:rule id="d_Extra_days_case_1_dt_r2">
+            <semantic:inputEntry id="d_Extra_days_case_1_dt_r2_i1">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_1_dt_r2_i2">
+               <semantic:text>&gt;=30</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_1_dt_r2_o1">
+               <semantic:text>10</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+      </semantic:decisionTable>
+   </semantic:decision>
+   <semantic:decision name="Extra days case 2" id="d_Extra_days_case_2">
+      <semantic:variable name="Extra days case 2" typeRef="number"/>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Age"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Years_of_Service"/>
+      </semantic:informationRequirement>
+      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
+         <semantic:input id="d_Extra_days_case_2_dt_i_age" label="Age">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Age</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:input id="d_Extra_days_case_2_dt_i_years" label="Years of 
Service">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Years of Service</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:output id="d_Extra_days_case_2_dt_o" label="Extra days">
+            <semantic:defaultOutputEntry>
+               <semantic:text>0</semantic:text>
+            </semantic:defaultOutputEntry>
+         </semantic:output>
+         <semantic:rule id="d_Extra_days_case_2_dt_r1">
+            <semantic:inputEntry id="d_Extra_days_case_2_dt_r1_i1">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_2_dt_r1_i2">
+               <semantic:text>&gt;=30</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_2_dt_r1_o1">
+               <semantic:text>3</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+         <semantic:rule id="d_Extra_days_case_2_dt_r2">
+            <semantic:inputEntry id="d_Extra_days_case_2_dt_r2_i1">
+               <semantic:text>&gt;=60</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_2_dt_r2_i2">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_2_dt_r2_o1">
+               <semantic:text>3</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+      </semantic:decisionTable>
+   </semantic:decision>
+   <semantic:decision name="Extra days case 3" id="d_Extra_days_case_3">
+      <semantic:variable name="Extra days case 3" typeRef="number"/>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Age"/>
+      </semantic:informationRequirement>
+      <semantic:informationRequirement>
+         <semantic:requiredInput href="#i_Years_of_Service"/>
+      </semantic:informationRequirement>
+      <semantic:decisionTable hitPolicy="COLLECT" aggregation="MAX">
+         <semantic:input id="d_Extra_days_case_3_dt_i_age" label="Age">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Age</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:input id="d_Extra_days_case_3_dt_i_years" label="Years of 
Service">
+            <semantic:inputExpression typeRef="number">
+               <semantic:text>Years of Service</semantic:text>
+            </semantic:inputExpression>
+         </semantic:input>
+         <semantic:output id="d_Extra_days_case_3_dt_o" label="Extra days">
+            <semantic:defaultOutputEntry>
+               <semantic:text>0</semantic:text>
+            </semantic:defaultOutputEntry>
+         </semantic:output>
+         <semantic:rule id="d_Extra_days_case_3_dt_r1">
+            <semantic:inputEntry id="d_Extra_days_case_3_dt_r1_i1">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_3_dt_r1_i2">
+               <semantic:text>[15..30)</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_3_dt_r1_o1">
+               <semantic:text>2</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+         <semantic:rule id="d_Extra_days_case_3_dt_r2">
+            <semantic:inputEntry id="d_Extra_days_case_3_dt_r2_i1">
+               <semantic:text>&gt;=45</semantic:text>
+            </semantic:inputEntry>
+            <semantic:inputEntry id="d_Extra_days_case_3_dt_r2_i2">
+               <semantic:text>-</semantic:text>
+            </semantic:inputEntry>
+            <semantic:outputEntry id="d_Extra_days_case_3_dt_r2_o1">
+               <semantic:text>2</semantic:text>
+            </semantic:outputEntry>
+         </semantic:rule>
+      </semantic:decisionTable>
+   </semantic:decision>
+   <semantic:decision id="d_Base_Vacation_Days" name="Base Vacation Days">
+      <semantic:variable name="Base Vacation Days" typeRef="number"/>
+      <semantic:literalExpression>
+         <semantic:text>22</semantic:text>
+      </semantic:literalExpression>
+   </semantic:decision>
+</semantic:definitions>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to