beginner needs help
by Senlin Liang
Hi all,
I just started using Drools. I tried to run some example, but they all give
me errors. Is there any simple instructions for beginners?
Any help is appreciated.
Senlin
====
I tried to run examples in
drools-examples/drools-examples-drl/src/main/java/org/drools/examples
But got some exceptions such as:
Exception in thread "main" org.drools.RuntimeDroolsException: Unable to load
dialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:188)
at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:173)
at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:146)
at
org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:123)
at
org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:141)
at
org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:102)
at HelloWorldExample.main(HelloWorldExample.java:31)
Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in
the classpath
at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:91)
at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:52)
at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:184)
... 6 more
====
16 years, 6 months
Re: Rules compiler is not able to extract (Promod)
by pramod george
Hi.
I too had the same problem but I do not remember in which
version. However, what I did was to check the classfile directly
and give the same casing. The exact casing of the entities you
have defined in the javaBean jar is waht you need to specify.
This *was* a 'bug' in the earlier versions ie:- 3.0.X
-P
16 years, 6 months
Re: [rules-users] Re: Rules compiler is not able to extract the field withxXXX format
by Sivakumar Thiruppathy
Thanks for trying it out.
Actually it was a typo in my posting text and not in the code. I have declared variable called tText and have a getTText() method.
Below is the rule segment.
rule "entity.testrule"
when
$rulesSerivceTest:RulesServiceTest(tText:tText)
then
logger.info("Received an Test");
end
Below is the error while creating the package.
[java] java.lang.RuntimeException: Unable to create Field Extractor for 'tText' : [Rule name=entity.testrule, agendaGroup=MAIN, salience=0, no-loop=false]
[java] org.drools.RuntimeDroolsException: org.drools.RuntimeDroolsException: Field/method 'tText' not found for class 'com.satmetrix.rules.test.rulestest.RulesServiceTest'
[java] 16:24:57,642 INFO - Error Summary : Unable to create Field Extractor for 'tText' : [Rule name=entity.testrule, agendaGroup=MAIN, salience=0, no-loop=false]
I was using 4.0.4 then I tried with 4.0.7 and got the same error. Are you extracting the field in the rule?
Regards,
Siva
----- Original Message ----
From: Alexander Claus <styjdt(a)claus4joy.de>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Wednesday, June 11, 2008 3:41:29 PM
Subject: [rules-users] Re: Rules compiler is not able to extract the field withxXXX format
> I have a member variable called tText (i.e any variable with xXXX format)
> and have the proper getter/setter ( getTText() and setTText(String arg) ).
> If I try the extract that field in the rule LHS ( i.e.
> someclass(myText:tText) ) then I get the "Unable to create Field
> Extractor
> for 'sText'" error.
Sorry, but I can't reproduce that.
I'm working with Drools 4.0.7 and if I set up a test case with the values as
you describe (String tText, ...), my test runs successfully.
Stupid question: Are you sure that you have no typo in your rule? You get an
error for "sText", but you have declared "tText".
Alexander Claus
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years, 6 months
RuleML-2008: Submission Deadline June 16
by Adrian Paschke
[ our apologies should you receive this message more than one time ]
2008 International RuleML Symposium
on Rule Interchange and Applications (RuleML-2008)
October 30-31, 2008, Orlando, Florida
http://2008.ruleml.org
Latest news:
--------------------------------------------------------------------
Deadlines are approaching: June 16 (one week left!)
- RuleML-2008 Keynote speakers:
* Michael Kifer (State University of New York at Stony Brook, USA),
on "Rule Interchange Format: Not Just Syntax".
Joint keynote between RuleML-2008 and RR2008.
* David Luckham (Stanford University, USA) on complex event
processing.
* Paul Haley (Haley Ltd) on business rules.
* Benjamin Grosof (Vulcan Inc, USA) on the SILK KRR system of the HALO
project.
- Joint Lunch Panel with the Business Rules Forum about "Rules on the
Web"
- RuleML-2008 Challenge with prestigious prices
- Lightning talks / Highlight talks
Accepted papers will be published in Springer LNCS proceedings and
a journal special issue (IEEE TKDE pending) is forthcoming.
PRESS RELEASE: http://www.targetwire.com/vpo/rm/
--------------------------------------------------------------------
Call for Papers:
http://2008.ruleml.org/cfp.pdf
Submission Site:
http://www.easychair.org/conferences/?conf=ruleml2008
Submission guidelines:
http://2008.ruleml.org/submissions.php
Topics of Interest:
http://2008.ruleml.org/topics.php
Organizing Committee:
http://2008.ruleml.org/oc.php
Program Committee:
http://2008.ruleml.org/pc.php
=====================================================================
Co-located with:
The 11th International Business Rules Forum
http://www.businessrulesforum.com
=====================================================================
Sponsored by:
Gold level : Vulcan Inc
Silver level: Model Systems
Bronze level: STI Innsbruck, ruleCore, JBoss
Sponsoring opportunities: http://2008.ruleml.org/sponsoring/
=====================================================================
In Co-operation with:
AAAI, W3C, BPM-Forum, Business Rules Forum , ECCAI, OASIS, OMG,
Dallas Rules Group, Belgium Business Rules Forum,
MIT Sloan CIO Symposium,
ACM, ACM SIGART, ACM SIGMIS, ACM SIGWEB, Open Research Society,
IEEE Systems Man and Cybernetics Society
IEEE SMCS TC on Intelligent Internet Systems
IEEE SMCS TC on Distributed Intelligent Systems
IEEE Computer Society TC on Autonomous and Autonomic Systems
=====================================================================
Media Partners:
Springer LNCS, MoDo Marketing
=====================================================================
16 years, 6 months
DSL: Same Constraint - Multiple Declarations
by Anders Hansen
I'm running into an issue using the same text for constraints on multiple declarations. The high level concept is that I'm trying to write DSL in a way that allows reuse of various conditions. For example, I have a Client and that needs a constraint that tests to see if a Client is disabled. I also want the ability to determine if a Client's child is disabled.
There is a Client who is disabled
The Client has a child who is disabled
The thought is that the client is a Client and the child is a Client, so we should be able to write our DSL in a way such that we can reuse the disabled constraint.
There is a Client
- who is disabled
The Client has a "Child"
- who is disabled
I wasn't able to figure out a way to reuse the constraint directly. However, to accomplish some level of reuse I've written the following DSL definitions:
[condition][Client]There is a Client=$client: Client()
[condition][Client]- who is disabled=disabled == true
[condition][Relationship]The Client has a {type}=exists ($relationship: Relationship(type=={type}, $relative: client) from $client.relationships)
[condition][Relationship]- who is disabled=$relative.disabled == true
This way the "who is disabled" constraint can at least be applied to Clients of differing relationships to the client, e.g. Spouse, Child, Parent, etc. I thought that by using the second "[]" (e.g. [Client]) it would indicate that the constraint should only be applied to a Client. In addition, I thought that the constraints themselves only apply to the declaration directly above. However, when I attempt this I can the following error:
org.drools.rule.InvalidRulePackage: Unable to create Field Extractor for 'disabled' of '[ClassObjectType class=Relationship]'
It appears that the "- who is disabled" I attempted to attach "There is a Client" is also applying to the "The Client has a {type}" statement? If I modify constraint attached to the second statement to use "that" instead of "who" then it works.
[condition][Relationship]- that is disabled=$relative.disabled == true
Can the same constraint text not be used on multiple declarations? Am I headed down the wrong path completely?
It appears from this article: http://blog.athico.com/2008/06/allowing-variable-masks-in-dsl-grammar.html that there are some new things coming that might help me accomplish the re-use I'm looking for. But, are there any options in version 4?
16 years, 6 months
NoClassDefFoundError when dynamically updating rulebase for rule using 'accumulate' CE
by kunal
I am dynamically adding/modifying rules (packages) to a loaded rule-base and
having issues specifically when my rule contains accumulate CE. For an
example, following is a rule which I am trying to add to my rulebase (which
is already loaded in memory).
rule "7d7fa7f1-164b-45a7-8e5a-c0c260815f9a"
enabled true
salience 0
no-loop true
agenda-group "DATA_ARRIVAL"
when
AgentID(agentId : agentId);
DeviceData()
Property(key=="threshold",classifier=="7d7fa7f1-164b-45a7-8e5a-c0c260815f9a.Condition0",$prop_threshold0
: value)
$total0: Number( doubleValue > $prop_threshold0) from accumulate(
DataPoint( $value0: value ) from
dataService.getDataPoints("5e0de623-9a25-45a1-8bc5-745254c2576e","SPEED",3),
average( $value0) )
then
agent.handleAction("rules.sl.7d7fa7f1-164b-45a7-8e5a-c0c260815f9a",0);
end
I am not getting any error (Rule validation or any other) when adding
package with my rule to rulebase, but when getting following error, when
rulebase is used thereafter:
java.lang.NoClassDefFoundError:
rules/sl/Rule_7d7fa7f1_164b_45a7_8e5a_c0c260815f9a_0
at
rules.sl.Rule_7d7fa7f1_164b_45a7_8e5a_c0c260815f9a_0AccumulateExpression0Invoker.evaluate(Unknown
Source)
at
org.drools.base.accumulators.JavaAccumulatorFunctionExecutor.reverse(JavaAccumulatorFunctionExecutor.java:91)
at org.drools.rule.Accumulate.reverse(Accumulate.java:151)
at
org.drools.reteoo.AccumulateNode.modifyTuple(AccumulateNode.java:376)
at
org.drools.reteoo.AccumulateNode.retractObject(AccumulateNode.java:292)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateRetractObject(SingleObjectSinkAdapter.java:32)
at
org.drools.reteoo.RightInputAdapterNode.retractTuple(RightInputAdapterNode.java:124)
at
org.drools.reteoo.SingleTupleSinkAdapter.propagateRetractTuple(SingleTupleSinkAdapter.java:38)
at org.drools.reteoo.FromNode.retractTuple(FromNode.java:130)
at
org.drools.reteoo.CompositeTupleSinkAdapter.propagateRetractTuple(CompositeTupleSinkAdapter.java:52)
at org.drools.reteoo.JoinNode.retractTuple(JoinNode.java:231)
at
org.drools.reteoo.CompositeTupleSinkAdapter.propagateRetractTuple(CompositeTupleSinkAdapter.java:52)
at org.drools.reteoo.JoinNode.retractObject(JoinNode.java:191)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:375)
at
org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)
at org.drools.reteoo.Rete.retractObject(Rete.java:215)
at
org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)
at
org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)
at
org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1023)
at
org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:982)
at
com.sensorlogic.rules.RuleAgent.retractMatchingFact(RuleAgent.java:283)
at com.sensorlogic.rules.RuleAgent.processFact(RuleAgent.java:264)
at com.sensorlogic.rules.RuleAgent.run(RuleAgent.java:342)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
I will appreciate any insight with this problem. My process of
adding/updating rules dynamically works with all other rules I am using but
only has issues with using 'accumulate' CE. Has someone encountered this
before? Or just any ideas on what can cause NoClassDefFound for my added
rule?
--
View this message in context: http://www.nabble.com/NoClassDefFoundError-when-dynamically-updating-rule...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 6 months
BRMS / Guvnor Standalone due back in version 5 / or other priorities?
by Paul Browne
Folks,
Happen to be writing the part of the guide (!) on how to setup the BRMS /
Guvnor. Aimed at end users (Excel people) so the fewer steps the better.i.e.
'Install Java and BRMS standalone' is going to be much easier to explain
than 'install Java-JBossWeb-BRMS' - one less thing to go wrong.
I know there was a version available previously that had to be taken down (
http://blog.athico.com/2007/07/jboss-drools-brms-standalone.html). Are there
any plans to restore it in version 5? I don't see any open items for it on
the Drools / Guvnor JIRA ....
I've no problems in explaining the full setup, but if we're likely to have
the more simple option soon then I'd prefer to talk about that. Just to wind
up Mark, even jBPM has had a standalone option for the last 18 months or so
:-)
Thanks
Paul
16 years, 6 months
Drools Maven repository error
by Wilson O Ojwang
All,
I am getting the following error while updating drools 4.0.7 repo. using
the following ant task
<artifact:dependencies pathId="dependency.class.path">
<dependency groupId="org.drools" artifactId="drools-repository"
version="4.0.7"/>
</artifact:dependencies>
OR using
<artifact:dependencies pathId="dependency.class.path">
<dependency groupId="org.drools" artifactId="drools-core"
version="4.0.7"/>
<dependency groupId="org.drools" artifactId="drools-compiler"
version="4.0.7"/>
</artifact:dependencies>
======== Here is the error ==============
ant
Buildfile: build.xml
[artifact:dependencies] Downloading:
org/drools/drools-repository/4.0.7/drools-repository-4.0.7.pom from central
[artifact:dependencies] Downloading:
org/drools/drools-repository/4.0.7/drools-repository-4.0.7.pom from central
[artifact:dependencies] Downloading:
org/drools/drools-repository/4.0.7/drools-repository-4.0.7.jar from central
[artifact:dependencies] Downloading:
org/drools/drools-repository/4.0.7/drools-repository-4.0.7.jar from central
[artifact:dependencies] An error has occurred while processing the Maven
artifact tasks.
[artifact:dependencies] Diagnosis:
[artifact:dependencies]
[artifact:dependencies] Unable to resolve artifact: Missing:
[artifact:dependencies] ----------
[artifact:dependencies] 1) org.drools:drools-repository:jar:4.0.7
[artifact:dependencies]
[artifact:dependencies] Try downloading the file manually from the
project website.
[artifact:dependencies]
[artifact:dependencies] Then, install it using the command:
[artifact:dependencies] mvn install:install-file
-DgroupId=org.drools -DartifactId=drools-repository -Dversion=4.0.7
-Dpackaging=jar -Dfile=/path/to/file
[artifact:dependencies]
[artifact:dependencies] Alternatively, if you host your own repository
you can deploy the file there:
[artifact:dependencies] mvn deploy:deploy-file
-DgroupId=org.drools -DartifactId=drools-repository -Dversion=4.0.7
-Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[artifact:dependencies]
[artifact:dependencies] Path to dependency:
[artifact:dependencies] 1) org.apache.maven:super-pom:jar:2.0
[artifact:dependencies] 2) org.drools:drools-repository:jar:4.0.7
[artifact:dependencies]
[artifact:dependencies] ----------
[artifact:dependencies] 1 required artifact is missing.
[artifact:dependencies]
[artifact:dependencies] for artifact:
[artifact:dependencies] org.apache.maven:super-pom:jar:2.0
[artifact:dependencies]
[artifact:dependencies] from the specified remote repositories:
[artifact:dependencies] central (http://repo1.maven.org/maven2)
[artifact:dependencies]
BUILD FAILED
/home/wojwang/workspace_5350/HibernateDrools/build.xml:13: Unable to
resolve artifact: Missing:
----------
1) org.drools:drools-repository:jar:4.0.7
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.drools
-DartifactId=drools-repository -Dversion=4.0.7 -Dpackaging=jar
-Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file
there:
mvn deploy:deploy-file -DgroupId=org.drools
-DartifactId=drools-repository -Dversion=4.0.7 -Dpackaging=jar
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.apache.maven:super-pom:jar:2.0
2) org.drools:drools-repository:jar:4.0.7
----------
1 required artifact is missing.
for artifact:
org.apache.maven:super-pom:jar:2.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
=============================
Thanks for your help.
Regards
Wilson
16 years, 6 months
Security, ldap and tomcat
by jbossruler
Hi,
I deployed Drools onto Tomcat and I am trying to figure out how to get
security to work. I want to use LDAP but I have no clue where to begin. All
of the tutorials I see make use of JBoss AS. I do not have the option of
using JBoss AS. Can somebody point me in the right direction or let me know
how I can modify the components.xml file or the repository.xml file?
What are the options besides using LDAP for security?
I am using Drools 4.04
Really appreciate your help!
--
View this message in context: http://www.nabble.com/Security%2C-ldap-and-tomcat-tp17693453p17693453.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 6 months