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 {
Show replies by date