Thread hung while trying to addKnowledgePackages
by nirmal
Hi,
I am trying to do some drools calls on startup of application
server(Websphere) and the server gets hung at a point and shows the
following warnings.
Any pointers or help appreciated.
[5/26/11 17:28:02:977 EDT] 00000020 ThreadMonitor W WSVR0605W: Thread
"SoapConnectorThreadPool : 1" (00000028) has been active for 674145
milliseconds and may be hung. There is/are 1 thread(s) in total in the
server that may be hung.
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:275)
at
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(JavaDialectRuntimeData.java:576)
at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:259)
at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:242)
at
org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:89)
at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
at
org.drools.rule.JavaDialectRuntimeData.wire(JavaDialectRuntimeData.java:410)
at
org.drools.rule.JavaDialectRuntimeData.reload(JavaDialectRuntimeData.java:477)
at
org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(JavaDialectRuntimeData.java:237)
at
org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(DialectRuntimeRegistry.java:134)
at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:513)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:430)
at
org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:143)
Thanks,
Nirmal
--
View this message in context: http://drools.46999.n3.nabble.com/Thread-hung-while-trying-to-addKnowledg...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
DSL Entry Question
by jstroup
Hi,
The 5.2 docs list the following example DSL entry
[when][][Tt]here is an? {entity:\w+}=${entity!lc}: ${entity!ucfirst} ()
and say the following about what follows the equals sign
"The remaining part of the line after the delimiting equal sign is the
replacement text for any DSLR text matching the regular expression. It may
contain variable references, i.e., a variable name enclosed in braces."
What does the colon following the first variable do? I'm guessing it acts as
an OR? I didn't see any explanation of this and I don't *think* this is
regex.
Also, I'm used to (and actually understand) the following syntax which does
not prefix { with a $.
[when]There is some {cheese} cheese available=Cheese(type=="{cheese}")
My best guess is that the $ denotes a class name that is specified
declaratively in the matching DSLR rule as opposed to a field {cheese} that
is simply a replaceable parameter that matches whatever you type between
"some" and "cheese available" and looks for Cheese objects of that type. So,
given the first DSL entry, if my rule text is
when
there is a cheese
the rule will fire if a Cheese object has been inserted. And, conversely
when
There is an Cheese
will also fire.
Am I on the right track here?
Thanks,
Jeff
--
View this message in context: http://drools.46999.n3.nabble.com/DSL-Entry-Question-tp2993076p2993076.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Accessing globals after FireAllRules
by sdinoo
I have a rule flow that has two tasks that insert global value called ndc11
In the ProcessTest.java (using the sample program) I am trying this code
ksession.startProcess("com.drughistory");
ksession.fireAllRules();
NdcMaster myNdc = (NdcMaster)ksession.getGlobal("ndc11");
System.out.println(">>>>>>" + myNdc.getNdc11()); //THIS IS LINE 53
CONSOLE OUTPUT
Inserted drug with ABCDEFGH
Found Global ABCDEFGH
java.lang.NullPointerException
at rules.tester.ProcessTest.main(ProcessTest.java:53)
All I want to do is access the inserted object and use the same - Can
someone please help?
DROOLS FILE
rule "getDrugMaster" ruleflow-group "DUR" dialect "java" salience 100
when
dc: DurClaim( )
then
ndc11 = ClaimsHistoryHelper.getClaimDrugRecord(dc.getProductSvcID());
insert(ndc11);
System.out.println("Inserted drug with " + ndc11.getNdc11());
end
rule "Get History Claims" ruleflow-group "getClaimHistory" dialect "java"
salience 99
when
n: NdcMaster( ndc11 == "ABCDEFGH" )
then
insert(ndc11);
System.out.println("Found Global " + n.getNdc11());
end
--
View this message in context: http://drools.46999.n3.nabble.com/Accessing-globals-after-FireAllRules-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
[Drools Flow 5.1] persistence + spring + localTransaction
by anton.litvinenko
Hi!
I am quite new to Drools and Drools Flow - please let me know if I am asking
something obvious here :)
I've implemented my custom WorkItemHandlers that are aware of the
KnowledgeSession. Now, I am trying to enable persistence to flows using
drools-persistence-jpa and drools-spring. Ideally, I wanted drools to start
and end transactions, but I wasn't able to achieve that (this is the
problem) and I have start/end transactions manually before
starting/aborting/signaling a process (i.e. running a process is a single
transaction -> if exception happens no state is persisted).
Problem: DroolsSpringTransactionManager has a flag localTransaction which is
set to true whenever a new transaction is started and transaction is
committed only if this flag is set to true. Now, if inside workItemHandler I
invoke a method on knowledgeSession, then my call is being delegated to
SingleSessionCommandService and it tries to start a transaction, but it sees
that there is a transaction already running and sets localTransaction flag
to false -> transaction never gets committed.
Am I doing something wrong here?
Thanks in advance!
Anton
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Flow-5-1-persistence-spring-loca...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Two version of hibernate in the same classpath, how to specify thecorrect version to be used in drools ?
by JAMAL Moundir (EXT)
Hello,
I'm working on a new functionality of an existing project, we will use drools flow to manage our workflow and we want to use persistent and BAM capabilities given by drools.
In all the examples I saw on the internet, only hibernate is used as an implementation of JPA, so I made an example who work very well using hibernate.
The problem is that the existing application already use an old version of hibernate. I can't change it ! So I have two versions of the hibernate in the same classpath which's made several problems.
Maybe I can use another implementation of JPA with drools, but It will be difficult to change the persistence and the BAM from hibernate to another framework !
What I want to do, is to keep hibernate and tell drools to use a specific version of hibernate, I don't know how to do this ? maybe with using the manifest but I don't know if It will work !
Any idea
thanks
*************************************************************************
This message and any attachments (the "message") are confidential, intended solely for the addressee(s), and may contain legally privileged information.
Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration.
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or
falsified.
************
Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et susceptibles de contenir des informations couvertes
par le secret professionnel.
Ce message est etabli a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie.
*************************************************************************
13 years, 6 months
Anyone uses Guided Editor in Eclipse and Guvnor
by Küng Sabrina
Hello
Eclipse: Can anyone provide an example or better tutorial creating and executing a brl-File?
Guvnor: the guided editor seams buggy... any workarounds? I cannot populate an object with value (Error on page).
Regards,
Sabrina
13 years, 6 months
DROOLS Guvnor Build 5.2.x compilatio issue
by mahmood lebbai
Hi,
I had taken the latest code base of Guvnor 5.2.x , when i tried to build webapp , I'm getting following pom error.
C:\fixguv\5.2.xsource\guv\guvnor-webapp>mvn -X clean install -Dmaven.test.skip=t
rue
Apache Maven 3.0.3 (r1075438; 2011-02-28 10:31:09-0700)
Maven home: C:\software\apache-maven-3.0.3-bin\apache-maven-3.0.3
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: C:\glassfish3\jdk\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\software\apache-maven-3.0.3-bin\apache-m
aven-3.0.3\conf\settings.xml
[DEBUG] Reading user settings from C:\Documents and Settings\mlebbai\.m2\setting
s.xml
[DEBUG] Using local repository at C:\Documents and Settings\mlebbai\.m2\reposito
ry
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Doc
uments and Settings\mlebbai\.m2\repository
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountere
d while processing the POMs:
[FATAL] Non-resolvable parent POM for org.drools:guvnor:5.2.0.CR1: Failure to fi
nd org.drools:droolsjbpm-parent:pom:5.2.0.CR1 in http://repository.jboss.org/nex
us/content/groups/public/ was cached in the local repository, resolution will no
t be reattempted until the update interval of jboss-public-repository-group has
elapsed or updates are forced and 'parent.relativePath' points at wrong local PO
M @ org.drools:guvnor:5.2.0.CR1, C:\fixguv\5.2.xsource\guv\pom.xml, line 6, colu
mn 11
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu
ilder.java:339)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:632)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven
.java:581)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:233)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
[ERROR]
[ERROR] The project org.drools:guvnor-webapp:5.2.0.CR1 (C:\fixguv\5.2.xsource\
guv\guvnor-webapp\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.drools:guvnor:5.2.0.CR1: Failure t
o find org.drools:droolsjbpm-parent:pom:5.2.0.CR1 in http://repository.jboss.org
/nexus/content/groups/public/ was cached in the local repository, resolution wil
l not be reattempted until the update interval of jboss-public-repository-group
has elapsed or updates are forced and 'parent.relativePath' points at wrong loca
l POM @ org.drools:guvnor:5.2.0.CR1, C:\fixguv\5.2.xsource\guv\pom.xml, line 6,
column 11 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Failure to find or
g.drools:droolsjbpm-parent:pom:5.2.0.CR1 in http://repository.jboss.org/nexus/co
ntent/groups/public/ was cached in the local repository, resolution will not be
reattempted until the update interval of jboss-public-repository-group has elaps
ed or updates are forced
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectMod
elResolver.java:159)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExterna
lly(DefaultModelBuilder.java:819)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(Defaul
tModelBuilder.java:670)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultMode
lBuilder.java:308)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultMode
lBuilder.java:232)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu
ilder.java:386)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu
ilder.java:355)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu
ilder.java:319)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:632)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven
.java:581)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:233)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure t
o find org.drools:droolsjbpm-parent:pom:5.2.0.CR1 in http://repository.jboss.org
/nexus/content/groups/public/ was cached in the local repository, resolution wil
l not be reattempted until the update interval of jboss-public-repository-group
has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:541)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
facts(DefaultArtifactResolver.java:220)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
fact(DefaultArtifactResolver.java:197)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArti
fact(DefaultRepositorySystem.java:323)
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectMod
elResolver.java:155)
... 22 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to fi
nd org.drools:droolsjbpm-parent:pom:5.2.0.CR1 in http://repository.jboss.org/nex
us/content/groups/public/ was cached in the local repository, resolution will no
t be reattempted until the update interval of jboss-public-repository-group has
elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArti
fact(DefaultUpdateCheckManager.java:190)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:430)
... 26 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableMo
delException
C:\fixguv\5.2.xsource\guv\guvnor-webapp>
Regards,
Mahmood
13 years, 6 months
NPE in Drools JPA Persistence with rules that use Flow
by Shannon Hastings
I am using drools 5.2.0.M2 and I still get this error:
Caused by: java.lang.NullPointerException
at org.drools.marshalling.impl.InputMarshaller.readLeftTuple(InputMarshaller.java:469)
Which was reported on drools 5.1.0 JIRA and claimed to be fixed. I see the error when trying to load a session that was persisted that had objects inserted that are time depended and cause rules to fire that use terms from flow such as "after". I only see this error if create a new session, submit some facts to it, close it, and then try to reload. If i do not submit any facts to it I do not get the error. I.E. If all i do is create the KB with my rules I can reload a session from the DB no problem, but if i submit some facts and persist the session, then i cannot reload it. This seems to be an issue with the JPA loading of the session that has facts in it that use Flow (JBPM). Any help would be greatly appreciated. Below are my simple rules followed by the test code used to submit the facts:
package com.inventrio.rules.readings
import com.inventrio.healthmonitoring.model.*;
declare Reading
@role(event)
@timestamp(readingTime)
end
rule "High Blood Pressure"
when
$eventA : Reading(readingType.name == "BPMETER")
$systolic : Value( this.valueType.name == "SYSTOLIC" ) from $eventA.values
$diastolic : Value( this.valueType.name == "DIASTOLIC" ) from $eventA.values
eval( $systolic.getLongValue() > 180 && $diastolic.getLongValue() > 120 )
then
System.out.println("HIGH BLOOD PRESSURE" );
end
rule "Weight Trending Up"
when
$eventC : Reading(readingType.name == "WEIGHT" )
$eventB : Reading( readingType.name == "WEIGHT" , this after[5s, 1m] $eventC )
$eventA : Reading( readingType.name == "WEIGHT" , this after[5s, 1m] $eventB )
$weight3 : Value( this.valueType.name == "WEIGHT" ) from $eventC.values
$weight2 : Value( this.valueType.name == "WEIGHT" ) from $eventB.values
$weight1 : Value( this.valueType.name == "WEIGHT" ) from $eventA.values
eval( $weight3.getDoubleValue().doubleValue() < $weight2.getDoubleValue().doubleValue() + 1.0 && $weight2.getDoubleValue().doubleValue() < $weight1.getDoubleValue().doubleValue() + 1.0 )
then
System.out.println("WEIGHT IS GOING UP" );
end
rule "Weight Trending Down"
when
$eventC : Reading(readingType.name == "WEIGHT" )
$eventB : Reading( readingType.name == "WEIGHT" , this after[5s, 1m] $eventC )
$eventA : Reading( readingType.name == "WEIGHT" , this after[5s, 1m] $eventB )
$weight3 : Value( this.valueType.name == "WEIGHT" ) from $eventC.values
$weight2 : Value( this.valueType.name == "WEIGHT" ) from $eventB.values
$weight1 : Value( this.valueType.name == "WEIGHT" ) from $eventA.values
eval( $weight3.getDoubleValue().doubleValue() > $weight2.getDoubleValue().doubleValue() + 1.0 && $weight2.getDoubleValue().doubleValue() > $weight1.getDoubleValue().doubleValue() + 1.0 )
then
System.out.println("WEIGHT IS GOING DOWN" );
end
And next is my object i insert before closeing and then trying to reload the session.
public void testWeightRules() {
try {
Reading reading = new Reading();
reading.setReadingTime(new Date(System.currentTimeMillis()));
ReadingType type = new ReadingType();
type.setName("WEIGHT");
type.setDescription("");
reading.setReadingType(type);
Value value = new Value();
value.setDoubleValue(140.0);
ValueType valueType = new ValueType();
valueType.setName("WEIGHT");
valueType.setDataType(ValueDataType.DOUBLE);
value.setValueType(valueType);
reading.getValues().add(value);
reading.setReadingType(type);
engine.process(reading);
Thread.sleep(7000);
reading = new Reading();
reading.setReadingTime(new Date(System.currentTimeMillis()));
type = new ReadingType();
type.setName("WEIGHT");
type.setDescription("");
reading.setReadingType(type);
value = new Value();
value.setDoubleValue(142.0);
valueType = new ValueType();
valueType.setName("WEIGHT");
valueType.setDataType(ValueDataType.DOUBLE);
value.setValueType(valueType);
reading.getValues().add(value);
reading.setReadingType(type);
engine.process(reading);
Thread.sleep(7000);
reading = new Reading();
reading.setReadingTime(new Date(System.currentTimeMillis()));
type = new ReadingType();
type.setName("WEIGHT");
type.setDescription("");
reading.setReadingType(type);
value = new Value();
value.setDoubleValue(144.0);
valueType = new ValueType();
valueType.setName("WEIGHT");
valueType.setDataType(ValueDataType.DOUBLE);
value.setValueType(valueType);
reading.getValues().add(value);
reading.setReadingType(type);
engine.process(reading);
} catch (Throwable t) {
t.printStackTrace();
}
}
Shannon Hastings
Inventrio
545 Metro Place South, Suite 475
Dublin, OH 43017
Phone: (614) 389-2795 x101
Fax: (614) 522-6249
Email: shannon.hastings(a)inventrio.com
http://www.inventrio.com
13 years, 6 months