Decision tables and globals
by Hehl, Thomas
I'm trying to discover if there's a way to resolve my decision table issue
using a global. How do I define a global in a decision table?
Thanks.
Thom Hehl
Sr. eJuror Architect
* Office (859) 277-8800 x 144
* Thomas.Hehl(a)acs-inc.com <mailto:Thomas.Hehl@acs-inc.com>
ACS, Inc.
Government Solutions
1733 Harrodsburg Road
Lexington, KY 40504-3617
This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message and notify
sender via e-mail at Thomas.Hehl(a)acs-inc.com
<mailto:Thomas.Hehl@acs-inc.com> or by telephone at 859-277-8800 ext. 144.
Thank you.
17 years, 3 months
Re: [rules-users] Usage of Drools in a RCP project
by Gaurav2007
i am also working in same technology i am not able to use service of one
plug-in from another in following cases :
1) export the required package of dependent plug-in,
2) add all the required jars in classpath from runtime tab of mainfest.mf
file of your plugin.
3) in run time configuration of application required plug-in is not
selected.
gurks wrote:
>
> I'm working on a RCP project and now want to integrate Drools. There are
> two plugins: CORE and UI.
> The initialization of Drools is done in a Manager class in the core
> plugin. The same plugin also has a class named Service. This class should
> be imported in a DRL-file. The Manager is first called in the UI plugin
> but don't think that's the problem. The Drools jars are placed in its own
> plugin and the other two plugins are augemnted with the dependency needed.
>
> When I try to initialize the ruleBase I get the following exception:
>
> org.drools.rule.InvalidRulePackage: Unable to resolve ObjectType 'Service'
> : [Rule name=Your First Rule, agendaGroup=MAIN, salience=0, no-loop=false]
> Rule Compilation error : [Rule name=Your First Rule, agendaGroup=MAIN,
> salience=0, no-loop=false]
> at/mcw/jdent/services/core/persistent/Rule_Your_First_Rule_0.java (2:55)
> : Only a type can be imported. test.core.persistent.Service resolves to a
> package
> at/mcw/jdent/services/core/persistent/Rule_Your_First_Rule_0.java (7:342)
> : $serviceName cannot be resolved
> org.drools.compiler.ImportError@17a99
> at org.drools.rule.Package.checkValidity(Package.java:408)
> at
> org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
> ...
>
> I don't know why Drools does not find my Service class. It's in the same
> plugin as the manager and should be visible to it.
>
> Could anybody give me an advice how I can integrate Drools into my RCP
> project correctly.
>
> Thanx, gurks
>
--
View this message in context: http://www.nabble.com/Usage-of-Drools-in-a-RCP-project-tf4383352.html#a12...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 3 months
Error running BRSM insurance example
by kissro@lidp.com
Hello,
I downloaded the 4.0.1 Drools examples and I'm having trouble getting
the BRMS example to run. I imported the rules repository using the
'repository_export.xml' file from the directory
drools-examples/drools-examples-brms/src/main/resources and I can see
the package and rules correctly loaded in BRMS, but when I try to build
a binary package I get the following errors:
16:37:25,203 INFO [STDOUT] ERROR 05-09 16:37:25,203
Exception while dispatching incoming RPC call
java.lang.IllegalArgumentException: Unable to handle content type: dslr
at org.drools.brms.server.contenthandler.ContentHandler.getHandle
r(ContentHandler.java:74)
at org.drools.brms.server.builder.ContentPackageAssembler.buildAs
set(ContentPackageAssembler.java:111)at
org.drools.brms.server.builder.ContentPackageAssembler.buildPa
ckage(ContentPackageAssembler.java:102)
at org.drools.brms.server.builder.ContentPackageAssembler.<init>(
ContentPackageAssembler.java:69)
at org.drools.brms.server.builder.ContentPackageAssembler.<init>(
ContentPackageAssembler.java:80)
etc., etc.
What am I doing wrong? The web page instructions for installing this
example said this step should complete and build without any errors.
Thanks,
Rod
17 years, 3 months
Building from source problem and an open stream problem
by Brett M. Bergquist
I downloaded 4.0.1 source and when I try to build it using maven, I get
the following error. Note that I can build 4.0.0 from the source with
this same command. Obviously I am missing something but I'm a maven
newbie and I really just want to fix a stream leak in drools and not
really learn maven at this point. Any help will be greatly appreciated.
Brett
----
C:\src\drools-4.0.1-src>mvn -Declipse=true -Ddocumentation=true clean
install
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: unknown
Reason: Could not find the model file
'C:\src\drools-4.0.1-src\drools-ant\pom.x
l'. for project unknown
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Could not find the
model file
'C:\src\drools-4.0.1-src\drools-ant\pom.xml'. for project unknown
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:290)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Could not
find th
model file 'C:\src\drools-4.0.1-src\drools-ant\pom.xml'. for project
unknown
at
org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Defaul
MavenProjectBuilder.java:1383)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceF
leInternal(DefaultMavenProjectBuilder.java:477)
at
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMav
nProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:553)
at
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:467)
at
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:527)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:364)
... 11 more
Caused by: java.io.FileNotFoundException:
C:\src\drools-4.0.1-src\drools-ant\po
.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileReader.<init>(FileReader.java:55)
at
org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Defaul
MavenProjectBuilder.java:1378)
... 17 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Sep 04 19:00:00 EDT 2007
[INFO] Final Memory: 1M/4M
[INFO]
------------------------------------------------------------------------
17 years, 3 months
LHS functions not in eval()...
by wasabifan
I am trying to write a function that takes a numeric value and returns a
string. Basically, I have a numeric number I need to match to a string
number (so I need to convert one to the other type). I wrote a function to
do this, but it only seems to work in the RHS or inside an eval().
Is there a way to convert numerics to strings (or vice-versa) in the LHS not
in an eval? Or is a big function inside the eval() the only way to do this?
Thanks,
Bryan
--
View this message in context: http://www.nabble.com/LHS-functions-not-in-eval%28%29...-tf4362273.html#a...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 3 months
Examples won't run
by Garry Brother
Hi,
After two (unsuccessful) attempts at downloading and running
the drools examples, I'm ready to throw in the towel. Before I
do that, however, I'm going to beg for help.
With ant, I was able to build the examples using the following
classpath:
<path id="drools.jars" >
<fileset dir="${drools.home}" >
<include name="*.jar"/>
</fileset>
</path>
<target name="compile">
<mkdir dir="target"/>
<mkdir dir="target/classes"/>
<copy todir="target/classes">
<fileset dir="src/main/resources"/>
<fileset dir="src/main/rules"/>
</copy>
<javac srcdir="src/main/java"
destdir="target/classes"
source="1.4">
<classpath >
<path refid="drools.jars" />
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>
All attempts to run the "run-waltz12" example fail regardless
of what classes I throw at it. I tried both "drools.jars"
above and the classpath below, without luck, as well as other
combinations of jars:
<path id="jsr94.jars" >
<fileset dir="${drools.home}" >
<include name="drools-core*.jar"/>
<include name="drools-compiler*.jar"/>
<include name="drools-jsr94.jar"/>
</fileset>
<fileset dir="${drools.home}/lib" >
<include name="jsr94-1.1.jar"/>
<include name="janino-2.5.7.jar"/>
</fileset>
</path>
Latest error is this:
[java] Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath
I went out of my way to specify the janino jar so don't know
why an eclipse jar is required (I'm building from the command
line and not using Eclipse.)
I'm sure it's my ignorance but wonder if someone could email me
ant script that will do the job?
Thanks, Garry
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
17 years, 3 months
insurance domain users?
by Michael Neale
If anyone is using rules and you work in an insurance company/domain -
please contact me off list.
Michael
Red Hat.
17 years, 3 months
DSL field constraint question
by Andy Mei
Hi,
I am new to Drools and working with 4.0.1 version.
I am playing with DSL and having trouble with conditional field
constraints.
I really appreciate any help, i like drools a lot and would love to use
it.
Here is the simple rule i have:
rule "Credit Approved"
salience 5
when
//notice here we are using our own domain specific language that's
defined within
#credit.dsl file
There is a person with
#-must has a name
-age is at least 18 years old
then
> System.out.println( "[ALLOW] Credit approved for " + person.getName
());
end
Here is my dsl definition:
[when]There is a person with=person:Person()
[when]-age is at least {age} years old=(age >= {age})
[when]-age is less than {age} years old=(age < {age})
[when]-must has a name=(name != "" && name != null)
[when]-id must be positive integer=id > 0
Everything works fine if i use only 'age is least 18 years old' or 'must has
a name'.
However, if i try to do a connective and between these two constraints, i am
getting
package build errors:
Package build error found:
[13,43]: unknown:13:43 mismatched token: [@59,331:331=',',<11>,13:43];
expecting type RIGHT_PAREN[13,59]: unknown:13:59 mismatched token:
[@71,347:347=')',<12>,13:59]; expecting type THEN
Exception in thread "main" org.drools.rule.InvalidRulePackage: [13,43]:
unknown:13:43 mismatched token: [@59,331:331=',',<11>,13:43]; expecting type
RIGHT_PAREN[13,59]: unknown:13:59 mismatched token:
[@71,347:347=')',<12>,13:59]; expecting type THEN
at org.drools.rule.Package.checkValidity(Package.java:419)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java
:292)
at com.trg.play.rules.PersonTest.readRule(PersonTest.java:103)
at com.trg.play.rules.PersonTest.main(PersonTest.java:51)
I have attached my test program for your review.
17 years, 3 months