Error while upgrdaing drools version
by mohan
Hi folks,
I'm using JBoss 5.1.0 GA, Jboss ESB 4.9 and Drool 5.1.0
recently i have tried to upgrade all my entities as below.
*jboss-6.1.0.Final, jbossesb-4.11, drools 5.3.1.Final*
while i start app server i'm getting below error and still i couldn't trace
it. Is it because of compatibility issue or bug? I'm using same drl file as
earlier.
19:01:56,634 ERROR
[org.jboss.kernel.plugins.dependency.AbstractKernelController] Error
installing to Start: name=jboss.esb.vfs:///I:/c
ep/jboss-6.1.0.Final/server/cep/deploy/cep-esb-1.0-SNAPSHOT.esb
state=Create: java.lang.VerifyError: (class: lk/dialog/cep/mobile/Rule_
No_such_offer_yetDefaultConsequenceInvoker, method: evaluate signature:
(Lorg/drools/spi/KnowledgeHelper;Lorg/drools/WorkingMemory;)V)
Expecting to find integer on stack
at java.lang.Class.getDeclaredConstructors0(Native Method) [:1.6.0]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
[:1.6.0]
at java.lang.Class.getConstructor0(Class.java:2699) [:1.6.0]
at java.lang.Class.newInstance0(Class.java:326) [:1.6.0]
at java.lang.Class.newInstance(Class.java:308) [:1.6.0]
at
org.drools.rule.JavaDialectRuntimeData.wire(JavaDialectRuntimeData.java:409)
[:5.3.1.Final]
at
org.drools.rule.JavaDialectRuntimeData.wire(JavaDialectRuntimeData.java:396)
[:5.3.1.Final]
at
org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(JavaDialectRuntimeData.java:237)
[:5.3.1.Final]
at
org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(DialectRuntimeRegistry.java:132)
[:5.3.1.Final]
at
org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:875)
[:5.3.1.Final]
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:828)
[:5.3.1.Final]
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:404)
[:5.3.1.Final]
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
[:5.3.1.Final]
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
[:5.3.1.Final]
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:712)
[:5.3.1.Final]
at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:917)
[:5.3.1.Final]
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:659)
[:5.3.1.Final]
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)
[:5.3.1.Final]
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:169)
[:5.3.1.Final]
at
lk.dialog.charging.cep.StatefullCepEngineSingleton.init(StatefullCepEngineSingleton.java:805)
[:]
at
lk.dialog.charging.cep.StatefullCepEngineSingleton.<init>(StatefullCepEngineSingleton.java:83)
[:]
at
lk.dialog.charging.cep.StatefullCepEngineSingleton.intialize(StatefullCepEngineSingleton.java:152)
[:]
at
lk.dialog.charging.cep.feeders.StatefullINUDPVoiceEventFeeder.initialise(StatefullINUDPVoiceEventFeeder.java:30)
at
org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.initialise(ActionProcessingPipeline.java:397)
[:]
at
org.jboss.soa.esb.listeners.message.MessageAwareListener.doInitialise(MessageAwareListener.java:188)
[:]
at
org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle.initialise(AbstractManagedLifecycle.java:133)
[:]
at
org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController.initialiseInstances(ManagedLifecycleController.java:109)
[:
]
kind regards
Mohan
--
View this message in context: http://drools.46999.n3.nabble.com/Error-while-upgrdaing-drools-version-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
Reg. Rule parsing & MVEL Dialect
by Phani Saripalli
Hi. Is there any valid impression that MVEL parsing can cause performance
bottlenecks as far is drools is concerned?
Or to put it in a better way, I have 500 rules, patterns for each rule are
bit complex, and my observations are that rule parsing (or grammar
formation) is very time consuming. Would this be better if I use Java
dialect.
To be very precise my issue is, I have a type declaration with 1000
variables and 500 rules. Each rule has a complex pattern. It is taking lot
of time to parse and for the grammar. And secondly, inserting an initial
fact is tending to be time consuming.
Many thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Reg-Rule-parsing-MVEL-Dialect-tp4020730...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
knowledgeBase.addKnowledgePackages api is getting hung
by himansu.nayak
my spreadsheet contains 3780 records. which create the same no of rules
during runtime.
the control just get hung in the line
"knowledgeBase.addKnowledgePackages(knowledgeBuilder
.getKnowledgePackages());"
CODE SNIPPET
----------------------
public KnowledgeBase buildKnowledgeBaseFromSpreadsheet(String spreadSheet,
String ruleTemplate, int rowNo, int colNo) {
KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder();
KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
String drl = externalSpreadsheetCompiler.compile(spreadSheetStream,
ruleTemplateStream, 0, 0);
knowledgeBuilder.add(new ByteArrayResource(drl.getBytes()),
ResourceType.DRL);
validateKnowledgeBuilder(knowledgeBuilder);
// code which get hung
*knowledgeBase.addKnowledgePackages(knowledgeBuilder
.getKnowledgePackages());*
return knowledgeBase;
}
public void validateKnowledgeBuilder(KnowledgeBuilder knowledgeBuilder) {
if (knowledgeBuilder.hasErrors()) {
System.out.println("Error compiling resources:");
for (KnowledgeBuilderError error : knowledgeBuilder.getErrors()) {
System.err.println(error.toString());
}
throw new IllegalStateException("Error compiling resources");
}
}
-----
Thanks...
Himansu
--
View this message in context: http://drools.46999.n3.nabble.com/knowledgeBase-addKnowledgePackages-api-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
Planer: Rule design causing problem
by Reinis
Hi,
I have application similar to nurse rostering. You have projects,
resources and dates. You assign resource on date to project (thus you
have an assignment).
Now, I have rule that is supposed to keep assignments "together". Most
of the assignments are indeed kept together with some few but very nasty
exceptions.
I have attached the image (Schedule.png) to visualize this. In the image
you see assignments for Project 9 being planed en block from 13. July
till 20. July (green box at the bottom). But then there are couple of
assignments (above, underlined in red on 2. January and on 22. February)
totally "out of the row".
I attempt to "pull" assignments together with this rule:
rule "penalize assignment dispersion to goLive"
when
$project : Project(goLive != null)
$furthestAssignment : Assignment(project == $project, interval
!= null, $project.goLive.compareTo(interval.end) >= 0)
not Assignment(id > $furthestAssignment.id, project ==
$project, interval != null, $project.goLive.compareTo(interval.end) >=
0, distanceToGoLive >= $furthestAssignment.distanceToGoLive)
then
insertLogical( new IntConstraintOccurrence("penalizing
assignment dispersion", ConstraintType.NEGATIVE_SOFT,
$furthestAssignment.distanceToGoLive(),
$project) );
end
There are number of other rules. The ones checking hard constraints are
trivial and I will just omit them, the soft constraint rules might have
impact on this issue although unlikely (I removed all the other soft
constraint rules and still got similar weird result). Here are the other
rules:
rule "penalize assignment with the resource without the capability
required by project option"
when
$projectOption : ProjectOption()
$penalizedAssignments : Number(intValue > 0)
from accumulate ( Assignment($penalizedAssignment : this,
project == $projectOption.project, resource != null,
resource.capabilities not contains $projectOption.name),
count($penalizedAssignment) )
then
insertLogical( new IntConstraintOccurrence("there are
assignments with the resource without the capability required by project
option", ConstraintType.NEGATIVE_SOFT,
$penalizedAssignments.intValue(), $projectOption,
$penalizedAssignments) );
end
rule "penalize assignment with the resource without the capability
required by project constraint"
when
$projectConstraint : ProjectConstraint()
$penalizedAssignments : Number(intValue > 0)
from accumulate ( Assignment($penalizedAssignment : this,
project == $projectConstraint.project, resource != null,
resource.capabilities not contains $projectConstraint.name),
count($penalizedAssignment) )
then
insertLogical( new IntConstraintOccurrence("there are
assignments with the resource without the capability required by project
constraint", ConstraintType.NEGATIVE_SOFT,
$penalizedAssignments.intValue(), $projectConstraint,
$penalizedAssignments) );
end
Am using Drools Planer 5.3. and biting out my teeth on this issue for
about 3 moth already. Any help is worth half the kingdom to me right now.
br
Reinis
11 years, 5 months
How can I nested rules
by leonardo_josue
Hi everybody, I hope some of you can tell me if I can do something with my
problem.
I have a table in a DB with medical information from too many patients. This
information was captured in paper and after put into the table. The
questions have a sequence, and a few answers depend of other answers, for
example:
P1. Age:____
P2. Gander: 1: Female, 2: Male
--> if P1 >= 12 and P2 = 1 then go to p3, else go to p5
P3. How many times have you been pregnant? 0, 1, 2, 3, 4, 5, ______
--> if number > 1 go to P3 else P5
P4. How many babes were born alive? 0, 1, 2, 3, 4, 5, _______
P5. Do you smoke? 1: no, 2: yes
In the table I have something like this:
mysql> SELECT * FROM table;
|id||P1|P2|P3|P4|P5|STATUS
------------------------------
|1|34|1|3|2|1|NULL
|2|10|1|3|2|1|NULL
|3|21|2|1|1|1|NULL
|4|66|1|0|1|1|NULL
|5|14|2|NULL|NULL|1|NULL
|6|09|1|NULL|NULL|1|NULL
I try to set STATUS = "OK" when information was consistent, i.e.
ID = 2. A girl of 10 years hardly been pregnant 3 times
ID = 3. A man can't get pregnant or abort
ID = 4. A woman can't abort if the number of times she has become pregnant
is zero
I'll try to use Drools to do something like this.
rule "Age and gender women"
no-loop
when
p : Person(p1 >= 12 && p2 = 1)
then
//execute rule "Pregnant"
end
rule "Pregnant"
no-loop
when
p : Person(p3 > 1)
then
//execute rule "Aborts"
end
rule "Pregnant"
no-loop
when
p : Person(p4 <= P3)
then
//it's ok
p.Status = 'OK'
end
Is this possible??? I read than you can't nested rules, but I want to know
if exist some way to do. Since now my thanks for any help.
Best regards.
Leo.
--
View this message in context: http://drools.46999.n3.nabble.com/How-can-I-nested-rules-tp4020488.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
Calling queries or collect() from functions
by Miguel Paraz
Hi,
I have a rule like:
rule "Rule1"
when
$fact: Fact1()
$allFacts: ArrayList() from collect(Fact1())
then
insert(new Fact2($allFacts.size()));
end
I want to compute $allFacts inside a function since I will use it across
different rules.
This doesn't work because it is not valid Java syntax:
function int size() {
ArrayList a = ArrayList() from collect(InQueuePredicate());
return a.size();
}
Could I put this in a named query, and call it from a function?
Thanks!
Miguel
11 years, 5 months