[seam-commits] Seam SVN: r12623 - in modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools: interceptor and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Apr 23 19:34:32 EDT 2010


Author: tsurdilovic
Date: 2010-04-23 19:34:32 -0400 (Fri, 23 Apr 2010)
New Revision: 12623

Modified:
   modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/InsertFact.java
   modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertFactInterceptor.java
Log:
added "untilHalt" attribute to insert fact interceptorbinding

Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/InsertFact.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/InsertFact.java	2010-04-23 23:22:36 UTC (rev 12622)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/InsertFact.java	2010-04-23 23:34:32 UTC (rev 12623)
@@ -43,6 +43,7 @@
 @Retention(RUNTIME)
 public @interface InsertFact
 {
-   @Nonbinding boolean fire() default false;   
+   @Nonbinding boolean fire() default false;  
+   @Nonbinding boolean untilHalt() default false;
    @Nonbinding String entrypoint() default "";
 }

Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertFactInterceptor.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertFactInterceptor.java	2010-04-23 23:22:36 UTC (rev 12622)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertFactInterceptor.java	2010-04-23 23:34:32 UTC (rev 12623)
@@ -54,6 +54,7 @@
    public Object insertFact(InvocationContext ctx) throws Exception
    {
       boolean fire = false;
+      boolean untilHalt = false;
       String entryPointName = null;
       
       Annotation[] methodAnnotations = ctx.getMethod().getAnnotations();
@@ -66,6 +67,7 @@
          if(manager.isInterceptorBinding(nextAnnotation.annotationType())) {
             if(nextAnnotation instanceof InsertFact) {
                fire = ((InsertFact) nextAnnotation).fire();
+               untilHalt = ((InsertFact) nextAnnotation).untilHalt();
                entryPointName = ((InsertFact) nextAnnotation).entrypoint();
             }
          }
@@ -80,7 +82,11 @@
             ksession.insert(retObj);
          }
          if(fire) {
-            ksession.fireAllRules();
+            if(untilHalt) {
+               
+            } else {
+               ksession.fireAllRules();
+            }
          }
          return retObj;
       } else {  



More information about the seam-commits mailing list