Drools 6.0.0.2 Beta uses different dependencies to antlr version
by dastraub
mvn dependency:tree
...
INFO] +- org.drools:drools-compiler:jar:6.0.0.Beta2:provided
[INFO] | +- org.drools:drools-core:jar:6.0.0.Beta2:provided
[INFO] | | +- org.kie:kie-api:jar:6.0.0.Beta2:provided
[INFO] | | \- org.kie:kie-internal:jar:6.0.0.Beta2:provided
[INFO] | +- org.antlr:antlr-runtime:jar:3.3:provided
[INFO] | +- org.antlr:antlr:jar:3.3:provided
[INFO] | +- org.antlr:stringtemplate:jar:3.2.1:provided
[INFO] | +- antlr:antlr:jar:2.7.7:provided
Is this correct ?
As far as I know, antlr 2.7 and 3.3 has different package names, so it's not
a problem to use both versions.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-0-0-2-Beta-uses-different-depe...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months
NullpointerException in Multithreading at KnowledgeBuilde
by Bojan Janisch
Hi everyone,
I'm using Drools in a multithreaded environment where I need to create multiple KnowledgeBuilders, which each contains a different rule. But if I want to add the rule to the builder I'm getting the following exception:
-----------------------------------------------------------------------
Exception in thread "ECJ Evaluation Thread 3" java.lang.NullPointerException
at org.drools.rule.builder.dialect.mvel.MVELDialect.addStaticPackageImport(MVELDialect.java:416)
at org.drools.rule.builder.dialect.mvel.MVELDialect.addStaticImport(MVELDialect.java:372)
at org.drools.compiler.DialectCompiletimeRegistry.addStaticImport(DialectCompiletimeRegistry.java:96)
at org.drools.compiler.PackageRegistry.addStaticImport(PackageRegistry.java:94)
at org.drools.compiler.PackageBuilder.processFunctions(PackageBuilder.java:1270)
at org.drools.compiler.PackageBuilder.processOtherDeclarations(PackageBuilder.java:1225)
at org.drools.compiler.PackageBuilder.mergePackage(PackageBuilder.java:1220)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:829)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:467)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:673)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)
at rulevolution.RulEvolution.getSession(RulEvolution.java:195)
at rulevolution.RulEvolution.runDrools(RulEvolution.java:159)
at rulevolution.RulEvolution.evaluate(RulEvolution.java:106)
at ec.simple.SimpleEvaluator.evalPopChunk(SimpleEvaluator.java:259)
at ec.simple.SimpleEvaluator$SimpleEvaluatorThreadCG.run(SimpleEvaluator.java:341)
at ec.util.ThreadPool$PoolThread.run(ThreadPool.java:57)
-----------------------------------------------------------------------
I'm getting the same exception in each thread so I only copied thread 3.
The Code I'm using to initiate my Session is the following:
-----------------------------------------------------------------------
public synchronized StatefulKnowledgeSession getSession(byte[] array){
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newByteArrayResource(array), ResourceType.DRL);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (!errors.isEmpty()) {
for (KnowledgeBuilderError knowledgeBuilderError : errors) {
logger.log(Level.SEVERE, "error while parsing grammmars in "+knowledgeBuilderError.getResource().toString()+":: "
+ knowledgeBuilderError.getMessage());
}
try {
throw new Exception();
} catch (Exception e) {
e.printStackTrace();
}
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase.newStatefulKnowledgeSession();
}
-----------------------------------------------------------------------
This method is called for each Rule I create one time. The rules are created
automatically and are syntactically correct, here is an example:
-----------------------------------------------------------------------
import function de.fraunhofer.scai.bio.uima.droolutils.FactChecker.*;
import function de.fraunhofer.scai.bio.uima.droolutils.ODMAnswerManager.*;
global org.apache.uima.util.impl.JSR47Logger_impl log
global org.apache.uima.jcas.JCas aJCas
rule '2'
when
$0: CoreAnnotation(
label_0:getActivityProvenance().toString(),
getConcept().identifierSource.contains('de.cloud4health.odm.eprd.bodySide'))
$1: CoreAnnotation(
label_1:getActivityProvenance().toString(),
getConcept().identifierSource.contains('de.cloud4health.odm.eprd.anatomy'))
$2: NormalizedNamedEntity(
label_2:getConcept().getPrefLabel().value,
getConcept().identifierSource.contains('de.cloud4health.odm.eprd.anatomy'))
eval (hasSameInstance($0, $1, $2))
eval (areEqual($0, $1, $2))
then
int start = getStart($0,$1,$2);
int ende = getEnd($0,$1,$2);
String attribute = label_0+label_1+label_2;
log.log(Level.FINE, 'Inserted de.cloud4health.odm.eprd.itemGroup.anatomy');
insert(annotate(aJCas, 'de.cloud4health.odm.eprd.itemGroup.anatomy', attribute, start, ende, null, null));
end
-----------------------------------------------------------------------
I appreciate any help. Thank you.
Bojan
12 years, 6 months
Guvnor and DSL i18n
by abluesongbird
Does Guvnor 5.5.0.Final provide i18n for created DSLs? If not, might this be
an upcoming Guvnor 6 feature?
I have seen the i18n/l10n of Guvnor's main UI, via the locale parameter, and
this is great. To fully support international customers, though, we need to
extend this to the the DSL that is authored by and presented to the user.
By i18n of the DSLs, I mean that
1. a single DSL can be expressed many times, once for each (supported)
locale,
2. each DSL expression is stored with its locale, and
3. the correct DSL expression is retrieved, based on the user's locale.
I don't see this in the UI or the documentation. I did see this, though, in
the "Drools Introduction and General User Guide", under "4.7.1. Language
Expressiveness Enhancements":
"* Complete rewrite of DSL engine, allowing for full l10n"
This sounds intriguing, but I can find no other information online.
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-and-DSL-i18n-tp4024032.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months
Error during fetching rules via REST API
by abhinay_agarwal
Hi,
I am trying to access guvnor(on tomcat) through my application(on websphere)
through a rest API call using "HttpURLConnection", but when i use
connection.connect();
it throws me the following error. Any idea about this error or which jar
might I be missing,
java.lang.NoClassDefFoundError: org.drools.util.ServiceRegistryImpl
(initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:145)
at
org.drools.builder.KnowledgeBuilderFactory.loadServiceFactory(KnowledgeBuilderFactory.java:130)
at
org.drools.builder.KnowledgeBuilderFactory.getKnowledgeBuilderServiceFactory(KnowledgeBuilderFactory.java:124)
at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:46)
Regards,
Abhinay
--
View this message in context: http://drools.46999.n3.nabble.com/Error-during-fetching-rules-via-REST-AP...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months
Guvnor 6.0 User Security
by Dean Whisnant
Maybe it's too early to ask this question, but in reviewing 6.0 beta 2 I didn't see how user security would be managed.
In 5.1.1 we have 100+ packages with 100+ users assigned various roles from read only to authoring. Our packages are hierarchical in that we have an overarching and intermediary set that everyone can view, and then individual packages that a user may have authoring privileges.
Is there a similar sense in the new framework?
Thanks
Dean
12 years, 6 months
Using a teradata db with DROOLS (or RH BRMS) - has anyone done it?
by William W. Austin
Quick question: we've been using Oracle with the BRMS (and with DROOLS running
with Tomcat) without only minor issues.
Now someone has the idea to replace Oracle with Teradata, and I'm supposed to
prototype a JDBC connection - which for various reasons has not been going
smoothly.
Has anyone had any success at doing this? If so any suggestions would be happy
accepted. (The setup we'll be using is BRMS with the RH Ent App Platform,
btw.)
Thanks
- w
--
william w. austin airedad(a)att.net
"life is just another phase i'm going through. this time, anyway ..."
12 years, 6 months
Guvnor Rest API for uploading model
by calcacuervo
Hi people!
I have an scenario where I have to create packages dinamically in Guvnor.
All the packages share the same pojo model.
What I did is having the model in global area, and then, after creating the
new package using guvnor REST API, I need to import the model to the new
package. In the UI, I can made it just importing it manually from global
area to my package. From REST API, what I tried to do is just getting the
model with REST API from global area, and then try to upload it to my new
package (just send a APPLICATION_OCTET_STREAM with the model I received..
The problem I am facing is that model is successfully created, but model
classes are not automatically imported to Drools Header.
I have seen this reported here:
https://issues.jboss.org/browse/GUVNOR-1995
Does anyone has some workaround or some idea about this?
Thanks!
Demian
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Rest-API-for-uploading-model-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months