[jboss-svn-commits] JBL Code SVN: r13631 - in labs/jbossrules/trunk/drools-compiler/src/test: resources/org/drools/integrationtests and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 19 07:50:57 EDT 2007


Author: mark.proctor at jboss.com
Date: 2007-07-19 07:50:57 -0400 (Thu, 19 Jul 2007)
New Revision: 13631

Added:
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rfm
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.drl
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.rf
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.rfm
Removed:
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rf
Modified:
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/ExecutionFlowControlTest.java
Log:
-Added ruleflow test for clearing a ruleflowgroup.

Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/ExecutionFlowControlTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/ExecutionFlowControlTest.java	2007-07-19 11:33:01 UTC (rev 13630)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/ExecutionFlowControlTest.java	2007-07-19 11:50:57 UTC (rev 13631)
@@ -552,7 +552,7 @@
     public void testRuleFlow() throws Exception {
         final PackageBuilder builder = new PackageBuilder();
         builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.drl" ) ) );
-        builder.addRuleFlow( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.rf" ) ) );
+        builder.addRuleFlow( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.rfm" ) ) );
         final Package pkg = builder.getPackage();
         final RuleBase ruleBase = getRuleBase();
         ruleBase.addPackage( pkg );
@@ -584,10 +584,62 @@
                       processInstance.getState() );
     }
     
+    public void testRuleFlowClear() throws Exception {
+        final PackageBuilder builder = new PackageBuilder();
+        builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_ruleflowClear.drl" ) ) );
+        builder.addRuleFlow( new InputStreamReader( getClass().getResourceAsStream( "test_ruleflowClear.rfm" ) ) );
+        final Package pkg = builder.getPackage();
+        final RuleBase ruleBase = getRuleBase();
+        ruleBase.addPackage( pkg );
+
+        final WorkingMemory workingMemory = ruleBase.newStatefulSession();
+        final List list = new ArrayList();
+        workingMemory.setGlobal( "list",
+                                 list );
+        
+        final List activations = new ArrayList();
+        AgendaEventListener listener = new DefaultAgendaEventListener() {            
+            public void activationCancelled(ActivationCancelledEvent event,
+                                            WorkingMemory workingMemory) {
+                activations.add( event.getActivation() );
+            }
+        };
+        
+        workingMemory.addEventListener( listener );
+     
+        assertEquals( 0 , workingMemory.getAgenda().getRuleFlowGroup( "flowgroup-1" ).size() );
+        
+        // We need to call fireAllRules here to get the InitialFact into the system, to the eval(true)'s kick in
+        workingMemory.fireAllRules();
+        
+        // Now we have 4 in the RuleFlow, but not yet in the agenda
+        assertEquals( 4 , workingMemory.getAgenda().getRuleFlowGroup( "flowgroup-1" ).size() );
+        
+        // Check they aren't in the Agenda
+        assertEquals( 0, workingMemory.getAgenda().getAgendaGroup( "MAIN" ).size() );
+        
+        // Start the process, which shoudl populate the Agenda
+        final ProcessInstance processInstance = workingMemory.startProcess( "ruleFlowClear" );
+        assertEquals( 4, workingMemory.getAgenda().getAgendaGroup( "MAIN" ).size() );
+        
+        
+        // Check we have 0 activation cancellation events
+        assertEquals( 0, activations.size() );
+        
+        workingMemory.getAgenda().clearRuleFlowGroup( "flowgroup-1" );
+        
+        // Check the AgendaGroup and RuleFlowGroup  are now empty
+        assertEquals( 0, workingMemory.getAgenda().getAgendaGroup( "MAIN" ).size() );
+        assertEquals( 0 , workingMemory.getAgenda().getRuleFlowGroup( "flowgroup-1" ).size() );
+        
+        // Check we have four activation cancellation events
+        assertEquals( 4, activations.size() );              
+    }
+    
     public void testRuleFlowInPackage() throws Exception {
         final PackageBuilder builder = new PackageBuilder();
         builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.drl" ) ) );
-        builder.addRuleFlow( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.rf" ) ) );
+        builder.addRuleFlow( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.rfm" ) ) );
         final Package pkg = builder.getPackage();
 
         final RuleBase ruleBase = getRuleBase();

Deleted: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rf
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rf	2007-07-19 11:33:01 UTC (rev 13630)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rf	2007-07-19 11:50:57 UTC (rev 13631)
@@ -1,150 +0,0 @@
-<org.drools.ruleflow.core.impl.RuleFlowProcessImpl id="1">
-  <nodes id="2">
-    <entry>
-      <long>2</long>
-      <org.drools.ruleflow.core.impl.RuleSetNodeImpl id="3">
-        <ruleFlowGroup>flowgroup-1</ruleFlowGroup>
-        <id>2</id>
-        <name>RuleSet1</name>
-        <incomingConnections id="4">
-          <org.drools.ruleflow.core.impl.ConnectionImpl id="5">
-            <type>1</type>
-            <from class="org.drools.ruleflow.core.impl.StartNodeImpl" id="6">
-              <id>1</id>
-              <name>Start</name>
-              <incomingConnections id="7"/>
-              <outgoingConnections id="8">
-                <org.drools.ruleflow.core.impl.ConnectionImpl reference="5"/>
-              </outgoingConnections>
-            </from>
-            <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="3"/>
-          </org.drools.ruleflow.core.impl.ConnectionImpl>
-        </incomingConnections>
-        <outgoingConnections id="9">
-          <org.drools.ruleflow.core.impl.ConnectionImpl id="10">
-            <type>1</type>
-            <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="3"/>
-            <to class="org.drools.ruleflow.core.impl.SplitImpl" id="11">
-              <type>1</type>
-              <constraints id="12"/>
-              <id>5</id>
-              <name>Split</name>
-              <incomingConnections id="13">
-                <org.drools.ruleflow.core.impl.ConnectionImpl reference="10"/>
-              </incomingConnections>
-              <outgoingConnections id="14">
-                <org.drools.ruleflow.core.impl.ConnectionImpl id="15">
-                  <type>1</type>
-                  <from class="org.drools.ruleflow.core.impl.SplitImpl" reference="11"/>
-                  <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" id="16">
-                    <ruleFlowGroup>flowgroup-2</ruleFlowGroup>
-                    <id>3</id>
-                    <name>RuleSet2</name>
-                    <incomingConnections id="17">
-                      <org.drools.ruleflow.core.impl.ConnectionImpl reference="15"/>
-                    </incomingConnections>
-                    <outgoingConnections id="18">
-                      <org.drools.ruleflow.core.impl.ConnectionImpl id="19">
-                        <type>1</type>
-                        <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="16"/>
-                        <to class="org.drools.ruleflow.core.impl.JoinImpl" id="20">
-                          <type>1</type>
-                          <id>6</id>
-                          <name>Join</name>
-                          <incomingConnections id="21">
-                            <org.drools.ruleflow.core.impl.ConnectionImpl id="22">
-                              <type>1</type>
-                              <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" id="23">
-                                <ruleFlowGroup>flowgroup-3</ruleFlowGroup>
-                                <id>4</id>
-                                <name>RuleSet3</name>
-                                <incomingConnections id="24">
-                                  <org.drools.ruleflow.core.impl.ConnectionImpl id="25">
-                                    <type>1</type>
-                                    <from class="org.drools.ruleflow.core.impl.SplitImpl" reference="11"/>
-                                    <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="23"/>
-                                  </org.drools.ruleflow.core.impl.ConnectionImpl>
-                                </incomingConnections>
-                                <outgoingConnections id="26">
-                                  <org.drools.ruleflow.core.impl.ConnectionImpl reference="22"/>
-                                </outgoingConnections>
-                              </from>
-                              <to class="org.drools.ruleflow.core.impl.JoinImpl" reference="20"/>
-                            </org.drools.ruleflow.core.impl.ConnectionImpl>
-                            <org.drools.ruleflow.core.impl.ConnectionImpl reference="19"/>
-                          </incomingConnections>
-                          <outgoingConnections id="27">
-                            <org.drools.ruleflow.core.impl.ConnectionImpl id="28">
-                              <type>1</type>
-                              <from class="org.drools.ruleflow.core.impl.JoinImpl" reference="20"/>
-                              <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" id="29">
-                                <ruleFlowGroup>flowgroup-4</ruleFlowGroup>
-                                <id>7</id>
-                                <name>RuleSet4</name>
-                                <incomingConnections id="30">
-                                  <org.drools.ruleflow.core.impl.ConnectionImpl reference="28"/>
-                                </incomingConnections>
-                                <outgoingConnections id="31">
-                                  <org.drools.ruleflow.core.impl.ConnectionImpl id="32">
-                                    <type>1</type>
-                                    <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="29"/>
-                                    <to class="org.drools.ruleflow.core.impl.EndNodeImpl" id="33">
-                                      <id>8</id>
-                                      <name>End</name>
-                                      <incomingConnections id="34">
-                                        <org.drools.ruleflow.core.impl.ConnectionImpl reference="32"/>
-                                      </incomingConnections>
-                                      <outgoingConnections id="35"/>
-                                    </to>
-                                  </org.drools.ruleflow.core.impl.ConnectionImpl>
-                                </outgoingConnections>
-                              </to>
-                            </org.drools.ruleflow.core.impl.ConnectionImpl>
-                          </outgoingConnections>
-                        </to>
-                      </org.drools.ruleflow.core.impl.ConnectionImpl>
-                    </outgoingConnections>
-                  </to>
-                </org.drools.ruleflow.core.impl.ConnectionImpl>
-                <org.drools.ruleflow.core.impl.ConnectionImpl reference="25"/>
-              </outgoingConnections>
-            </to>
-          </org.drools.ruleflow.core.impl.ConnectionImpl>
-        </outgoingConnections>
-      </org.drools.ruleflow.core.impl.RuleSetNodeImpl>
-    </entry>
-    <entry>
-      <long>4</long>
-      <org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="23"/>
-    </entry>
-    <entry>
-      <long>8</long>
-      <org.drools.ruleflow.core.impl.EndNodeImpl reference="33"/>
-    </entry>
-    <entry>
-      <long>6</long>
-      <org.drools.ruleflow.core.impl.JoinImpl reference="20"/>
-    </entry>
-    <entry>
-      <long>1</long>
-      <org.drools.ruleflow.core.impl.StartNodeImpl reference="6"/>
-    </entry>
-    <entry>
-      <long>3</long>
-      <org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="16"/>
-    </entry>
-    <entry>
-      <long>7</long>
-      <org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="29"/>
-    </entry>
-    <entry>
-      <long>5</long>
-      <org.drools.ruleflow.core.impl.SplitImpl reference="11"/>
-    </entry>
-  </nodes>
-  <variables id="36"/>
-  <lastNodeId>8</lastNodeId>
-  <id>0</id>
-  <name>flow</name>
-  <type>Workflow</type>
-</org.drools.ruleflow.core.impl.RuleFlowProcessImpl>
\ No newline at end of file

Copied: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rfm (from rev 13578, labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rf)
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rfm	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/ruleflow.rfm	2007-07-19 11:50:57 UTC (rev 13631)
@@ -0,0 +1,150 @@
+<org.drools.ruleflow.core.impl.RuleFlowProcessImpl id="1">
+  <nodes id="2">
+    <entry>
+      <long>2</long>
+      <org.drools.ruleflow.core.impl.RuleSetNodeImpl id="3">
+        <ruleFlowGroup>flowgroup-1</ruleFlowGroup>
+        <id>2</id>
+        <name>RuleSet1</name>
+        <incomingConnections id="4">
+          <org.drools.ruleflow.core.impl.ConnectionImpl id="5">
+            <type>1</type>
+            <from class="org.drools.ruleflow.core.impl.StartNodeImpl" id="6">
+              <id>1</id>
+              <name>Start</name>
+              <incomingConnections id="7"/>
+              <outgoingConnections id="8">
+                <org.drools.ruleflow.core.impl.ConnectionImpl reference="5"/>
+              </outgoingConnections>
+            </from>
+            <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="3"/>
+          </org.drools.ruleflow.core.impl.ConnectionImpl>
+        </incomingConnections>
+        <outgoingConnections id="9">
+          <org.drools.ruleflow.core.impl.ConnectionImpl id="10">
+            <type>1</type>
+            <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="3"/>
+            <to class="org.drools.ruleflow.core.impl.SplitImpl" id="11">
+              <type>1</type>
+              <constraints id="12"/>
+              <id>5</id>
+              <name>Split</name>
+              <incomingConnections id="13">
+                <org.drools.ruleflow.core.impl.ConnectionImpl reference="10"/>
+              </incomingConnections>
+              <outgoingConnections id="14">
+                <org.drools.ruleflow.core.impl.ConnectionImpl id="15">
+                  <type>1</type>
+                  <from class="org.drools.ruleflow.core.impl.SplitImpl" reference="11"/>
+                  <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" id="16">
+                    <ruleFlowGroup>flowgroup-2</ruleFlowGroup>
+                    <id>3</id>
+                    <name>RuleSet2</name>
+                    <incomingConnections id="17">
+                      <org.drools.ruleflow.core.impl.ConnectionImpl reference="15"/>
+                    </incomingConnections>
+                    <outgoingConnections id="18">
+                      <org.drools.ruleflow.core.impl.ConnectionImpl id="19">
+                        <type>1</type>
+                        <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="16"/>
+                        <to class="org.drools.ruleflow.core.impl.JoinImpl" id="20">
+                          <type>1</type>
+                          <id>6</id>
+                          <name>Join</name>
+                          <incomingConnections id="21">
+                            <org.drools.ruleflow.core.impl.ConnectionImpl id="22">
+                              <type>1</type>
+                              <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" id="23">
+                                <ruleFlowGroup>flowgroup-3</ruleFlowGroup>
+                                <id>4</id>
+                                <name>RuleSet3</name>
+                                <incomingConnections id="24">
+                                  <org.drools.ruleflow.core.impl.ConnectionImpl id="25">
+                                    <type>1</type>
+                                    <from class="org.drools.ruleflow.core.impl.SplitImpl" reference="11"/>
+                                    <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="23"/>
+                                  </org.drools.ruleflow.core.impl.ConnectionImpl>
+                                </incomingConnections>
+                                <outgoingConnections id="26">
+                                  <org.drools.ruleflow.core.impl.ConnectionImpl reference="22"/>
+                                </outgoingConnections>
+                              </from>
+                              <to class="org.drools.ruleflow.core.impl.JoinImpl" reference="20"/>
+                            </org.drools.ruleflow.core.impl.ConnectionImpl>
+                            <org.drools.ruleflow.core.impl.ConnectionImpl reference="19"/>
+                          </incomingConnections>
+                          <outgoingConnections id="27">
+                            <org.drools.ruleflow.core.impl.ConnectionImpl id="28">
+                              <type>1</type>
+                              <from class="org.drools.ruleflow.core.impl.JoinImpl" reference="20"/>
+                              <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" id="29">
+                                <ruleFlowGroup>flowgroup-4</ruleFlowGroup>
+                                <id>7</id>
+                                <name>RuleSet4</name>
+                                <incomingConnections id="30">
+                                  <org.drools.ruleflow.core.impl.ConnectionImpl reference="28"/>
+                                </incomingConnections>
+                                <outgoingConnections id="31">
+                                  <org.drools.ruleflow.core.impl.ConnectionImpl id="32">
+                                    <type>1</type>
+                                    <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="29"/>
+                                    <to class="org.drools.ruleflow.core.impl.EndNodeImpl" id="33">
+                                      <id>8</id>
+                                      <name>End</name>
+                                      <incomingConnections id="34">
+                                        <org.drools.ruleflow.core.impl.ConnectionImpl reference="32"/>
+                                      </incomingConnections>
+                                      <outgoingConnections id="35"/>
+                                    </to>
+                                  </org.drools.ruleflow.core.impl.ConnectionImpl>
+                                </outgoingConnections>
+                              </to>
+                            </org.drools.ruleflow.core.impl.ConnectionImpl>
+                          </outgoingConnections>
+                        </to>
+                      </org.drools.ruleflow.core.impl.ConnectionImpl>
+                    </outgoingConnections>
+                  </to>
+                </org.drools.ruleflow.core.impl.ConnectionImpl>
+                <org.drools.ruleflow.core.impl.ConnectionImpl reference="25"/>
+              </outgoingConnections>
+            </to>
+          </org.drools.ruleflow.core.impl.ConnectionImpl>
+        </outgoingConnections>
+      </org.drools.ruleflow.core.impl.RuleSetNodeImpl>
+    </entry>
+    <entry>
+      <long>4</long>
+      <org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="23"/>
+    </entry>
+    <entry>
+      <long>8</long>
+      <org.drools.ruleflow.core.impl.EndNodeImpl reference="33"/>
+    </entry>
+    <entry>
+      <long>6</long>
+      <org.drools.ruleflow.core.impl.JoinImpl reference="20"/>
+    </entry>
+    <entry>
+      <long>1</long>
+      <org.drools.ruleflow.core.impl.StartNodeImpl reference="6"/>
+    </entry>
+    <entry>
+      <long>3</long>
+      <org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="16"/>
+    </entry>
+    <entry>
+      <long>7</long>
+      <org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="29"/>
+    </entry>
+    <entry>
+      <long>5</long>
+      <org.drools.ruleflow.core.impl.SplitImpl reference="11"/>
+    </entry>
+  </nodes>
+  <variables id="36"/>
+  <lastNodeId>8</lastNodeId>
+  <id>0</id>
+  <name>flow</name>
+  <type>Workflow</type>
+</org.drools.ruleflow.core.impl.RuleFlowProcessImpl>
\ No newline at end of file

Added: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.drl	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.drl	2007-07-19 11:50:57 UTC (rev 13631)
@@ -0,0 +1,33 @@
+package com.sample
+ 
+import java.util.List;
+
+global List list
+
+rule "Rule1" ruleflow-group "flowgroup-1"
+	when
+		eval(true)
+	then
+		list.add("Rule1");
+end
+
+rule "Rule2" ruleflow-group "flowgroup-1"
+	when
+		eval(true)
+	then
+		list.add("Rule2");
+end
+
+rule "Rule3" ruleflow-group "flowgroup-1" salience 10
+	when
+		eval(true)
+	then
+		list.add("Rule3");
+end
+
+rule "Rule4" ruleflow-group "flowgroup-1" salience 20
+	when
+		eval(true)
+	then
+		list.add("Rule4");
+end
\ No newline at end of file

Added: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.rf
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.rf	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.rf	2007-07-19 11:50:57 UTC (rev 13631)
@@ -0,0 +1,154 @@
+<org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper id="1" serialization="custom">
+  <org.drools.eclipse.flow.common.editor.core.ProcessWrapper>
+    <default>
+      <elements id="2">
+        <entry>
+          <string>2-Wrapper</string>
+          <org.drools.eclipse.flow.ruleflow.core.EndNodeWrapper id="3" serialization="custom">
+            <org.drools.eclipse.flow.common.editor.core.DefaultElementWrapper>
+              <default>
+                <constraint id="4">
+                  <x>530</x>
+                  <y>111</y>
+                  <width>80</width>
+                  <height>40</height>
+                </constraint>
+                <element class="org.drools.ruleflow.core.impl.EndNodeImpl" id="5">
+                  <id>2</id>
+                  <name>End</name>
+                  <incomingConnections id="6">
+                    <org.drools.ruleflow.core.impl.ConnectionImpl id="7">
+                      <type>1</type>
+                      <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" id="8">
+                        <ruleFlowGroup>flowgroup-1</ruleFlowGroup>
+                        <id>3</id>
+                        <name>flowgroup-1</name>
+                        <incomingConnections id="9">
+                          <org.drools.ruleflow.core.impl.ConnectionImpl id="10">
+                            <type>1</type>
+                            <from class="org.drools.ruleflow.core.impl.StartNodeImpl" id="11">
+                              <id>1</id>
+                              <name>Start</name>
+                              <incomingConnections id="12"/>
+                              <outgoingConnections id="13">
+                                <org.drools.ruleflow.core.impl.ConnectionImpl reference="10"/>
+                              </outgoingConnections>
+                            </from>
+                            <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="8"/>
+                          </org.drools.ruleflow.core.impl.ConnectionImpl>
+                        </incomingConnections>
+                        <outgoingConnections id="14">
+                          <org.drools.ruleflow.core.impl.ConnectionImpl reference="7"/>
+                        </outgoingConnections>
+                      </from>
+                      <to class="org.drools.ruleflow.core.impl.EndNodeImpl" reference="5"/>
+                    </org.drools.ruleflow.core.impl.ConnectionImpl>
+                  </incomingConnections>
+                  <outgoingConnections id="15"/>
+                </element>
+                <incomingConnections id="16">
+                  <org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper id="17" serialization="custom">
+                    <org.drools.eclipse.flow.common.editor.core.ElementConnection>
+                      <default>
+                        <type>1</type>
+                        <bendpoints id="18"/>
+                        <source class="org.drools.eclipse.flow.ruleflow.core.RuleSetNodeWrapper" id="19" serialization="custom">
+                          <org.drools.eclipse.flow.common.editor.core.DefaultElementWrapper>
+                            <default>
+                              <constraint id="20">
+                                <x>297</x>
+                                <y>112</y>
+                                <width>80</width>
+                                <height>40</height>
+                              </constraint>
+                              <element class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="8"/>
+                              <incomingConnections id="21">
+                                <org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper id="22" serialization="custom">
+                                  <org.drools.eclipse.flow.common.editor.core.ElementConnection>
+                                    <default>
+                                      <type>1</type>
+                                      <bendpoints id="23"/>
+                                      <source class="org.drools.eclipse.flow.ruleflow.core.StartNodeWrapper" id="24" serialization="custom">
+                                        <org.drools.eclipse.flow.common.editor.core.DefaultElementWrapper>
+                                          <default>
+                                            <constraint id="25">
+                                              <x>100</x>
+                                              <y>100</y>
+                                              <width>80</width>
+                                              <height>40</height>
+                                            </constraint>
+                                            <element class="org.drools.ruleflow.core.impl.StartNodeImpl" reference="11"/>
+                                            <incomingConnections id="26"/>
+                                            <outgoingConnections id="27">
+                                              <org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper reference="22"/>
+                                            </outgoingConnections>
+                                          </default>
+                                        </org.drools.eclipse.flow.common.editor.core.DefaultElementWrapper>
+                                      </source>
+                                      <target class="org.drools.eclipse.flow.ruleflow.core.RuleSetNodeWrapper" reference="19"/>
+                                    </default>
+                                  </org.drools.eclipse.flow.common.editor.core.ElementConnection>
+                                  <org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper>
+                                    <default>
+                                      <connection class="org.drools.ruleflow.core.impl.ConnectionImpl" reference="10"/>
+                                    </default>
+                                  </org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper>
+                                </org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper>
+                              </incomingConnections>
+                              <outgoingConnections id="28">
+                                <org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper reference="17"/>
+                              </outgoingConnections>
+                              <parent class="org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper" reference="1"/>
+                            </default>
+                          </org.drools.eclipse.flow.common.editor.core.DefaultElementWrapper>
+                        </source>
+                        <target class="org.drools.eclipse.flow.ruleflow.core.EndNodeWrapper" reference="3"/>
+                      </default>
+                    </org.drools.eclipse.flow.common.editor.core.ElementConnection>
+                    <org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper>
+                      <default>
+                        <connection class="org.drools.ruleflow.core.impl.ConnectionImpl" reference="7"/>
+                      </default>
+                    </org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper>
+                  </org.drools.eclipse.flow.ruleflow.core.ConnectionWrapper>
+                </incomingConnections>
+                <outgoingConnections id="29"/>
+                <parent class="org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper" reference="1"/>
+              </default>
+            </org.drools.eclipse.flow.common.editor.core.DefaultElementWrapper>
+          </org.drools.eclipse.flow.ruleflow.core.EndNodeWrapper>
+        </entry>
+        <entry>
+          <string>3-Wrapper</string>
+          <org.drools.eclipse.flow.ruleflow.core.RuleSetNodeWrapper reference="19"/>
+        </entry>
+        <entry>
+          <string>1-Wrapper</string>
+          <org.drools.eclipse.flow.ruleflow.core.StartNodeWrapper reference="24"/>
+        </entry>
+      </elements>
+      <process class="org.drools.ruleflow.core.impl.RuleFlowProcessImpl" id="30">
+        <nodes id="31">
+          <entry>
+            <long>2</long>
+            <org.drools.ruleflow.core.impl.EndNodeImpl reference="5"/>
+          </entry>
+          <entry>
+            <long>1</long>
+            <org.drools.ruleflow.core.impl.StartNodeImpl reference="11"/>
+          </entry>
+          <entry>
+            <long>3</long>
+            <org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="8"/>
+          </entry>
+        </nodes>
+        <variables id="32"/>
+        <lastNodeId>3</lastNodeId>
+        <id>ruleFlowClear</id>
+        <name>test_ruleflowClear</name>
+        <type>RuleFlow</type>
+      </process>
+      <routerLayout>2</routerLayout>
+    </default>
+  </org.drools.eclipse.flow.common.editor.core.ProcessWrapper>
+</org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper>
\ No newline at end of file

Added: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.rfm
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.rfm	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_ruleflowClear.rfm	2007-07-19 11:50:57 UTC (rev 13631)
@@ -0,0 +1,53 @@
+<org.drools.ruleflow.core.impl.RuleFlowProcessImpl id="1">
+  <nodes id="2">
+    <entry>
+      <long>2</long>
+      <org.drools.ruleflow.core.impl.EndNodeImpl id="3">
+        <id>2</id>
+        <name>End</name>
+        <incomingConnections id="4">
+          <org.drools.ruleflow.core.impl.ConnectionImpl id="5">
+            <type>1</type>
+            <from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" id="6">
+              <ruleFlowGroup>flowgroup-1</ruleFlowGroup>
+              <id>3</id>
+              <name>flowgroup-1</name>
+              <incomingConnections id="7">
+                <org.drools.ruleflow.core.impl.ConnectionImpl id="8">
+                  <type>1</type>
+                  <from class="org.drools.ruleflow.core.impl.StartNodeImpl" id="9">
+                    <id>1</id>
+                    <name>Start</name>
+                    <incomingConnections id="10"/>
+                    <outgoingConnections id="11">
+                      <org.drools.ruleflow.core.impl.ConnectionImpl reference="8"/>
+                    </outgoingConnections>
+                  </from>
+                  <to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="6"/>
+                </org.drools.ruleflow.core.impl.ConnectionImpl>
+              </incomingConnections>
+              <outgoingConnections id="12">
+                <org.drools.ruleflow.core.impl.ConnectionImpl reference="5"/>
+              </outgoingConnections>
+            </from>
+            <to class="org.drools.ruleflow.core.impl.EndNodeImpl" reference="3"/>
+          </org.drools.ruleflow.core.impl.ConnectionImpl>
+        </incomingConnections>
+        <outgoingConnections id="13"/>
+      </org.drools.ruleflow.core.impl.EndNodeImpl>
+    </entry>
+    <entry>
+      <long>1</long>
+      <org.drools.ruleflow.core.impl.StartNodeImpl reference="9"/>
+    </entry>
+    <entry>
+      <long>3</long>
+      <org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="6"/>
+    </entry>
+  </nodes>
+  <variables id="14"/>
+  <lastNodeId>3</lastNodeId>
+  <id>ruleFlowClear</id>
+  <name>test_ruleflowClear</name>
+  <type>RuleFlow</type>
+</org.drools.ruleflow.core.impl.RuleFlowProcessImpl>
\ No newline at end of file




More information about the jboss-svn-commits mailing list