JBoss Rules as a Daemon Service
by Arjun Dhar
Hi,
I uploaded the JBoss Rules 4 WAR; I saw the repository options but no admin
console to run a service. Maybe I'm missing something?!?!
Q) Being under the cover of the JBoss server am sure there must be some
fascility to run this as a daemon service 'out of the box'! Right?? <--
Important
(posted this 3 days ago but it got lost somwhere; prob deleted the approval
mail; FYI not being impatient :o) but its important so would like to know)
Thanks!
15 years, 8 months
Writing rules using java..
by Kolla, Sandeep
Hi Rahul,
Its not about storing the whole file into the database.
I would have a Table representing the parameteres required to construct
a rule.
For example.
Tables:
RuleSetTable:
Ruleset_id
Ruleset_name
RuleTable:
Rule_id
Rule_name
Rule_saliance
Rule_condition
Rule_consequence
Ruleset_id
Now while loading the rules the application basically should read from
the DB, and construct the rules, as everything required to construct the
rules is avaliable in the tables.
This requirement had come up because as the rules keep changing quite
frequently, we don't want to bring down the application to load a new
DRL file.
Hope you understood what I want to achieve.
Thanks much,
Sandeep.
16 years, 1 month
RE: Rules with Lookup Tables...
by Rahul Phadnis
Have you looked at
http://labs.jboss.com/portal/jbossrules/subversion.html
I think that page is not uptodate since at the bottom
it says "Trunk is unstable and may often not build. If
you wish to build form Subversion source the latest
tag is:
http://anonsvn.labs.jboss.com/labs/jbossrules/tags/3.0.3-GA/
"
Are n't we at 3.0.5 already?
-Rahul
--- jjdepaul(a)us.ibm.com wrote:
> Rahul -
>
> Where can I find Maven2 repository that has the
> nightly builds for Drools project?! I've looked
> around on a couple of well-known ones abut no luck
> finding anything above D3.0.5
>
> thanks,
> james
> >
> > The "from" CE (conditional expression) is not
> > available in the current released jboss rules
> version
> > (3.0.5) and you probably have to use the nightly
> build
> > to use it.
> >
> > -Rahul
> >
> >
>
>
16 years, 5 months
Agenda filter based on package name
by Hooman Mozaffari
It seems "Rule" class doesn't store its parent "Package" information and Rule.getPackage() always returns null.
I would like to create an AgendaFilter based on package name but there is no way to get the parent package of each rule.
Thanks,
Hooman
public class PackageNameAgendaFilter implements AgendaFilter {
private final String packageSuffix;
private final boolean accept;
public PackageNameAgendaFilter(String packageSuffix){
this(packageSuffix, true);
}
public PackageNameAgendaFilter(String packageSuffix, boolean accept){
this.packageSuffix = packageSuffix;
this.accept = accept;
}
public boolean accept(Activation activation) {
if(activation.getRule().getPackage().startsWith(packageSuffix))
return accept;
else
return false;
}
}
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
17 years
JBoss Rules IDE Error on StringEvaluator
by Ronald R. DiFrango
Anyone ever seen this error in the IDE:
Severity and Description Path Resource Location Creation Time
Id
Operator '50' does not exist for StringEvaluator
RtvDecisionEngine/src/rules/com/circuitcity/rtvcrms/rules rtv.drl
Unknown 1179954317638 29080
And if so what do you do about it? My rules file is just under 1000 lines
[and growing] and shows no other errors.
17 years, 3 months
RE: [rules-users] Using rules with database scenario
by Uday Kamath
We had similar use case. What we do is we model the Schema elements,
generate Java Beans (pojo), and write rules using these Pojo. Now we
have written a Service on top which takes Hibernate QL and gets the
database records as the same Pojos that Rules are defined on and fire
the Rules. Thus the service is generic and can be changed to take any
Query. The Rules can me modified and changed anytime and redeployed but
business objects in form of Pojos remain the same. Hope this helps
-Uday
________________________________
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Joe Chuby
Sent: Friday, March 09, 2007 3:53 AM
To: rules-users(a)lists.jboss.org
Subject: [rules-users] Using rules with database scenario
Hi all,
First time trying to learn JBoss Rules here. We have a pretty large
database (DBMS), we want to build some rules and retrieve data based on
the rules.
Could someone give a hint or an example of this usage scenario? I mean,
how can I use rules for database query, without writing my rules in SQL
directly? We are currently writing everything in HQL (Hibernate), but
the rules change every 3 months on average, so that's not a way to
maintain the system. Therefore, we want to extract that portion of the
business logic out of the code. The data structure does not change, but
the rules keep on changing.
I'm reading the user's guide, running thru the examples, writing some of
my own, but still no clue how to make it work with database.
If someone could give a sample, that would be greatly appreciated.
Thanks a lot.
________________________________
Bored stiff? <http://us.rd.yahoo.com/evt=49935/*http:/games.yahoo.com>
Loosen up...
Download and play hundreds of games for free
<http://us.rd.yahoo.com/evt=49935/*http:/games.yahoo.com> on Yahoo!
Games.
17 years, 4 months
Need Help: Errors while running FibonacciExample
by venkatesh devalapura nagabhushana
Hi,
After successfully compiling the example code FibnacciExample.java, I
tried to run it, I get the following error, let me know how to solve it:
java FibonacciExample
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
at org.drools.semantics.java.RuleBuilder.<clinit>() (Unknown Source)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
at
org.drools.compiler.PackageBuilder.addRule(org.drools.lang.descr.RuleDescr) (Unknown Source)
at
org.drools.compiler.PackageBuilder.addPackage(org.drools.lang.descr.PackageDescr) (Unknown Source)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(java.io.Reader)
(Unknown Source)
at FibonacciExample.main(java.lang.String[]) (Unknown Source)
at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Caused by: java.util.regex.PatternSyntaxException: At position 2 in
regular expression pattern:
expected end of character class
(.*)\bmodify\s*\(([^)]+)\)(.*)
^
at java.util.regex.Pattern.Pattern(java.lang.String, int)
(/usr/lib/libgcj.so.6.0.0)
at java.util.regex.Pattern.compile(java.lang.String, int)
(/usr/lib/libgcj.so.6.0.0)
at org.drools.semantics.java.KnowledgeHelperFixer.<clinit>() (Unknown
Source) at java.lang.Class.initializeClass()
(/usr/lib/libgcj.so.6.0.0)
...8 more
Is it require to place .drl file in the same directory as that of the
source code ?
Thanks,
Venkatesh
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
17 years, 5 months
probleam in breaking conditions into multiple lines in DSL
by kingston
Hi
i have written many rules in DRL . These rules look like
when
<condition1> ||
<condition2> &&
<condition3> ||
<condition4>
Then
<some action>
end;
I am trying to rewrite these rules in DSL format .
I tried something like this :
I added the english text before the statement for condition1 and used
variables for passing input values. and in the rule file ( .drl file ) i had
the english text along with the input value in the place for the variable.
Finally i could make the dsl syntax work onlly when i had all the conditions
on a single line using "eval". This looks pretty long. The syntax provided
in Drools documentaion " [when]- " works fine for "AND" conditions
How do i break my conditions in the dsl format on each new line with all my
logical conditions "AND" , "OR" intact ? Do we have any other options for
breaking into new line ? Is there any work around for that ? How do I handle
"OR" conditions?
Thanks.
--
View this message in context: http://www.nabble.com/probleam-in-breaking-conditions-into-multiple-lines...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 5 months
Logic behind the Rule
by Rajesh.Sachin10
Following is the Example taken form the following URL:
http://labs.jboss.com/file-access/default/members/jbossrules/freezone/doc...
But this rule is not working for me. If anyone know the logic behind the
rule, please explain me.
Example:
Imagine we have two classes - Student and Module. Module represents each of
the courses the Student attended for that semester, referenced by the List
collection. At the end of the semester each Module has a score. If the
Student has a Module score below 40 then they will fail that semester - the
existential quantifier can be used used with the "less than 40" open
proposition to check for the existence of a Module that is true for the
specified criteria.
public class Student {
private String name;
private List modules;
...
}
public Class Module {
private String name;
private String studentName;
private int score;
Java is Turing complete in that you can write code, among other things, to
iterate data structures to check for existence. The following should return
a List of students who have failed the semester.
List failedStudents = new ArrayList();
for ( Iterator studentIter = students.iterator(); studentIter.hasNext() {
Student student = ( Student ) studentIter.next();
for ( Iterator it = student.getModules.iterator(); it.hasNext(); ) {
Module module = ( Module ) it.next();
if ( module.getScore() < 40 ) {
failedStudents.add( student ) ;
break;
}
}
}
Early SQL implementations where not Turing complete as they did not provide
quantifiers to asses the structure of data. However modern SQL engines allow
nesting of SQL which can be combined with keywords like 'exists' and 'in':
The following query would return a set of Students who have failed the
semester.
select
*
from
Students s
where exists (
select
*
from
Modules m
where
m.student_name = s.name and
m.score < 40
)
rule
when
exists( $student : Student() && Module( student == $student, score <
40 ) )
--
View this message in context: http://www.nabble.com/Logic-behind-the-Rule-tf3848998.html#a10902431
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 6 months
Unexpected Token Exception
by Rajesh.Sachin10
I got the following exception when I tried to run the drl file rule.
org.drools.rule.InvalidRulePackage: unknown:13:37 mismatched token:
[@79,307:308='&&',<55>,13:37]; expecting type ')'
unknown:13:81 Unexpected token ')'
at org.drools.rule.Package.checkValidity(Unknown Source)
at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)
at com.sample.DroolsTest.main(DroolsTest.java:47)
Rule:
package com.policy;
#expander Ex1.dsl;
#list any import classes here.
#import java.util.HashMap;
import java.util.Iterator;
import com.examples.Student;
import com.examples.Module;
#declare any global variables here
global java.util.List errorlist;
rule "Ex1"
when
exists( $student : Student() && Module( student == $student, score <
40 ))
then
System.out.println("fierd");
end
Files:
Class 1:
package com.examples;
public class Student {
private String name;
private Object[] modules;
public Object[] getModules() {
return modules;
}
public void setModules(Object[] modules) {
this.modules = modules;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
class 2:
package com.examples;
public class Module {
private String name;
private String studentName;
private int score;
public Module(String name, int score){
this.setName(name);
this.setScore(score);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
}
Anyone have any idea about it
--
View this message in context: http://www.nabble.com/Unexpected-Token-Exception-tf3848843.html#a10901896
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 6 months