Are implicit ANDs allowed in "not" blocks?
by Nathan Bell
This rule:
rule "Not"
when
not(
RuleTime()
Patient()
)
then
System.out.println("not");
end
produces the following errors when compiled:
[ERR 102] Line 43:5 mismatched input 'Patient' expecting ')' in rule
"Not"
[ERR 102] Line 44:5 mismatched input ')' expecting 'then' in rule "Not"
But if I change it to use explicit ANDs instead of implicit ANDs it
compiles and runs.
rule "NotBlock"
when
not(
RuleTime()
and
Patient()
)
then
System.out.println("notBlock");
end
Is it invalid syntax to use implicit ANDs in a not block? If so, why?
Thank You,
Nathan Bell
15 years, 3 months
Deadlock using BatchExecutionCommand and Rule that uses the duration attribute
by MacDonald, Bob
Has anyone run into this issue? I've found a couple other references to
deadlocks but nothing that seems to match exactly what I'm seeing. I'm
running with drools 5.1.1 and using the BatchExecutionCommand interface
to feed a set of commands into my StatefulKnowledgeSession. I also have
a simple rule that uses the duration attribute to clean up old facts.
The problem is that the thread that executes the rule associated with
the duration attribute acquires the lock associated with the
DefaultAgenda class object and subsequently tries to acquire the locks
managed by the AbstractWorkingMemory. However, my main thread that uses
the BatchExecutionCommand interface could run while the other thread is
running and this thread first acquires the AbstractWorkingMemory locks
and later tries to acquire the DefaultAgenda class object lock resulting
in the deadlock.
Here's is the stack trace for the thread that runs when duration
expires:
Unsafe.park(boolean, long) line: not available [native method]
LockSupport.park(Object) line: 158
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).parkAndCheckInterr
upt() line: 747
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquireQueued(Abst
ractQueuedSynchronizer$Node, int) line: 778
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquire(int) line:
1114
ReentrantLock$NonfairSync.lock() line: 186
ReentrantLock.lock() line: 262
ReteooStatefulSession(AbstractWorkingMemory).retract(FactHandle,
boolean, boolean, Rule, Activation) line: 1256
DefaultKnowledgeHelper.retract(FactHandle) line: 201
DefaultKnowledgeHelper.retract(Object) line: 214
Rule_Automatically_Remove_Old_Events_0.defaultConsequence(KnowledgeHelpe
r, Event, FactHandle) line: 10
Rule_Automatically_Remove_Old_Events_0DefaultConsequenceInvoker.evaluate
(KnowledgeHelper, WorkingMemory) line: 29
DefaultAgenda.fireActivation(Activation) line: 917
Scheduler$ActivationTimerJob.execute(JobContext) line: 73
JDKTimerService$JDKCallableJob.call() line: 147
JDKTimerService$JDKCallableJob.call() line: 125
FutureTask$Sync.innerRun() line: 303
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).run()
line: 138
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$301(ScheduledT
hreadPoolExecutor$ScheduledFutureTask) line: 98
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.run() line: 207
ThreadPoolExecutor$Worker.runTask(Runnable) line: 886
ThreadPoolExecutor$Worker.run() line: 908
Thread.run() line: 619
And here's the stack trace of the thread using the BatchExecutionCommand
interface:
DefaultAgenda.fireActivation(Activation) line: 889
DefaultAgenda.fireNextItem(AgendaFilter) line: 856
DefaultAgenda.fireAllRules(AgendaFilter, int) line: 1071
ReteooStatefulSession(AbstractWorkingMemory).fireAllRules(AgendaFilter,
int) line: 785
ReteooStatefulSession(AbstractWorkingMemory).fireAllRules() line: 751
StatefulKnowledgeSessionImpl.fireAllRules() line: 218
FireAllRulesCommand.execute(Context) line: 99
FireAllRulesCommand.execute(Context) line: 33
BatchExecutionCommandImpl.execute(Context) line: 159
BatchExecutionCommandImpl.execute(Context) line: 81
StatefulKnowledgeSessionImpl.execute(Context, Command<T>) line: 887
StatefulKnowledgeSessionImpl.execute(Command<T>) line: 862
Rules$RuleRunnerThread.run() line: 554
The rule with the duration attribute is very simple and included below:
rule "Automatically Remove Old Events"
agenda-group "SYSTEM"
// 1 hour (specified in milliseconds)
duration 3600000
when
$event : Event(eventId : id)
not SituationEvent(correlator == eventId)
then
retract($event);
end
CONFIDENTIALITY NOTICE: The information contained in this e-mail and its
attachments are privileged and confidential and may contain proprietary,
copyrighted or other legally protected information which is intended
solely for the use of the addressee(s). If you are not the intended
recipient, you are hereby notified that any disclosure, use, copying or
distribution of this communication is strictly prohibited. Please
notify the sender immediately and permanently delete this e-mail from
your computer.
15 years, 3 months
Droos Guvnor 5.1.1 - Relation between Category and Package
by Achyutha, Venkata
Hi,
I am using ServiceImplementaion.java class to read categories and packages in repository, I didn't find any method in this class to get like what all packages are there for Category. Can someone please point out me how to get this relation.
We are developing small ui, where we show Category in dropdown, its packages in one more dropdown and rules in one more dropdown. This is little urgent requirement, help would be highly appreciated.
Thanks
Kumar
15 years, 3 months
Scenario issue with ruleflow-group in guvnor
by kyori
Hello,
I created a rule flow in Eclipse with some rules (BRLs, DRLs and XLS format
decision tables) which worked perfectly in Eclipse (with jBoss IDE plugin
5.1).
Then I committed the flow and all the rules to Guvnor and created a scenario
with "ruleflow-group" activation. But none of these rules is fired, even
the simplest ones...
The error message was "Rule [...] was not activated. Expected it to be
activated".
If I remove the "ruleflow-group" option from the rules, they worked fine
again.
I've tested in Guvnor 5.1 and 5.2 snapshot, the same result.
Does anybody else have this problem. Did I miss something except the
activation of ruleflow-group in the scenario?
Regards,
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Scenario-issue-with-r...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 3 months
drools with IKVM
by Piyush Goel
We are using Drools engine on our client written in C#. We are using IKVM to
convert the drools jar and our java beans into dll's using IKVM. We have a
rule similar to this:-
rule "aggregate rule"
when
$b : Bill(billAmount > 100)
$n : Number(doubleValue > 100) from accumulate ( $l : LineItem()
from $b.findItems("color", "blue"), sum($l.getSellingValue()))
then
VoucherSeries fact0 = new VoucherSeries();
fact0.setSeriesCode( "aggregate voucher" );
insert(fact0 );
voucherlist.add(fact0);
System.out.println("sum" + $n);
end
This rule works fine when it is run with java based drools API's, but while
running it with IKVM converted drools, it throws the following error:-
Unable to cast object of type 'AccumulateMemory' to type 'FromMemory'.
Any ideas on what might be going wrong ?
thanks,
piyush
15 years, 3 months
Advantage of org.drools.runtime.Environment
by O.S.
Hello,
can someone tell me what's the advantage of using Environments for
StatefulSessions?
An Example:
this.ksession = kbase.newStatefulKnowledgeSession(this.ksessionConfig,
environment);
vs.
this.ksession = kbase.newStatefulKnowledgeSession(this.ksessionConfig,
null);
Are Globals or other Objects (e.g. Session-ID's) shared within/depending
on the Environment? Because that will be problematic in my Application.
Actually i'm using Environments, but they aren't serializable which is
why I have to check if I really need them.
Kind regards,
O.S.
Furthermore: I don't need the JPA-Persistence functionality.
15 years, 3 months
drools gwt-console problems
by melc
Hello,
Can you please assist with two issues that I have related to gwt-console,
1. In gwt-console after starting a simple process with one human task (the
sample process from eclipse with one human task before ending) and clicking
the diagram button (as shown on the screencast
http://people.redhat.com/kverlaen/install-gwt-console.swf) while the process
is in running stat, I get a dialog with the title " Incomplete deployment"
and message " No diagram associated with process ". How can the diagram of
the process be displayed with the red triangle for the currently active node
etc ??
2. If a new process is added in guvnor from eclipse and the package is
compiled the process is never shown in gwt-console, unless jboss AS
restarts. Is it possible to refresh gwt-console and show the current state?
I was hoping that it would be possible to add processes to the repository
while the system is up and running as with rules etc....
I would appreciate any help thank you
p.s. for all of the above i've used drools guvnor versions 5.1 and 5.2,
gwt-console versions 5.1 and 5.2, gwt-server versions 5.1 and 5.2, eclipse
only 5.2, runtime only 5.1 .
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-gwt-console-pr...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 4 months